diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml
deleted file mode 100644
index 288780793..000000000
--- a/.github/workflows/go.yml
+++ /dev/null
@@ -1,26 +0,0 @@
-name: Go
-
-on:
- push:
- branches: [ main ]
- pull_request:
- branches: [ main ]
-
-jobs:
-
- build:
- name: Build
- runs-on: ubuntu-latest
- steps:
-
- - name: Setup Go environment
- uses: actions/setup-go@v2
-
- - name: Check out code into the Go module directory
- uses: actions/checkout@v2
-
- - name: Test
- run: go test -race -coverprofile=coverage.txt -covermode=atomic ./...
-
- - name: Codecov
- uses: codecov/codecov-action@v1
diff --git a/.gitignore b/.gitignore
index 5bd4b85eb..e43b0f988 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,16 +1 @@
-# Binaries for programs and plugins
-*.exe
-*.exe~
-*.dll
-*.so
-*.dylib
-
-# Test binary, build with `go test -c`
-*.test
-
-# Output of the go coverage tool, specifically when used with LiteIDE
-*.out
-
-Makefile
-
-/leetcode*
+.DS_Store
diff --git a/CNAME b/CNAME
new file mode 100644
index 000000000..135ff1398
--- /dev/null
+++ b/CNAME
@@ -0,0 +1 @@
+leetcode.awesee.cn
\ No newline at end of file
diff --git a/LICENSE b/LICENSE
deleted file mode 100644
index 4a2706eb7..000000000
--- a/LICENSE
+++ /dev/null
@@ -1,21 +0,0 @@
-MIT License
-
-Copyright (c) 2018 Shuo
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
diff --git a/README.md b/README.md
index 340a1f882..fedae2030 100644
--- a/README.md
+++ b/README.md
@@ -1,461 +1 @@
-
-
-
-
-
-
-
-# [LeetCode](https://awesee.github.io/leetcode)
-LeetCode Problems' Solutions
-[[力扣](https://awesee.github.io/categories/leetcode/) ∙ [话题分类](https://github.com/awesee/leetcode/blob/master/tag/README.md)]
-
-[](https://github.com/awesee/leetcode/actions)
-[](https://codecov.io/gh/awesee/leetcode)
-[](https://goreportcard.com/report/github.com/awesee/leetcode)
-[](https://github.com/awesee/leetcode/graphs/contributors)
-[](https://github.com/awesee/leetcode/blob/master/LICENSE)
-[](https://app.fossa.io/projects/git%2Bgithub.com%2Fawesee%2Fleetcode?ref=badge_shield)
-[](https://gitter.im/awesee/leetcode?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
-
-
The first character can be represented by one bit 0.
-
The second character can be represented by two bits (10 or 11).
-
-
-
Given a binary array bits that ends with 0, return true if the last character must be a one-bit character.
-
-
-
Example 1:
-
-
-Input: bits = [1,0,0]
-Output: true
-Explanation: The only way to decode it is two-bit character and one-bit character.
-So the last character is one-bit character.
-
-
-
Example 2:
-
-
-Input: bits = [1,1,1,0]
-Output: false
-Explanation: The only way to decode it is two-bit character and two-bit character.
-So the last character is not one-bit character.
-
-
-
-
Constraints:
-
-
-
1 <= bits.length <= 1000
-
bits[i] is either 0 or 1.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
-
-### Similar Questions
- 1. [Gray Code](../gray-code) (Medium)
-
-### Hints
-
-Hint 1
-Keep track of where the next character starts. At the end, you want to know if you started on the last bit.
-
diff --git a/problems/132-pattern/132_pattern.go b/problems/132-pattern/132_pattern.go
deleted file mode 100644
index 021713a47..000000000
--- a/problems/132-pattern/132_pattern.go
+++ /dev/null
@@ -1,16 +0,0 @@
-package problem456
-
-func find132pattern(nums []int) bool {
- ak, ajStack := -1<<31, make([]int, 0, len(nums))
- for i := len(nums) - 1; 0 <= i; i-- {
- if nums[i] < ak {
- return true
- }
- for len(ajStack) > 0 && ajStack[len(ajStack)-1] < nums[i] {
- ak = ajStack[len(ajStack)-1]
- ajStack = ajStack[:len(ajStack)-1]
- }
- ajStack = append(ajStack, nums[i])
- }
- return false
-}
diff --git a/problems/132-pattern/132_pattern_test.go b/problems/132-pattern/132_pattern_test.go
deleted file mode 100644
index eeaa7b8d7..000000000
--- a/problems/132-pattern/132_pattern_test.go
+++ /dev/null
@@ -1,31 +0,0 @@
-package problem456
-
-import "testing"
-
-type testType struct {
- in []int
- want bool
-}
-
-func TestFind132pattern(t *testing.T) {
- tests := [...]testType{
- {
- in: []int{1, 2, 3, 4},
- want: false,
- },
- {
- in: []int{3, 1, 4, 2},
- want: true,
- },
- {
- in: []int{-1, 3, 2, 0},
- want: true,
- },
- }
- for _, tt := range tests {
- got := find132pattern(tt.in)
- if got != tt.want {
- t.Fatalf("in: %v, got: %v, want: %v", tt.in, got, tt.want)
- }
- }
-}
diff --git a/problems/132-pattern/README.md b/problems/132-pattern/README.md
deleted file mode 100644
index 3adc70a27..000000000
--- a/problems/132-pattern/README.md
+++ /dev/null
@@ -1,57 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../assign-cookies "Assign Cookies")
-
-[Next >](../circular-array-loop "Circular Array Loop")
-
-## [456. 132 Pattern (Medium)](https://leetcode.com/problems/132-pattern "132 模式")
-
-
Given an array of n integers nums, a 132 pattern is a subsequence of three integers nums[i], nums[j] and nums[k] such that i < j < k and nums[i] < nums[k] < nums[j].
-
-
Return true if there is a 132 pattern in nums, otherwise, return false.
-
-
-
Example 1:
-
-
-Input: nums = [1,2,3,4]
-Output: false
-Explanation: There is no 132 pattern in the sequence.
-
-
-
Example 2:
-
-
-Input: nums = [3,1,4,2]
-Output: true
-Explanation: There is a 132 pattern in the sequence: [1, 4, 2].
-
-
-
Example 3:
-
-
-Input: nums = [-1,3,2,0]
-Output: true
-Explanation: There are three 132 patterns in the sequence: [-1, 3, 2], [-1, 3, 0] and [-1, 2, 0].
-
There is only one character 'A' on the screen of a notepad. You can perform two operations on this notepad for each step:
-
-
-
Copy All: You can copy all the characters present on the screen (a partial copy is not allowed).
-
Paste: You can paste the characters which are copied last time.
-
-
-
Given an integer n, return the minimum number of operations to get the character'A'exactlyntimes on the screen.
-
-
-
Example 1:
-
-
-Input: n = 3
-Output: 3
-Explanation: Intitally, we have one character 'A'.
-In step 1, we use Copy All operation.
-In step 2, we use Paste operation to get 'AA'.
-In step 3, we use Paste operation to get 'AAA'.
-
You are given an integer array cards of length 4. You have four cards, each containing a number in the range [1, 9]. You should arrange the numbers on these cards in a mathematical expression using the operators ['+', '-', '*', '/'] and the parentheses '(' and ')' to get the value 24.
-
-
You are restricted with the following rules:
-
-
-
The division operator '/' represents real division, not integer division.
-
-
For example, 4 / (1 - 2 / 3) = 4 / (1 / 3) = 12.
-
-
-
Every operation done is between two numbers. In particular, we cannot use '-' as a unary operator.
-
-
For example, if cards = [1, 1, 1, 1], the expression "-1 - 1 - 1 - 1" is not allowed.
-
-
-
You cannot concatenate numbers together
-
-
For example, if cards = [1, 2, 1, 2], the expression "12 + 12" is not valid.
-
-
-
-
-
Return true if you can get such expression that evaluates to 24, and false otherwise.
Given an array of n integers nums and a target, find the number of index triplets i, j, k with 0 <= i < j < k < n that satisfy the condition nums[i] + nums[j] + nums[k] < target.
-
-
Example:
-
-
-Input:nums = [-2,0,1,3], and target = 2
-Output: 2
-Explanation: Because there are two triplets which sums are less than 2:
- [-2,0,1]
- [-2,0,3]
-
Given an integer array nums, return all the triplets [nums[i], nums[j], nums[k]] such that i != j, i != k, and j != k, and nums[i] + nums[j] + nums[k] == 0.
-
-
Notice that the solution set must not contain duplicate triplets.
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Two Pointers](../../tag/two-pointers/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Similar Questions
- 1. [Two Sum](../two-sum) (Easy)
- 1. [3Sum Closest](../3sum-closest) (Medium)
- 1. [4Sum](../4sum) (Medium)
- 1. [3Sum Smaller](../3sum-smaller) (Medium)
-
-### Hints
-
-Hint 1
-So, we essentially need to find three numbers x, y, and z such that they add up to the given value. If we fix one of the numbers say x, we are left with the two-sum problem at hand!
-
-
-
-Hint 2
-For the two-sum problem, if we fix one of the numbers, say
x
, we have to scan the entire array to find the next number
y
which is
value - x
where value is the input parameter. Can we change our array somehow so that this search becomes faster?
-
-
-
-Hint 3
-The second train of thought for two-sum is, without changing the array, can we use additional space somehow? Like maybe a hash map to speed up the search?
-
diff --git a/problems/4-keys-keyboard/4_keys_keyboard.go b/problems/4-keys-keyboard/4_keys_keyboard.go
deleted file mode 100644
index 3dff4fa3d..000000000
--- a/problems/4-keys-keyboard/4_keys_keyboard.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem651
diff --git a/problems/4-keys-keyboard/4_keys_keyboard_test.go b/problems/4-keys-keyboard/4_keys_keyboard_test.go
deleted file mode 100644
index 3dff4fa3d..000000000
--- a/problems/4-keys-keyboard/4_keys_keyboard_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem651
diff --git a/problems/4-keys-keyboard/README.md b/problems/4-keys-keyboard/README.md
deleted file mode 100644
index 14b9a794c..000000000
--- a/problems/4-keys-keyboard/README.md
+++ /dev/null
@@ -1,55 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../2-keys-keyboard "2 Keys Keyboard")
-
-[Next >](../find-duplicate-subtrees "Find Duplicate Subtrees")
-
-## [651. 4 Keys Keyboard (Medium)](https://leetcode.com/problems/4-keys-keyboard "4键键盘")
-
-
Imagine you have a special keyboard with the following keys:
-
Key 1: (A): Print one 'A' on screen.
-
Key 2: (Ctrl-A): Select the whole screen.
-
Key 3: (Ctrl-C): Copy selection to buffer.
-
Key 4: (Ctrl-V): Print buffer on screen appending it after what has already been printed.
-
-
-
-
Now, you can only press the keyboard for N times (with the above four keys), find out the maximum numbers of 'A' you can print on screen.
-
-
-
Example 1:
-
Input: N = 3
-Output: 3
-Explanation:
-We can at most get 3 A's on screen by pressing following key sequence:
-A, A, A
-
-
-
-
Example 2:
-
Input: N = 7
-Output: 9
-Explanation:
-We can at most get 9 A's on screen by pressing following key sequence:
-A, A, A, Ctrl A, Ctrl C, Ctrl V, Ctrl V
-
-
-
-
Note:
-
-
1 <= N <= 50
-
Answers will be in the range of 32-bit signed integer.
-
-
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Similar Questions
- 1. [2 Keys Keyboard](../2-keys-keyboard) (Medium)
diff --git a/problems/4sum-ii/4sum_ii.go b/problems/4sum-ii/4sum_ii.go
deleted file mode 100644
index afe2cf381..000000000
--- a/problems/4sum-ii/4sum_ii.go
+++ /dev/null
@@ -1,17 +0,0 @@
-package problem454
-
-func fourSumCount(A []int, B []int, C []int, D []int) int {
- ans, n := 0, len(A)
- sum := make(map[int]int, n*n)
- for i := 0; i < n; i++ {
- for j := 0; j < n; j++ {
- sum[A[i]+B[j]]++
- }
- }
- for k := 0; k < n; k++ {
- for l := 0; l < n; l++ {
- ans += sum[-C[k]-D[l]]
- }
- }
- return ans
-}
diff --git a/problems/4sum-ii/4sum_ii_test.go b/problems/4sum-ii/4sum_ii_test.go
deleted file mode 100644
index ed19e4509..000000000
--- a/problems/4sum-ii/4sum_ii_test.go
+++ /dev/null
@@ -1,29 +0,0 @@
-package problem454
-
-import "testing"
-
-type testType struct {
- a []int
- b []int
- c []int
- d []int
- want int
-}
-
-func TestFourSumCount(t *testing.T) {
- tests := [...]testType{
- {
- a: []int{1, 2},
- b: []int{-2, -1},
- c: []int{-1, 2},
- d: []int{0, 2},
- want: 2,
- },
- }
- for _, tt := range tests {
- got := fourSumCount(tt.a, tt.b, tt.c, tt.d)
- if got != tt.want {
- t.Fatalf("in: %v, got: %v, want: %v", tt, got, tt.want)
- }
- }
-}
diff --git a/problems/4sum-ii/README.md b/problems/4sum-ii/README.md
deleted file mode 100644
index b2fcdb145..000000000
--- a/problems/4sum-ii/README.md
+++ /dev/null
@@ -1,57 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-moves-to-equal-array-elements "Minimum Moves to Equal Array Elements")
-
-[Next >](../assign-cookies "Assign Cookies")
-
-## [454. 4Sum II (Medium)](https://leetcode.com/problems/4sum-ii "四数相加 II")
-
-
Given four integer arrays nums1, nums2, nums3, and nums4 all of length n, return the number of tuples (i, j, k, l) such that:
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Two Pointers](../../tag/two-pointers/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Similar Questions
- 1. [Two Sum](../two-sum) (Easy)
- 1. [3Sum](../3sum) (Medium)
- 1. [4Sum II](../4sum-ii) (Medium)
- 1. [Count Special Quadruplets](../count-special-quadruplets) (Easy)
diff --git a/problems/a-number-after-a-double-reversal/README.md b/problems/a-number-after-a-double-reversal/README.md
deleted file mode 100644
index 4fffcb4b3..000000000
--- a/problems/a-number-after-a-double-reversal/README.md
+++ /dev/null
@@ -1,61 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../build-the-equation "Build the Equation")
-
-[Next >](../execution-of-all-suffix-instructions-staying-in-a-grid "Execution of All Suffix Instructions Staying in a Grid")
-
-## [2119. A Number After a Double Reversal (Easy)](https://leetcode.com/problems/a-number-after-a-double-reversal "反转两次的数字")
-
-
Reversing an integer means to reverse all its digits.
-
-
-
For example, reversing 2021 gives 1202. Reversing 12300 gives 321 as the leading zeros are not retained.
-
-
-
Given an integer num, reversenum to get reversed1, then reversereversed1 to get reversed2. Return trueifreversed2equalsnum. Otherwise return false.
-
-
-
Example 1:
-
-
-Input: num = 526
-Output: true
-Explanation: Reverse num to get 625, then reverse 625 to get 526, which equals num.
-
-
-
Example 2:
-
-
-Input: num = 1800
-Output: false
-Explanation: Reverse num to get 81, then reverse 81 to get 18, which does not equal num.
-
-
-
Example 3:
-
-
-Input: num = 0
-Output: true
-Explanation: Reverse num to get 0, then reverse 0 to get 0, which equals num.
-
-
-
-
Constraints:
-
-
-
0 <= num <= 106
-
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
-
-### Hints
-
-Hint 1
-Other than the number 0 itself, any number that ends with 0 would lose some digits permanently when reversed.
-
diff --git a/problems/abbreviating-the-product-of-a-range/README.md b/problems/abbreviating-the-product-of-a-range/README.md
deleted file mode 100644
index 3ee8a1c74..000000000
--- a/problems/abbreviating-the-product-of-a-range/README.md
+++ /dev/null
@@ -1,103 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../check-if-a-parentheses-string-can-be-valid "Check if a Parentheses String Can Be Valid")
-
-[Next >](../build-the-equation "Build the Equation")
-
-## [2117. Abbreviating the Product of a Range (Hard)](https://leetcode.com/problems/abbreviating-the-product-of-a-range "一个区间内所有数乘积的缩写")
-
-
You are given two positive integers left and right with left <= right. Calculate the product of all integers in the inclusive range [left, right].
-
-
Since the product may be very large, you will abbreviate it following these steps:
-
-
-
Count all trailing zeros in the product and remove them. Let us denote this count as C.
-
-
For example, there are 3 trailing zeros in 1000, and there are 0 trailing zeros in 546.
-
-
-
Denote the remaining number of digits in the product as d. If d > 10, then express the product as <pre>...<suf> where <pre> denotes the first5 digits of the product, and <suf> denotes the last5 digits of the product after removing all trailing zeros. If d <= 10, we keep it unchanged.
-
-
For example, we express 1234567654321 as 12345...54321, but 1234567 is represented as 1234567.
-
-
-
Finally, represent the product as a string"<pre>...<suf>eC".
-
-
For example, 12345678987600000 will be represented as "12345...89876e5".
-
-
-
-
-
Return a string denoting the abbreviated product of all integers in the inclusive range[left, right].
-
-
-
Example 1:
-
-
-Input: left = 1, right = 4
-Output: "24e0"
-Explanation: The product is 1 × 2 × 3 × 4 = 24.
-There are no trailing zeros, so 24 remains the same. The abbreviation will end with "e0".
-Since the number of digits is 2, which is less than 10, we do not have to abbreviate it further.
-Thus, the final representation is "24e0".
-
-
-
Example 2:
-
-
-Input: left = 2, right = 11
-Output: "399168e2"
-Explanation: The product is 39916800.
-There are 2 trailing zeros, which we remove to get 399168. The abbreviation will end with "e2".
-The number of digits after removing the trailing zeros is 6, so we do not abbreviate it further.
-Hence, the abbreviated product is "399168e2".
-
-
-
Example 3:
-
-
-Input: left = 371, right = 375
-Output: "7219856259e3"
-Explanation: The product is 7219856259000.
-
-
-
-
Constraints:
-
-
-
1 <= left <= right <= 104
-
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
-
-### Hints
-
-Hint 1
-Calculating the number of trailing zeros, the last five digits, and the first five digits can all be done separately.
-
-
-
-Hint 2
-Use a prime factorization property to find the number of trailing zeros. Use modulo to find the last 5 digits. Use a logarithm property to find the first 5 digits.
-
-
-
-Hint 3
-The number of trailing zeros C is nothing but the number of times the product is completely divisible by 10. Since 2 and 5 are the only prime factors of 10, C will be equal to the minimum number of times 2 or 5 appear in the prime factorization of the product.
-
-
-
-Hint 4
-Iterate through the integers from left to right. For every integer, keep dividing it by 2 as long as it is divisible by 2 and C occurrences of 2 haven't been removed in total. Repeat this process for 5. Finally, multiply the integer under modulo of 10^5 with the product obtained till now to obtain the last five digits.
-
-
-
-Hint 5
-The product P can be represented as P=10^(x+y) where x is the integral part and y is the fractional part of x+y. Using the property "if S = A * B, then log(S) = log(A) + log(B)", we can write x+y = log_10(P) = sum(log_10(i)) for each integer i in [left, right]. Once we obtain the sum, the first five digits can be represented as floor(10^(y+4)).
-
diff --git a/problems/accepted-candidates-from-the-interviews/README.md b/problems/accepted-candidates-from-the-interviews/README.md
deleted file mode 100644
index b6aa925d5..000000000
--- a/problems/accepted-candidates-from-the-interviews/README.md
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../kth-smallest-product-of-two-sorted-arrays "Kth Smallest Product of Two Sorted Arrays")
-
-[Next >](../check-if-numbers-are-ascending-in-a-sentence "Check if Numbers Are Ascending in a Sentence")
-
-## [2041. Accepted Candidates From the Interviews (Medium)](https://leetcode.com/problems/accepted-candidates-from-the-interviews "面试中被录取的候选人")
-
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/accepted-candidates-from-the-interviews/mysql_schemas.sql b/problems/accepted-candidates-from-the-interviews/mysql_schemas.sql
deleted file mode 100644
index 6d1a6a9d4..000000000
--- a/problems/accepted-candidates-from-the-interviews/mysql_schemas.sql
+++ /dev/null
@@ -1,20 +0,0 @@
-Create table If Not Exists Candidates (candidate_id int, name varchar(30), years_of_exp int, interview_id int);
-Create table If Not Exists Rounds (interview_id int, round_id int, score int);
-Truncate table Candidates;
-insert into Candidates (candidate_id, name, years_of_exp, interview_id) values ('11', 'Atticus', '1', '101');
-insert into Candidates (candidate_id, name, years_of_exp, interview_id) values ('9', 'Ruben', '6', '104');
-insert into Candidates (candidate_id, name, years_of_exp, interview_id) values ('6', 'Aliza', '10', '109');
-insert into Candidates (candidate_id, name, years_of_exp, interview_id) values ('8', 'Alfredo', '0', '107');
-Truncate table Rounds;
-insert into Rounds (interview_id, round_id, score) values ('109', '3', '4');
-insert into Rounds (interview_id, round_id, score) values ('101', '2', '8');
-insert into Rounds (interview_id, round_id, score) values ('109', '4', '1');
-insert into Rounds (interview_id, round_id, score) values ('107', '1', '3');
-insert into Rounds (interview_id, round_id, score) values ('104', '3', '6');
-insert into Rounds (interview_id, round_id, score) values ('109', '1', '4');
-insert into Rounds (interview_id, round_id, score) values ('104', '4', '7');
-insert into Rounds (interview_id, round_id, score) values ('104', '1', '2');
-insert into Rounds (interview_id, round_id, score) values ('109', '2', '1');
-insert into Rounds (interview_id, round_id, score) values ('104', '2', '7');
-insert into Rounds (interview_id, round_id, score) values ('107', '2', '3');
-insert into Rounds (interview_id, round_id, score) values ('101', '1', '8');
diff --git a/problems/account-balance/README.md b/problems/account-balance/README.md
deleted file mode 100644
index a5dbfabc3..000000000
--- a/problems/account-balance/README.md
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-path-quality-of-a-graph "Maximum Path Quality of a Graph")
-
-[Next >](../number-of-equal-count-substrings "Number of Equal Count Substrings")
-
-## [2066. Account Balance (Medium)](https://leetcode.com/problems/account-balance "账户余额")
-
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/account-balance/mysql_schemas.sql b/problems/account-balance/mysql_schemas.sql
deleted file mode 100644
index 74d4a5114..000000000
--- a/problems/account-balance/mysql_schemas.sql
+++ /dev/null
@@ -1,7 +0,0 @@
-Create table If Not Exists Transactions (account_id int, day date, type ENUM('Deposit', 'Withdraw'), amount int);
-Truncate table Transactions;
-insert into Transactions (account_id, day, type, amount) values ('1', '2021-11-07', 'Deposit', '2000');
-insert into Transactions (account_id, day, type, amount) values ('1', '2021-11-09', 'Withdraw', '1000');
-insert into Transactions (account_id, day, type, amount) values ('1', '2021-11-11', 'Deposit', '3000');
-insert into Transactions (account_id, day, type, amount) values ('2', '2021-12-07', 'Deposit', '7000');
-insert into Transactions (account_id, day, type, amount) values ('2', '2021-12-12', 'Withdraw', '7000');
diff --git a/problems/accounts-merge/README.md b/problems/accounts-merge/README.md
deleted file mode 100644
index 63f2c14d2..000000000
--- a/problems/accounts-merge/README.md
+++ /dev/null
@@ -1,67 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../longest-word-in-dictionary "Longest Word in Dictionary")
-
-[Next >](../remove-comments "Remove Comments")
-
-## [721. Accounts Merge (Medium)](https://leetcode.com/problems/accounts-merge "账户合并")
-
-
Given a list of accounts where each element accounts[i] is a list of strings, where the first element accounts[i][0] is a name, and the rest of the elements are emails representing emails of the account.
-
-
Now, we would like to merge these accounts. Two accounts definitely belong to the same person if there is some common email to both accounts. Note that even if two accounts have the same name, they may belong to different people as people could have the same name. A person can have any number of accounts initially, but all of their accounts definitely have the same name.
-
-
After merging the accounts, return the accounts in the following format: the first element of each account is the name, and the rest of the elements are emails in sorted order. The accounts themselves can be returned in any order.
-
-
-
Example 1:
-
-
-Input: accounts = [["John","johnsmith@mail.com","john_newyork@mail.com"],["John","johnsmith@mail.com","john00@mail.com"],["Mary","mary@mail.com"],["John","johnnybravo@mail.com"]]
-Output: [["John","john00@mail.com","john_newyork@mail.com","johnsmith@mail.com"],["Mary","mary@mail.com"],["John","johnnybravo@mail.com"]]
-Explanation:
-The first and second John's are the same person as they have the common email "johnsmith@mail.com".
-The third John and Mary are different people as none of their email addresses are used by other accounts.
-We could return these lists in any order, for example the answer [['Mary', 'mary@mail.com'], ['John', 'johnnybravo@mail.com'],
-['John', 'john00@mail.com', 'john_newyork@mail.com', 'johnsmith@mail.com']] would still be accepted.
-
-+---------------+---------+
-| Column Name | Type |
-+---------------+---------+
-| business_id | int |
-| event_type | varchar |
-| occurences | int |
-+---------------+---------+
-(business_id, event_type) is the primary key of this table.
-Each row in the table logs the info that an event of some type occured at some business for a number of times.
-
-
-
-
Write an SQL query to find all active businesses.
-
-
An active business is a business that has more than one event type with occurences greater than the average occurences of that event type among all businesses.
-
-
The query result format is in the following example:
-
-
-Events table:
-+-------------+------------+------------+
-| business_id | event_type | occurences |
-+-------------+------------+------------+
-| 1 | reviews | 7 |
-| 3 | reviews | 3 |
-| 1 | ads | 11 |
-| 2 | ads | 7 |
-| 3 | ads | 6 |
-| 1 | page views | 3 |
-| 2 | page views | 12 |
-+-------------+------------+------------+
-
-Result table:
-+-------------+
-| business_id |
-+-------------+
-| 1 |
-+-------------+
-Average for 'reviews', 'ads' and 'page views' are (7+3)/2=5, (11+7+6)/3=8, (3+12)/2=7.5 respectively.
-Business with id 1 has 7 'reviews' events (more than 5) and 11 'ads' events (more than 8) so it is an active business.
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/active-businesses/active_businesses.sql b/problems/active-businesses/active_businesses.sql
deleted file mode 100644
index bae62cf19..000000000
--- a/problems/active-businesses/active_businesses.sql
+++ /dev/null
@@ -1 +0,0 @@
-# Write your MySQL query statement below
diff --git a/problems/active-businesses/mysql_schemas.sql b/problems/active-businesses/mysql_schemas.sql
deleted file mode 100644
index b80874bf4..000000000
--- a/problems/active-businesses/mysql_schemas.sql
+++ /dev/null
@@ -1,9 +0,0 @@
-Create table If Not Exists Events (business_id int, event_type varchar(10), occurences int);
-Truncate table Events;
-insert into Events (business_id, event_type, occurences) values ('1', 'reviews', '7');
-insert into Events (business_id, event_type, occurences) values ('3', 'reviews', '3');
-insert into Events (business_id, event_type, occurences) values ('1', 'ads', '11');
-insert into Events (business_id, event_type, occurences) values ('2', 'ads', '7');
-insert into Events (business_id, event_type, occurences) values ('3', 'ads', '6');
-insert into Events (business_id, event_type, occurences) values ('1', 'page views', '3');
-insert into Events (business_id, event_type, occurences) values ('2', 'page views', '12');
diff --git a/problems/active-users/README.md b/problems/active-users/README.md
deleted file mode 100644
index ef8762c21..000000000
--- a/problems/active-users/README.md
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-number-of-darts-inside-of-a-circular-dartboard "Maximum Number of Darts Inside of a Circular Dartboard")
-
-[Next >](../check-if-a-word-occurs-as-a-prefix-of-any-word-in-a-sentence "Check If a Word Occurs As a Prefix of Any Word in a Sentence")
-
-## [1454. Active Users (Medium)](https://leetcode.com/problems/active-users "活跃用户")
-
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/active-users/mysql_schemas.sql b/problems/active-users/mysql_schemas.sql
deleted file mode 100644
index 256bf8be8..000000000
--- a/problems/active-users/mysql_schemas.sql
+++ /dev/null
@@ -1,15 +0,0 @@
-Create table If Not Exists Accounts (id int, name varchar(10));
-Create table If Not Exists Logins (id int, login_date date);
-Truncate table Accounts;
-insert into Accounts (id, name) values ('1', 'Winston');
-insert into Accounts (id, name) values ('7', 'Jonathan');
-Truncate table Logins;
-insert into Logins (id, login_date) values ('7', '2020-05-30');
-insert into Logins (id, login_date) values ('1', '2020-05-30');
-insert into Logins (id, login_date) values ('7', '2020-05-31');
-insert into Logins (id, login_date) values ('7', '2020-06-01');
-insert into Logins (id, login_date) values ('7', '2020-06-02');
-insert into Logins (id, login_date) values ('7', '2020-06-02');
-insert into Logins (id, login_date) values ('7', '2020-06-03');
-insert into Logins (id, login_date) values ('1', '2020-06-07');
-insert into Logins (id, login_date) values ('7', '2020-06-10');
diff --git a/problems/activity-participants/README.md b/problems/activity-participants/README.md
deleted file mode 100644
index 066be853b..000000000
--- a/problems/activity-participants/README.md
+++ /dev/null
@@ -1,81 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../construct-target-array-with-multiple-sums "Construct Target Array With Multiple Sums")
-
-[Next >](../sort-integers-by-the-number-of-1-bits "Sort Integers by The Number of 1 Bits")
-
-## [1355. Activity Participants (Medium)](https://leetcode.com/problems/activity-participants "活动参与者")
-
-
Table: Friends
-
-+---------------+---------+
-| Column Name | Type |
-+---------------+---------+
-| id | int |
-| name | varchar |
-| activity | varchar |
-+---------------+---------+
-id is the id of the friend and primary key for this table.
-name is the name of the friend.
-activity is the name of the activity which the friend takes part in.
-
-
-
Table: Activities
-
-+---------------+---------+
-| Column Name | Type |
-+---------------+---------+
-| id | int |
-| name | varchar |
-+---------------+---------+
-id is the primary key for this table.
-name is the name of the activity.
-
-
-Write an SQL query to find the names of all the activities with neither maximum, nor minimum number of participants.
-
-Return the result table in any order. Each activity in table Activities is performed by any person in the table Friends.
-
-The query result format is in the following example:
-
-Friends table:
-
-+------+--------------+---------------+
-| id | name | activity |
-+------+--------------+---------------+
-| 1 | Jonathan D. | Eating |
-| 2 | Jade W. | Singing |
-| 3 | Victor J. | Singing |
-| 4 | Elvis Q. | Eating |
-| 5 | Daniel A. | Eating |
-| 6 | Bob B. | Horse Riding |
-+------+--------------+---------------+
-
-Activities table:
-+------+--------------+
-| id | name |
-+------+--------------+
-| 1 | Eating |
-| 2 | Singing |
-| 3 | Horse Riding |
-+------+--------------+
-
-Result table:
-+--------------+
-| results |
-+--------------+
-| Singing |
-+--------------+
-
-Eating activity is performed by 3 friends, maximum number of participants, (Jonathan D. , Elvis Q. and Daniel A.)
-Horse Riding activity is performed by 1 friend, minimum number of participants, (Bob B.)
-Singing is performed by 2 friends (Victor J. and Jade W.)
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/activity-participants/mysql_schemas.sql b/problems/activity-participants/mysql_schemas.sql
deleted file mode 100644
index 161ef2e28..000000000
--- a/problems/activity-participants/mysql_schemas.sql
+++ /dev/null
@@ -1,13 +0,0 @@
-Create table If Not Exists Friends (id int, name varchar(30), activity varchar(30));
-Create table If Not Exists Activities (id int, name varchar(30));
-Truncate table Friends;
-insert into Friends (id, name, activity) values ('1', 'Jonathan D.', 'Eating');
-insert into Friends (id, name, activity) values ('2', 'Jade W.', 'Singing');
-insert into Friends (id, name, activity) values ('3', 'Victor J.', 'Singing');
-insert into Friends (id, name, activity) values ('4', 'Elvis Q.', 'Eating');
-insert into Friends (id, name, activity) values ('5', 'Daniel A.', 'Eating');
-insert into Friends (id, name, activity) values ('6', 'Bob B.', 'Horse Riding');
-Truncate table Activities;
-insert into Activities (id, name) values ('1', 'Eating');
-insert into Activities (id, name) values ('2', 'Singing');
-insert into Activities (id, name) values ('3', 'Horse Riding');
diff --git a/problems/actors-and-directors-who-cooperated-at-least-three-times/README.md b/problems/actors-and-directors-who-cooperated-at-least-three-times/README.md
deleted file mode 100644
index 553490bae..000000000
--- a/problems/actors-and-directors-who-cooperated-at-least-three-times/README.md
+++ /dev/null
@@ -1,57 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../last-stone-weight-ii "Last Stone Weight II")
-
-[Next >](../height-checker "Height Checker")
-
-## [1050. Actors and Directors Who Cooperated At Least Three Times (Easy)](https://leetcode.com/problems/actors-and-directors-who-cooperated-at-least-three-times "合作过至少三次的演员和导演")
-
-
Table: ActorDirector
-
-
-+-------------+---------+
-| Column Name | Type |
-+-------------+---------+
-| actor_id | int |
-| director_id | int |
-| timestamp | int |
-+-------------+---------+
-timestamp is the primary key column for this table.
-
-
-
-
-
Write a SQL query for a report that provides the pairs (actor_id, director_id) where the actor have cooperated with the director at least 3 times.
Given an integer num, repeatedly add all its digits until the result has only one digit, and return it.
-
-
-
Example 1:
-
-
-Input: num = 38
-Output: 2
-Explanation: The process is
-38 --> 3 + 8 --> 11
-11 --> 1 + 1 --> 2
-Since 2 has only one digit, return it.
-
-
-
Example 2:
-
-
-Input: num = 0
-Output: 0
-
-
-
-
Constraints:
-
-
-
0 <= num <= 231 - 1
-
-
-
-
Follow up: Could you do it without any loop/recursion in O(1) runtime?
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
- [[Simulation](../../tag/simulation/README.md)]
- [[Number Theory](../../tag/number-theory/README.md)]
-
-### Similar Questions
- 1. [Happy Number](../happy-number) (Easy)
- 1. [Sum of Digits in the Minimum Number](../sum-of-digits-in-the-minimum-number) (Easy)
- 1. [Sum of Digits of String After Convert](../sum-of-digits-of-string-after-convert) (Easy)
-
-### Hints
-
-Hint 1
-A naive implementation of the above process is trivial. Could you come up with other methods?
-
-
-
-Hint 2
-What are all the possible results?
-
-
-
-Hint 3
-How do they occur, periodically or randomly?
-
-
-
-Hint 4
-You may find this Wikipedia article useful.
-
diff --git a/problems/add-digits/add_digits.go b/problems/add-digits/add_digits.go
deleted file mode 100644
index e1673c7e8..000000000
--- a/problems/add-digits/add_digits.go
+++ /dev/null
@@ -1,5 +0,0 @@
-package problem258
-
-func addDigits(num int) int {
- return (num-1)%9 + 1
-}
diff --git a/problems/add-digits/add_digits_test.go b/problems/add-digits/add_digits_test.go
deleted file mode 100644
index 4272d203f..000000000
--- a/problems/add-digits/add_digits_test.go
+++ /dev/null
@@ -1,23 +0,0 @@
-package problem258
-
-import "testing"
-
-type testType struct {
- in int
- want int
-}
-
-func TestAddDigits(t *testing.T) {
- tests := [...]testType{
- {
- in: 38,
- want: 2,
- },
- }
- for _, tt := range tests {
- got := addDigits(tt.in)
- if got != tt.want {
- t.Fatalf("in: %v, got: %v, want: %v", tt.in, got, tt.want)
- }
- }
-}
diff --git a/problems/add-minimum-number-of-rungs/README.md b/problems/add-minimum-number-of-rungs/README.md
deleted file mode 100644
index 75ced1a88..000000000
--- a/problems/add-minimum-number-of-rungs/README.md
+++ /dev/null
@@ -1,80 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-number-of-words-you-can-type "Maximum Number of Words You Can Type")
-
-[Next >](../maximum-number-of-points-with-cost "Maximum Number of Points with Cost")
-
-## [1936. Add Minimum Number of Rungs (Medium)](https://leetcode.com/problems/add-minimum-number-of-rungs "新增的最少台阶数")
-
-
You are given a strictly increasing integer array rungs that represents the height of rungs on a ladder. You are currently on the floor at height 0, and you want to reach the last rung.
-
-
You are also given an integer dist. You can only climb to the next highest rung if the distance between where you are currently at (the floor or on a rung) and the next rung is at mostdist. You are able to insert rungs at any positive integer height if a rung is not already there.
-
-
Return the minimum number of rungs that must be added to the ladder in order for you to climb to the last rung.
-
-
-
Example 1:
-
-
-Input: rungs = [1,3,5,10], dist = 2
-Output: 2
-Explanation:
-You currently cannot reach the last rung.
-Add rungs at heights 7 and 8 to climb this ladder.
-The ladder will now have rungs at [1,3,5,7,8,10].
-
-
-
Example 2:
-
-
-Input: rungs = [3,6,8,10], dist = 3
-Output: 0
-Explanation:
-This ladder can be climbed without adding additional rungs.
-
-
-
Example 3:
-
-
-Input: rungs = [3,4,6,7], dist = 2
-Output: 1
-Explanation:
-You currently cannot reach the first rung from the ground.
-Add a rung at height 1 to climb this ladder.
-The ladder will now have rungs at [1,3,4,6,7].
-
-
-
-
Constraints:
-
-
-
1 <= rungs.length <= 105
-
1 <= rungs[i] <= 109
-
1 <= dist <= 109
-
rungs is strictly increasing.
-
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[Array](../../tag/array/README.md)]
-
-### Hints
-
-Hint 1
-Go as far as you can on the available rungs before adding new rungs.
-
-
-
-Hint 2
-If you have to add a new rung, add it as high up as possible.
-
-
-
-Hint 3
-Try using division to decrease the number of computations.
-
diff --git a/problems/add-one-row-to-tree/README.md b/problems/add-one-row-to-tree/README.md
deleted file mode 100644
index 46e4b2d6a..000000000
--- a/problems/add-one-row-to-tree/README.md
+++ /dev/null
@@ -1,57 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../design-circular-queue "Design Circular Queue")
-
-[Next >](../maximum-distance-in-arrays "Maximum Distance in Arrays")
-
-## [623. Add One Row to Tree (Medium)](https://leetcode.com/problems/add-one-row-to-tree "在二叉树中增加一行")
-
-
Given the root of a binary tree and two integers val and depth, add a row of nodes with value val at the given depth depth.
-
-
Note that the root node is at depth 1.
-
-
The adding rule is:
-
-
-
Given the integer depth, for each not null tree node cur at the depth depth - 1, create two tree nodes with value val as cur's left subtree root and right subtree root.
-
cur's original left subtree should be the left subtree of the new left subtree root.
-
cur's original right subtree should be the right subtree of the new right subtree root.
-
If depth == 1 that means there is no depth depth - 1 at all, then create a tree node with value val as the new root of the whole original tree, and the original tree is the new root's left subtree.
Given two non-negative integers, num1 and num2 represented as string, return the sum ofnum1andnum2as a string.
-
-
You must solve the problem without using any built-in library for handling large integers (such as BigInteger). You must also not convert the inputs to integers directly.
You are given two non-empty linked lists representing two non-negative integers. The most significant digit comes first and each of their nodes contains a single digit. Add the two numbers and return the sum as a linked list.
-
-
You may assume the two numbers do not contain any leading zero, except the number 0 itself.
You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order, and each of their nodes contains a single digit. Add the two numbers and return the sum as a linked list.
-
-
You may assume the two numbers do not contain any leading zero, except the number 0 itself.
The number of nodes in each linked list is in the range [1, 100].
-
0 <= Node.val <= 9
-
It is guaranteed that the list represents a number that does not have leading zeros.
-
-
-### Related Topics
- [[Recursion](../../tag/recursion/README.md)]
- [[Linked List](../../tag/linked-list/README.md)]
- [[Math](../../tag/math/README.md)]
-
-### Similar Questions
- 1. [Multiply Strings](../multiply-strings) (Medium)
- 1. [Add Binary](../add-binary) (Easy)
- 1. [Sum of Two Integers](../sum-of-two-integers) (Medium)
- 1. [Add Strings](../add-strings) (Easy)
- 1. [Add Two Numbers II](../add-two-numbers-ii) (Medium)
- 1. [Add to Array-Form of Integer](../add-to-array-form-of-integer) (Easy)
diff --git a/problems/add-two-numbers/add_two_numbers.go b/problems/add-two-numbers/add_two_numbers.go
deleted file mode 100644
index 2bd03f25e..000000000
--- a/problems/add-two-numbers/add_two_numbers.go
+++ /dev/null
@@ -1,32 +0,0 @@
-package problem2
-
-import "github.com/awesee/leetcode/internal/kit"
-
-// ListNode - Definition for singly-linked list.
-type ListNode = kit.ListNode
-
-/**
- * Definition for singly-linked list.
- * type ListNode struct {
- * Val int
- * Next *ListNode
- * }
- */
-func addTwoNumbers(l1 *ListNode, l2 *ListNode) *ListNode {
- ans, carry := &ListNode{}, 0
- t := ans
- for l1 != nil || l2 != nil || carry != 0 {
- if l1 != nil {
- carry += l1.Val
- l1 = l1.Next
- }
- if l2 != nil {
- carry += l2.Val
- l2 = l2.Next
- }
- t.Next = &ListNode{Val: carry % 10}
- t = t.Next
- carry /= 10
- }
- return ans.Next
-}
diff --git a/problems/add-two-numbers/add_two_numbers_test.go b/problems/add-two-numbers/add_two_numbers_test.go
deleted file mode 100644
index 435a43070..000000000
--- a/problems/add-two-numbers/add_two_numbers_test.go
+++ /dev/null
@@ -1,42 +0,0 @@
-package problem2
-
-import (
- "reflect"
- "testing"
-
- "github.com/awesee/leetcode/internal/kit"
-)
-
-type testType struct {
- l1 []int
- l2 []int
- want []int
-}
-
-func TestAddTwoNumbers(t *testing.T) {
- tests := [...]testType{
- {
- l1: []int{2, 4, 3},
- l2: []int{5, 6, 4},
- want: []int{7, 0, 8},
- },
- {
- l1: []int{5},
- l2: []int{5},
- want: []int{0, 1},
- },
- {
- l1: []int{5},
- l2: []int{5, 9, 9},
- want: []int{0, 0, 0, 1},
- },
- }
- for _, tt := range tests {
- l1 := kit.SliceInt2ListNode(tt.l1)
- l2 := kit.SliceInt2ListNode(tt.l2)
- got := kit.ListNode2SliceInt(addTwoNumbers(l1, l2))
- if !reflect.DeepEqual(got, tt.want) {
- t.Fatalf("in: %v %v, got: %v, want: %v", tt.l1, tt.l2, got, tt.want)
- }
- }
-}
diff --git a/problems/add-two-polynomials-represented-as-linked-lists/README.md b/problems/add-two-polynomials-represented-as-linked-lists/README.md
deleted file mode 100644
index 3c0db5e11..000000000
--- a/problems/add-two-polynomials-represented-as-linked-lists/README.md
+++ /dev/null
@@ -1,35 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../percentage-of-users-attended-a-contest "Percentage of Users Attended a Contest")
-
-[Next >](../hopper-company-queries-i "Hopper Company Queries I")
-
-## [1634. Add Two Polynomials Represented as Linked Lists (Medium)](https://leetcode.com/problems/add-two-polynomials-represented-as-linked-lists "求两个多项式链表的和")
-
-
-
-### Related Topics
- [[Linked List](../../tag/linked-list/README.md)]
- [[Math](../../tag/math/README.md)]
- [[Two Pointers](../../tag/two-pointers/README.md)]
-
-### Hints
-
-Hint 1
-Process both linked lists at the same time
-
-
-
-Hint 2
-If the current power of the two heads is equal, add this power with the sum of the coefficients to the answer list.
-
-
-
-Hint 3
-If one head has a larger power, add this power to the answer list and move only this head.
-
diff --git a/problems/adding-spaces-to-a-string/README.md b/problems/adding-spaces-to-a-string/README.md
deleted file mode 100644
index 2239ba4fd..000000000
--- a/problems/adding-spaces-to-a-string/README.md
+++ /dev/null
@@ -1,82 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../find-first-palindromic-string-in-the-array "Find First Palindromic String in the Array")
-
-[Next >](../number-of-smooth-descent-periods-of-a-stock "Number of Smooth Descent Periods of a Stock")
-
-## [2109. Adding Spaces to a String (Medium)](https://leetcode.com/problems/adding-spaces-to-a-string "向字符串添加空格")
-
-
You are given a 0-indexed string s and a 0-indexed integer array spaces that describes the indices in the original string where spaces will be added. Each space should be inserted before the character at the given index.
-
-
-
For example, given s = "EnjoyYourCoffee" and spaces = [5, 9], we place spaces before 'Y' and 'C', which are at indices 5 and 9 respectively. Thus, we obtain "Enjoy Your Coffee".
-
-
-
Returnthe modified string after the spaces have been added.
-
-
-
Example 1:
-
-
-Input: s = "LeetcodeHelpsMeLearn", spaces = [8,13,15]
-Output: "Leetcode Helps Me Learn"
-Explanation:
-The indices 8, 13, and 15 correspond to the underlined characters in "LeetcodeHelpsMeLearn".
-We then place spaces before those characters.
-
-
-
Example 2:
-
-
-Input: s = "icodeinpython", spaces = [1,5,7,9]
-Output: "i code in py thon"
-Explanation:
-The indices 1, 5, 7, and 9 correspond to the underlined characters in "icodeinpython".
-We then place spaces before those characters.
-
-
-
Example 3:
-
-
-Input: s = "spacing", spaces = [0,1,2,3,4,5,6]
-Output: " s p a c i n g"
-Explanation:
-We are also able to place spaces before the first character of the string.
-
-
-
-
Constraints:
-
-
-
1 <= s.length <= 3 * 105
-
s consists only of lowercase and uppercase English letters.
-
1 <= spaces.length <= 3 * 105
-
0 <= spaces[i] <= s.length - 1
-
All the values of spaces are strictly increasing.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[String](../../tag/string/README.md)]
- [[Simulation](../../tag/simulation/README.md)]
-
-### Hints
-
-Hint 1
-Create a new string, initially empty, as the modified string. Iterate through the original string and append each character of the original string to the new string. However, each time you reach a character that requires a space before it, append a space before appending the character.
-
-
-
-Hint 2
-Since the array of indices for the space locations is sorted, use a pointer to keep track of the next index to place a space. Only increment the pointer once a space has been appended.
-
-
-
-Hint 3
-Ensure that your append operation can be done in O(1).
-
diff --git a/problems/adding-two-negabinary-numbers/README.md b/problems/adding-two-negabinary-numbers/README.md
deleted file mode 100644
index be61ff03b..000000000
--- a/problems/adding-two-negabinary-numbers/README.md
+++ /dev/null
@@ -1,60 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../flip-columns-for-maximum-number-of-equal-rows "Flip Columns For Maximum Number of Equal Rows")
-
-[Next >](../number-of-submatrices-that-sum-to-target "Number of Submatrices That Sum to Target")
-
-## [1073. Adding Two Negabinary Numbers (Medium)](https://leetcode.com/problems/adding-two-negabinary-numbers "负二进制数相加")
-
-
Given two numbers arr1 and arr2 in base -2, return the result of adding them together.
-
-
Each number is given in array format: as an array of 0s and 1s, from most significant bit to least significant bit. For example, arr = [1,1,0,1] represents the number (-2)^3 + (-2)^2 + (-2)^0 = -3. A number arr in array, format is also guaranteed to have no leading zeros: either arr == [0] or arr[0] == 1.
-
-
Return the result of adding arr1 and arr2 in the same format: as an array of 0s and 1s with no leading zeros.
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Math](../../tag/math/README.md)]
-
-### Hints
-
-Hint 1
-We can try to determine the last digit of the answer, then divide everything by 2 and repeat.
-
diff --git a/problems/adding-two-negabinary-numbers/adding_two_negabinary_numbers.go b/problems/adding-two-negabinary-numbers/adding_two_negabinary_numbers.go
deleted file mode 100644
index de035c93e..000000000
--- a/problems/adding-two-negabinary-numbers/adding_two_negabinary_numbers.go
+++ /dev/null
@@ -1,38 +0,0 @@
-package problem1073
-
-func addNegabinary(A, B []int) []int {
- i, j := len(A)-1, len(B)-1
- res := make([]int, 0, i+j)
- carry := 0
- for i >= 0 || j >= 0 || carry != 0 {
- if i >= 0 {
- carry += A[i]
- i--
- }
- if j >= 0 {
- carry += B[j]
- j--
- }
- res = append(res, carry&1)
- carry = -(carry >> 1)
- }
-
- res = reverse(res)
-
- // cut leading zero
- i, end := 0, len(res)-1
- for i < end && res[i] == 0 {
- i++
- }
- return res[i:]
-}
-
-func reverse(A []int) []int {
- i, j := 0, len(A)-1
- for i < j {
- A[i], A[j] = A[j], A[i]
- i++
- j--
- }
- return A
-}
diff --git a/problems/additive-number/README.md b/problems/additive-number/README.md
deleted file mode 100644
index dc51c75c0..000000000
--- a/problems/additive-number/README.md
+++ /dev/null
@@ -1,57 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../number-of-islands-ii "Number of Islands II")
-
-[Next >](../range-sum-query-mutable "Range Sum Query - Mutable")
-
-## [306. Additive Number (Medium)](https://leetcode.com/problems/additive-number "累加数")
-
-
Additive number is a string whose digits can form additive sequence.
-
-
A valid additive sequence should contain at least three numbers. Except for the first two numbers, each subsequent number in the sequence must be the sum of the preceding two.
-
-
Given a string containing only digits '0'-'9', write a function to determine if it's an additive number.
-
-
Note: Numbers in the additive sequence cannot have leading zeros, so sequence 1, 2, 03 or 1, 02, 3 is invalid.
-
-
-
Example 1:
-
-
-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
-
-+---------------+---------+
-| Column Name | Type |
-+---------------+---------+
-| ad_id | int |
-| user_id | int |
-| action | enum |
-+---------------+---------+
-(ad_id, user_id) is the primary key for this table.
-Each row of this table contains the ID of an Ad, the ID of a user and the action taken by this user regarding this Ad.
-The action column is an ENUM type of ('Clicked', 'Viewed', 'Ignored').
-
-
-A company is running Ads and wants to calculate the performance of each Ad.
-
-Performance of the Ad is measured using Click-Through Rate (CTR) where:
-
-[[image-blog:Leetcode: Ads Performance][https://raw.githubusercontent.com/dennyzhang/code.dennyzhang.com/master/problems/ads-performance/ctrformula.png]]
-
-Write an SQL query to find the ctr of each Ad.
-
-Round ctr to 2 decimal points. Order the result table by ctr in descending order and by ad_id in ascending order in case of a tie.
-
-The query result format is in the following example:
-
-Ads table:
-+-------+---------+---------+
-| ad_id | user_id | action |
-+-------+---------+---------+
-| 1 | 1 | Clicked |
-| 2 | 2 | Clicked |
-| 3 | 3 | Viewed |
-| 5 | 5 | Ignored |
-| 1 | 7 | Ignored |
-| 2 | 7 | Viewed |
-| 3 | 5 | Clicked |
-| 1 | 4 | Viewed |
-| 2 | 11 | Viewed |
-| 1 | 2 | Clicked |
-+-------+---------+---------+
-Result table:
-+-------+-------+
-| ad_id | ctr |
-+-------+-------+
-| 1 | 66.67 |
-| 3 | 50.00 |
-| 2 | 33.33 |
-| 5 | 0.00 |
-+-------+-------+
-for ad_id = 1, ctr = (2/(2+1)) * 100 = 66.67
-for ad_id = 2, ctr = (1/(1+2)) * 100 = 33.33
-for ad_id = 3, ctr = (1/(1+1)) * 100 = 50.00
-for ad_id = 5, ctr = 0.00, Note that ad_id has no clicks or views.
-Note that we don't care about Ignored Ads.
-Result table is ordered by the ctr. in case of a tie we order them by ad_id
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/ads-performance/mysql_schemas.sql b/problems/ads-performance/mysql_schemas.sql
deleted file mode 100644
index 0ccce8bb5..000000000
--- a/problems/ads-performance/mysql_schemas.sql
+++ /dev/null
@@ -1,12 +0,0 @@
-Create table If Not Exists Ads (ad_id int, user_id int, action ENUM('Clicked', 'Viewed', 'Ignored'));
-Truncate table Ads;
-insert into Ads (ad_id, user_id, action) values ('1', '1', 'Clicked');
-insert into Ads (ad_id, user_id, action) values ('2', '2', 'Clicked');
-insert into Ads (ad_id, user_id, action) values ('3', '3', 'Viewed');
-insert into Ads (ad_id, user_id, action) values ('5', '5', 'Ignored');
-insert into Ads (ad_id, user_id, action) values ('1', '7', 'Ignored');
-insert into Ads (ad_id, user_id, action) values ('2', '7', 'Viewed');
-insert into Ads (ad_id, user_id, action) values ('3', '5', 'Clicked');
-insert into Ads (ad_id, user_id, action) values ('1', '4', 'Viewed');
-insert into Ads (ad_id, user_id, action) values ('2', '11', 'Viewed');
-insert into Ads (ad_id, user_id, action) values ('1', '2', 'Clicked');
diff --git a/problems/advantage-shuffle/README.md b/problems/advantage-shuffle/README.md
deleted file mode 100644
index 129cfef84..000000000
--- a/problems/advantage-shuffle/README.md
+++ /dev/null
@@ -1,38 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../reordered-power-of-2 "Reordered Power of 2")
-
-[Next >](../minimum-number-of-refueling-stops "Minimum Number of Refueling Stops")
-
-## [870. Advantage Shuffle (Medium)](https://leetcode.com/problems/advantage-shuffle "优势洗牌")
-
-
You are given two integer arrays nums1 and nums2 both of the same length. The advantage of nums1 with respect to nums2 is the number of indices i for which nums1[i] > nums2[i].
-
-
Return any permutation of nums1 that maximizes its advantage with respect to nums2.
n passengers board an airplane with exactly n seats. The first passenger has lost the ticket and picks a seat randomly. But after that, the rest of passengers will:
-
-
-
Take their own seat if it is still available,
-
Pick other seats randomly when they find their seat occupied
-
-
-
What is the probability that the n-th person can get his own seat?
-
-
-
Example 1:
-
-
-Input: n = 1
-Output: 1.00000
-Explanation: The first person can only get the first seat.
-
-
Example 2:
-
-
-Input: n = 2
-Output: 0.50000
-Explanation: The second person has a probability of 0.5 to get the second seat (when first person gets the first seat).
-
-
-
-
Constraints:
-
-
-
1 <= n <= 10^5
-
-
-### Related Topics
- [[Brainteaser](../../tag/brainteaser/README.md)]
- [[Math](../../tag/math/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Probability and Statistics](../../tag/probability-and-statistics/README.md)]
-
-### Hints
-
-Hint 1
-Use dynamic programming, dp[i] indicates the probability that the i-th person can get his seat when there're i persons in total. It's okay to start with O(n^2) solution and then optimize it.
-
-
-
-Hint 2
-Try to find the regular pattern of the result.
-
diff --git a/problems/alert-using-same-key-card-three-or-more-times-in-a-one-hour-period/README.md b/problems/alert-using-same-key-card-three-or-more-times-in-a-one-hour-period/README.md
deleted file mode 100644
index a91e1b097..000000000
--- a/problems/alert-using-same-key-card-three-or-more-times-in-a-one-hour-period/README.md
+++ /dev/null
@@ -1,63 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../design-parking-system "Design Parking System")
-
-[Next >](../find-valid-matrix-given-row-and-column-sums "Find Valid Matrix Given Row and Column Sums")
-
-## [1604. Alert Using Same Key-Card Three or More Times in a One Hour Period (Medium)](https://leetcode.com/problems/alert-using-same-key-card-three-or-more-times-in-a-one-hour-period "警告一小时内使用相同员工卡大于等于三次的人")
-
-
LeetCode company workers use key-cards to unlock office doors. Each time a worker uses their key-card, the security system saves the worker's name and the time when it was used. The system emits an alert if any worker uses the key-card three or more times in a one-hour period.
-
-
You are given a list of strings keyName and keyTime where [keyName[i], keyTime[i]] corresponds to a person's name and the time when their key-card was used in asingle day.
-
-
Access times are given in the 24-hour time format "HH:MM", such as "23:51" and "09:49".
-
-
Return a list of unique worker names who received an alert for frequent keycard use. Sort the names in ascending order alphabetically.
-
-
Notice that "10:00" - "11:00" is considered to be within a one-hour period, while "22:51" - "23:52" is not considered to be within a one-hour period.
-
-
-
Example 1:
-
-
-Input: keyName = ["daniel","daniel","daniel","luis","luis","luis","luis"], keyTime = ["10:00","10:40","11:00","09:00","11:00","13:00","15:00"]
-Output: ["daniel"]
-Explanation: "daniel" used the keycard 3 times in a one-hour period ("10:00","10:40", "11:00").
-
-
-
Example 2:
-
-
-Input: keyName = ["alice","alice","alice","bob","bob","bob","bob"], keyTime = ["12:01","12:00","18:00","21:00","21:20","21:30","23:00"]
-Output: ["bob"]
-Explanation: "bob" used the keycard 3 times in a one-hour period ("21:00","21:20", "21:30").
-
-
-
-
Constraints:
-
-
-
1 <= keyName.length, keyTime.length <= 105
-
keyName.length == keyTime.length
-
keyTime[i] is in the format "HH:MM".
-
[keyName[i], keyTime[i]] is unique.
-
1 <= keyName[i].length <= 10
-
keyName[i] contains only lowercase English letters.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Hints
-
-Hint 1
-Group the times by the name of the card user, then sort each group
-
diff --git a/problems/alien-dictionary/README.md b/problems/alien-dictionary/README.md
deleted file mode 100644
index 4c7fde95a..000000000
--- a/problems/alien-dictionary/README.md
+++ /dev/null
@@ -1,76 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../missing-number "Missing Number")
-
-[Next >](../closest-binary-search-tree-value "Closest Binary Search Tree Value")
-
-## [269. Alien Dictionary (Hard)](https://leetcode.com/problems/alien-dictionary "火星词典")
-
-
There is a new alien language which uses the latin alphabet. However, the order among letters are unknown to you. You receive a list of non-empty words from the dictionary, where words are sorted lexicographically by the rules of this new language. Derive the order of letters in this language.
-Input:
-[
- "z",
- "x",
- "z"
-]
-
-Output:""
-
-Explanation: The order is invalid, so return "".
-
-
-
Note:
-
-
-
You may assume all letters are in lowercase.
-
You may assume that if a is a prefix of b, then a must appear before b in the given dictionary.
-
If the order is invalid, return an empty string.
-
There may be multiple valid order of letters, return any one of them is fine.
-
-
-### Related Topics
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Graph](../../tag/graph/README.md)]
- [[Topological Sort](../../tag/topological-sort/README.md)]
- [[Array](../../tag/array/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Similar Questions
- 1. [Course Schedule II](../course-schedule-ii) (Medium)
diff --git a/problems/alien-dictionary/alien_dictionary.go b/problems/alien-dictionary/alien_dictionary.go
deleted file mode 100644
index e2e505be7..000000000
--- a/problems/alien-dictionary/alien_dictionary.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem269
diff --git a/problems/alien-dictionary/alien_dictionary_test.go b/problems/alien-dictionary/alien_dictionary_test.go
deleted file mode 100644
index e2e505be7..000000000
--- a/problems/alien-dictionary/alien_dictionary_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem269
diff --git a/problems/all-divisions-with-the-highest-score-of-a-binary-array/README.md b/problems/all-divisions-with-the-highest-score-of-a-binary-array/README.md
deleted file mode 100644
index 3e8ea2eca..000000000
--- a/problems/all-divisions-with-the-highest-score-of-a-binary-array/README.md
+++ /dev/null
@@ -1,92 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../keep-multiplying-found-values-by-two "Keep Multiplying Found Values by Two")
-
-[Next >](../find-substring-with-given-hash-value "Find Substring With Given Hash Value")
-
-## [2155. All Divisions With the Highest Score of a Binary Array (Medium)](https://leetcode.com/problems/all-divisions-with-the-highest-score-of-a-binary-array "分组得分最高的所有下标")
-
-
You are given a 0-indexed binary array nums of length n. nums can be divided at index i (where 0 <= i <= n) into two arrays (possibly empty) numsleft and numsright:
-
-
-
numsleft has all the elements of nums between index 0 and i - 1(inclusive), while numsright has all the elements of nums between index i and n - 1(inclusive).
-
If i == 0, numsleft is empty, while numsright has all the elements of nums.
-
If i == n, numsleft has all the elements of nums, while numsright is empty.
-
-
-
The division score of an index i is the sum of the number of 0's in numsleft and the number of 1's in numsright.
-
-
Return all distinct indices that have the highest possible division score. You may return the answer in any order.
-
-
-
Example 1:
-
-
-Input: nums = [0,0,1,0]
-Output: [2,4]
-Explanation: Division at index
-- 0: numsleft is []. numsright is [0,0,1,0]. The score is 0 + 1 = 1.
-- 1: numsleft is [0]. numsright is [0,1,0]. The score is 1 + 1 = 2.
-- 2: numsleft is [0,0]. numsright is [1,0]. The score is 2 + 1 = 3.
-- 3: numsleft is [0,0,1]. numsright is [0]. The score is 2 + 0 = 2.
-- 4: numsleft is [0,0,1,0]. numsright is []. The score is 3 + 0 = 3.
-Indices 2 and 4 both have the highest possible division score 3.
-Note the answer [4,2] would also be accepted.
-
-
Example 2:
-
-
-Input: nums = [0,0,0]
-Output: [3]
-Explanation: Division at index
-- 0: numsleft is []. numsright is [0,0,0]. The score is 0 + 0 = 0.
-- 1: numsleft is [0]. numsright is [0,0]. The score is 1 + 0 = 1.
-- 2: numsleft is [0,0]. numsright is [0]. The score is 2 + 0 = 2.
-- 3: numsleft is [0,0,0]. numsright is []. The score is 3 + 0 = 3.
-Only index 3 has the highest possible division score 3.
-
-
-
Example 3:
-
-
-Input: nums = [1,1]
-Output: [0]
-Explanation: Division at index
-- 0: numsleft is []. numsright is [1,1]. The score is 0 + 2 = 2.
-- 1: numsleft is [1]. numsright is [1]. The score is 0 + 1 = 1.
-- 2: numsleft is [1,1]. numsright is []. The score is 0 + 0 = 0.
-Only index 0 has the highest possible division score 2.
-
-
-
-
Constraints:
-
-
-
n == nums.length
-
1 <= n <= 105
-
nums[i] is either 0 or 1.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
-
-### Hints
-
-Hint 1
-When you iterate the array, maintain the number of zeros and ones on the left side. Can you quickly calculate the number of ones on the right side?
-
-
-
-Hint 2
-The number of ones on the right side equals the number of ones in the whole array minus the number of ones on the left side.
-
-
-
-Hint 3
-Alternatively, you can quickly calculate it by using a prefix sum array.
-
diff --git a/problems/all-elements-in-two-binary-search-trees/README.md b/problems/all-elements-in-two-binary-search-trees/README.md
deleted file mode 100644
index add402354..000000000
--- a/problems/all-elements-in-two-binary-search-trees/README.md
+++ /dev/null
@@ -1,55 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../find-n-unique-integers-sum-up-to-zero "Find N Unique Integers Sum up to Zero")
-
-[Next >](../jump-game-iii "Jump Game III")
-
-## [1305. All Elements in Two Binary Search Trees (Medium)](https://leetcode.com/problems/all-elements-in-two-binary-search-trees "两棵二叉搜索树中的所有元素")
-
-
Given two binary search trees root1 and root2, return a list containing all the integers from both trees sorted in ascending order.
The number of nodes in each tree is in the range [0, 5000].
-
-105 <= Node.val <= 105
-
-
-### Related Topics
- [[Tree](../../tag/tree/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Binary Search Tree](../../tag/binary-search-tree/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
- [[Binary Tree](../../tag/binary-tree/README.md)]
-
-### Hints
-
-Hint 1
-Traverse the first tree in list1 and the second tree in list2.
-
-
-
-Hint 2
-Merge the two trees in one list and sort it.
-
diff --git a/problems/all-nodes-distance-k-in-binary-tree/README.md b/problems/all-nodes-distance-k-in-binary-tree/README.md
deleted file mode 100644
index c312b5eab..000000000
--- a/problems/all-nodes-distance-k-in-binary-tree/README.md
+++ /dev/null
@@ -1,49 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../shortest-subarray-with-sum-at-least-k "Shortest Subarray with Sum at Least K")
-
-[Next >](../shortest-path-to-get-all-keys "Shortest Path to Get All Keys")
-
-## [863. All Nodes Distance K in Binary Tree (Medium)](https://leetcode.com/problems/all-nodes-distance-k-in-binary-tree "二叉树中所有距离为 K 的结点")
-
-
Given the root of a binary tree, the value of a target node target, and an integer k, return an array of the values of all nodes that have a distance k from the target node.
-
-
You can return the answer in any order.
-
-
-
Example 1:
-
-
-Input: root = [3,5,1,6,2,0,8,null,null,7,4], target = 5, k = 2
-Output: [7,4,1]
-Explanation: The nodes that are a distance 2 from the target node (with value 5) have values 7, 4, and 1.
-
Design a data structure to store the strings' count with the ability to return the strings with minimum and maximum counts.
-
-
Implement the AllOne class:
-
-
-
AllOne() Initializes the object of the data structure.
-
inc(String key) Increments the count of the string key by 1. If key does not exist in the data structure, insert it with count 1.
-
dec(String key) Decrements the count of the string key by 1. If the count of key is 0 after the decrement, remove it from the data structure. It is guaranteed that key exists in the data structure before the decrement.
-
getMaxKey() Returns one of the keys with the maximal count. If no element exists, return an empty string "".
-
getMinKey() Returns one of the keys with the minimum count. If no element exists, return an empty string "".
It is guaranteed that for each call to dec, key is existing in the data structure.
-
At most 5 * 104 calls will be made to inc, dec, getMaxKey, and getMinKey.
-
-
-### Related Topics
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Linked List](../../tag/linked-list/README.md)]
- [[Design](../../tag/design/README.md)]
- [[Doubly-Linked List](../../tag/doubly-linked-list/README.md)]
diff --git a/problems/all-oone-data-structure/all_oone_data_structure.go b/problems/all-oone-data-structure/all_oone_data_structure.go
deleted file mode 100644
index a62225c93..000000000
--- a/problems/all-oone-data-structure/all_oone_data_structure.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem432
diff --git a/problems/all-oone-data-structure/all_oone_data_structure_test.go b/problems/all-oone-data-structure/all_oone_data_structure_test.go
deleted file mode 100644
index a62225c93..000000000
--- a/problems/all-oone-data-structure/all_oone_data_structure_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem432
diff --git a/problems/all-paths-from-source-lead-to-destination/README.md b/problems/all-paths-from-source-lead-to-destination/README.md
deleted file mode 100644
index 6f5e1223b..000000000
--- a/problems/all-paths-from-source-lead-to-destination/README.md
+++ /dev/null
@@ -1,107 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimize-rounding-error-to-meet-target "Minimize Rounding Error to Meet Target")
-
-[Next >](../missing-element-in-sorted-array "Missing Element in Sorted Array")
-
-## [1059. All Paths from Source Lead to Destination (Medium)](https://leetcode.com/problems/all-paths-from-source-lead-to-destination "从始点到终点的所有路径")
-
-
Given the edges of a directed graph, and two nodes source and destination of this graph, determine whether or not all paths starting from source eventually end at destination, that is:
-
-
-
At least one path exists from the source node to the destination node
-
If a path exists from the source node to a node with no outgoing edges, then that node is equal to destination.
-
The number of possible paths from source to destination is a finite number.
-
-
-
Return true if and only if all roads from source lead to destination.
-
-
-
-
Example 1:
-
-
-
-
-Input: n = 3, edges = [[0,1],[0,2]], source = 0, destination = 2
-Output: false
-Explanation: It is possible to reach and get stuck on both node 1 and node 2.
-
-
-
Example 2:
-
-
-
-
-Input: n = 4, edges = [[0,1],[0,3],[1,2],[2,1]], source = 0, destination = 3
-Output: false
-Explanation: We have two possibilities: to end at node 3, or to loop over node 1 and node 2 indefinitely.
-
-Input: n = 3, edges = [[0,1],[1,1],[1,2]], source = 0, destination = 2
-Output: false
-Explanation: All paths from the source node end at the destination node, but there are an infinite number of paths, such as 0-1-2, 0-1-1-2, 0-1-1-1-2, 0-1-1-1-1-2, and so on.
-
-
-
Example 5:
-
-
-
-
-Input: n = 2, edges = [[0,1],[1,1]], source = 0, destination = 1
-Output: false
-Explanation: There is infinite self-loop at destination node.
-
-
-
-
-
Note:
-
-
-
The given graph may have self loops and parallel edges.
-
The number of nodes n in the graph is between 1 and 10000
-
The number of edges in the graph is between 0 and 10000
-
0 <= edges.length <= 10000
-
edges[i].length == 2
-
0 <= source <= n - 1
-
0 <= destination <= n - 1
-
-
-### Related Topics
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Graph](../../tag/graph/README.md)]
-
-### Hints
-
-Hint 1
-What if we can reach to a cycle from the source node?
-
-
-
-Hint 2
-Then the answer will be false, because we eventually get trapped in the cycle forever.
-
-
-
-Hint 3
-What if the we can't reach to a cycle from the source node? Then we need to ensure that from all visited nodes from source the unique node with indegree = 0 is the destination node.
-
diff --git a/problems/all-paths-from-source-to-target/README.md b/problems/all-paths-from-source-to-target/README.md
deleted file mode 100644
index 35dbddd71..000000000
--- a/problems/all-paths-from-source-to-target/README.md
+++ /dev/null
@@ -1,74 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../rotate-string "Rotate String")
-
-[Next >](../smallest-rotation-with-highest-score "Smallest Rotation with Highest Score")
-
-## [797. All Paths From Source to Target (Medium)](https://leetcode.com/problems/all-paths-from-source-to-target "所有可能的路径")
-
-
Given a directed acyclic graph (DAG) of n nodes labeled from 0 to n - 1, find all possible paths from node 0 to node n - 1 and return them in any order.
-
-
The graph is given as follows: graph[i] is a list of all nodes you can visit from node i (i.e., there is a directed edge from node i to node graph[i][j]).
-
-
-
Example 1:
-
-
-Input: graph = [[1,2],[3],[3],[]]
-Output: [[0,1,3],[0,2,3]]
-Explanation: There are two paths: 0 -> 1 -> 3 and 0 -> 2 -> 3.
-
graph[i][j] != i (i.e., there will be no self-loops).
-
All the elements of graph[i] are unique.
-
The input graph is guaranteed to be a DAG.
-
-
-### Related Topics
- [[Backtracking](../../tag/backtracking/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Graph](../../tag/graph/README.md)]
-
-### Similar Questions
- 1. [Number of Ways to Arrive at Destination](../number-of-ways-to-arrive-at-destination) (Medium)
diff --git a/problems/all-paths-from-source-to-target/all_paths_from_source_to_target.go b/problems/all-paths-from-source-to-target/all_paths_from_source_to_target.go
deleted file mode 100644
index 74b7b969a..000000000
--- a/problems/all-paths-from-source-to-target/all_paths_from_source_to_target.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem797
diff --git a/problems/all-paths-from-source-to-target/all_paths_from_source_to_target_test.go b/problems/all-paths-from-source-to-target/all_paths_from_source_to_target_test.go
deleted file mode 100644
index 74b7b969a..000000000
--- a/problems/all-paths-from-source-to-target/all_paths_from_source_to_target_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem797
diff --git a/problems/all-people-report-to-the-given-manager/README.md b/problems/all-people-report-to-the-given-manager/README.md
deleted file mode 100644
index e5e7d006b..000000000
--- a/problems/all-people-report-to-the-given-manager/README.md
+++ /dev/null
@@ -1,68 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../number-of-ways-to-stay-in-the-same-place-after-some-steps "Number of Ways to Stay in the Same Place After Some Steps")
-
-[Next >](../hexspeak "Hexspeak")
-
-## [1270. All People Report to the Given Manager (Medium)](https://leetcode.com/problems/all-people-report-to-the-given-manager "向公司CEO汇报工作的所有人")
-
-
Table: Employees
-
-+---------------+---------+
-| Column Name | Type |
-+---------------+---------+
-| employee_id | int |
-| employee_name | varchar |
-| manager_id | int |
-+---------------+---------+
-employee_id is the primary key for this table.
-Each row of this table indicates that the employee with ID employee_id and name employee_name reports his work to his/her direct manager with manager_id
-The head of the company is the employee with employee_id = 1.
-
-
-Write an SQL query to find employee_id of all employees that directly or indirectly report their work to the head of the company.
-
-The indirect relation between managers will not exceed 3 managers as the company is small.
-
-Return result table in any order without duplicates.
-
-The query result format is in the following example:
-
-Employees table:
-+-------------+---------------+------------+
-| employee_id | employee_name | manager_id |
-+-------------+---------------+------------+
-| 1 | Boss | 1 |
-| 3 | Alice | 3 |
-| 2 | Bob | 1 |
-| 4 | Daniel | 2 |
-| 7 | Luis | 4 |
-| 8 | Jhon | 3 |
-| 9 | Angela | 8 |
-| 77 | Robert | 1 |
-+-------------+---------------+------------+
-
-Result table:
-+-------------+
-| employee_id |
-+-------------+
-| 2 |
-| 77 |
-| 4 |
-| 7 |
-+-------------+
-
-The head of the company is the employee with employee_id 1.
-The employees with employee_id 2 and 77 report their work directly to the head of the company.
-The employee with employee_id 4 report his work indirectly to the head of the company 4 --> 2 --> 1.
-The employee with employee_id 7 report his work indirectly to the head of the company 7 --> 4 --> 2 --> 1.
-The employees with employee_id 3, 8 and 9 don't report their work to head of company directly or indirectly.
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/all-people-report-to-the-given-manager/mysql_schemas.sql b/problems/all-people-report-to-the-given-manager/mysql_schemas.sql
deleted file mode 100644
index 25fc46e17..000000000
--- a/problems/all-people-report-to-the-given-manager/mysql_schemas.sql
+++ /dev/null
@@ -1,10 +0,0 @@
-Create table If Not Exists Employees (employee_id int, employee_name varchar(30), manager_id int);
-Truncate table Employees;
-insert into Employees (employee_id, employee_name, manager_id) values ('1', 'Boss', '1');
-insert into Employees (employee_id, employee_name, manager_id) values ('3', 'Alice', '3');
-insert into Employees (employee_id, employee_name, manager_id) values ('2', 'Bob', '1');
-insert into Employees (employee_id, employee_name, manager_id) values ('4', 'Daniel', '2');
-insert into Employees (employee_id, employee_name, manager_id) values ('7', 'Luis', '4');
-insert into Employees (employee_id, employee_name, manager_id) values ('8', 'John', '3');
-insert into Employees (employee_id, employee_name, manager_id) values ('9', 'Angela', '8');
-insert into Employees (employee_id, employee_name, manager_id) values ('77', 'Robert', '1');
diff --git a/problems/all-possible-full-binary-trees/README.md b/problems/all-possible-full-binary-trees/README.md
deleted file mode 100644
index 663028786..000000000
--- a/problems/all-possible-full-binary-trees/README.md
+++ /dev/null
@@ -1,47 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../groups-of-special-equivalent-strings "Groups of Special-Equivalent Strings")
-
-[Next >](../maximum-frequency-stack "Maximum Frequency Stack")
-
-## [894. All Possible Full Binary Trees (Medium)](https://leetcode.com/problems/all-possible-full-binary-trees "所有可能的满二叉树")
-
-
Given an integer n, return a list of all possible full binary trees withnnodes. Each node of each tree in the answer must have Node.val == 0.
-
-
Each element of the answer is the root node of one possible tree. You may return the final list of trees in any order.
-
-
A full binary tree is a binary tree where each node has exactly 0 or 2 children.
-
-
-
Example 1:
-
-
-Input: n = 7
-Output: [[0,0,0,null,null,0,0,null,null,0,0],[0,0,0,null,null,0,0,0,0],[0,0,0,0,0,0,0],[0,0,0,0,0,null,null,null,null,0,0],[0,0,0,0,0,null,null,0,0]]
-
-
-
Example 2:
-
-
-Input: n = 3
-Output: [[0,0,0]]
-
-
-
-
Constraints:
-
-
-
1 <= n <= 20
-
-
-### Related Topics
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Tree](../../tag/tree/README.md)]
- [[Recursion](../../tag/recursion/README.md)]
- [[Memoization](../../tag/memoization/README.md)]
- [[Binary Tree](../../tag/binary-tree/README.md)]
diff --git a/problems/all-possible-full-binary-trees/all_possible_full_binary_trees.go b/problems/all-possible-full-binary-trees/all_possible_full_binary_trees.go
deleted file mode 100644
index 3fc11d1d5..000000000
--- a/problems/all-possible-full-binary-trees/all_possible_full_binary_trees.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem894
diff --git a/problems/all-possible-full-binary-trees/all_possible_full_binary_trees_test.go b/problems/all-possible-full-binary-trees/all_possible_full_binary_trees_test.go
deleted file mode 100644
index 3fc11d1d5..000000000
--- a/problems/all-possible-full-binary-trees/all_possible_full_binary_trees_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem894
diff --git a/problems/all-the-pairs-with-the-maximum-number-of-common-followers/README.md b/problems/all-the-pairs-with-the-maximum-number-of-common-followers/README.md
deleted file mode 100644
index 85484c71c..000000000
--- a/problems/all-the-pairs-with-the-maximum-number-of-common-followers/README.md
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-of-minimum-values-in-all-subarrays "Maximum of Minimum Values in All Subarrays")
-
-[Next >](../three-divisors "Three Divisors")
-
-## [1951. All the Pairs With the Maximum Number of Common Followers (Medium)](https://leetcode.com/problems/all-the-pairs-with-the-maximum-number-of-common-followers "查询具有最多共同关注者的所有两两结对组")
-
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/all-the-pairs-with-the-maximum-number-of-common-followers/mysql_schemas.sql b/problems/all-the-pairs-with-the-maximum-number-of-common-followers/mysql_schemas.sql
deleted file mode 100644
index 358f44061..000000000
--- a/problems/all-the-pairs-with-the-maximum-number-of-common-followers/mysql_schemas.sql
+++ /dev/null
@@ -1,11 +0,0 @@
-Create table If Not Exists Relations (user_id int, follower_id int);
-Truncate table Relations;
-insert into Relations (user_id, follower_id) values ('1', '3');
-insert into Relations (user_id, follower_id) values ('2', '3');
-insert into Relations (user_id, follower_id) values ('7', '3');
-insert into Relations (user_id, follower_id) values ('1', '4');
-insert into Relations (user_id, follower_id) values ('2', '4');
-insert into Relations (user_id, follower_id) values ('7', '4');
-insert into Relations (user_id, follower_id) values ('1', '5');
-insert into Relations (user_id, follower_id) values ('2', '6');
-insert into Relations (user_id, follower_id) values ('7', '5');
diff --git a/problems/all-valid-triplets-that-can-represent-a-country/README.md b/problems/all-valid-triplets-that-can-represent-a-country/README.md
deleted file mode 100644
index 30cf0bbaa..000000000
--- a/problems/all-valid-triplets-that-can-represent-a-country/README.md
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../fancy-sequence "Fancy Sequence")
-
-[Next >](../largest-substring-between-two-equal-characters "Largest Substring Between Two Equal Characters")
-
-## [1623. All Valid Triplets That Can Represent a Country (Easy)](https://leetcode.com/problems/all-valid-triplets-that-can-represent-a-country "三人国家代表队")
-
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/all-valid-triplets-that-can-represent-a-country/mysql_schemas.sql b/problems/all-valid-triplets-that-can-represent-a-country/mysql_schemas.sql
deleted file mode 100644
index 9f28968ca..000000000
--- a/problems/all-valid-triplets-that-can-represent-a-country/mysql_schemas.sql
+++ /dev/null
@@ -1,12 +0,0 @@
-Create table If Not Exists SchoolA (student_id int, student_name varchar(20));
-Create table If Not Exists SchoolB (student_id int, student_name varchar(20));
-Create table If Not Exists SchoolC (student_id int, student_name varchar(20));
-Truncate table SchoolA;
-insert into SchoolA (student_id, student_name) values ('1', 'Alice');
-insert into SchoolA (student_id, student_name) values ('2', 'Bob');
-Truncate table SchoolB;
-insert into SchoolB (student_id, student_name) values ('3', 'Tom');
-Truncate table SchoolC;
-insert into SchoolC (student_id, student_name) values ('3', 'Tom');
-insert into SchoolC (student_id, student_name) values ('2', 'Jerry');
-insert into SchoolC (student_id, student_name) values ('10', 'Alice');
diff --git a/problems/allocate-mailboxes/README.md b/problems/allocate-mailboxes/README.md
deleted file mode 100644
index b0bd29e7e..000000000
--- a/problems/allocate-mailboxes/README.md
+++ /dev/null
@@ -1,63 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../find-two-non-overlapping-sub-arrays-each-with-target-sum "Find Two Non-overlapping Sub-arrays Each With Target Sum")
-
-[Next >](../sales-by-day-of-the-week "Sales by Day of the Week")
-
-## [1478. Allocate Mailboxes (Hard)](https://leetcode.com/problems/allocate-mailboxes "安排邮筒")
-
-
Given the array houses where houses[i] is the location of the ith house along a street and an integer k, allocate k mailboxes in the street.
-
-
Return the minimum total distance between each house and its nearest mailbox.
-
-
The test cases are generated so that the answer fits in a 32-bit integer.
-
-
-
Example 1:
-
-
-Input: houses = [1,4,8,10,20], k = 3
-Output: 5
-Explanation: Allocate mailboxes in position 3, 9 and 20.
-Minimum total distance from each houses to nearest mailboxes is |3-1| + |4-3| + |9-8| + |10-9| + |20-20| = 5
-
-
-
Example 2:
-
-
-Input: houses = [2,3,5,12,18], k = 2
-Output: 9
-Explanation: Allocate mailboxes in position 3 and 14.
-Minimum total distance from each houses to nearest mailboxes is |2-3| + |3-3| + |5-3| + |12-14| + |18-14| = 9.
-
-
-
-
Constraints:
-
-
-
1 <= k <= houses.length <= 100
-
1 <= houses[i] <= 104
-
All the integers of houses are unique.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Math](../../tag/math/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Hints
-
-Hint 1
-If k =1, the minimum distance is obtained allocating the mailbox in the median of the array houses.
-
-
-
-Hint 2
-Generalize this idea, using dynamic programming allocating k mailboxes.
-
diff --git a/problems/alphabet-board-path/README.md b/problems/alphabet-board-path/README.md
deleted file mode 100644
index 6a4c93f65..000000000
--- a/problems/alphabet-board-path/README.md
+++ /dev/null
@@ -1,63 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../n-th-tribonacci-number "N-th Tribonacci Number")
-
-[Next >](../largest-1-bordered-square "Largest 1-Bordered Square")
-
-## [1138. Alphabet Board Path (Medium)](https://leetcode.com/problems/alphabet-board-path "字母板上的路径")
-
-
On an alphabet board, we start at position (0, 0), corresponding to character board[0][0].
-
-
Here, board = ["abcde", "fghij", "klmno", "pqrst", "uvwxy", "z"], as shown in the diagram below.
-
-
-
-
We may make the following moves:
-
-
-
'U' moves our position up one row, if the position exists on the board;
-
'D' moves our position down one row, if the position exists on the board;
-
'L' moves our position left one column, if the position exists on the board;
-
'R' moves our position right one column, if the position exists on the board;
-
'!' adds the character board[r][c] at our current position (r, c) to the answer.
-
-
-
(Here, the only positions that exist on the board are positions with letters on them.)
-
-
Return a sequence of moves that makes our answer equal to target in the minimum number of moves. You may return any path that does so.
target consists only of English lowercase letters.
-
-
-### Related Topics
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../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/alphabet-board-path/alphabet_board_path.go b/problems/alphabet-board-path/alphabet_board_path.go
deleted file mode 100644
index 53e45d526..000000000
--- a/problems/alphabet-board-path/alphabet_board_path.go
+++ /dev/null
@@ -1,42 +0,0 @@
-package problem1138
-
-import "strings"
-
-func alphabetBoardPath(target string) string {
- var sb strings.Builder
- // form [x1,y1] move to [x2,y2]
- move := func(x1, y1, x2, y2 int) {
- for y1 > y2 {
- y1--
- sb.WriteByte('L')
- }
- for x1 > x2 {
- x1--
- sb.WriteByte('U')
- }
- for x1 < x2 {
- x1++
- sb.WriteByte('D')
- }
- for y1 < y2 {
- y1++
- sb.WriteByte('R')
- }
- return
- }
-
- x1, y1 := 0, 0
- for _, r := range target {
- x2, y2 := coordinate(r)
- move(x1, y1, x2, y2)
- sb.WriteByte('!')
- x1, y1 = x2, y2
- }
- return sb.String()
-}
-
-func coordinate(r rune) (x, y int) {
- a := int(r - 'a')
- x, y = a/5, a%5
- return
-}
diff --git a/problems/ambiguous-coordinates/README.md b/problems/ambiguous-coordinates/README.md
deleted file mode 100644
index 9b197c55a..000000000
--- a/problems/ambiguous-coordinates/README.md
+++ /dev/null
@@ -1,68 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../bus-routes "Bus Routes")
-
-[Next >](../linked-list-components "Linked List Components")
-
-## [816. Ambiguous Coordinates (Medium)](https://leetcode.com/problems/ambiguous-coordinates "模糊坐标")
-
-
We had some 2-dimensional coordinates, like "(1, 3)" or "(2, 0.5)". Then, we removed all commas, decimal points, and spaces and ended up with the string s.
-
-
-
For example, "(1, 3)" becomes s = "(13)" and "(2, 0.5)" becomes s = "(205)".
-
-
-
Return a list of strings representing all possibilities for what our original coordinates could have been.
-
-
Our original representation never had extraneous zeroes, so we never started with numbers like "00", "0.0", "0.00", "1.0", "001", "00.01", or any other number that can be represented with fewer digits. Also, a decimal point within a number never occurs without at least one digit occurring before it, so we never started with numbers like ".1".
-
-
The final answer list can be returned in any order. All coordinates in the final answer have exactly one space between them (occurring after the comma.)
-Input: s = "(0123)"
-Output: ["(0, 1.23)","(0, 12.3)","(0, 123)","(0.1, 2.3)","(0.1, 23)","(0.12, 3)"]
-Explanation: 0.0, 00, 0001 or 00.01 are not allowed.
-
-
-
Example 3:
-
-
-Input: s = "(00011)"
-Output: ["(0, 0.011)","(0.001, 1)"]
-
-
-
Example 4:
-
-
-Input: s = "(100)"
-Output: ["(10, 0)"]
-Explanation: 1.0 is not allowed.
-
-
-
-
Constraints:
-
-
-
4 <= s.length <= 12
-
s[0] == '(' and s[s.length - 1] == ')'.
-
The rest of s are digits.
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
- [[Backtracking](../../tag/backtracking/README.md)]
diff --git a/problems/ambiguous-coordinates/ambiguous_coordinates.go b/problems/ambiguous-coordinates/ambiguous_coordinates.go
deleted file mode 100644
index 2ba471c29..000000000
--- a/problems/ambiguous-coordinates/ambiguous_coordinates.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem816
diff --git a/problems/ambiguous-coordinates/ambiguous_coordinates_test.go b/problems/ambiguous-coordinates/ambiguous_coordinates_test.go
deleted file mode 100644
index 2ba471c29..000000000
--- a/problems/ambiguous-coordinates/ambiguous_coordinates_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem816
diff --git a/problems/amount-of-new-area-painted-each-day/README.md b/problems/amount-of-new-area-painted-each-day/README.md
deleted file mode 100644
index 7af517b36..000000000
--- a/problems/amount-of-new-area-painted-each-day/README.md
+++ /dev/null
@@ -1,40 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../groups-of-strings "Groups of Strings")
-
-[Next >](../order-two-columns-independently "Order Two Columns Independently")
-
-## [2158. Amount of New Area Painted Each Day (Hard)](https://leetcode.com/problems/amount-of-new-area-painted-each-day "")
-
-
-
-### Related Topics
- [[Segment Tree](../../tag/segment-tree/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Ordered Set](../../tag/ordered-set/README.md)]
-
-### Hints
-
-Hint 1
-What’s a good way to keep track of intervals that you have already painted?
-
-
-
-Hint 2
-Create an array of all 1’s, and when you have painted an interval, set the values in that interval to 0.
-
-
-
-Hint 3
-Using this array, how can you quickly calculate the amount of new area that you paint on a given day?
-
-
-
-Hint 4
-Calculate the sum of the new array in the interval that you paint.
-
diff --git a/problems/analyze-user-website-visit-pattern/README.md b/problems/analyze-user-website-visit-pattern/README.md
deleted file mode 100644
index e6a48d34d..000000000
--- a/problems/analyze-user-website-visit-pattern/README.md
+++ /dev/null
@@ -1,84 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-swaps-to-group-all-1s-together "Minimum Swaps to Group All 1's Together")
-
-[Next >](../string-transforms-into-another-string "String Transforms Into Another String")
-
-## [1152. Analyze User Website Visit Pattern (Medium)](https://leetcode.com/problems/analyze-user-website-visit-pattern "用户网站访问行为分析")
-
-
We are given some website visits: the user with name username[i] visited the website website[i] at time timestamp[i].
-
-
A 3-sequence is a list of websites of length 3 sorted in ascending order by the time of their visits. (The websites in a 3-sequence are not necessarily distinct.)
-
-
Find the 3-sequence visited by the largest number of users. If there is more than one solution, return the lexicographically smallest such 3-sequence.
-
-
-
-
Example 1:
-
-
-Input: username = ["joe","joe","joe","james","james","james","james","mary","mary","mary"], timestamp = [1,2,3,4,5,6,7,8,9,10], website = ["home","about","career","home","cart","maps","home","home","about","career"]
-Output: ["home","about","career"]
-Explanation:
-The tuples in this example are:
-["joe", 1, "home"]
-["joe", 2, "about"]
-["joe", 3, "career"]
-["james", 4, "home"]
-["james", 5, "cart"]
-["james", 6, "maps"]
-["james", 7, "home"]
-["mary", 8, "home"]
-["mary", 9, "about"]
-["mary", 10, "career"]
-The 3-sequence ("home", "about", "career") was visited at least once by 2 users.
-The 3-sequence ("home", "cart", "maps") was visited at least once by 1 user.
-The 3-sequence ("home", "cart", "home") was visited at least once by 1 user.
-The 3-sequence ("home", "maps", "home") was visited at least once by 1 user.
-The 3-sequence ("cart", "maps", "home") was visited at least once by 1 user.
-
Both username[i] and website[i] contain only lowercase characters.
-
It is guaranteed that there is at least one user who visited at least 3 websites.
-
No user visits two websites at the same time.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Hints
-
-Hint 1
-Let's find for every user separately the websites he visited.
-
-
-
-Hint 2
-Consider all possible 3-sequences, find the number of distinct users who visited each of them.
-
-
-
-Hint 3
-How to check if some user visited some 3-sequence ?
-
-
-
-Hint 4
-Store for every user all the 3-sequence he visited.
-
diff --git a/problems/android-unlock-patterns/README.md b/problems/android-unlock-patterns/README.md
deleted file mode 100644
index 681daf4dc..000000000
--- a/problems/android-unlock-patterns/README.md
+++ /dev/null
@@ -1,65 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../intersection-of-two-arrays-ii "Intersection of Two Arrays II")
-
-[Next >](../data-stream-as-disjoint-intervals "Data Stream as Disjoint Intervals")
-
-## [351. Android Unlock Patterns (Medium)](https://leetcode.com/problems/android-unlock-patterns "安卓系统手势解锁")
-
-
Given an Android 3x3 key lock screen and two integers m and n, where 1 ≤ m ≤ n ≤ 9, count the total number of unlock patterns of the Android lock screen, which consist of minimum of m keys and maximum n keys.
-
-
-
-
Rules for a valid pattern:
-
-
-
Each pattern must connect at least m keys and at most n keys.
-
All the keys must be distinct.
-
If the line connecting two consecutive keys in the pattern passes through any other keys, the other keys must have previously selected in the pattern. No jumps through non selected key is allowed.
-
The order of keys used matters.
-
-
-
-
-
-
-
-
-
-
Explanation:
-
-
-| 1 | 2 | 3 |
-| 4 | 5 | 6 |
-| 7 | 8 | 9 |
-
-
Invalid move:4 - 1 - 3 - 6
-Line 1 - 3 passes through key 2 which had not been selected in the pattern.
-
-
Invalid move:4 - 1 - 9 - 2
-Line 1 - 9 passes through key 5 which had not been selected in the pattern.
-
-
Valid move:2 - 4 - 1 - 3 - 6
-Line 1 - 3 is valid because it passes through key 2, which had been selected in the pattern
-
-
Valid move:6 - 5 - 4 - 1 - 9 - 2
-Line 1 - 9 is valid because it passes through key 5, which had been selected in the pattern.
-
-
-
-
Example:
-
-
-
-Input: m = 1, n = 1
-Output: 9
-
-
-### Related Topics
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Backtracking](../../tag/backtracking/README.md)]
diff --git a/problems/android-unlock-patterns/android_unlock_patterns.go b/problems/android-unlock-patterns/android_unlock_patterns.go
deleted file mode 100644
index 80010d0fd..000000000
--- a/problems/android-unlock-patterns/android_unlock_patterns.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem351
diff --git a/problems/android-unlock-patterns/android_unlock_patterns_test.go b/problems/android-unlock-patterns/android_unlock_patterns_test.go
deleted file mode 100644
index 80010d0fd..000000000
--- a/problems/android-unlock-patterns/android_unlock_patterns_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem351
diff --git a/problems/angle-between-hands-of-a-clock/README.md b/problems/angle-between-hands-of-a-clock/README.md
deleted file mode 100644
index a3bacec65..000000000
--- a/problems/angle-between-hands-of-a-clock/README.md
+++ /dev/null
@@ -1,79 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../number-of-sub-arrays-of-size-k-and-average-greater-than-or-equal-to-threshold "Number of Sub-arrays of Size K and Average Greater than or Equal to Threshold")
-
-[Next >](../jump-game-iv "Jump Game IV")
-
-## [1344. Angle Between Hands of a Clock (Medium)](https://leetcode.com/problems/angle-between-hands-of-a-clock "时钟指针的夹角")
-
-
Given two numbers, hour and minutes. Return the smaller angle (in degrees) formed between the hour and the minute hand.
-
-
-
Example 1:
-
-
-
-
-Input: hour = 12, minutes = 30
-Output: 165
-
-
-
Example 2:
-
-
-
-
-Input: hour = 3, minutes = 30
-Output: 75
-
-
-
Example 3:
-
-
-
-
-Input: hour = 3, minutes = 15
-Output: 7.5
-
-
-
Example 4:
-
-
-Input: hour = 4, minutes = 50
-Output: 155
-
-
-
Example 5:
-
-
-Input: hour = 12, minutes = 0
-Output: 0
-
-
-
-
Constraints:
-
-
-
1 <= hour <= 12
-
0 <= minutes <= 59
-
Answers within 10^-5 of the actual value will be accepted as correct.
-
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
-
-### Hints
-
-Hint 1
-The tricky part is determining how the minute hand affects the position of the hour hand.
-
-
-
-Hint 2
-Calculate the angles separately then find the difference.
-
diff --git a/problems/apples-oranges/README.md b/problems/apples-oranges/README.md
deleted file mode 100644
index 61bfaa61e..000000000
--- a/problems/apples-oranges/README.md
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../number-of-ways-of-cutting-a-pizza "Number of Ways of Cutting a Pizza")
-
-[Next >](../consecutive-characters "Consecutive Characters")
-
-## [1445. Apples & Oranges (Medium)](https://leetcode.com/problems/apples-oranges "苹果和桔子")
-
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/apples-oranges/mysql_schemas.sql b/problems/apples-oranges/mysql_schemas.sql
deleted file mode 100644
index 426703feb..000000000
--- a/problems/apples-oranges/mysql_schemas.sql
+++ /dev/null
@@ -1,10 +0,0 @@
-Create table If Not Exists Sales (sale_date date, fruit ENUM('apples', 'oranges'), sold_num int);
-Truncate table Sales;
-insert into Sales (sale_date, fruit, sold_num) values ('2020-05-01', 'apples', '10');
-insert into Sales (sale_date, fruit, sold_num) values ('2020-05-01', 'oranges', '8');
-insert into Sales (sale_date, fruit, sold_num) values ('2020-05-02', 'apples', '15');
-insert into Sales (sale_date, fruit, sold_num) values ('2020-05-02', 'oranges', '15');
-insert into Sales (sale_date, fruit, sold_num) values ('2020-05-03', 'apples', '20');
-insert into Sales (sale_date, fruit, sold_num) values ('2020-05-03', 'oranges', '0');
-insert into Sales (sale_date, fruit, sold_num) values ('2020-05-04', 'apples', '15');
-insert into Sales (sale_date, fruit, sold_num) values ('2020-05-04', 'oranges', '16');
diff --git a/problems/apply-discount-every-n-orders/README.md b/problems/apply-discount-every-n-orders/README.md
deleted file mode 100644
index d43de40f0..000000000
--- a/problems/apply-discount-every-n-orders/README.md
+++ /dev/null
@@ -1,87 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../sort-integers-by-the-number-of-1-bits "Sort Integers by The Number of 1 Bits")
-
-[Next >](../number-of-substrings-containing-all-three-characters "Number of Substrings Containing All Three Characters")
-
-## [1357. Apply Discount Every n Orders (Medium)](https://leetcode.com/problems/apply-discount-every-n-orders "每隔 n 个顾客打折")
-
-
There is a supermarket that is frequented by many customers. The products sold at the supermarket are represented as two parallel integer arrays products and prices, where the ith product has an ID of products[i] and a price of prices[i].
-
-
When a customer is paying, their bill is represented as two parallel integer arrays product and amount, where the jth product they purchased has an ID of product[j], and amount[j] is how much of the product they bought. Their subtotal is calculated as the sum of each amount[j] * (price of the jth product).
-
-
The supermarket decided to have a sale. Every nth customer paying for their groceries will be given a percentage discount. The discount amount is given by discount, where they will be given discount percent off their subtotal. More formally, if their subtotal is bill, then they would actually pay bill * ((100 - discount) / 100).
-
-
Implement the Cashier class:
-
-
-
Cashier(int n, int discount, int[] products, int[] prices) Initializes the object with n, the discount, and the products and their prices.
-
double getBill(int[] product, int[] amount) Returns the final total of the bill with the discount applied (if any). Answers within 10-5 of the actual value will be accepted.
-
-
-
-
Example 1:
-
-
-Input
-["Cashier","getBill","getBill","getBill","getBill","getBill","getBill","getBill"]
-[[3,50,[1,2,3,4,5,6,7],[100,200,300,400,300,200,100]],[[1,2],[1,2]],[[3,7],[10,10]],[[1,2,3,4,5,6,7],[1,1,1,1,1,1,1]],[[4],[10]],[[7,3],[10,10]],[[7,5,3,1,6,4,2],[10,10,10,9,9,9,7]],[[2,3,5],[5,3,2]]]
-Output
-[null,500.0,4000.0,800.0,4000.0,4000.0,7350.0,2500.0]
-Explanation
-Cashier cashier = new Cashier(3,50,[1,2,3,4,5,6,7],[100,200,300,400,300,200,100]);
-cashier.getBill([1,2],[1,2]); // return 500.0. 1st customer, no discount.
- // bill = 1 * 100 + 2 * 200 = 500.
-cashier.getBill([3,7],[10,10]); // return 4000.0. 2nd customer, no discount.
- // bill = 10 * 300 + 10 * 100 = 4000.
-cashier.getBill([1,2,3,4,5,6,7],[1,1,1,1,1,1,1]); // return 800.0. 3rd customer, 50% discount.
- // Original bill = 1600
- // Actual bill = 1600 * ((100 - 50) / 100) = 800.
-cashier.getBill([4],[10]); // return 4000.0. 4th customer, no discount.
-cashier.getBill([7,3],[10,10]); // return 4000.0. 5th customer, no discount.
-cashier.getBill([7,5,3,1,6,4,2],[10,10,10,9,9,9,7]); // return 7350.0. 6th customer, 50% discount.
- // Original bill = 14700, but with
- // Actual bill = 14700 * ((100 - 50) / 100) = 7350.
-cashier.getBill([2,3,5],[5,3,2]); // return 2500.0. 6th customer, no discount.
-
-
-
-
Constraints:
-
-
-
1 <= n <= 104
-
0 <= discount <= 100
-
1 <= products.length <= 200
-
prices.length == products.length
-
1 <= products[i] <= 200
-
1 <= prices[i] <= 1000
-
The elements in products are unique.
-
1 <= product.length <= products.length
-
amount.length == product.length
-
product[j] exists in products.
-
1 <= amount[j] <= 1000
-
The elements of product are unique.
-
At most 1000 calls will be made to getBill.
-
Answers within 10-5 of the actual value will be accepted.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Design](../../tag/design/README.md)]
-
-### Hints
-
-Hint 1
-Keep track of the count of the customers.
-
-
-
-Hint 2
-Check if the count of the customers is divisible by n then apply the discount formula.
-
diff --git a/problems/arithmetic-slices-ii-subsequence/README.md b/problems/arithmetic-slices-ii-subsequence/README.md
deleted file mode 100644
index 8481d5223..000000000
--- a/problems/arithmetic-slices-ii-subsequence/README.md
+++ /dev/null
@@ -1,68 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../add-two-numbers-ii "Add Two Numbers II")
-
-[Next >](../number-of-boomerangs "Number of Boomerangs")
-
-## [446. Arithmetic Slices II - Subsequence (Hard)](https://leetcode.com/problems/arithmetic-slices-ii-subsequence "等差数列划分 II - 子序列")
-
-
Given an integer array nums, return the number of all the arithmetic subsequences ofnums.
-
-
A sequence of numbers is called arithmetic if it consists of at least three elements and if the difference between any two consecutive elements is the same.
-
-
-
For example, [1, 3, 5, 7, 9], [7, 7, 7, 7], and [3, -1, -5, -9] are arithmetic sequences.
-
For example, [1, 1, 2, 5, 7] is not an arithmetic sequence.
-
-
-
A subsequence of an array is a sequence that can be formed by removing some elements (possibly none) of the array.
-
-
-
For example, [2,5,10] is a subsequence of [1,2,1,2,4,1,5,10].
-
-
-
The test cases are generated so that the answer fits in 32-bit integer.
An integer array is called arithmetic if it consists of at least three elements and if the difference between any two consecutive elements is the same.
-
-
-
For example, [1,3,5,7,9], [7,7,7,7], and [3,-1,-5,-9] are arithmetic sequences.
-
-
-
Given an integer array nums, return the number of arithmetic subarrays ofnums.
-
-
A subarray is a contiguous subsequence of the array.
-
-
-
Example 1:
-
-
-Input: nums = [1,2,3,4]
-Output: 3
-Explanation: We have 3 arithmetic slices in nums: [1, 2, 3], [2, 3, 4] and [1,2,3,4] itself.
-
A sequence of numbers is called arithmetic if it consists of at least two elements, and the difference between every two consecutive elements is the same. More formally, a sequence s is arithmetic if and only if s[i+1] - s[i] == s[1] - s[0] for all valid i.
-
-
For example, these are arithmetic sequences:
-
-
-1, 3, 5, 7, 9
-7, 7, 7, 7
-3, -1, -5, -9
-
-
The following sequence is not arithmetic:
-
-
-1, 1, 2, 5, 7
-
-
You are given an array of n integers, nums, and two arrays of m integers each, l and r, representing the m range queries, where the ith query is the range [l[i], r[i]]. All the arrays are 0-indexed.
-
-
Return a list of booleanelementsanswer, whereanswer[i]istrueif the subarraynums[l[i]], nums[l[i]+1], ... , nums[r[i]] can be rearranged to form an arithmetic sequence, andfalseotherwise.
-
-
-
Example 1:
-
-
-Input: nums = [4,6,5,9,3,7], l = [0,0,2], r = [2,3,5]
-Output:[true,false,true]
-Explanation:
-In the 0th query, the subarray is [4,6,5]. This can be rearranged as [6,5,4], which is an arithmetic sequence.
-In the 1st query, the subarray is [4,6,5,9]. This cannot be rearranged as an arithmetic sequence.
-In the 2nd query, the subarray is [5,9,3,7]. This can be rearranged as [3,5,7,9], which is an arithmetic sequence.
-
-
Example 2:
-
-
-Input: nums = [-12,-9,-3,-12,-6,15,20,-25,-20,-15,-10], l = [0,1,6,4,8,7], r = [4,4,9,7,9,10]
-Output: [false,true,false,false,true,true]
-
-
-
-
Constraints:
-
-
-
n == nums.length
-
m == l.length
-
m == r.length
-
2 <= n <= 500
-
1 <= m <= 500
-
0 <= l[i] < r[i] < n
-
-105 <= nums[i] <= 105
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Hints
-
-Hint 1
-To check if a given sequence is arithmetic, just check that the difference between every two consecutive elements is the same.
-
-
-
-Hint 2
-If and only if a set of numbers can make an arithmetic sequence, then its sorted version makes an arithmetic sequence. So to check a set of numbers, sort it, and check if that sequence is arithmetic.
-
-
-
-Hint 3
-For each query, get the corresponding set of numbers which will be the sub-array represented by the query, sort it, and check if the result sequence is arithmetic.
-
diff --git a/problems/armstrong-number/README.md b/problems/armstrong-number/README.md
deleted file mode 100644
index 6393d60cd..000000000
--- a/problems/armstrong-number/README.md
+++ /dev/null
@@ -1,63 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../largest-unique-number "Largest Unique Number")
-
-[Next >](../connecting-cities-with-minimum-cost "Connecting Cities With Minimum Cost")
-
-## [1134. Armstrong Number (Easy)](https://leetcode.com/problems/armstrong-number "阿姆斯特朗数")
-
-
The k-digit number N is an Armstrong number if and only if the k-th power of each digit sums to N.
-
-
Given a positive integer N, return true if and only if it is an Armstrong number.
-
-
-
-
Example 1:
-
-
-Input: 153
-Output: true
-Explanation:
-153 is a 3-digit number, and 153 = 1^3 + 5^3 + 3^3.
-
-
-
Example 2:
-
-
-Input: 123
-Output: false
-Explanation:
-123 is a 3-digit number, and 123 != 1^3 + 2^3 + 3^3 = 36.
-
-
-
-
-
Note:
-
-
-
1 <= N <= 10^8
-
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
-
-### Hints
-
-Hint 1
-Check if the given k-digit number equals the sum of the k-th power of it's digits.
-
-
-
-Hint 2
-How to compute the sum of the k-th power of the digits of a number ? Can you divide the number into digits using division and modulus operations ?
-
-
-
-Hint 3
-You can find the least significant digit of a number by taking it modulus 10. And you can remove it by dividing the number by 10 (integer division). Once you have a digit, you can raise it to the power of k and add it to the sum.
-
diff --git a/problems/arranging-coins/README.md b/problems/arranging-coins/README.md
deleted file mode 100644
index 57ce5aa46..000000000
--- a/problems/arranging-coins/README.md
+++ /dev/null
@@ -1,44 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../k-th-smallest-in-lexicographical-order "K-th Smallest in Lexicographical Order")
-
-[Next >](../find-all-duplicates-in-an-array "Find All Duplicates in an Array")
-
-## [441. Arranging Coins (Easy)](https://leetcode.com/problems/arranging-coins "排列硬币")
-
-
You have n coins and you want to build a staircase with these coins. The staircase consists of k rows where the ith row has exactly i coins. The last row of the staircase may be incomplete.
-
-
Given the integer n, return the number of complete rows of the staircase you will build.
-
-
-
Example 1:
-
-
-Input: n = 5
-Output: 2
-Explanation: Because the 3rd row is incomplete, we return 2.
-
-
-
Example 2:
-
-
-Input: n = 8
-Output: 3
-Explanation: Because the 4th row is incomplete, we return 3.
-
-
-### Related Topics
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Array](../../tag/array/README.md)]
-
-### Similar Questions
- 1. [Nested List Weight Sum](../nested-list-weight-sum) (Medium)
- 1. [Flatten Nested List Iterator](../flatten-nested-list-iterator) (Medium)
- 1. [Nested List Weight Sum II](../nested-list-weight-sum-ii) (Medium)
diff --git a/problems/array-nesting/array_nesting.go b/problems/array-nesting/array_nesting.go
deleted file mode 100644
index c0dff58f4..000000000
--- a/problems/array-nesting/array_nesting.go
+++ /dev/null
@@ -1,16 +0,0 @@
-package problem565
-
-func arrayNesting(nums []int) int {
- ans := 0
- for i := range nums {
- c := 1
- for nums[i] != i {
- nums[i], nums[nums[i]] = nums[nums[i]], nums[i]
- c++
- }
- if ans < c {
- ans = c
- }
- }
- return ans
-}
diff --git a/problems/array-nesting/array_nesting_test.go b/problems/array-nesting/array_nesting_test.go
deleted file mode 100644
index d9d3f068c..000000000
--- a/problems/array-nesting/array_nesting_test.go
+++ /dev/null
@@ -1,37 +0,0 @@
-package problem565
-
-import (
- "testing"
-)
-
-type testType struct {
- in []int
- want int
-}
-
-func TestArrayNesting(t *testing.T) {
- tests := [...]testType{
- {
- in: []int{5, 4, 0, 3, 1, 6, 2},
- want: 4,
- },
- {
- in: []int{0, 3, 1, 5, 4, 6, 2},
- want: 5,
- },
- {
- in: []int{6, 2, 5, 4, 0, 3, 1},
- want: 7,
- },
- {
- in: []int{3, 1, 5, 4, 0, 6, 2},
- want: 3,
- },
- }
- for _, tt := range tests {
- got := arrayNesting(tt.in)
- if got != tt.want {
- t.Fatalf("in: %v, got: %v, want: %v", tt.in, got, tt.want)
- }
- }
-}
diff --git a/problems/array-of-doubled-pairs/README.md b/problems/array-of-doubled-pairs/README.md
deleted file mode 100644
index 7308b457d..000000000
--- a/problems/array-of-doubled-pairs/README.md
+++ /dev/null
@@ -1,62 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../verifying-an-alien-dictionary "Verifying an Alien Dictionary")
-
-[Next >](../delete-columns-to-make-sorted-ii "Delete Columns to Make Sorted II")
-
-## [954. Array of Doubled Pairs (Medium)](https://leetcode.com/problems/array-of-doubled-pairs "二倍数对数组")
-
-
Given an integer array of even length arr, return true if it is possible to reorder arr such that arr[2 * i + 1] = 2 * arr[2 * i] for every 0 <= i < len(arr) / 2, or false otherwise.
-
-
-
Example 1:
-
-
-Input: arr = [3,1,3,6]
-Output: false
-
-
-
Example 2:
-
-
-Input: arr = [2,1,2,6]
-Output: false
-
-
-
Example 3:
-
-
-Input: arr = [4,-2,2,-4]
-Output: true
-Explanation: We can take two groups, [-2,-4] and [2,4] to form [-2,-4,2,4] or [2,4,-2,-4].
-
-
-
Example 4:
-
-
-Input: arr = [1,2,4,16,8,4]
-Output: false
-
-
-
-
Constraints:
-
-
-
2 <= arr.length <= 3 * 104
-
arr.length is even.
-
-105 <= arr[i] <= 105
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Greedy](../../tag/greedy/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Similar Questions
- 1. [Find Original Array From Doubled Array](../find-original-array-from-doubled-array) (Medium)
diff --git a/problems/array-of-doubled-pairs/array_of_doubled_pairs.go b/problems/array-of-doubled-pairs/array_of_doubled_pairs.go
deleted file mode 100644
index 1ee16fc96..000000000
--- a/problems/array-of-doubled-pairs/array_of_doubled_pairs.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem954
diff --git a/problems/array-of-doubled-pairs/array_of_doubled_pairs_test.go b/problems/array-of-doubled-pairs/array_of_doubled_pairs_test.go
deleted file mode 100644
index 1ee16fc96..000000000
--- a/problems/array-of-doubled-pairs/array_of_doubled_pairs_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem954
diff --git a/problems/array-partition-i/README.md b/problems/array-partition-i/README.md
deleted file mode 100644
index bf1e259b2..000000000
--- a/problems/array-partition-i/README.md
+++ /dev/null
@@ -1,70 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../subarray-sum-equals-k "Subarray Sum Equals K")
-
-[Next >](../longest-line-of-consecutive-one-in-matrix "Longest Line of Consecutive One in Matrix")
-
-## [561. Array Partition I (Easy)](https://leetcode.com/problems/array-partition-i "数组拆分 I")
-
-
Given an integer array nums of 2n integers, group these integers into n pairs (a1, b1), (a2, b2), ..., (an, bn) such that the sum of min(ai, bi) for all i is maximized. Return the maximized sum.
-
-
-
Example 1:
-
-
-Input: nums = [1,4,3,2]
-Output: 4
-Explanation: All possible pairings (ignoring the ordering of elements) are:
-1. (1, 4), (2, 3) -> min(1, 4) + min(2, 3) = 1 + 2 = 3
-2. (1, 3), (2, 4) -> min(1, 3) + min(2, 4) = 1 + 2 = 3
-3. (1, 2), (3, 4) -> min(1, 2) + min(3, 4) = 1 + 3 = 4
-So the maximum possible sum is 4.
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Counting Sort](../../tag/counting-sort/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Hints
-
-Hint 1
-Obviously, brute force won't help here. Think of something else, take some example like 1,2,3,4.
-
-
-
-Hint 2
-How will you make pairs to get the result? There must be some pattern.
-
-
-
-Hint 3
-Did you observe that- Minimum element gets add into the result in sacrifice of maximum element.
-
-
-
-Hint 4
-Still won't able to find pairs? Sort the array and try to find the pattern.
-
diff --git a/problems/array-partition-i/array_partition_i.go b/problems/array-partition-i/array_partition_i.go
deleted file mode 100644
index 4deaaf2d8..000000000
--- a/problems/array-partition-i/array_partition_i.go
+++ /dev/null
@@ -1,14 +0,0 @@
-package problem561
-
-import "sort"
-
-func arrayPairSum(nums []int) int {
- sum := 0
- sort.Ints(nums)
- for i, v := range nums {
- if i&1 == 0 {
- sum += v
- }
- }
- return sum
-}
diff --git a/problems/array-partition-i/array_partition_i_test.go b/problems/array-partition-i/array_partition_i_test.go
deleted file mode 100644
index 58d398f4b..000000000
--- a/problems/array-partition-i/array_partition_i_test.go
+++ /dev/null
@@ -1,23 +0,0 @@
-package problem561
-
-import "testing"
-
-type testType struct {
- in []int
- want int
-}
-
-func TestArrayPairSum(t *testing.T) {
- tests := [...]testType{
- {
- in: []int{1, 4, 3, 2},
- want: 4,
- },
- }
- for _, tt := range tests {
- got := arrayPairSum(tt.in)
- if got != tt.want {
- t.Fatalf("in: %v, got: %v, want: %v", tt.in, got, tt.want)
- }
- }
-}
diff --git a/problems/array-transformation/README.md b/problems/array-transformation/README.md
deleted file mode 100644
index b4fcc4466..000000000
--- a/problems/array-transformation/README.md
+++ /dev/null
@@ -1,69 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../web-crawler-multithreaded "Web Crawler Multithreaded")
-
-[Next >](../design-a-leaderboard "Design A Leaderboard")
-
-## [1243. Array Transformation (Easy)](https://leetcode.com/problems/array-transformation "数组变换")
-
-
Given an initial array arr, every day you produce a new array using the array of the previous day.
-
-
On the i-th day, you do the following operations on the array of day i-1 to produce the array of day i:
-
-
-
If an element is smaller than both its left neighbor and its right neighbor, then this element is incremented.
-
If an element is bigger than both its left neighbor and its right neighbor, then this element is decremented.
-
The first and last elements never change.
-
-
-
After some days, the array does not change. Return that final array.
-
-
-
Example 1:
-
-
-Input: arr = [6,2,3,4]
-Output: [6,3,3,4]
-Explanation:
-On the first day, the array is changed from [6,2,3,4] to [6,3,3,4].
-No more operations can be done to this array.
-
-
-
Example 2:
-
-
-Input: arr = [1,6,3,4,3,5]
-Output: [1,4,4,4,4,5]
-Explanation:
-On the first day, the array is changed from [1,6,3,4,3,5] to [1,5,4,3,4,5].
-On the second day, the array is changed from [1,5,4,3,4,5] to [1,4,4,4,4,5].
-No more operations can be done to this array.
-
-
-
-
Constraints:
-
-
-
1 <= arr.length <= 100
-
1 <= arr[i] <= 100
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Simulation](../../tag/simulation/README.md)]
-
-### Hints
-
-Hint 1
-Try to simulate the process.
-
-
-
-Hint 2
-For every iteration, find the new array using the old one and the given rules.
-
diff --git a/problems/array-with-elements-not-equal-to-average-of-neighbors/README.md b/problems/array-with-elements-not-equal-to-average-of-neighbors/README.md
deleted file mode 100644
index 25d9d3c60..000000000
--- a/problems/array-with-elements-not-equal-to-average-of-neighbors/README.md
+++ /dev/null
@@ -1,65 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../number-of-strings-that-appear-as-substrings-in-word "Number of Strings That Appear as Substrings in Word")
-
-[Next >](../minimum-non-zero-product-of-the-array-elements "Minimum Non-Zero Product of the Array Elements")
-
-## [1968. Array With Elements Not Equal to Average of Neighbors (Medium)](https://leetcode.com/problems/array-with-elements-not-equal-to-average-of-neighbors "构造元素不等于两相邻元素平均值的数组")
-
-
You are given a 0-indexed array nums of distinct integers. You want to rearrange the elements in the array such that every element in the rearranged array is not equal to the average of its neighbors.
-
-
More formally, the rearranged array should have the property such that for every i in the range 1 <= i < nums.length - 1, (nums[i-1] + nums[i+1]) / 2 is not equal to nums[i].
-
-
Return any rearrangement of nums that meets the requirements.
-
-
-
Example 1:
-
-
-Input: nums = [1,2,3,4,5]
-Output: [1,2,4,5,3]
-Explanation:
-When i=1, nums[i] = 2, and the average of its neighbors is (1+4) / 2 = 2.5.
-When i=2, nums[i] = 4, and the average of its neighbors is (2+5) / 2 = 3.5.
-When i=3, nums[i] = 5, and the average of its neighbors is (4+3) / 2 = 3.5.
-
-
-
Example 2:
-
-
-Input: nums = [6,2,0,9,7]
-Output: [9,7,6,2,0]
-Explanation:
-When i=1, nums[i] = 7, and the average of its neighbors is (9+6) / 2 = 7.5.
-When i=2, nums[i] = 6, and the average of its neighbors is (7+2) / 2 = 4.5.
-When i=3, nums[i] = 2, and the average of its neighbors is (6+0) / 2 = 3.
-
-
-
-
Constraints:
-
-
-
3 <= nums.length <= 105
-
0 <= nums[i] <= 105
-
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Hints
-
-Hint 1
-A number can be the average of its neighbors if one neighbor is smaller than the number and the other is greater than the number.
-
-
-
-Hint 2
-We can put numbers smaller than the median on odd indices and the rest on even indices.
-
diff --git a/problems/article-views-i/README.md b/problems/article-views-i/README.md
deleted file mode 100644
index 8b68e333a..000000000
--- a/problems/article-views-i/README.md
+++ /dev/null
@@ -1,59 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../longest-chunked-palindrome-decomposition "Longest Chunked Palindrome Decomposition")
-
-[Next >](../article-views-ii "Article Views II")
-
-## [1148. Article Views I (Easy)](https://leetcode.com/problems/article-views-i "文章浏览 I")
-
-
Table: Views
-
-
-+---------------+---------+
-| Column Name | Type |
-+---------------+---------+
-| article_id | int |
-| author_id | int |
-| viewer_id | int |
-| view_date | date |
-+---------------+---------+
-There is no primary key for this table, it may have duplicate rows.
-Each row of this table indicates that some viewer viewed an article (written by some author) on some date.
-Note that equal author_id and viewer_id indicate the same person.
-
-
-
-
Write an SQL query to find all the authors that viewed at least one of their own articles, sorted in ascending order by their id.
-
-
The query result format is in the following example:
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/article-views-i/mysql_schemas.sql b/problems/article-views-i/mysql_schemas.sql
deleted file mode 100644
index 70943fd44..000000000
--- a/problems/article-views-i/mysql_schemas.sql
+++ /dev/null
@@ -1,9 +0,0 @@
-Create table If Not Exists Views (article_id int, author_id int, viewer_id int, view_date date);
-Truncate table Views;
-insert into Views (article_id, author_id, viewer_id, view_date) values ('1', '3', '5', '2019-08-01');
-insert into Views (article_id, author_id, viewer_id, view_date) values ('1', '3', '6', '2019-08-02');
-insert into Views (article_id, author_id, viewer_id, view_date) values ('2', '7', '7', '2019-08-01');
-insert into Views (article_id, author_id, viewer_id, view_date) values ('2', '7', '6', '2019-08-02');
-insert into Views (article_id, author_id, viewer_id, view_date) values ('4', '7', '1', '2019-07-22');
-insert into Views (article_id, author_id, viewer_id, view_date) values ('3', '4', '4', '2019-07-21');
-insert into Views (article_id, author_id, viewer_id, view_date) values ('3', '4', '4', '2019-07-21');
diff --git a/problems/article-views-ii/README.md b/problems/article-views-ii/README.md
deleted file mode 100644
index 49af2063a..000000000
--- a/problems/article-views-ii/README.md
+++ /dev/null
@@ -1,59 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../article-views-i "Article Views I")
-
-[Next >](../check-if-a-number-is-majority-element-in-a-sorted-array "Check If a Number Is Majority Element in a Sorted Array")
-
-## [1149. Article Views II (Medium)](https://leetcode.com/problems/article-views-ii "文章浏览 II")
-
-
Table: Views
-
-
-+---------------+---------+
-| Column Name | Type |
-+---------------+---------+
-| article_id | int |
-| author_id | int |
-| viewer_id | int |
-| view_date | date |
-+---------------+---------+
-There is no primary key for this table, it may have duplicate rows.
-Each row of this table indicates that some viewer viewed an article (written by some author) on some date.
-Note that equal author_id and viewer_id indicate the same person.
-
-
-
-
Write an SQL query to find all the people who viewed more than one article on the same date, sorted in ascending order by their id.
-
-
The query result format is in the following example:
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/article-views-ii/mysql_schemas.sql b/problems/article-views-ii/mysql_schemas.sql
deleted file mode 100644
index c0178ce47..000000000
--- a/problems/article-views-ii/mysql_schemas.sql
+++ /dev/null
@@ -1,10 +0,0 @@
-Create table If Not Exists Views (article_id int, author_id int, viewer_id int, view_date date);
-Truncate table Views;
-insert into Views (article_id, author_id, viewer_id, view_date) values ('1', '3', '5', '2019-08-01');
-insert into Views (article_id, author_id, viewer_id, view_date) values ('3', '4', '5', '2019-08-01');
-insert into Views (article_id, author_id, viewer_id, view_date) values ('1', '3', '6', '2019-08-02');
-insert into Views (article_id, author_id, viewer_id, view_date) values ('2', '7', '7', '2019-08-01');
-insert into Views (article_id, author_id, viewer_id, view_date) values ('2', '7', '6', '2019-08-02');
-insert into Views (article_id, author_id, viewer_id, view_date) values ('4', '7', '1', '2019-07-22');
-insert into Views (article_id, author_id, viewer_id, view_date) values ('3', '4', '4', '2019-07-21');
-insert into Views (article_id, author_id, viewer_id, view_date) values ('3', '4', '4', '2019-07-21');
diff --git a/problems/as-far-from-land-as-possible/README.md b/problems/as-far-from-land-as-possible/README.md
deleted file mode 100644
index f7b860658..000000000
--- a/problems/as-far-from-land-as-possible/README.md
+++ /dev/null
@@ -1,73 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-level-sum-of-a-binary-tree "Maximum Level Sum of a Binary Tree")
-
-[Next >](../last-substring-in-lexicographical-order "Last Substring in Lexicographical Order")
-
-## [1162. As Far from Land as Possible (Medium)](https://leetcode.com/problems/as-far-from-land-as-possible "地图分析")
-
-
Given an n x ngrid containing only values 0 and 1, where 0 represents water and 1 represents land, find a water cell such that its distance to the nearest land cell is maximized, and return the distance. If no land or water exists in the grid, return -1.
-
-
The distance used in this problem is the Manhattan distance: the distance between two cells (x0, y0) and (x1, y1) is |x0 - x1| + |y0 - y1|.
-
-
-
Example 1:
-
-
-Input: grid = [[1,0,1],[0,0,0],[1,0,1]]
-Output: 2
-Explanation: The cell (1, 1) is as far as possible from all the land with distance 2.
-
-
-
Example 2:
-
-
-Input: grid = [[1,0,0],[0,0,0],[0,0,0]]
-Output: 4
-Explanation: The cell (2, 2) is as far as possible from all the land with distance 4.
-
-
-
-
Constraints:
-
-
-
n == grid.length
-
n == grid[i].length
-
1 <= n <= 100
-
grid[i][j] is 0 or 1
-
-
-### Related Topics
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
-
-### Similar Questions
- 1. [Shortest Distance from All Buildings](../shortest-distance-from-all-buildings) (Hard)
-
-### Hints
-
-Hint 1
-Can you think of this problem in a backwards way ?
-
-
-
-Hint 2
-Imagine expanding outward from each land cell. What kind of search does that ?
-
-
-
-Hint 3
-Use BFS starting from all land cells in the same time.
-
-
-
-Hint 4
-When do you reach the furthest water cell?
-
diff --git a/problems/assign-cookies/README.md b/problems/assign-cookies/README.md
deleted file mode 100644
index b2899d806..000000000
--- a/problems/assign-cookies/README.md
+++ /dev/null
@@ -1,51 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../4sum-ii "4Sum II")
-
-[Next >](../132-pattern "132 Pattern")
-
-## [455. Assign Cookies (Easy)](https://leetcode.com/problems/assign-cookies "分发饼干")
-
-
Assume you are an awesome parent and want to give your children some cookies. But, you should give each child at most one cookie.
-
-
Each child i has a greed factor g[i], which is the minimum size of a cookie that the child will be content with; and each cookie j has a size s[j]. If s[j] >= g[i], we can assign the cookie j to the child i, and the child i will be content. Your goal is to maximize the number of your content children and output the maximum number.
-
-
-
Example 1:
-
-
-Input: g = [1,2,3], s = [1,1]
-Output: 1
-Explanation: You have 3 children and 2 cookies. The greed factors of 3 children are 1, 2, 3.
-And even though you have 2 cookies, since their size is both 1, you could only make the child whose greed factor is 1 content.
-You need to output 1.
-
-
-
Example 2:
-
-
-Input: g = [1,2], s = [1,2,3]
-Output: 2
-Explanation: You have 2 children and 3 cookies. The greed factors of 2 children are 1, 2.
-You have 3 cookies and their sizes are big enough to gratify all of the children,
-You need to output 2.
-
We are given an array asteroids of integers representing asteroids in a row.
-
-
For each asteroid, the absolute value represents its size, and the sign represents its direction (positive meaning right, negative meaning left). Each asteroid moves at the same speed.
-
-
Find out the state of the asteroids after all collisions. If two asteroids meet, the smaller one will explode. If both are the same size, both will explode. Two asteroids moving in the same direction will never meet.
-
-
-
Example 1:
-
-
-Input: asteroids = [5,10,-5]
-Output: [5,10]
-Explanation: The 10 and -5 collide resulting in 10. The 5 and 10 never collide.
-
-
-
Example 2:
-
-
-Input: asteroids = [8,-8]
-Output: []
-Explanation: The 8 and -8 collide exploding each other.
-
-
-
Example 3:
-
-
-Input: asteroids = [10,2,-5]
-Output: [10]
-Explanation: The 2 and -5 collide resulting in -5. The 10 and -5 collide resulting in 10.
-
-
-
Example 4:
-
-
-Input: asteroids = [-2,-1,1,2]
-Output: [-2,-1,1,2]
-Explanation: The -2 and -1 are moving left, while the 1 and 2 are moving right. Asteroids moving the same direction never meet, so no asteroids will meet each other.
-
-
-
-
Constraints:
-
-
-
2 <= asteroids.length <= 104
-
-1000 <= asteroids[i] <= 1000
-
asteroids[i] != 0
-
-
-### Related Topics
- [[Stack](../../tag/stack/README.md)]
- [[Array](../../tag/array/README.md)]
-
-### Similar Questions
- 1. [Can Place Flowers](../can-place-flowers) (Easy)
-
-### Hints
-
-Hint 1
-Say a row of asteroids is stable. What happens when a new asteroid is added on the right?
-
diff --git a/problems/asteroid-collision/asteroid_collision.go b/problems/asteroid-collision/asteroid_collision.go
deleted file mode 100644
index 5d878d55e..000000000
--- a/problems/asteroid-collision/asteroid_collision.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem735
diff --git a/problems/asteroid-collision/asteroid_collision_test.go b/problems/asteroid-collision/asteroid_collision_test.go
deleted file mode 100644
index 5d878d55e..000000000
--- a/problems/asteroid-collision/asteroid_collision_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem735
diff --git a/problems/available-captures-for-rook/README.md b/problems/available-captures-for-rook/README.md
deleted file mode 100644
index d1375f510..000000000
--- a/problems/available-captures-for-rook/README.md
+++ /dev/null
@@ -1,58 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-binary-tree-ii "Maximum Binary Tree II")
-
-[Next >](../minimum-cost-to-merge-stones "Minimum Cost to Merge Stones")
-
-## [999. Available Captures for Rook (Easy)](https://leetcode.com/problems/available-captures-for-rook "可以被一步捕获的棋子数")
-
-
On an 8 x 8 chessboard, there is exactly one white rook 'R' and some number of white bishops 'B', black pawns 'p', and empty squares '.'.
-
-
When the rook moves, it chooses one of four cardinal directions (north, east, south, or west), then moves in that direction until it chooses to stop, reaches the edge of the board, captures a black pawn, or is blocked by a white bishop. A rook is considered attacking a pawn if the rook can capture the pawn on the rook's turn. The number of available captures for the white rook is the number of pawns that the rook is attacking.
-
-
Return the number of available captures for the white rook.
-
-
-
Example 1:
-
-
-Input: board = [[".",".",".",".",".",".",".","."],[".",".",".","p",".",".",".","."],[".",".",".","R",".",".",".","p"],[".",".",".",".",".",".",".","."],[".",".",".",".",".",".",".","."],[".",".",".","p",".",".",".","."],[".",".",".",".",".",".",".","."],[".",".",".",".",".",".",".","."]]
-Output: 3
-Explanation: In this example, the rook is attacking all the pawns.
-
-
-
Example 2:
-
-
-Input: board = [[".",".",".",".",".",".",".","."],[".","p","p","p","p","p",".","."],[".","p","p","B","p","p",".","."],[".","p","B","R","B","p",".","."],[".","p","p","B","p","p",".","."],[".","p","p","p","p","p",".","."],[".",".",".",".",".",".",".","."],[".",".",".",".",".",".",".","."]]
-Output: 0
-Explanation: The bishops are blocking the rook from attacking any of the pawns.
-
-
-
Example 3:
-
-
-Input: board = [[".",".",".",".",".",".",".","."],[".",".",".","p",".",".",".","."],[".",".",".","p",".",".",".","."],["p","p",".","R",".","p","B","."],[".",".",".",".",".",".",".","."],[".",".",".","B",".",".",".","."],[".",".",".","p",".",".",".","."],[".",".",".",".",".",".",".","."]]
-Output: 3
-Explanation: The rook is attacking the pawns at positions b5, d6, and f5.
-
-
-
-
Constraints:
-
-
-
board.length == 8
-
board[i].length == 8
-
board[i][j] is either 'R', '.', 'B', or 'p'
-
There is exactly one cell with board[i][j] == 'R'
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
- [[Simulation](../../tag/simulation/README.md)]
diff --git a/problems/available-captures-for-rook/available_captures_for_rook.go b/problems/available-captures-for-rook/available_captures_for_rook.go
deleted file mode 100644
index 39d372526..000000000
--- a/problems/available-captures-for-rook/available_captures_for_rook.go
+++ /dev/null
@@ -1,33 +0,0 @@
-package problem999
-
-func numRookCaptures(board [][]byte) int {
- ans, rx, ry, left, up := 0, -1, -1, [8]int{}, [8]int{}
- for i, row := range board {
- for j, v := range row {
- if rx == -1 {
- if v == 'p' {
- left[i], up[j] = 1, 1
- } else if v == 'B' {
- left[i], up[j] = 0, 0
- } else if v == 'R' {
- ans, rx, ry = left[i]+up[j], i, j
- }
- } else if i == rx {
- if v == 'p' {
- ans++
- }
- if v != '.' {
- break
- }
- } else if j == ry {
- if v == 'p' {
- ans++
- }
- if v != '.' {
- return ans
- }
- }
- }
- }
- return ans
-}
diff --git a/problems/available-captures-for-rook/available_captures_for_rook_test.go b/problems/available-captures-for-rook/available_captures_for_rook_test.go
deleted file mode 100644
index 39348f3a6..000000000
--- a/problems/available-captures-for-rook/available_captures_for_rook_test.go
+++ /dev/null
@@ -1,71 +0,0 @@
-package problem999
-
-import "testing"
-
-type testType struct {
- in [][]byte
- want int
-}
-
-func TestNumRookCaptures(t *testing.T) {
- tests := [...]testType{
- {
- in: [][]byte{
- {'.', '.', '.', '.', '.', '.', '.', '.'},
- {'.', '.', '.', 'p', '.', '.', '.', '.'},
- {'.', '.', '.', 'R', '.', '.', '.', 'p'},
- {'.', '.', '.', '.', '.', '.', '.', '.'},
- {'.', '.', '.', '.', '.', '.', '.', '.'},
- {'.', '.', '.', 'p', '.', '.', '.', '.'},
- {'.', '.', '.', '.', '.', '.', '.', '.'},
- {'.', '.', '.', '.', '.', '.', '.', '.'},
- },
- want: 3,
- },
- {
- in: [][]byte{
- {'.', '.', '.', '.', '.', '.', '.', '.'},
- {'.', 'p', 'p', 'p', 'p', 'p', '.', '.'},
- {'.', 'p', 'p', 'B', 'p', 'p', '.', '.'},
- {'.', 'p', 'B', 'R', 'B', 'p', '.', '.'},
- {'.', 'p', 'p', 'B', 'p', 'p', '.', '.'},
- {'.', 'p', 'p', 'p', 'p', 'p', '.', '.'},
- {'.', '.', '.', '.', '.', '.', '.', '.'},
- {'.', '.', '.', '.', '.', '.', '.', '.'},
- },
- want: 0,
- },
- {
- in: [][]byte{
- {'.', '.', '.', '.', '.', '.', '.', '.'},
- {'.', '.', '.', 'p', '.', '.', '.', '.'},
- {'.', '.', '.', 'p', '.', '.', '.', '.'},
- {'p', 'p', '.', 'R', '.', 'p', 'B', '.'},
- {'.', '.', '.', '.', '.', '.', '.', '.'},
- {'.', '.', '.', 'B', '.', '.', '.', '.'},
- {'.', '.', '.', 'p', '.', '.', '.', '.'},
- {'.', '.', '.', '.', '.', '.', '.', '.'},
- },
- want: 3,
- },
- {
- in: [][]byte{
- {'.', '.', '.', '.', '.', '.', '.', '.'},
- {'.', '.', '.', 'p', '.', '.', '.', '.'},
- {'.', '.', '.', 'p', '.', '.', '.', '.'},
- {'p', 'B', '.', 'R', '.', 'p', 'B', '.'},
- {'.', '.', '.', '.', '.', '.', '.', '.'},
- {'.', '.', '.', '.', '.', '.', '.', '.'},
- {'.', '.', 'p', '.', 'p', '.', '.', '.'},
- {'.', '.', '.', '.', '.', '.', '.', '.'},
- },
- want: 2,
- },
- }
- for _, tt := range tests {
- got := numRookCaptures(tt.in)
- if got != tt.want {
- t.Fatalf("in: %v, got: %v, want: %v", tt.in, got, tt.want)
- }
- }
-}
diff --git a/problems/average-height-of-buildings-in-each-segment/README.md b/problems/average-height-of-buildings-in-each-segment/README.md
deleted file mode 100644
index d47e0bd37..000000000
--- a/problems/average-height-of-buildings-in-each-segment/README.md
+++ /dev/null
@@ -1,41 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../longest-subsequence-repeated-k-times "Longest Subsequence Repeated k Times")
-
-[Next >](../maximum-difference-between-increasing-elements "Maximum Difference Between Increasing Elements")
-
-## [2015. Average Height of Buildings in Each Segment (Medium)](https://leetcode.com/problems/average-height-of-buildings-in-each-segment "")
-
-
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
- [[Heap (Priority Queue)](../../tag/heap-priority-queue/README.md)]
-
-### Hints
-
-Hint 1
-Try sorting the start and end points of each building.
-
-
-
-Hint 2
-The naive solution is to go through each position on the street and keep track of the sum of all the buildings at that position and the number of buildings at that position.
-
-
-
-Hint 3
-How could we optimize that solution to pass?
-
-
-
-Hint 4
-We don't need to go through every position, just the ones where a building starts or a building ends.
-
diff --git a/problems/average-of-levels-in-binary-tree/README.md b/problems/average-of-levels-in-binary-tree/README.md
deleted file mode 100644
index aac5fb089..000000000
--- a/problems/average-of-levels-in-binary-tree/README.md
+++ /dev/null
@@ -1,48 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../exclusive-time-of-functions "Exclusive Time of Functions")
-
-[Next >](../shopping-offers "Shopping Offers")
-
-## [637. Average of Levels in Binary Tree (Easy)](https://leetcode.com/problems/average-of-levels-in-binary-tree "二叉树的层平均值")
-
-Given the root of a binary tree, return the average value of the nodes on each level in the form of an array. Answers within 10-5 of the actual answer will be accepted.
-
-
Example 1:
-
-
-Input: root = [3,9,20,null,null,15,7]
-Output: [3.00000,14.50000,11.00000]
-Explanation: The average value of nodes on level 0 is 3, on level 1 is 14.5, and on level 2 is 11.
-Hence return [3, 14.5, 11].
-
-In March, the company's average salary is (9000+6000+10000)/3 = 8333.33...
-
-
-The average salary for department '1' is 9000, which is the salary of employee_id '1' since there is only one employee in this department. So the comparison result is 'higher' since 9000 > 8333.33 obviously.
-
-
-The average salary of department '2' is (6000 + 10000)/2 = 8000, which is the average of employee_id '2' and '3'. So the comparison result is 'lower' since 8000 < 8333.33.
-
-
-With he same formula for the average salary comparison in February, the result is 'same' since both the department '1' and '2' have the same average salary with the company, which is 7000.
-
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/average-salary-departments-vs-company/average_salary_departments_vs_company.sql b/problems/average-salary-departments-vs-company/average_salary_departments_vs_company.sql
deleted file mode 100644
index b0dd6d5bd..000000000
--- a/problems/average-salary-departments-vs-company/average_salary_departments_vs_company.sql
+++ /dev/null
@@ -1,29 +0,0 @@
-# Write your MySQL query statement below
-
-SELECT
- department_salary.pay_month,
- department_id,
- CASE
- WHEN department_avg > company_avg
- THEN 'higher'
- WHEN department_avg < company_avg
- THEN 'lower'
- ELSE 'same'
- END AS comparison
-FROM
- (SELECT
- department_id,
- avg(amount) AS department_avg,
- date_format(pay_date, '%Y-%m') AS pay_month
- FROM salary
- JOIN employee ON salary.employee_id = employee.employee_id
- GROUP BY department_id, pay_month
- ) AS department_salary
- JOIN (
- SELECT
- avg(amount) AS company_avg,
- date_format(pay_date, '%Y-%m') AS pay_month
- FROM salary
- GROUP BY date_format(pay_date, '%Y-%m')
- ) AS company_salary
- ON department_salary.pay_month = company_salary.pay_month;
diff --git a/problems/average-salary-departments-vs-company/mysql_schemas.sql b/problems/average-salary-departments-vs-company/mysql_schemas.sql
deleted file mode 100644
index 3ab9ca94f..000000000
--- a/problems/average-salary-departments-vs-company/mysql_schemas.sql
+++ /dev/null
@@ -1,13 +0,0 @@
-Create table If Not Exists Salary (id int, employee_id int, amount int, pay_date date);
-Create table If Not Exists Employee (employee_id int, department_id int);
-Truncate table Salary;
-insert into Salary (id, employee_id, amount, pay_date) values ('1', '1', '9000', '2017/03/31');
-insert into Salary (id, employee_id, amount, pay_date) values ('2', '2', '6000', '2017/03/31');
-insert into Salary (id, employee_id, amount, pay_date) values ('3', '3', '10000', '2017/03/31');
-insert into Salary (id, employee_id, amount, pay_date) values ('4', '1', '7000', '2017/02/28');
-insert into Salary (id, employee_id, amount, pay_date) values ('5', '2', '6000', '2017/02/28');
-insert into Salary (id, employee_id, amount, pay_date) values ('6', '3', '8000', '2017/02/28');
-Truncate table Employee;
-insert into Employee (employee_id, department_id) values ('1', '1');
-insert into Employee (employee_id, department_id) values ('2', '2');
-insert into Employee (employee_id, department_id) values ('3', '2');
diff --git a/problems/average-salary-excluding-the-minimum-and-maximum-salary/README.md b/problems/average-salary-excluding-the-minimum-and-maximum-salary/README.md
deleted file mode 100644
index 239269d1b..000000000
--- a/problems/average-salary-excluding-the-minimum-and-maximum-salary/README.md
+++ /dev/null
@@ -1,54 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../clone-n-ary-tree "Clone N-ary Tree")
-
-[Next >](../the-kth-factor-of-n "The kth Factor of n")
-
-## [1491. Average Salary Excluding the Minimum and Maximum Salary (Easy)](https://leetcode.com/problems/average-salary-excluding-the-minimum-and-maximum-salary "去掉最低工资和最高工资后的工资平均值")
-
-
You are given an array of unique integers salary where salary[i] is the salary of the ith employee.
-
-
Return the average salary of employees excluding the minimum and maximum salary. Answers within 10-5 of the actual answer will be accepted.
-
-
-
Example 1:
-
-
-Input: salary = [4000,3000,1000,2000]
-Output: 2500.00000
-Explanation: Minimum salary and maximum salary are 1000 and 4000 respectively.
-Average salary excluding minimum and maximum salary is (2000+3000) / 2 = 2500
-
-
-
Example 2:
-
-
-Input: salary = [1000,2000,3000]
-Output: 2000.00000
-Explanation: Minimum salary and maximum salary are 1000 and 3000 respectively.
-Average salary excluding minimum and maximum salary is (2000) / 1 = 2000
-
-
-
-
Constraints:
-
-
-
3 <= salary.length <= 100
-
1000 <= salary[i] <= 106
-
All the integers of salary are unique.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Hints
-
-Hint 1
-Get the total sum and subtract the minimum and maximum value in the array. Finally divide the result by n - 2.
-
diff --git a/problems/average-selling-price/README.md b/problems/average-selling-price/README.md
deleted file mode 100644
index 2801a6793..000000000
--- a/problems/average-selling-price/README.md
+++ /dev/null
@@ -1,88 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../check-if-it-is-a-good-array "Check If It Is a Good Array")
-
-[Next >](../cells-with-odd-values-in-a-matrix "Cells with Odd Values in a Matrix")
-
-## [1251. Average Selling Price (Easy)](https://leetcode.com/problems/average-selling-price "平均售价")
-
-
Table: Prices
-
-
-+---------------+---------+
-| Column Name | Type |
-+---------------+---------+
-| product_id | int |
-| start_date | date |
-| end_date | date |
-| price | int |
-+---------------+---------+
-(product_id, start_date, end_date) is the primary key for this table.
-Each row of this table indicates the price of the product_id in the period from start_date to end_date.
-For each product_id there will be no two overlapping periods. That means there will be no two intersecting periods for the same product_id.
-
-
-
-
-
Table: UnitsSold
-
-
-+---------------+---------+
-| Column Name | Type |
-+---------------+---------+
-| product_id | int |
-| purchase_date | date |
-| units | int |
-+---------------+---------+
-There is no primary key for this table, it may contain duplicates.
-Each row of this table indicates the date, units and product_id of each product sold.
-
-
-
-
-
Write an SQL query to find the average selling price for each product.
-
-
average_price should be rounded to 2 decimal places.
-
-
The query result format is in the following example:
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/average-selling-price/mysql_schemas.sql b/problems/average-selling-price/mysql_schemas.sql
deleted file mode 100644
index e4c3cf269..000000000
--- a/problems/average-selling-price/mysql_schemas.sql
+++ /dev/null
@@ -1,12 +0,0 @@
-Create table If Not Exists Prices (product_id int, start_date date, end_date date, price int);
-Create table If Not Exists UnitsSold (product_id int, purchase_date date, units int);
-Truncate table Prices;
-insert into Prices (product_id, start_date, end_date, price) values ('1', '2019-02-17', '2019-02-28', '5');
-insert into Prices (product_id, start_date, end_date, price) values ('1', '2019-03-01', '2019-03-22', '20');
-insert into Prices (product_id, start_date, end_date, price) values ('2', '2019-02-01', '2019-02-20', '15');
-insert into Prices (product_id, start_date, end_date, price) values ('2', '2019-02-21', '2019-03-31', '30');
-Truncate table UnitsSold;
-insert into UnitsSold (product_id, purchase_date, units) values ('1', '2019-02-25', '100');
-insert into UnitsSold (product_id, purchase_date, units) values ('1', '2019-03-01', '15');
-insert into UnitsSold (product_id, purchase_date, units) values ('2', '2019-02-10', '200');
-insert into UnitsSold (product_id, purchase_date, units) values ('2', '2019-03-22', '30');
diff --git a/problems/average-time-of-process-per-machine/README.md b/problems/average-time-of-process-per-machine/README.md
deleted file mode 100644
index 0a4023215..000000000
--- a/problems/average-time-of-process-per-machine/README.md
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../correct-a-binary-tree "Correct a Binary Tree")
-
-[Next >](../check-if-two-string-arrays-are-equivalent "Check If Two String Arrays are Equivalent")
-
-## [1661. Average Time of Process per Machine (Easy)](https://leetcode.com/problems/average-time-of-process-per-machine "每台机器的进程平均运行时间")
-
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/average-time-of-process-per-machine/mysql_schemas.sql b/problems/average-time-of-process-per-machine/mysql_schemas.sql
deleted file mode 100644
index 7ae9bb48a..000000000
--- a/problems/average-time-of-process-per-machine/mysql_schemas.sql
+++ /dev/null
@@ -1,14 +0,0 @@
-Create table If Not Exists Activity (machine_id int, process_id int, activity_type ENUM('start', 'end'), timestamp float);
-Truncate table Activity;
-insert into Activity (machine_id, process_id, activity_type, timestamp) values ('0', '0', 'start', '0.712');
-insert into Activity (machine_id, process_id, activity_type, timestamp) values ('0', '0', 'end', '1.52');
-insert into Activity (machine_id, process_id, activity_type, timestamp) values ('0', '1', 'start', '3.14');
-insert into Activity (machine_id, process_id, activity_type, timestamp) values ('0', '1', 'end', '4.12');
-insert into Activity (machine_id, process_id, activity_type, timestamp) values ('1', '0', 'start', '0.55');
-insert into Activity (machine_id, process_id, activity_type, timestamp) values ('1', '0', 'end', '1.55');
-insert into Activity (machine_id, process_id, activity_type, timestamp) values ('1', '1', 'start', '0.43');
-insert into Activity (machine_id, process_id, activity_type, timestamp) values ('1', '1', 'end', '1.42');
-insert into Activity (machine_id, process_id, activity_type, timestamp) values ('2', '0', 'start', '4.1');
-insert into Activity (machine_id, process_id, activity_type, timestamp) values ('2', '0', 'end', '4.512');
-insert into Activity (machine_id, process_id, activity_type, timestamp) values ('2', '1', 'start', '2.5');
-insert into Activity (machine_id, process_id, activity_type, timestamp) values ('2', '1', 'end', '5');
diff --git a/problems/average-waiting-time/README.md b/problems/average-waiting-time/README.md
deleted file mode 100644
index d2cba9701..000000000
--- a/problems/average-waiting-time/README.md
+++ /dev/null
@@ -1,78 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../number-of-students-unable-to-eat-lunch "Number of Students Unable to Eat Lunch")
-
-[Next >](../maximum-binary-string-after-change "Maximum Binary String After Change")
-
-## [1701. Average Waiting Time (Medium)](https://leetcode.com/problems/average-waiting-time "平均等待时间")
-
-
There is a restaurant with a single chef. You are given an array customers, where customers[i] = [arrivali, timei]:
-
-
-
arrivali is the arrival time of the ith customer. The arrival times are sorted in non-decreasing order.
-
timei is the time needed to prepare the order of the ith customer.
-
-
-
When a customer arrives, he gives the chef his order, and the chef starts preparing it once he is idle. The customer waits till the chef finishes preparing his order. The chef does not prepare food for more than one customer at a time. The chef prepares food for customers in the order they were given in the input.
-
-
Return the average waiting time of all customers. Solutions within 10-5 from the actual answer are considered accepted.
-
-
-
Example 1:
-
-
-Input: customers = [[1,2],[2,5],[4,3]]
-Output: 5.00000
-Explanation:
-1) The first customer arrives at time 1, the chef takes his order and starts preparing it immediately at time 1, and finishes at time 3, so the waiting time of the first customer is 3 - 1 = 2.
-2) The second customer arrives at time 2, the chef takes his order and starts preparing it at time 3, and finishes at time 8, so the waiting time of the second customer is 8 - 2 = 6.
-3) The third customer arrives at time 4, the chef takes his order and starts preparing it at time 8, and finishes at time 11, so the waiting time of the third customer is 11 - 4 = 7.
-So the average waiting time = (2 + 6 + 7) / 3 = 5.
-
-
-
Example 2:
-
-
-Input: customers = [[5,2],[5,4],[10,3],[20,1]]
-Output: 3.25000
-Explanation:
-1) The first customer arrives at time 5, the chef takes his order and starts preparing it immediately at time 5, and finishes at time 7, so the waiting time of the first customer is 7 - 5 = 2.
-2) The second customer arrives at time 5, the chef takes his order and starts preparing it at time 7, and finishes at time 11, so the waiting time of the second customer is 11 - 5 = 6.
-3) The third customer arrives at time 10, the chef takes his order and starts preparing it at time 11, and finishes at time 14, so the waiting time of the third customer is 14 - 10 = 4.
-4) The fourth customer arrives at time 20, the chef takes his order and starts preparing it immediately at time 20, and finishes at time 21, so the waiting time of the fourth customer is 21 - 20 = 1.
-So the average waiting time = (2 + 6 + 4 + 1) / 4 = 3.25.
-
-
-
-
Constraints:
-
-
-
1 <= customers.length <= 105
-
1 <= arrivali, timei <= 104
-
arrivali <= arrivali+1
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Simulation](../../tag/simulation/README.md)]
-
-### Hints
-
-Hint 1
-Iterate on the customers, maintaining the time the chef will finish the previous orders.
-
-
-
-Hint 2
-If that time is before the current arrival time, the chef starts immediately. Else, the current customer waits till the chef finishes, and then the chef starts.
-
-
-
-Hint 3
-Update the running time by the time when the chef starts preparing + preparation time.
-
diff --git a/problems/avoid-flood-in-the-city/README.md b/problems/avoid-flood-in-the-city/README.md
deleted file mode 100644
index fdd8339ce..000000000
--- a/problems/avoid-flood-in-the-city/README.md
+++ /dev/null
@@ -1,100 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../making-file-names-unique "Making File Names Unique")
-
-[Next >](../find-critical-and-pseudo-critical-edges-in-minimum-spanning-tree "Find Critical and Pseudo-Critical Edges in Minimum Spanning Tree")
-
-## [1488. Avoid Flood in The City (Medium)](https://leetcode.com/problems/avoid-flood-in-the-city "避免洪水泛滥")
-
-
Your country has an infinite number of lakes. Initially, all the lakes are empty, but when it rains over the nth lake, the nth lake becomes full of water. If it rains over a lake which is full of water, there will be a flood. Your goal is to avoid the flood in any lake.
-
-
Given an integer array rains where:
-
-
-
rains[i] > 0 means there will be rains over the rains[i] lake.
-
rains[i] == 0 means there are no rains this day and you can choose one lake this day and dry it.
-
-
-
Return an array ans where:
-
-
-
ans.length == rains.length
-
ans[i] == -1 if rains[i] > 0.
-
ans[i] is the lake you choose to dry in the ith day if rains[i] == 0.
-
-
-
If there are multiple valid answers return any of them. If it is impossible to avoid flood return an empty array.
-
-
Notice that if you chose to dry a full lake, it becomes empty, but if you chose to dry an empty lake, nothing changes. (see example 4)
-
-
-
Example 1:
-
-
-Input: rains = [1,2,3,4]
-Output: [-1,-1,-1,-1]
-Explanation: After the first day full lakes are [1]
-After the second day full lakes are [1,2]
-After the third day full lakes are [1,2,3]
-After the fourth day full lakes are [1,2,3,4]
-There's no day to dry any lake and there is no flood in any lake.
-
-
-
Example 2:
-
-
-Input: rains = [1,2,0,0,2,1]
-Output: [-1,-1,2,1,-1,-1]
-Explanation: After the first day full lakes are [1]
-After the second day full lakes are [1,2]
-After the third day, we dry lake 2. Full lakes are [1]
-After the fourth day, we dry lake 1. There is no full lakes.
-After the fifth day, full lakes are [2].
-After the sixth day, full lakes are [1,2].
-It is easy that this scenario is flood-free. [-1,-1,1,2,-1,-1] is another acceptable scenario.
-
-
-
Example 3:
-
-
-Input: rains = [1,2,0,1,2]
-Output: []
-Explanation: After the second day, full lakes are [1,2]. We have to dry one lake in the third day.
-After that, it will rain over lakes [1,2]. It's easy to prove that no matter which lake you choose to dry in the 3rd day, the other one will flood.
-
-
-
-
Constraints:
-
-
-
1 <= rains.length <= 105
-
0 <= rains[i] <= 109
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
- [[Greedy](../../tag/greedy/README.md)]
- [[Heap (Priority Queue)](../../tag/heap-priority-queue/README.md)]
-
-### Hints
-
-Hint 1
-Keep An array of the last day there was rains over each city.
-
-
-
-Hint 2
-Keep an array of the days you can dry a lake when you face one.
-
-
-
-Hint 3
-When it rains over a lake, check the first possible day you can dry this lake and assign this day to this lake.
-
diff --git a/problems/backspace-string-compare/README.md b/problems/backspace-string-compare/README.md
deleted file mode 100644
index e5ba9c09d..000000000
--- a/problems/backspace-string-compare/README.md
+++ /dev/null
@@ -1,58 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../guess-the-word "Guess the Word")
-
-[Next >](../longest-mountain-in-array "Longest Mountain in Array")
-
-## [844. Backspace String Compare (Easy)](https://leetcode.com/problems/backspace-string-compare "比较含退格的字符串")
-
-
Given two strings s and t, return trueif they are equal when both are typed into empty text editors. '#' means a backspace character.
-
-
Note that after backspacing an empty text, the text will continue empty.
-
-
-
Example 1:
-
-
-Input: s = "ab#c", t = "ad#c"
-Output: true
-Explanation: Both s and t become "ac".
-
-
-
Example 2:
-
-
-Input: s = "ab##", t = "c#d#"
-Output: true
-Explanation: Both s and t become "".
-
-
-
Example 3:
-
-
-Input: s = "a#c", t = "b"
-Output: false
-Explanation: s becomes "c" while t becomes "b".
-
-
-
-
Constraints:
-
-
-
1 <= s.length, t.length <= 200
-
s and t only contain lowercase letters and '#' characters.
-
-
-
-
Follow up: Can you solve it in O(n) time and O(1) space?
-
-### Related Topics
- [[Stack](../../tag/stack/README.md)]
- [[Two Pointers](../../tag/two-pointers/README.md)]
- [[String](../../tag/string/README.md)]
- [[Simulation](../../tag/simulation/README.md)]
diff --git a/problems/backspace-string-compare/backspace_string_compare.go b/problems/backspace-string-compare/backspace_string_compare.go
deleted file mode 100644
index 996e14c27..000000000
--- a/problems/backspace-string-compare/backspace_string_compare.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem844
diff --git a/problems/backspace-string-compare/backspace_string_compare_test.go b/problems/backspace-string-compare/backspace_string_compare_test.go
deleted file mode 100644
index 996e14c27..000000000
--- a/problems/backspace-string-compare/backspace_string_compare_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem844
diff --git a/problems/bag-of-tokens/README.md b/problems/bag-of-tokens/README.md
deleted file mode 100644
index e5400398d..000000000
--- a/problems/bag-of-tokens/README.md
+++ /dev/null
@@ -1,69 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../most-stones-removed-with-same-row-or-column "Most Stones Removed with Same Row or Column")
-
-[Next >](../largest-time-for-given-digits "Largest Time for Given Digits")
-
-## [948. Bag of Tokens (Medium)](https://leetcode.com/problems/bag-of-tokens "令牌放置")
-
-
You have an initial power of power, an initial score of 0, and a bag of tokens where tokens[i] is the value of the ith token (0-indexed).
-
-
Your goal is to maximize your total score by potentially playing each token in one of two ways:
-
-
-
If your current power is at least tokens[i], you may play the ith token face up, losing tokens[i]power and gaining 1score.
-
If your current score is at least 1, you may play the ith token face down, gaining tokens[i]power and losing 1score.
-
-
-
Each token may be played at most once and in any order. You do not have to play all the tokens.
-
-
Return the largest possible score you can achieve after playing any number of tokens.
-
-
-
Example 1:
-
-
-Input: tokens = [100], power = 50
-Output: 0
-Explanation: Playing the only token in the bag is impossible because you either have too little power or too little score.
-
-
-
Example 2:
-
-
-Input: tokens = [100,200], power = 150
-Output: 1
-Explanation: Play the 0th token (100) face up, your power becomes 50 and score becomes 1.
-There is no need to play the 1st token since you cannot play it face up to add to your score.
-
-
-
Example 3:
-
-
-Input: tokens = [100,200,300,400], power = 200
-Output: 2
-Explanation: Play the tokens in this order to get a score of 2:
-1. Play the 0th token (100) face up, your power becomes 100 and score becomes 1.
-2. Play the 3rd token (400) face down, your power becomes 500 and score becomes 0.
-3. Play the 1st token (200) face up, your power becomes 300 and score becomes 1.
-4. Play the 2nd token (300) face up, your power becomes 0 and score becomes 2.
-
Given the root of a binary search tree, return a balanced binary search tree with the same node values. If there is more than one answer, return any of them.
-
-
A binary search tree is balanced if the depth of the two subtrees of every node never differs by more than 1.
-
-
-
Example 1:
-
-
-Input: root = [1,null,2,null,3,null,4,null,null]
-Output: [2,1,3,null,null,null,4]
-Explanation: This is not the only correct answer, [3,1,4,null,2] is also correct.
-
-
-
Example 2:
-
-
-Input: root = [2,1,3]
-Output: [2,1,3]
-
-
-
-
Constraints:
-
-
-
The number of nodes in the tree is in the range [1, 104].
-
1 <= Node.val <= 105
-
-
-### Related Topics
- [[Divide and Conquer](../../tag/divide-and-conquer/README.md)]
- [[Greedy](../../tag/greedy/README.md)]
- [[Tree](../../tag/tree/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Binary Search Tree](../../tag/binary-search-tree/README.md)]
- [[Binary Tree](../../tag/binary-tree/README.md)]
-
-### Hints
-
-Hint 1
-Convert the tree to a sorted array using an in-order traversal.
-
-
-
-Hint 2
-Construct a new balanced tree from the sorted array recursively.
-
diff --git a/problems/balanced-binary-tree/README.md b/problems/balanced-binary-tree/README.md
deleted file mode 100644
index 22b4d5ef7..000000000
--- a/problems/balanced-binary-tree/README.md
+++ /dev/null
@@ -1,58 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../convert-sorted-list-to-binary-search-tree "Convert Sorted List to Binary Search Tree")
-
-[Next >](../minimum-depth-of-binary-tree "Minimum Depth of Binary Tree")
-
-## [110. Balanced Binary Tree (Easy)](https://leetcode.com/problems/balanced-binary-tree "平衡二叉树")
-
-
Given a binary tree, determine if it is height-balanced.
-
-
For this problem, a height-balanced binary tree is defined as:
-
-
-
a binary tree in which the left and right subtrees of every node differ in height by no more than 1.
You are keeping score for a baseball game with strange rules. The game consists of several rounds, where the scores of past rounds may affect future rounds' scores.
-
-
At the beginning of the game, you start with an empty record. You are given a list of strings ops, where ops[i] is the ith operation you must apply to the record and is one of the following:
-
-
-
An integer x - Record a new score of x.
-
"+" - Record a new score that is the sum of the previous two scores. It is guaranteed there will always be two previous scores.
-
"D" - Record a new score that is double the previous score. It is guaranteed there will always be a previous score.
-
"C" - Invalidate the previous score, removing it from the record. It is guaranteed there will always be a previous score.
-
-
-
Return the sum of all the scores on the record.
-
-
-
Example 1:
-
-
-Input: ops = ["5","2","C","D","+"]
-Output: 30
-Explanation:
-"5" - Add 5 to the record, record is now [5].
-"2" - Add 2 to the record, record is now [5, 2].
-"C" - Invalidate and remove the previous score, record is now [5].
-"D" - Add 2 * 5 = 10 to the record, record is now [5, 10].
-"+" - Add 5 + 10 = 15 to the record, record is now [5, 10, 15].
-The total sum is 5 + 10 + 15 = 30.
-
-
-
Example 2:
-
-
-Input: ops = ["5","-2","4","C","D","9","+","+"]
-Output: 27
-Explanation:
-"5" - Add 5 to the record, record is now [5].
-"-2" - Add -2 to the record, record is now [5, -2].
-"4" - Add 4 to the record, record is now [5, -2, 4].
-"C" - Invalidate and remove the previous score, record is now [5, -2].
-"D" - Add 2 * -2 = -4 to the record, record is now [5, -2, -4].
-"9" - Add 9 to the record, record is now [5, -2, -4, 9].
-"+" - Add -4 + 9 = 5 to the record, record is now [5, -2, -4, 9, 5].
-"+" - Add 9 + 5 = 14 to the record, record is now [5, -2, -4, 9, 5, 14].
-The total sum is 5 + -2 + -4 + 9 + 5 + 14 = 27.
-
-
-
Example 3:
-
-
-Input: ops = ["1"]
-Output: 1
-
-
-
-
Constraints:
-
-
-
1 <= ops.length <= 1000
-
ops[i] is "C", "D", "+", or a string representing an integer in the range [-3 * 104, 3 * 104].
-
For operation "+", there will always be at least two previous scores on the record.
-
For operations "C" and "D", there will always be at least one previous score on the record.
Implement a basic calculator to evaluate a simple expression string.
-
-
The expression string may contain open ( and closing parentheses ), the plus + or minus sign -, non-negative integers and empty spaces .
-
-
The expression string contains only non-negative integers, +, -, *, / operators , open ( and closing parentheses ) and empty spaces . The integer division should truncate toward zero.
-
-
You may assume that the given expression is always valid. All intermediate results will be in the range of [-2147483648, 2147483647].
Given an expression such as expression = "e + 8 - a + 5" and an evaluation map such as {"e": 1} (given in terms of evalvars = ["e"] and evalints = [1]), return a list of tokens representing the simplified expression, such as ["-1*a","14"]
-
-
-
An expression alternates chunks and symbols, with a space separating each chunk and symbol.
-
A chunk is either an expression in parentheses, a variable, or a non-negative integer.
-
A variable is a string of lowercase letters (not including digits.) Note that variables can be multiple letters, and note that variables never have a leading coefficient or unary operator like "2x" or "-x".
-
-
-
Expressions are evaluated in the usual order: brackets first, then multiplication, then addition and subtraction.
-
-
-
For example, expression = "1 + 2 * 3" has an answer of ["7"].
-
-
-
The format of the output is as follows:
-
-
-
For each term of free variables with a non-zero coefficient, we write the free variables within a term in sorted order lexicographically.
-
-
For example, we would never write a term like "b*a*c", only "a*b*c".
-
-
-
Terms have degrees equal to the number of free variables being multiplied, counting multiplicity. We write the largest degree terms of our answer first, breaking ties by lexicographic order ignoring the leading coefficient of the term.
-
-
For example, "a*a*b*c" has degree 4.
-
-
-
The leading coefficient of the term is placed directly to the left with an asterisk separating it from the variables (if they exist.) A leading coefficient of 1 is still printed.
-
An example of a well-formatted answer is ["-2*a*a*a", "3*a*a*b", "3*b*b", "4*a", "5*c", "-6"].
-
Terms (including constant terms) with coefficient 0 are not included.
-
-
For example, an expression of "0" has an output of [].
-Input: expression = "a * b * c + b * a * c * 4", evalvars = [], evalints = []
-Output: ["5*a*b*c"]
-
-
-
Example 5:
-
-
-Input: expression = "((a - b) * (b - c) + (c - a)) * ((a - b) + (b - c) * (c - a))", evalvars = [], evalints = []
-Output: ["-1*a*a*b*b","2*a*a*b*c","-1*a*a*c*c","1*a*b*b*b","-1*a*b*b*c","-1*a*b*c*c","1*a*c*c*c","-1*b*b*b*c","2*b*b*c*c","-1*b*c*c*c","2*a*a*b","-2*a*a*c","-2*a*b*b","2*a*c*c","1*b*b*b","-1*b*b*c","1*b*c*c","-1*c*c*c","-1*a*a","1*a*b","1*a*c","-1*b*c"]
-
-
-
-
Constraints:
-
-
-
1 <= expression.length <= 250
-
expression consists of lowercase English letters, digits, '+', '-', '*', '(', ')', ' '.
-
expression does not contain any leading or trailing spaces.
-
All the tokens in expression are separated by a single space.
-
0 <= evalvars.length <= 100
-
1 <= evalvars[i].length <= 20
-
evalvars[i] consists of lowercase English letters.
-
evalints.length == evalvars.length
-
-100 <= evalints[i] <= 100
-
-
-### Related Topics
- [[Stack](../../tag/stack/README.md)]
- [[Recursion](../../tag/recursion/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Math](../../tag/math/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Similar Questions
- 1. [Parse Lisp Expression](../parse-lisp-expression) (Hard)
- 1. [Basic Calculator III](../basic-calculator-iii) (Hard)
-
-### Hints
-
-Hint 1
-One way is with a Polynomial class. For example,
-
-* `Poly:add(this, that)` returns the result of `this + that`.
-* `Poly:sub(this, that)` returns the result of `this - that`.
-* `Poly:mul(this, that)` returns the result of `this * that`.
-* `Poly:evaluate(this, evalmap)` returns the polynomial after replacing all free variables with constants as specified by `evalmap`.
-* `Poly:toList(this)` returns the polynomial in the correct output format.
-
-* `Solution::combine(left, right, symbol)` returns the result of applying the binary operator represented by `symbol` to `left` and `right`.
-* `Solution::make(expr)` makes a new `Poly` represented by either the constant or free variable specified by `expr`.
-* `Solution::parse(expr)` parses an expression into a new `Poly`.
-
diff --git a/problems/basic-calculator-iv/basic_calculator_iv.go b/problems/basic-calculator-iv/basic_calculator_iv.go
deleted file mode 100644
index 58dead005..000000000
--- a/problems/basic-calculator-iv/basic_calculator_iv.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem770
diff --git a/problems/basic-calculator-iv/basic_calculator_iv_test.go b/problems/basic-calculator-iv/basic_calculator_iv_test.go
deleted file mode 100644
index 58dead005..000000000
--- a/problems/basic-calculator-iv/basic_calculator_iv_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem770
diff --git a/problems/basic-calculator/README.md b/problems/basic-calculator/README.md
deleted file mode 100644
index df8bef877..000000000
--- a/problems/basic-calculator/README.md
+++ /dev/null
@@ -1,64 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../rectangle-area "Rectangle Area")
-
-[Next >](../implement-stack-using-queues "Implement Stack using Queues")
-
-## [224. Basic Calculator (Hard)](https://leetcode.com/problems/basic-calculator "基本计算器")
-
-
Given a string s representing a valid expression, implement a basic calculator to evaluate it, and return the result of the evaluation.
-
-
Note: You are not allowed to use any built-in function which evaluates strings as mathematical expressions, such as eval().
-
-
-
Example 1:
-
-
-Input: s = "1 + 1"
-Output: 2
-
-
-
Example 2:
-
-
-Input: s = " 2-1 + 2 "
-Output: 3
-
-
-
Example 3:
-
-
-Input: s = "(1+(4+5+2)-3)+(6+8)"
-Output: 23
-
-
-
-
Constraints:
-
-
-
1 <= s.length <= 3 * 105
-
s consists of digits, '+', '-', '(', ')', and ' '.
-
s represents a valid expression.
-
'+' is not used as a unary operation (i.e., "+1" and "+(2 + 3)" is invalid).
-
'-' could be used as a unary operation (i.e., "-1" and "-(2 + 3)" is valid).
-
There will be no two consecutive operators in the input.
-
Every number and running calculation will fit in a signed 32-bit integer.
Given an m x n matrix board where each cell is a battleship 'X' or empty '.', return the number of the battleships onboard.
-
-
Battleships can only be placed horizontally or vertically on board. In other words, they can only be made of the shape 1 x k (1 row, k columns) or k x 1 (k rows, 1 column), where k can be of any size. At least one horizontal or vertical cell separates between two battleships (i.e., there are no adjacent battleships).
Given two integers n and k, construct a list answer that contains n different positive integers ranging from 1 to n and obeys the following requirement:
-
-
-
Suppose this list is answer = [a1, a2, a3, ... , an], then the list [|a1 - a2|, |a2 - a3|, |a3 - a4|, ... , |an-1 - an|] has exactly k distinct integers.
-
-
-
Return the listanswer. If there multiple valid answers, return any of them.
-
-
-
Example 1:
-
-
-Input: n = 3, k = 1
-Output: [1,2,3]
-Explanation: The [1,2,3] has three different positive integers ranging from 1 to 3, and the [1,1] has exactly 1 distinct integer: 1
-
-
-
Example 2:
-
-
-Input: n = 3, k = 2
-Output: [1,3,2]
-Explanation: The [1,3,2] has three different positive integers ranging from 1 to 3, and the [2,1] has exactly 2 distinct integers: 1 and 2.
-
Suppose you have n integers labeled 1 through n. A permutation of those n integers perm (1-indexed) is considered a beautiful arrangement if for every i (1 <= i <= n), either of the following is true:
-
-
-
perm[i] is divisible by i.
-
i is divisible by perm[i].
-
-
-
Given an integer n, return the number of the beautiful arrangements that you can construct.
-
-
-
Example 1:
-
-
-Input: n = 2
-Output: 2
-Explanation:
-The first beautiful arrangement is [1,2]:
- - perm[1] = 1 is divisible by i = 1
- - perm[2] = 2 is divisible by i = 2
-The second beautiful arrangement is [2,1]:
- - perm[1] = 2 is divisible by i = 1
- - i = 2 is divisible by perm[2] = 1
-
nums is a permutation of the integers in the range [1, n].
-
For every 0 <= i < j < n, there is no index k with i < k < j where 2 * nums[k] == nums[i] + nums[j].
-
-
-
Given the integer n, return any beautiful array nums of length n. There will be at least one valid answer for the given n.
-
-
-
Example 1:
-
Input: n = 4
-Output: [2,1,4,3]
-
Example 2:
-
Input: n = 5
-Output: [3,1,2,5,4]
-
-
-
Constraints:
-
-
-
1 <= n <= 1000
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Math](../../tag/math/README.md)]
- [[Divide and Conquer](../../tag/divide-and-conquer/README.md)]
diff --git a/problems/beautiful-array/beautiful_array.go b/problems/beautiful-array/beautiful_array.go
deleted file mode 100644
index 852504bce..000000000
--- a/problems/beautiful-array/beautiful_array.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem932
diff --git a/problems/beautiful-array/beautiful_array_test.go b/problems/beautiful-array/beautiful_array_test.go
deleted file mode 100644
index 852504bce..000000000
--- a/problems/beautiful-array/beautiful_array_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem932
diff --git a/problems/before-and-after-puzzle/README.md b/problems/before-and-after-puzzle/README.md
deleted file mode 100644
index 24706b19c..000000000
--- a/problems/before-and-after-puzzle/README.md
+++ /dev/null
@@ -1,81 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../count-substrings-with-only-one-distinct-letter "Count Substrings with Only One Distinct Letter")
-
-[Next >](../shortest-distance-to-target-color "Shortest Distance to Target Color")
-
-## [1181. Before and After Puzzle (Medium)](https://leetcode.com/problems/before-and-after-puzzle "前后拼接")
-
-
Given a list of phrases, generate a list of Before and After puzzles.
-
-
A phrase is a string that consists of lowercase English letters and spaces only. No space appears in the start or the end of a phrase. There are no consecutive spaces in a phrase.
-
-
Before and After puzzles are phrases that are formed by merging two phrases where the last word of the first phrase is the same as the first word of the second phrase.
-
-
Return the Before and After puzzles that can be formed by every two phrases phrases[i] and phrases[j] where i != j. Note that the order of matching two phrases matters, we want to consider both orders.
-
-
You should return a list of distinct strings sorted lexicographically.
-Input: phrases = ["mission statement",
- "a quick bite to eat",
- "a chip off the old block",
- "chocolate bar",
- "mission impossible",
- "a man on a mission",
- "block party",
- "eat my words",
- "bar of soap"]
-Output: ["a chip off the old block party",
- "a man on a mission impossible",
- "a man on a mission statement",
- "a quick bite to eat my words",
- "chocolate bar of soap"]
-
-
-
Example 3:
-
-
-Input: phrases = ["a","b","a"]
-Output: ["a"]
-
-
-
-
Constraints:
-
-
-
1 <= phrases.length <= 100
-
1 <= phrases[i].length <= 100
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Hints
-
-Hint 1
-What if you check every pair of strings (bruteforce)?
-
-
-
-Hint 2
-For every two strings, check if they can form a puzzle by comparing their last and first words.
-
diff --git a/problems/best-meeting-point/README.md b/problems/best-meeting-point/README.md
deleted file mode 100644
index f513e9738..000000000
--- a/problems/best-meeting-point/README.md
+++ /dev/null
@@ -1,47 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../find-median-from-data-stream "Find Median from Data Stream")
-
-[Next >](../serialize-and-deserialize-binary-tree "Serialize and Deserialize Binary Tree")
-
-## [296. Best Meeting Point (Hard)](https://leetcode.com/problems/best-meeting-point "最佳的碰头地点")
-
-
A group of two or more people wants to meet and minimize the total travel distance. You are given a 2D grid of values 0 or 1, where each 1 marks the home of someone in the group. The distance is calculated using Manhattan Distance, where distance(p1, p2) = |p2.x - p1.x| + |p2.y - p1.y|.
-
-
Example:
-
-
-Input:
-
-1 - 0 - 0 - 0 - 1
-| | | | |
-0 - 0 - 0 - 0 - 0
-| | | | |
-0 - 0 - 1 - 0 - 0
-
-Output: 6
-
-Explanation: Given three people living at (0,0), (0,4), and (2,2):
- The point (0,2) is an ideal meeting point, as the total travel distance
- of 2+2+2=6 is minimal. So return 6.
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Math](../../tag/math/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Similar Questions
- 1. [Shortest Distance from All Buildings](../shortest-distance-from-all-buildings) (Hard)
- 1. [Minimum Moves to Equal Array Elements II](../minimum-moves-to-equal-array-elements-ii) (Medium)
-
-### Hints
-
-Hint 1
-Try to solve it in one dimension first. How can this solution apply to the two dimension case?
-
diff --git a/problems/best-meeting-point/best_meeting_point.go b/problems/best-meeting-point/best_meeting_point.go
deleted file mode 100644
index b562cd74e..000000000
--- a/problems/best-meeting-point/best_meeting_point.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem296
diff --git a/problems/best-meeting-point/best_meeting_point_test.go b/problems/best-meeting-point/best_meeting_point_test.go
deleted file mode 100644
index b562cd74e..000000000
--- a/problems/best-meeting-point/best_meeting_point_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem296
diff --git a/problems/best-position-for-a-service-centre/README.md b/problems/best-position-for-a-service-centre/README.md
deleted file mode 100644
index 224671215..000000000
--- a/problems/best-position-for-a-service-centre/README.md
+++ /dev/null
@@ -1,62 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../path-with-maximum-probability "Path with Maximum Probability")
-
-[Next >](../move-sub-tree-of-n-ary-tree "Move Sub-Tree of N-Ary Tree")
-
-## [1515. Best Position for a Service Centre (Hard)](https://leetcode.com/problems/best-position-for-a-service-centre "服务中心的最佳位置")
-
-
A delivery company wants to build a new service center in a new city. The company knows the positions of all the customers in this city on a 2D-Map and wants to build the new center in a position such that the sum of the euclidean distances to all customers is minimum.
-
-
Given an array positions where positions[i] = [xi, yi] is the position of the ith customer on the map, return the minimum sum of the euclidean distances to all customers.
-
-
In other words, you need to choose the position of the service center [xcentre, ycentre] such that the following formula is minimized:
-
-
Answers within 10-5 of the actual value will be accepted.
-
-
-
Example 1:
-
-
-Input: positions = [[0,1],[1,0],[1,2],[2,1]]
-Output: 4.00000
-Explanation: As shown, you can see that choosing [xcentre, ycentre] = [1, 1] will make the distance to each customer = 1, the sum of all distances is 4 which is the minimum possible we can achieve.
-
-
-
Example 2:
-
-
-Input: positions = [[1,1],[3,3]]
-Output: 2.82843
-Explanation: The minimum possible sum of distances = sqrt(2) + sqrt(2) = 2.82843
-
-
-
-
Constraints:
-
-
-
1 <= positions.length <= 50
-
positions[i].length == 2
-
0 <= xi, yi <= 100
-
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
- [[Geometry](../../tag/geometry/README.md)]
- [[Randomized](../../tag/randomized/README.md)]
-
-### Hints
-
-Hint 1
-The problem can be reworded as, giving a set of points on a 2d-plane, return the geometric median.
-
-
-
-Hint 2
-Loop over each triplet of points (positions[i], positions[j], positions[k]) where i < j < k, get the centre of the circle which goes throw the 3 points, check if all other points lie in this circle.
-
diff --git a/problems/best-sightseeing-pair/README.md b/problems/best-sightseeing-pair/README.md
deleted file mode 100644
index 2889a419e..000000000
--- a/problems/best-sightseeing-pair/README.md
+++ /dev/null
@@ -1,52 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../partition-array-into-three-parts-with-equal-sum "Partition Array Into Three Parts With Equal Sum")
-
-[Next >](../smallest-integer-divisible-by-k "Smallest Integer Divisible by K")
-
-## [1014. Best Sightseeing Pair (Medium)](https://leetcode.com/problems/best-sightseeing-pair "最佳观光组合")
-
-
You are given an integer array values where values[i] represents the value of the ith sightseeing spot. Two sightseeing spots i and j have a distancej - i between them.
-
-
The score of a pair (i < j) of sightseeing spots is values[i] + values[j] + i - j: the sum of the values of the sightseeing spots, minus the distance between them.
-
-
Return the maximum score of a pair of sightseeing spots.
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Hints
-
-Hint 1
-Can you tell the best sightseeing spot in one pass (ie. as you iterate over the input?) What should we store or keep track of as we iterate to do this?
-
diff --git a/problems/best-sightseeing-pair/best_sightseeing_pair.go b/problems/best-sightseeing-pair/best_sightseeing_pair.go
deleted file mode 100644
index bad3da607..000000000
--- a/problems/best-sightseeing-pair/best_sightseeing_pair.go
+++ /dev/null
@@ -1,18 +0,0 @@
-package problem1014
-
-func maxScoreSightseeingPair(A []int) int {
- a := A[0] // a is A[i]+i
- res := 0
- for j := 1; j < len(A); j++ {
- res = max(res, a+A[j]-j)
- a = max(a, A[j]+j)
- }
- return res
-}
-
-func max(a, b int) int {
- if a > b {
- return a
- }
- return b
-}
diff --git a/problems/best-team-with-no-conflicts/README.md b/problems/best-team-with-no-conflicts/README.md
deleted file mode 100644
index 945122c01..000000000
--- a/problems/best-team-with-no-conflicts/README.md
+++ /dev/null
@@ -1,69 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../lexicographically-smallest-string-after-applying-operations "Lexicographically Smallest String After Applying Operations")
-
-[Next >](../graph-connectivity-with-threshold "Graph Connectivity With Threshold")
-
-## [1626. Best Team With No Conflicts (Medium)](https://leetcode.com/problems/best-team-with-no-conflicts "无矛盾的最佳球队")
-
-
You are the manager of a basketball team. For the upcoming tournament, you want to choose the team with the highest overall score. The score of the team is the sum of scores of all the players in the team.
-
-
However, the basketball team is not allowed to have conflicts. A conflict exists if a younger player has a strictly higher score than an older player. A conflict does not occur between players of the same age.
-
-
Given two lists, scores and ages, where each scores[i] and ages[i] represents the score and age of the ith player, respectively, return the highest overall score of all possible basketball teams.
-
-
-
Example 1:
-
-
-Input: scores = [1,3,5,10,15], ages = [1,2,3,4,5]
-Output: 34
-Explanation: You can choose all the players.
-
-
-
Example 2:
-
-
-Input: scores = [4,5,6,5], ages = [2,1,2,1]
-Output: 16
-Explanation: It is best to choose the last 3 players. Notice that you are allowed to choose multiple people of the same age.
-
-
-
Example 3:
-
-
-Input: scores = [1,2,3,5], ages = [8,9,10,1]
-Output: 6
-Explanation: It is best to choose the first 3 players.
-
-
-
-
Constraints:
-
-
-
1 <= scores.length, ages.length <= 1000
-
scores.length == ages.length
-
1 <= scores[i] <= 106
-
1 <= ages[i] <= 1000
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Hints
-
-Hint 1
-First, sort players by age and break ties by their score. You can now consider the players from left to right.
-
-
-
-Hint 2
-If you choose to include a player, you must only choose players with at least that score later on.
-
diff --git a/problems/best-time-to-buy-and-sell-stock-ii/README.md b/problems/best-time-to-buy-and-sell-stock-ii/README.md
deleted file mode 100644
index 2bd861814..000000000
--- a/problems/best-time-to-buy-and-sell-stock-ii/README.md
+++ /dev/null
@@ -1,66 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../best-time-to-buy-and-sell-stock "Best Time to Buy and Sell Stock")
-
-[Next >](../best-time-to-buy-and-sell-stock-iii "Best Time to Buy and Sell Stock III")
-
-## [122. Best Time to Buy and Sell Stock II (Medium)](https://leetcode.com/problems/best-time-to-buy-and-sell-stock-ii "买卖股票的最佳时机 II")
-
-
You are given an integer array prices where prices[i] is the price of a given stock on the ith day.
-
-
On each day, you may decide to buy and/or sell the stock. You can only hold at most one share of the stock at any time. However, you can buy it then immediately sell it on the same day.
-
-
Find and return the maximum profit you can achieve.
-
-
-
Example 1:
-
-
-Input: prices = [7,1,5,3,6,4]
-Output: 7
-Explanation: Buy on day 2 (price = 1) and sell on day 3 (price = 5), profit = 5-1 = 4.
-Then buy on day 4 (price = 3) and sell on day 5 (price = 6), profit = 6-3 = 3.
-Total profit is 4 + 3 = 7.
-
-
-
Example 2:
-
-
-Input: prices = [1,2,3,4,5]
-Output: 4
-Explanation: Buy on day 1 (price = 1) and sell on day 5 (price = 5), profit = 5-1 = 4.
-Total profit is 4.
-
-
-
Example 3:
-
-
-Input: prices = [7,6,4,3,1]
-Output: 0
-Explanation: There is no way to make a positive profit, so we never buy the stock to achieve the maximum profit of 0.
-
-
-
-
Constraints:
-
-
-
1 <= prices.length <= 3 * 104
-
0 <= prices[i] <= 104
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Greedy](../../tag/greedy/README.md)]
-
-### Similar Questions
- 1. [Best Time to Buy and Sell Stock](../best-time-to-buy-and-sell-stock) (Easy)
- 1. [Best Time to Buy and Sell Stock III](../best-time-to-buy-and-sell-stock-iii) (Hard)
- 1. [Best Time to Buy and Sell Stock IV](../best-time-to-buy-and-sell-stock-iv) (Hard)
- 1. [Best Time to Buy and Sell Stock with Cooldown](../best-time-to-buy-and-sell-stock-with-cooldown) (Medium)
- 1. [Best Time to Buy and Sell Stock with Transaction Fee](../best-time-to-buy-and-sell-stock-with-transaction-fee) (Medium)
diff --git a/problems/best-time-to-buy-and-sell-stock-ii/best_time_to_buy_and_sell_stock_ii.go b/problems/best-time-to-buy-and-sell-stock-ii/best_time_to_buy_and_sell_stock_ii.go
deleted file mode 100644
index 7260b3177..000000000
--- a/problems/best-time-to-buy-and-sell-stock-ii/best_time_to_buy_and_sell_stock_ii.go
+++ /dev/null
@@ -1,11 +0,0 @@
-package problem122
-
-func maxProfit(prices []int) int {
- maxProfit := 0
- for i, p := range prices {
- if i > 0 && p > prices[i-1] {
- maxProfit += p - prices[i-1]
- }
- }
- return maxProfit
-}
diff --git a/problems/best-time-to-buy-and-sell-stock-ii/best_time_to_buy_and_sell_stock_ii_test.go b/problems/best-time-to-buy-and-sell-stock-ii/best_time_to_buy_and_sell_stock_ii_test.go
deleted file mode 100644
index ce9cfbb4e..000000000
--- a/problems/best-time-to-buy-and-sell-stock-ii/best_time_to_buy_and_sell_stock_ii_test.go
+++ /dev/null
@@ -1,32 +0,0 @@
-package problem122
-
-import "testing"
-
-type testType struct {
- in []int
- want int
-}
-
-func TestMaxProfit(t *testing.T) {
- tests := [...]testType{
- {
- in: []int{7, 1, 5, 3, 6, 4},
- want: 7,
- },
- {
- in: []int{1, 2, 3, 4, 5},
- want: 4,
- },
- {
- in: []int{7, 6, 4, 3, 1},
- want: 0,
- },
- }
-
- for _, tt := range tests {
- got := maxProfit(tt.in)
- if got != tt.want {
- t.Fatalf("in: %v, got: %v, want: %v", tt.in, got, tt.want)
- }
- }
-}
diff --git a/problems/best-time-to-buy-and-sell-stock-iii/README.md b/problems/best-time-to-buy-and-sell-stock-iii/README.md
deleted file mode 100644
index aed420db4..000000000
--- a/problems/best-time-to-buy-and-sell-stock-iii/README.md
+++ /dev/null
@@ -1,62 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../best-time-to-buy-and-sell-stock-ii "Best Time to Buy and Sell Stock II")
-
-[Next >](../binary-tree-maximum-path-sum "Binary Tree Maximum Path Sum")
-
-## [123. Best Time to Buy and Sell Stock III (Hard)](https://leetcode.com/problems/best-time-to-buy-and-sell-stock-iii "买卖股票的最佳时机 III")
-
-
You are given an array prices where prices[i] is the price of a given stock on the ith day.
-
-
Find the maximum profit you can achieve. You may complete at most two transactions.
-
-
Note: You may not engage in multiple transactions simultaneously (i.e., you must sell the stock before you buy again).
-
-
-
Example 1:
-
-
-Input: prices = [3,3,5,0,0,3,1,4]
-Output: 6
-Explanation: Buy on day 4 (price = 0) and sell on day 6 (price = 3), profit = 3-0 = 3.
-Then buy on day 7 (price = 1) and sell on day 8 (price = 4), profit = 4-1 = 3.
-
-
Example 2:
-
-
-Input: prices = [1,2,3,4,5]
-Output: 4
-Explanation: Buy on day 1 (price = 1) and sell on day 5 (price = 5), profit = 5-1 = 4.
-Note that you cannot buy on day 1, buy on day 2 and sell them later, as you are engaging multiple transactions at the same time. You must sell before buying again.
-
-
-
Example 3:
-
-
-Input: prices = [7,6,4,3,1]
-Output: 0
-Explanation: In this case, no transaction is done, i.e. max profit = 0.
-
-
-
-
Constraints:
-
-
-
1 <= prices.length <= 105
-
0 <= prices[i] <= 105
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Similar Questions
- 1. [Best Time to Buy and Sell Stock](../best-time-to-buy-and-sell-stock) (Easy)
- 1. [Best Time to Buy and Sell Stock II](../best-time-to-buy-and-sell-stock-ii) (Medium)
- 1. [Best Time to Buy and Sell Stock IV](../best-time-to-buy-and-sell-stock-iv) (Hard)
- 1. [Maximum Sum of 3 Non-Overlapping Subarrays](../maximum-sum-of-3-non-overlapping-subarrays) (Hard)
diff --git a/problems/best-time-to-buy-and-sell-stock-iii/best_time_to_buy_and_sell_stock_iii.go b/problems/best-time-to-buy-and-sell-stock-iii/best_time_to_buy_and_sell_stock_iii.go
deleted file mode 100644
index 9575f65f6..000000000
--- a/problems/best-time-to-buy-and-sell-stock-iii/best_time_to_buy_and_sell_stock_iii.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem123
diff --git a/problems/best-time-to-buy-and-sell-stock-iii/best_time_to_buy_and_sell_stock_iii_test.go b/problems/best-time-to-buy-and-sell-stock-iii/best_time_to_buy_and_sell_stock_iii_test.go
deleted file mode 100644
index 9575f65f6..000000000
--- a/problems/best-time-to-buy-and-sell-stock-iii/best_time_to_buy_and_sell_stock_iii_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem123
diff --git a/problems/best-time-to-buy-and-sell-stock-iv/README.md b/problems/best-time-to-buy-and-sell-stock-iv/README.md
deleted file mode 100644
index 6bba064fd..000000000
--- a/problems/best-time-to-buy-and-sell-stock-iv/README.md
+++ /dev/null
@@ -1,53 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../repeated-dna-sequences "Repeated DNA Sequences")
-
-[Next >](../rotate-array "Rotate Array")
-
-## [188. Best Time to Buy and Sell Stock IV (Hard)](https://leetcode.com/problems/best-time-to-buy-and-sell-stock-iv "买卖股票的最佳时机 IV")
-
-
You are given an integer array prices where prices[i] is the price of a given stock on the ith day, and an integer k.
-
-
Find the maximum profit you can achieve. You may complete at most k transactions.
-
-
Note: You may not engage in multiple transactions simultaneously (i.e., you must sell the stock before you buy again).
-
-
-
Example 1:
-
-
-Input: k = 2, prices = [2,4,1]
-Output: 2
-Explanation: Buy on day 1 (price = 2) and sell on day 2 (price = 4), profit = 4-2 = 2.
-
-
-
Example 2:
-
-
-Input: k = 2, prices = [3,2,6,5,0,3]
-Output: 7
-Explanation: Buy on day 2 (price = 2) and sell on day 3 (price = 6), profit = 6-2 = 4. Then buy on day 5 (price = 0) and sell on day 6 (price = 3), profit = 3-0 = 3.
-
-
-
-
Constraints:
-
-
-
0 <= k <= 100
-
0 <= prices.length <= 1000
-
0 <= prices[i] <= 1000
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Similar Questions
- 1. [Best Time to Buy and Sell Stock](../best-time-to-buy-and-sell-stock) (Easy)
- 1. [Best Time to Buy and Sell Stock II](../best-time-to-buy-and-sell-stock-ii) (Medium)
- 1. [Best Time to Buy and Sell Stock III](../best-time-to-buy-and-sell-stock-iii) (Hard)
diff --git a/problems/best-time-to-buy-and-sell-stock-iv/best_time_to_buy_and_sell_stock_iv.go b/problems/best-time-to-buy-and-sell-stock-iv/best_time_to_buy_and_sell_stock_iv.go
deleted file mode 100644
index 1da2acbdd..000000000
--- a/problems/best-time-to-buy-and-sell-stock-iv/best_time_to_buy_and_sell_stock_iv.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem188
diff --git a/problems/best-time-to-buy-and-sell-stock-iv/best_time_to_buy_and_sell_stock_iv_test.go b/problems/best-time-to-buy-and-sell-stock-iv/best_time_to_buy_and_sell_stock_iv_test.go
deleted file mode 100644
index 1da2acbdd..000000000
--- a/problems/best-time-to-buy-and-sell-stock-iv/best_time_to_buy_and_sell_stock_iv_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem188
diff --git a/problems/best-time-to-buy-and-sell-stock-with-cooldown/README.md b/problems/best-time-to-buy-and-sell-stock-with-cooldown/README.md
deleted file mode 100644
index 1c8c2b76d..000000000
--- a/problems/best-time-to-buy-and-sell-stock-with-cooldown/README.md
+++ /dev/null
@@ -1,54 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../range-sum-query-2d-mutable "Range Sum Query 2D - Mutable")
-
-[Next >](../minimum-height-trees "Minimum Height Trees")
-
-## [309. Best Time to Buy and Sell Stock with Cooldown (Medium)](https://leetcode.com/problems/best-time-to-buy-and-sell-stock-with-cooldown "最佳买卖股票时机含冷冻期")
-
-
You are given an array prices where prices[i] is the price of a given stock on the ith day.
-
-
Find the maximum profit you can achieve. You may complete as many transactions as you like (i.e., buy one and sell one share of the stock multiple times) with the following restrictions:
-
-
-
After you sell your stock, you cannot buy stock on the next day (i.e., cooldown one day).
-
-
-
Note: You may not engage in multiple transactions simultaneously (i.e., you must sell the stock before you buy again).
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Similar Questions
- 1. [Best Time to Buy and Sell Stock](../best-time-to-buy-and-sell-stock) (Easy)
- 1. [Best Time to Buy and Sell Stock II](../best-time-to-buy-and-sell-stock-ii) (Medium)
diff --git a/problems/best-time-to-buy-and-sell-stock-with-cooldown/best_time_to_buy_and_sell_stock_with_cooldown.go b/problems/best-time-to-buy-and-sell-stock-with-cooldown/best_time_to_buy_and_sell_stock_with_cooldown.go
deleted file mode 100644
index 3faa85852..000000000
--- a/problems/best-time-to-buy-and-sell-stock-with-cooldown/best_time_to_buy_and_sell_stock_with_cooldown.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem309
diff --git a/problems/best-time-to-buy-and-sell-stock-with-cooldown/best_time_to_buy_and_sell_stock_with_cooldown_test.go b/problems/best-time-to-buy-and-sell-stock-with-cooldown/best_time_to_buy_and_sell_stock_with_cooldown_test.go
deleted file mode 100644
index 3faa85852..000000000
--- a/problems/best-time-to-buy-and-sell-stock-with-cooldown/best_time_to_buy_and_sell_stock_with_cooldown_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem309
diff --git a/problems/best-time-to-buy-and-sell-stock-with-transaction-fee/README.md b/problems/best-time-to-buy-and-sell-stock-with-transaction-fee/README.md
deleted file mode 100644
index 199745595..000000000
--- a/problems/best-time-to-buy-and-sell-stock-with-transaction-fee/README.md
+++ /dev/null
@@ -1,62 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../subarray-product-less-than-k "Subarray Product Less Than K")
-
-[Next >](../range-module "Range Module")
-
-## [714. Best Time to Buy and Sell Stock with Transaction Fee (Medium)](https://leetcode.com/problems/best-time-to-buy-and-sell-stock-with-transaction-fee "买卖股票的最佳时机含手续费")
-
-
You are given an array prices where prices[i] is the price of a given stock on the ith day, and an integer fee representing a transaction fee.
-
-
Find the maximum profit you can achieve. You may complete as many transactions as you like, but you need to pay the transaction fee for each transaction.
-
-
Note: You may not engage in multiple transactions simultaneously (i.e., you must sell the stock before you buy again).
-
-
-
Example 1:
-
-
-Input: prices = [1,3,2,8,4,9], fee = 2
-Output: 8
-Explanation: The maximum profit can be achieved by:
-- Buying at prices[0] = 1
-- Selling at prices[3] = 8
-- Buying at prices[4] = 4
-- Selling at prices[5] = 9
-The total profit is ((8 - 1) - 2) + ((9 - 4) - 2) = 8.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Greedy](../../tag/greedy/README.md)]
-
-### Similar Questions
- 1. [Best Time to Buy and Sell Stock II](../best-time-to-buy-and-sell-stock-ii) (Medium)
-
-### Hints
-
-Hint 1
-Consider the first K stock prices. At the end, the only legal states are that you don't own a share of stock, or that you do. Calculate the most profit you could have under each of these two cases.
-
diff --git a/problems/best-time-to-buy-and-sell-stock-with-transaction-fee/best_time_to_buy_and_sell_stock_with_transaction_fee.go b/problems/best-time-to-buy-and-sell-stock-with-transaction-fee/best_time_to_buy_and_sell_stock_with_transaction_fee.go
deleted file mode 100644
index 8a1fc1d4c..000000000
--- a/problems/best-time-to-buy-and-sell-stock-with-transaction-fee/best_time_to_buy_and_sell_stock_with_transaction_fee.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem714
diff --git a/problems/best-time-to-buy-and-sell-stock-with-transaction-fee/best_time_to_buy_and_sell_stock_with_transaction_fee_test.go b/problems/best-time-to-buy-and-sell-stock-with-transaction-fee/best_time_to_buy_and_sell_stock_with_transaction_fee_test.go
deleted file mode 100644
index 8a1fc1d4c..000000000
--- a/problems/best-time-to-buy-and-sell-stock-with-transaction-fee/best_time_to_buy_and_sell_stock_with_transaction_fee_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem714
diff --git a/problems/best-time-to-buy-and-sell-stock/README.md b/problems/best-time-to-buy-and-sell-stock/README.md
deleted file mode 100644
index f421fa34b..000000000
--- a/problems/best-time-to-buy-and-sell-stock/README.md
+++ /dev/null
@@ -1,55 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../triangle "Triangle")
-
-[Next >](../best-time-to-buy-and-sell-stock-ii "Best Time to Buy and Sell Stock II")
-
-## [121. Best Time to Buy and Sell Stock (Easy)](https://leetcode.com/problems/best-time-to-buy-and-sell-stock "买卖股票的最佳时机")
-
-
You are given an array prices where prices[i] is the price of a given stock on the ith day.
-
-
You want to maximize your profit by choosing a single day to buy one stock and choosing a different day in the future to sell that stock.
-
-
Return the maximum profit you can achieve from this transaction. If you cannot achieve any profit, return 0.
-
-
-
Example 1:
-
-
-Input: prices = [7,1,5,3,6,4]
-Output: 5
-Explanation: Buy on day 2 (price = 1) and sell on day 5 (price = 6), profit = 6-1 = 5.
-Note that buying on day 2 and selling on day 1 is not allowed because you must buy before you sell.
-
-
-
Example 2:
-
-
-Input: prices = [7,6,4,3,1]
-Output: 0
-Explanation: In this case, no transactions are done and the max profit = 0.
-
-
-
-
Constraints:
-
-
-
1 <= prices.length <= 105
-
0 <= prices[i] <= 104
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Similar Questions
- 1. [Maximum Subarray](../maximum-subarray) (Easy)
- 1. [Best Time to Buy and Sell Stock II](../best-time-to-buy-and-sell-stock-ii) (Medium)
- 1. [Best Time to Buy and Sell Stock III](../best-time-to-buy-and-sell-stock-iii) (Hard)
- 1. [Best Time to Buy and Sell Stock IV](../best-time-to-buy-and-sell-stock-iv) (Hard)
- 1. [Best Time to Buy and Sell Stock with Cooldown](../best-time-to-buy-and-sell-stock-with-cooldown) (Medium)
diff --git a/problems/best-time-to-buy-and-sell-stock/best_time_to_buy_and_sell_stock.go b/problems/best-time-to-buy-and-sell-stock/best_time_to_buy_and_sell_stock.go
deleted file mode 100644
index fb2cd65fe..000000000
--- a/problems/best-time-to-buy-and-sell-stock/best_time_to_buy_and_sell_stock.go
+++ /dev/null
@@ -1,13 +0,0 @@
-package problem121
-
-func maxProfit(prices []int) int {
- ans, min := 0, 0
- for i, v := range prices {
- if v < prices[min] {
- min = i
- } else if v-prices[min] > ans {
- ans = v - prices[min]
- }
- }
- return ans
-}
diff --git a/problems/best-time-to-buy-and-sell-stock/best_time_to_buy_and_sell_stock_test.go b/problems/best-time-to-buy-and-sell-stock/best_time_to_buy_and_sell_stock_test.go
deleted file mode 100644
index 6f7bb2251..000000000
--- a/problems/best-time-to-buy-and-sell-stock/best_time_to_buy_and_sell_stock_test.go
+++ /dev/null
@@ -1,35 +0,0 @@
-package problem121
-
-import "testing"
-
-type testType struct {
- in []int
- want int
-}
-
-func TestMaxProfit(t *testing.T) {
- tests := [...]testType{
- {
- in: []int{7, 1, 5, 3, 6, 4},
- want: 5,
- },
- {
- in: []int{7, 6, 4, 3, 1},
- want: 0,
- },
- {
- in: []int{1, 1, 1, 1, 1},
- want: 0,
- },
- {
- in: []int{},
- want: 0,
- },
- }
- for _, tt := range tests {
- got := maxProfit(tt.in)
- if got != tt.want {
- t.Fatalf("in: %v, got: %v, want: %v", tt.in, got, tt.want)
- }
- }
-}
diff --git a/problems/big-countries/README.md b/problems/big-countries/README.md
deleted file mode 100644
index ff5363393..000000000
--- a/problems/big-countries/README.md
+++ /dev/null
@@ -1,46 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../longest-harmonious-subsequence "Longest Harmonious Subsequence")
-
-[Next >](../classes-more-than-5-students "Classes More Than 5 Students")
-
-## [595. Big Countries (Easy)](https://leetcode.com/problems/big-countries "大的国家")
-
-
There is a table World
-
-
-+-----------------+------------+------------+--------------+---------------+
-| name | continent | area | population | gdp |
-+-----------------+------------+------------+--------------+---------------+
-| Afghanistan | Asia | 652230 | 25500100 | 20343000 |
-| Albania | Europe | 28748 | 2831741 | 12960000 |
-| Algeria | Africa | 2381741 | 37100000 | 188681000 |
-| Andorra | Europe | 468 | 78115 | 3712000 |
-| Angola | Africa | 1246700 | 20609294 | 100990000 |
-+-----------------+------------+------------+--------------+---------------+
-
-
-
A country is big if it has an area of bigger than 3 million square km or a population of more than 25 million.
-
-
Write a SQL solution to output big countries' name, population and area.
-
-
For example, according to the above table, we should output:
-
-
-+--------------+-------------+--------------+
-| name | population | area |
-+--------------+-------------+--------------+
-| Afghanistan | 25500100 | 652230 |
-| Algeria | 37100000 | 2381741 |
-+--------------+-------------+--------------+
-
-
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/big-countries/big_countries.sql b/problems/big-countries/big_countries.sql
deleted file mode 100644
index bd4c7cee4..000000000
--- a/problems/big-countries/big_countries.sql
+++ /dev/null
@@ -1,11 +0,0 @@
-# Write your MySQL query statement below
-
-SELECT
- `name`,
- `population`,
- `area`
-FROM
- `World`
-WHERE
- `area` > 3000000
- OR `population` > 25000000;
diff --git a/problems/big-countries/mysql_schemas.sql b/problems/big-countries/mysql_schemas.sql
deleted file mode 100644
index 44994d550..000000000
--- a/problems/big-countries/mysql_schemas.sql
+++ /dev/null
@@ -1,7 +0,0 @@
-Create table If Not Exists World (name varchar(255), continent varchar(255), area int, population int, gdp int);
-Truncate table World;
-insert into World (name, continent, area, population, gdp) values ('Afghanistan', 'Asia', '652230', '25500100', '20343000000');
-insert into World (name, continent, area, population, gdp) values ('Albania', 'Europe', '28748', '2831741', '12960000000');
-insert into World (name, continent, area, population, gdp) values ('Algeria', 'Africa', '2381741', '37100000', '188681000000');
-insert into World (name, continent, area, population, gdp) values ('Andorra', 'Europe', '468', '78115', '3712000000');
-insert into World (name, continent, area, population, gdp) values ('Angola', 'Africa', '1246700', '20609294', '100990000000');
diff --git a/problems/biggest-single-number/README.md b/problems/biggest-single-number/README.md
deleted file mode 100644
index bb71e7128..000000000
--- a/problems/biggest-single-number/README.md
+++ /dev/null
@@ -1,44 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../students-report-by-geography "Students Report By Geography")
-
-[Next >](../not-boring-movies "Not Boring Movies")
-
-## [619. Biggest Single Number (Easy)](https://leetcode.com/problems/biggest-single-number "只出现一次的最大数字")
-
-
Table my_numbers contains many numbers in column num including duplicated ones.
-Can you write a SQL query to find the biggest number, which only appears once.
-For the sample data above, your query should return the following result:
-
-
-+---+
-|num|
-+---+
-| 6 |
-
-Note:
-If there is no such number, just output null.
-
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/biggest-single-number/biggest_single_number.sql b/problems/biggest-single-number/biggest_single_number.sql
deleted file mode 100644
index 3e097c7a8..000000000
--- a/problems/biggest-single-number/biggest_single_number.sql
+++ /dev/null
@@ -1,9 +0,0 @@
-# Write your MySQL query statement below
-
-SELECT MAX(num) AS num
-FROM
- (SELECT num
- FROM
- `my_numbers`
- GROUP BY num
- HAVING COUNT(num) = 1) AS t;
diff --git a/problems/biggest-single-number/mysql_schemas.sql b/problems/biggest-single-number/mysql_schemas.sql
deleted file mode 100644
index 99c31bfa5..000000000
--- a/problems/biggest-single-number/mysql_schemas.sql
+++ /dev/null
@@ -1,10 +0,0 @@
-Create table If Not Exists my_numbers (num int);
-Truncate table my_numbers;
-insert into my_numbers (num) values ('8');
-insert into my_numbers (num) values ('8');
-insert into my_numbers (num) values ('3');
-insert into my_numbers (num) values ('3');
-insert into my_numbers (num) values ('1');
-insert into my_numbers (num) values ('4');
-insert into my_numbers (num) values ('5');
-insert into my_numbers (num) values ('6');
diff --git a/problems/biggest-window-between-visits/README.md b/problems/biggest-window-between-visits/README.md
deleted file mode 100644
index b6e868d16..000000000
--- a/problems/biggest-window-between-visits/README.md
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../largest-subarray-length-k "Largest Subarray Length K")
-
-[Next >](../maximum-units-on-a-truck "Maximum Units on a Truck")
-
-## [1709. Biggest Window Between Visits (Medium)](https://leetcode.com/problems/biggest-window-between-visits "访问日期之间最大的空档期")
-
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/biggest-window-between-visits/mysql_schemas.sql b/problems/biggest-window-between-visits/mysql_schemas.sql
deleted file mode 100644
index fba17a19a..000000000
--- a/problems/biggest-window-between-visits/mysql_schemas.sql
+++ /dev/null
@@ -1,8 +0,0 @@
-Create table If Not Exists UserVisits(user_id int, visit_date date);
-Truncate table UserVisits;
-insert into UserVisits (user_id, visit_date) values ('1', '2020-11-28');
-insert into UserVisits (user_id, visit_date) values ('1', '2020-10-20');
-insert into UserVisits (user_id, visit_date) values ('1', '2020-12-3');
-insert into UserVisits (user_id, visit_date) values ('2', '2020-10-5');
-insert into UserVisits (user_id, visit_date) values ('2', '2020-12-9');
-insert into UserVisits (user_id, visit_date) values ('3', '2020-11-11');
diff --git a/problems/binary-gap/README.md b/problems/binary-gap/README.md
deleted file mode 100644
index ba1264dc0..000000000
--- a/problems/binary-gap/README.md
+++ /dev/null
@@ -1,72 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../transpose-matrix "Transpose Matrix")
-
-[Next >](../reordered-power-of-2 "Reordered Power of 2")
-
-## [868. Binary Gap (Easy)](https://leetcode.com/problems/binary-gap "二进制间距")
-
-
Given a positive integer n, find and return the longest distance between any two adjacent1's in the binary representation of n. If there are no two adjacent 1's, return 0.
-
-
Two 1's are adjacent if there are only 0's separating them (possibly no 0's). The distance between two 1's is the absolute difference between their bit positions. For example, the two 1's in "1001" have a distance of 3.
-
-
-
Example 1:
-
-
-Input: n = 22
-Output: 2
-Explanation: 22 in binary is "10110".
-The first adjacent pair of 1's is "10110" with a distance of 2.
-The second adjacent pair of 1's is "10110" with a distance of 1.
-The answer is the largest of these two distances, which is 2.
-Note that "10110" is not a valid pair since there is a 1 separating the two 1's underlined.
-
-
-
Example 2:
-
-
-Input: n = 5
-Output: 2
-Explanation: 5 in binary is "101".
-
-
-
Example 3:
-
-
-Input: n = 6
-Output: 1
-Explanation: 6 in binary is "110".
-
-
-
Example 4:
-
-
-Input: n = 8
-Output: 0
-Explanation: 8 in binary is "1000".
-There aren't any adjacent pairs of 1's in the binary representation of 8, so we return 0.
-
We define xi as the number whose binary representation is the subarray nums[0..i] (from most-significant-bit to least-significant-bit).
-
-
-
For example, if nums = [1,0,1], then x0 = 1, x1 = 2, and x2 = 5.
-
-
-
Return an array of booleans answer where answer[i] is true if xi is divisible by 5.
-
-
-
Example 1:
-
-
-Input: nums = [0,1,1]
-Output: [true,false,false]
-Explanation: The input numbers in binary are 0, 01, 011; which are 0, 1, and 3 in base-10.
-Only the first number is divisible by 5, so answer[0] is true.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
-
-### Hints
-
-Hint 1
-If X is the first i digits of the array as a binary number, then 2X + A[i] is the first i+1 digits.
-
diff --git a/problems/binary-prefix-divisible-by-5/binary_prefix_divisible_by_5.go b/problems/binary-prefix-divisible-by-5/binary_prefix_divisible_by_5.go
deleted file mode 100644
index 57fadaa99..000000000
--- a/problems/binary-prefix-divisible-by-5/binary_prefix_divisible_by_5.go
+++ /dev/null
@@ -1,10 +0,0 @@
-package problem1018
-
-func prefixesDivBy5(A []int) []bool {
- ans, v := make([]bool, len(A)), 0
- for i, b := range A {
- v = (v<<1 + b) % 5
- ans[i] = v == 0
- }
- return ans
-}
diff --git a/problems/binary-prefix-divisible-by-5/binary_prefix_divisible_by_5_test.go b/problems/binary-prefix-divisible-by-5/binary_prefix_divisible_by_5_test.go
deleted file mode 100644
index 113d6d1c8..000000000
--- a/problems/binary-prefix-divisible-by-5/binary_prefix_divisible_by_5_test.go
+++ /dev/null
@@ -1,42 +0,0 @@
-package problem1018
-
-import (
- "reflect"
- "testing"
-)
-
-type testType struct {
- in []int
- want []bool
-}
-
-func TestPrefixesDivBy5(t *testing.T) {
- tests := [...]testType{
- {
- in: []int{0, 1, 1},
- want: []bool{true, false, false},
- },
- {
- in: []int{1, 1, 1},
- want: []bool{false, false, false},
- },
- {
- in: []int{0, 1, 1, 1, 1, 1},
- want: []bool{true, false, false, false, true, false},
- },
- {
- in: []int{1, 1, 1, 0, 1},
- want: []bool{false, false, false, false, false},
- },
- {
- in: []int{1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 1, 0},
- want: []bool{false, false, true, false, false, false, false, false, false, false, true, true, true, true, true, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, true, false, false, false, true, false, false, true, false, false, true, true, true, true, true, true, true, false, false, true, false, false, false, false, true, true},
- },
- }
- for _, tt := range tests {
- got := prefixesDivBy5(tt.in)
- if !reflect.DeepEqual(got, tt.want) {
- t.Fatalf("in: %v, got: %v, want: %v", tt.in, got, tt.want)
- }
- }
-}
diff --git a/problems/binary-search-tree-iterator-ii/README.md b/problems/binary-search-tree-iterator-ii/README.md
deleted file mode 100644
index b4e7ca01b..000000000
--- a/problems/binary-search-tree-iterator-ii/README.md
+++ /dev/null
@@ -1,38 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../check-if-string-is-transformable-with-substring-sort-operations "Check If String Is Transformable With Substring Sort Operations")
-
-[Next >](../bank-account-summary-ii "Bank Account Summary II")
-
-## [1586. Binary Search Tree Iterator II (Medium)](https://leetcode.com/problems/binary-search-tree-iterator-ii "二叉搜索树迭代器 II")
-
-
-
-### Related Topics
- [[Stack](../../tag/stack/README.md)]
- [[Tree](../../tag/tree/README.md)]
- [[Design](../../tag/design/README.md)]
- [[Binary Search Tree](../../tag/binary-search-tree/README.md)]
- [[Binary Tree](../../tag/binary-tree/README.md)]
- [[Iterator](../../tag/iterator/README.md)]
-
-### Hints
-
-Hint 1
-The inorder traversal of a BST gives us the elements in a sorted order.
-
-
-
-Hint 2
-We can use a stack to simulate the inorder traversal of the BST.
-
-
-
-Hint 3
-We can use another stack as a buffer to store numbers returned from calls to next and use this buffer whenever prev is called.
-
diff --git a/problems/binary-search-tree-iterator/README.md b/problems/binary-search-tree-iterator/README.md
deleted file mode 100644
index a76bdfa24..000000000
--- a/problems/binary-search-tree-iterator/README.md
+++ /dev/null
@@ -1,79 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../factorial-trailing-zeroes "Factorial Trailing Zeroes")
-
-[Next >](../dungeon-game "Dungeon Game")
-
-## [173. Binary Search Tree Iterator (Medium)](https://leetcode.com/problems/binary-search-tree-iterator "二叉搜索树迭代器")
-
-
Implement the BSTIterator class that represents an iterator over the in-order traversal of a binary search tree (BST):
-
-
-
BSTIterator(TreeNode root) Initializes an object of the BSTIterator class. The root of the BST is given as part of the constructor. The pointer should be initialized to a non-existent number smaller than any element in the BST.
-
boolean hasNext() Returns true if there exists a number in the traversal to the right of the pointer, otherwise returns false.
-
int next() Moves the pointer to the right, then returns the number at the pointer.
-
-
-
Notice that by initializing the pointer to a non-existent smallest number, the first call to next() will return the smallest element in the BST.
-
-
You may assume that next() calls will always be valid. That is, there will be at least a next number in the in-order traversal when next() is called.
Given the root of a Binary Search Tree (BST), convert it to a Greater Tree such that every key of the original BST is changed to the original key plus the sum of all keys greater than the original key in BST.
-
-
As a reminder, a binary search tree is a tree that satisfies these constraints:
-
-
-
The left subtree of a node contains only nodes with keys less than the node's key.
-
The right subtree of a node contains only nodes with keys greater than the node's key.
-
Both the left and right subtrees must also be binary search trees.
-
-### Related Topics
- [[Tree](../../tag/tree/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Binary Search Tree](../../tag/binary-search-tree/README.md)]
- [[Binary Tree](../../tag/binary-tree/README.md)]
-
-### Hints
-
-Hint 1
-What traversal method organizes all nodes in sorted order?
-
diff --git a/problems/binary-search/README.md b/problems/binary-search/README.md
deleted file mode 100644
index 782afcd83..000000000
--- a/problems/binary-search/README.md
+++ /dev/null
@@ -1,50 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../kth-largest-element-in-a-stream "Kth Largest Element in a Stream")
-
-[Next >](../design-hashset "Design HashSet")
-
-## [704. Binary Search (Easy)](https://leetcode.com/problems/binary-search "二分查找")
-
-
Given an array of integers nums which is sorted in ascending order, and an integer target, write a function to search target in nums. If target exists, then return its index. Otherwise, return -1.
-
-
You must write an algorithm with O(log n) runtime complexity.
-
-
-
Example 1:
-
-
-Input: nums = [-1,0,3,5,9,12], target = 9
-Output: 4
-Explanation: 9 exists in nums and its index is 4
-
-
-
Example 2:
-
-
-Input: nums = [-1,0,3,5,9,12], target = 2
-Output: -1
-Explanation: 2 does not exist in nums so return -1
-
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 104
-
-104 < nums[i], target < 104
-
All the integers in nums are unique.
-
nums is sorted in ascending order.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
-
-### Similar Questions
- 1. [Search in a Sorted Array of Unknown Size](../search-in-a-sorted-array-of-unknown-size) (Medium)
diff --git a/problems/binary-search/binary_search.go b/problems/binary-search/binary_search.go
deleted file mode 100644
index 9a16a73fc..000000000
--- a/problems/binary-search/binary_search.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem704
diff --git a/problems/binary-search/binary_search_test.go b/problems/binary-search/binary_search_test.go
deleted file mode 100644
index 9a16a73fc..000000000
--- a/problems/binary-search/binary_search_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem704
diff --git a/problems/binary-searchable-numbers-in-an-unsorted-array/README.md b/problems/binary-searchable-numbers-in-an-unsorted-array/README.md
deleted file mode 100644
index 6bebaaf0d..000000000
--- a/problems/binary-searchable-numbers-in-an-unsorted-array/README.md
+++ /dev/null
@@ -1,30 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../employees-with-missing-information "Employees With Missing Information")
-
-[Next >](../number-of-strings-that-appear-as-substrings-in-word "Number of Strings That Appear as Substrings in Word")
-
-## [1966. Binary Searchable Numbers in an Unsorted Array (Medium)](https://leetcode.com/problems/binary-searchable-numbers-in-an-unsorted-array "未排序数组中的可被二分搜索的数")
-
-
-
-### Hints
-
-Hint 1
-The target will not be found if it is removed from the sequence. When does this occur?
-
-
-
-Hint 2
-If a pivot is to the left of and is greater than the target, then the target will be removed. The same occurs when the pivot is to the right of and is less than the target.
-
-
-
-Hint 3
-Since any element can be chosen as the pivot, for any target NOT to be removed, the condition described in the previous hint must never occur.
-
diff --git a/problems/binary-string-with-substrings-representing-1-to-n/README.md b/problems/binary-string-with-substrings-representing-1-to-n/README.md
deleted file mode 100644
index 86dfded8d..000000000
--- a/problems/binary-string-with-substrings-representing-1-to-n/README.md
+++ /dev/null
@@ -1,42 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../smallest-integer-divisible-by-k "Smallest Integer Divisible by K")
-
-[Next >](../convert-to-base-2 "Convert to Base -2")
-
-## [1016. Binary String With Substrings Representing 1 To N (Medium)](https://leetcode.com/problems/binary-string-with-substrings-representing-1-to-n "子串能表示从 1 到 N 数字的二进制串")
-
-
Given a binary string s and a positive integer n, return true if the binary representation of all the integers in the range [1, n] are substrings of s, or false otherwise.
-
-
A substring is a contiguous sequence of characters within a string.
-
-
-
Example 1:
-
Input: s = "0110", n = 3
-Output: true
-
Example 2:
-
Input: s = "0110", n = 4
-Output: false
-
-
-
Constraints:
-
-
-
1 <= s.length <= 1000
-
s[i] is either '0' or '1'.
-
1 <= n <= 109
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
-
-### Hints
-
-Hint 1
-We only need to check substrings of length at most 20, because 10^6 has 20 bits.
-
diff --git a/problems/binary-string-with-substrings-representing-1-to-n/binary_string_with_substrings_representing_1_to_n.go b/problems/binary-string-with-substrings-representing-1-to-n/binary_string_with_substrings_representing_1_to_n.go
deleted file mode 100644
index be4db217c..000000000
--- a/problems/binary-string-with-substrings-representing-1-to-n/binary_string_with_substrings_representing_1_to_n.go
+++ /dev/null
@@ -1,33 +0,0 @@
-package problem1016
-
-import "strings"
-
-func queryString(S string, N int) bool {
- end := N >> 1
- for N >= end {
- if !strings.Contains(S, binaryString(N)) {
- return false
- }
- N--
- }
- return true
-}
-
-func binaryString(n int) string {
- B := make([]byte, 0, 30)
- for n > 0 {
- B = append(B, byte(n&1)+'0')
- n >>= 1
- }
- swap(B)
- return string(B)
-}
-
-func swap(B []byte) {
- i, j := 0, len(B)-1
- for i < j {
- B[i], B[j] = B[j], B[i]
- i++
- j--
- }
-}
diff --git a/problems/binary-subarrays-with-sum/README.md b/problems/binary-subarrays-with-sum/README.md
deleted file mode 100644
index 775b0833f..000000000
--- a/problems/binary-subarrays-with-sum/README.md
+++ /dev/null
@@ -1,51 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../unique-email-addresses "Unique Email Addresses")
-
-[Next >](../minimum-falling-path-sum "Minimum Falling Path Sum")
-
-## [930. Binary Subarrays With Sum (Medium)](https://leetcode.com/problems/binary-subarrays-with-sum "和相同的二元子数组")
-
-
Given a binary array nums and an integer goal, return the number of non-empty subarrays with a sumgoal.
-
-
A subarray is a contiguous part of the array.
-
-
-
Example 1:
-
-
-Input: nums = [1,0,1,0,1], goal = 2
-Output: 4
-Explanation: The 4 subarrays are bolded and underlined below:
-[1,0,1,0,1]
-[1,0,1,0,1]
-[1,0,1,0,1]
-[1,0,1,0,1]
-
You are given the root of a binary tree. We install cameras on the tree nodes where each camera at a node can monitor its parent, itself, and its immediate children.
-
-
Return the minimum number of cameras needed to monitor all nodes of the tree.
-
-
-
Example 1:
-
-
-Input: root = [0,0,null,0,0]
-Output: 1
-Explanation: One camera is enough to monitor all nodes if placed as shown.
-
-
-
Example 2:
-
-
-Input: root = [0,0,null,0,null,0,null,null,0]
-Output: 2
-Explanation: At least two cameras are needed to monitor all nodes of the tree. The above image shows one of the valid configurations of camera placement.
-
-
-
-
Constraints:
-
-
-
The number of nodes in the tree is in the range [1, 1000].
-
Node.val == 0
-
-
-### Related Topics
- [[Tree](../../tag/tree/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Binary Tree](../../tag/binary-tree/README.md)]
-
-### Similar Questions
- 1. [Distribute Coins in Binary Tree](../distribute-coins-in-binary-tree) (Medium)
diff --git a/problems/binary-tree-cameras/binary_tree_cameras.go b/problems/binary-tree-cameras/binary_tree_cameras.go
deleted file mode 100644
index 3f5cdd844..000000000
--- a/problems/binary-tree-cameras/binary_tree_cameras.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem968
diff --git a/problems/binary-tree-coloring-game/README.md b/problems/binary-tree-coloring-game/README.md
deleted file mode 100644
index d1f3a7289..000000000
--- a/problems/binary-tree-coloring-game/README.md
+++ /dev/null
@@ -1,65 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../decrease-elements-to-make-array-zigzag "Decrease Elements To Make Array Zigzag")
-
-[Next >](../snapshot-array "Snapshot Array")
-
-## [1145. Binary Tree Coloring Game (Medium)](https://leetcode.com/problems/binary-tree-coloring-game "二叉树着色游戏")
-
-
Two players play a turn based game on a binary tree. We are given the root of this binary tree, and the number of nodes n in the tree. n is odd, and each node has a distinct value from 1 to n.
-
-
Initially, the first player names a value x with 1 <= x <= n, and the second player names a value y with 1 <= y <= n and y != x. The first player colors the node with value x red, and the second player colors the node with value y blue.
-
-
Then, the players take turns starting with the first player. In each turn, that player chooses a node of their color (red if player 1, blue if player 2) and colors an uncolored neighbor of the chosen node (either the left child, right child, or parent of the chosen node.)
-
-
If (and only if) a player cannot choose such a node in this way, they must pass their turn. If both players pass their turn, the game ends, and the winner is the player that colored more nodes.
-
-
You are the second player. If it is possible to choose such a y to ensure you win the game, return true. If it is not possible, return false.
-
-
-
Example 1:
-
-
-Input: root = [1,2,3,4,5,6,7,8,9,10,11], n = 11, x = 3
-Output: true
-Explanation: The second player can choose the node with value 2.
-
-
-
Example 2:
-
-
-Input: root = [1,2,3], n = 3, x = 1
-Output: false
-
-
-
-
Constraints:
-
-
-
The number of nodes in the tree is n.
-
1 <= x <= n <= 100
-
n is odd.
-
1 <= Node.val <= n
-
All the values of the tree are unique.
-
-
-### Related Topics
- [[Tree](../../tag/tree/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Binary Tree](../../tag/binary-tree/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/binary-tree-inorder-traversal/README.md b/problems/binary-tree-inorder-traversal/README.md
deleted file mode 100644
index a64db82ed..000000000
--- a/problems/binary-tree-inorder-traversal/README.md
+++ /dev/null
@@ -1,78 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../restore-ip-addresses "Restore IP Addresses")
-
-[Next >](../unique-binary-search-trees-ii "Unique Binary Search Trees II")
-
-## [94. Binary Tree Inorder Traversal (Easy)](https://leetcode.com/problems/binary-tree-inorder-traversal "二叉树的中序遍历")
-
-
Given the root of a binary tree, return the inorder traversal of its nodes' values.
-
-
-
Example 1:
-
-
-Input: root = [1,null,2,3]
-Output: [1,3,2]
-
-
-
Example 2:
-
-
-Input: root = []
-Output: []
-
-
-
Example 3:
-
-
-Input: root = [1]
-Output: [1]
-
-
-
Example 4:
-
-
-Input: root = [1,2]
-Output: [2,1]
-
-
-
Example 5:
-
-
-Input: root = [1,null,2]
-Output: [1,2]
-
-
-
-
Constraints:
-
-
-
The number of nodes in the tree is in the range [0, 100].
-
-100 <= Node.val <= 100
-
-
-
-Follow up: Recursive solution is trivial, could you do it iteratively?
-
-### Related Topics
- [[Stack](../../tag/stack/README.md)]
- [[Tree](../../tag/tree/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Binary Tree](../../tag/binary-tree/README.md)]
-
-### Similar Questions
- 1. [Validate Binary Search Tree](../validate-binary-search-tree) (Medium)
- 1. [Binary Tree Preorder Traversal](../binary-tree-preorder-traversal) (Easy)
- 1. [Binary Tree Postorder Traversal](../binary-tree-postorder-traversal) (Easy)
- 1. [Binary Search Tree Iterator](../binary-search-tree-iterator) (Medium)
- 1. [Kth Smallest Element in a BST](../kth-smallest-element-in-a-bst) (Medium)
- 1. [Closest Binary Search Tree Value II](../closest-binary-search-tree-value-ii) (Hard)
- 1. [Inorder Successor in BST](../inorder-successor-in-bst) (Medium)
- 1. [Convert Binary Search Tree to Sorted Doubly Linked List](../convert-binary-search-tree-to-sorted-doubly-linked-list) (Medium)
- 1. [Minimum Distance Between BST Nodes](../minimum-distance-between-bst-nodes) (Easy)
diff --git a/problems/binary-tree-inorder-traversal/binary_tree_inorder_traversal.go b/problems/binary-tree-inorder-traversal/binary_tree_inorder_traversal.go
deleted file mode 100644
index e24e5d8e9..000000000
--- a/problems/binary-tree-inorder-traversal/binary_tree_inorder_traversal.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem94
diff --git a/problems/binary-tree-inorder-traversal/binary_tree_inorder_traversal_test.go b/problems/binary-tree-inorder-traversal/binary_tree_inorder_traversal_test.go
deleted file mode 100644
index e24e5d8e9..000000000
--- a/problems/binary-tree-inorder-traversal/binary_tree_inorder_traversal_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem94
diff --git a/problems/binary-tree-level-order-traversal-ii/README.md b/problems/binary-tree-level-order-traversal-ii/README.md
deleted file mode 100644
index 4cf8b3360..000000000
--- a/problems/binary-tree-level-order-traversal-ii/README.md
+++ /dev/null
@@ -1,53 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../construct-binary-tree-from-inorder-and-postorder-traversal "Construct Binary Tree from Inorder and Postorder Traversal")
-
-[Next >](../convert-sorted-array-to-binary-search-tree "Convert Sorted Array to Binary Search Tree")
-
-## [107. Binary Tree Level Order Traversal II (Medium)](https://leetcode.com/problems/binary-tree-level-order-traversal-ii "二叉树的层序遍历 II")
-
-
Given the root of a binary tree, return the bottom-up level order traversal of its nodes' values. (i.e., from left to right, level by level from leaf to root).
The number of nodes in the tree is in the range [0, 2000].
-
-1000 <= Node.val <= 1000
-
-
-### Related Topics
- [[Tree](../../tag/tree/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Binary Tree](../../tag/binary-tree/README.md)]
-
-### Similar Questions
- 1. [Binary Tree Zigzag Level Order Traversal](../binary-tree-zigzag-level-order-traversal) (Medium)
- 1. [Binary Tree Level Order Traversal II](../binary-tree-level-order-traversal-ii) (Medium)
- 1. [Minimum Depth of Binary Tree](../minimum-depth-of-binary-tree) (Easy)
- 1. [Binary Tree Vertical Order Traversal](../binary-tree-vertical-order-traversal) (Medium)
- 1. [Average of Levels in Binary Tree](../average-of-levels-in-binary-tree) (Easy)
- 1. [N-ary Tree Level Order Traversal](../n-ary-tree-level-order-traversal) (Medium)
- 1. [Cousins in Binary Tree](../cousins-in-binary-tree) (Easy)
diff --git a/problems/binary-tree-level-order-traversal/binary_tree_level_order_traversal.go b/problems/binary-tree-level-order-traversal/binary_tree_level_order_traversal.go
deleted file mode 100644
index 2a1ce7079..000000000
--- a/problems/binary-tree-level-order-traversal/binary_tree_level_order_traversal.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem102
diff --git a/problems/binary-tree-level-order-traversal/binary_tree_level_order_traversal_test.go b/problems/binary-tree-level-order-traversal/binary_tree_level_order_traversal_test.go
deleted file mode 100644
index 2a1ce7079..000000000
--- a/problems/binary-tree-level-order-traversal/binary_tree_level_order_traversal_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem102
diff --git a/problems/binary-tree-longest-consecutive-sequence-ii/README.md b/problems/binary-tree-longest-consecutive-sequence-ii/README.md
deleted file mode 100644
index 04a3c7e03..000000000
--- a/problems/binary-tree-longest-consecutive-sequence-ii/README.md
+++ /dev/null
@@ -1,52 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../split-array-with-equal-sum "Split Array with Equal Sum")
-
-[Next >](../game-play-analysis-iv "Game Play Analysis IV")
-
-## [549. Binary Tree Longest Consecutive Sequence II (Medium)](https://leetcode.com/problems/binary-tree-longest-consecutive-sequence-ii "二叉树中最长的连续序列")
-
-
Given a binary tree, you need to find the length of Longest Consecutive Path in Binary Tree.
-
-
Especially, this path can be either increasing or decreasing. For example, [1,2,3,4] and [4,3,2,1] are both considered valid, but the path [1,2,4,3] is not valid. On the other hand, the path can be in the child-Parent-child order, where not necessarily be parent-child order.
-
-
Example 1:
-
-
-Input:
- 1
- / \
- 2 3
-Output: 2
-Explanation: The longest consecutive path is [1, 2] or [2, 1].
-
-
-
-
-
Example 2:
-
-
-Input:
- 2
- / \
- 1 3
-Output: 3
-Explanation: The longest consecutive path is [1, 2, 3] or [3, 2, 1].
-
-
-
-
-
Note: All the values of tree nodes are in the range of [-1e7, 1e7].
Given a binary tree, find the length of the longest consecutive sequence path.
-
-
The path refers to any sequence of nodes from some starting node to any node in the tree along the parent-child connections. The longest consecutive path need to be from parent to child (cannot be the reverse).
A path in a binary tree is a sequence of nodes where each pair of adjacent nodes in the sequence has an edge connecting them. A node can only appear in the sequence at most once. Note that the path does not need to pass through the root.
-
-
The path sum of a path is the sum of the node's values in the path.
-
-
Given the root of a binary tree, return the maximum path sum of any non-empty path.
-
-
-
Example 1:
-
-
-Input: root = [1,2,3]
-Output: 6
-Explanation: The optimal path is 2 -> 1 -> 3 with a path sum of 2 + 1 + 3 = 6.
-
-
-
Example 2:
-
-
-Input: root = [-10,9,20,null,null,15,7]
-Output: 42
-Explanation: The optimal path is 15 -> 20 -> 7 with a path sum of 15 + 20 + 7 = 42.
-
-
-
-
Constraints:
-
-
-
The number of nodes in the tree is in the range [1, 3 * 104].
Given the root of a binary tree, return the same tree where every subtree (of the given tree) not containing a 1 has been removed.
-
-
A subtree of a node node is node plus every node that is a descendant of node.
-
-
-
Example 1:
-
-
-Input: root = [1,null,0,0,1]
-Output: [1,null,0,null,1]
-Explanation:
-Only the red nodes satisfy the property "every subtree not containing a 1".
-The diagram on the right represents the answer.
-
Given the root of a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see ordered from top to bottom.
The number of nodes in the tree is in the range [0, 100].
-
-100 <= Node.val <= 100
-
-
-### Related Topics
- [[Tree](../../tag/tree/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Binary Tree](../../tag/binary-tree/README.md)]
-
-### Similar Questions
- 1. [Populating Next Right Pointers in Each Node](../populating-next-right-pointers-in-each-node) (Medium)
- 1. [Boundary of Binary Tree](../boundary-of-binary-tree) (Medium)
diff --git a/problems/binary-tree-right-side-view/binary_tree_right_side_view.go b/problems/binary-tree-right-side-view/binary_tree_right_side_view.go
deleted file mode 100644
index f29ea357a..000000000
--- a/problems/binary-tree-right-side-view/binary_tree_right_side_view.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem199
diff --git a/problems/binary-tree-right-side-view/binary_tree_right_side_view_test.go b/problems/binary-tree-right-side-view/binary_tree_right_side_view_test.go
deleted file mode 100644
index f29ea357a..000000000
--- a/problems/binary-tree-right-side-view/binary_tree_right_side_view_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem199
diff --git a/problems/binary-tree-tilt/README.md b/problems/binary-tree-tilt/README.md
deleted file mode 100644
index 39e9371ae..000000000
--- a/problems/binary-tree-tilt/README.md
+++ /dev/null
@@ -1,85 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../longest-line-of-consecutive-one-in-matrix "Longest Line of Consecutive One in Matrix")
-
-[Next >](../find-the-closest-palindrome "Find the Closest Palindrome")
-
-## [563. Binary Tree Tilt (Easy)](https://leetcode.com/problems/binary-tree-tilt "二叉树的坡度")
-
-
Given the root of a binary tree, return the sum of every tree node's tilt.
-
-
The tilt of a tree node is the absolute difference between the sum of all left subtree node values and all right subtree node values. If a node does not have a left child, then the sum of the left subtree node values is treated as 0. The rule is similar if there the node does not have a right child.
-
-
-
Example 1:
-
-
-Input: root = [1,2,3]
-Output: 1
-Explanation:
-Tilt of node 2 : |0-0| = 0 (no children)
-Tilt of node 3 : |0-0| = 0 (no children)
-Tilt of node 1 : |2-3| = 1 (left subtree is just left child, so sum is 2; right subtree is just right child, so sum is 3)
-Sum of every tilt : 0 + 0 + 1 = 1
-
-
-
Example 2:
-
-
-Input: root = [4,2,9,3,5,null,7]
-Output: 15
-Explanation:
-Tilt of node 3 : |0-0| = 0 (no children)
-Tilt of node 5 : |0-0| = 0 (no children)
-Tilt of node 7 : |0-0| = 0 (no children)
-Tilt of node 2 : |3-5| = 2 (left subtree is just left child, so sum is 3; right subtree is just right child, so sum is 5)
-Tilt of node 9 : |0-7| = 7 (no left child, so sum is 0; right subtree is just right child, so sum is 7)
-Tilt of node 4 : |(3+5+2)-(9+7)| = |10-16| = 6 (left subtree values are 3, 5, and 2, which sums to 10; right subtree values are 9 and 7, which sums to 16)
-Sum of every tilt : 0 + 0 + 0 + 2 + 7 + 6 = 15
-
-
-
Example 3:
-
-
-Input: root = [21,7,14,1,1,2,2,3,3]
-Output: 9
-
-
-
-
Constraints:
-
-
-
The number of nodes in the tree is in the range [0, 104].
-
-1000 <= Node.val <= 1000
-
-
-### Related Topics
- [[Tree](../../tag/tree/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Binary Tree](../../tag/binary-tree/README.md)]
-
-### Hints
-
-Hint 1
-Don't think too much, this is an easy problem. Take some small tree as an example.
-
-
-
-Hint 2
-Can a parent node use the values of its child nodes? How will you implement it?
-
-
-
-Hint 3
-May be recursion and tree traversal can help you in implementing.
-
-
-
-Hint 4
-What about postorder traversal, using values of left and right childs?
-
diff --git a/problems/binary-tree-tilt/binary_tree_tilt.go b/problems/binary-tree-tilt/binary_tree_tilt.go
deleted file mode 100644
index a5ae7cbfd..000000000
--- a/problems/binary-tree-tilt/binary_tree_tilt.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem563
diff --git a/problems/binary-tree-tilt/binary_tree_tilt_test.go b/problems/binary-tree-tilt/binary_tree_tilt_test.go
deleted file mode 100644
index a5ae7cbfd..000000000
--- a/problems/binary-tree-tilt/binary_tree_tilt_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem563
diff --git a/problems/binary-tree-upside-down/README.md b/problems/binary-tree-upside-down/README.md
deleted file mode 100644
index 9e4be9643..000000000
--- a/problems/binary-tree-upside-down/README.md
+++ /dev/null
@@ -1,62 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../min-stack "Min Stack")
-
-[Next >](../read-n-characters-given-read4 "Read N Characters Given Read4")
-
-## [156. Binary Tree Upside Down (Medium)](https://leetcode.com/problems/binary-tree-upside-down "上下翻转二叉树")
-
-
Given a binary tree where all the right nodes are either leaf nodes with a sibling (a left node that shares the same parent node) or empty, flip it upside down and turn it into a tree where the original right nodes turned into left leaf nodes. Return the new root.
Given the root of a binary tree, return the zigzag level order traversal of its nodes' values. (i.e., from left to right, then right to left for the next level and alternate between).
Given an array of unique integers, arr, where each integer arr[i] is strictly greater than 1.
-
-
We make a binary tree using these integers, and each number may be used for any number of times. Each non-leaf node's value should be equal to the product of the values of its children.
-
-
Return the number of binary trees we can make. The answer may be too large so return the answer modulo109 + 7.
-
-
-
Example 1:
-
-
-Input: arr = [2,4]
-Output: 3
-Explanation: We can make these trees: [2], [4], [4, 2, 2]
-
-
Example 2:
-
-
-Input: arr = [2,4,5,10]
-Output: 7
-Explanation: We can make these trees: [2], [4], [5], [10], [4, 2, 2], [10, 2, 5], [10, 5, 2].
A binary watch has 4 LEDs on the top which represent the hours (0-11), and the 6 LEDs on the bottom represent the minutes (0-59). Each LED represents a zero or one, with the least significant bit on the right.
-
-
-
For example, the below binary watch reads "4:51".
-
-
-
-
-
Given an integer turnedOn which represents the number of LEDs that are currently on, return all possible times the watch could represent. You may return the answer in any order.
-
-
The hour must not contain a leading zero.
-
-
-
For example, "01:00" is not valid. It should be "1:00".
-
-
-
The minute must be consist of two digits and may contain a leading zero.
-
-
-
For example, "10:2" is not valid. It should be "10:02".
For every (contiguous) subarray sub = [arr[i], arr[i + 1], ..., arr[j]] (with i <= j), we take the bitwise OR of all the elements in sub, obtaining a result arr[i] | arr[i + 1] | ... | arr[j].
-
-
Return the number of possible results. Results that occur more than once are only counted once in the final answer
-
-
-
Example 1:
-
-
-Input: arr = [0]
-Output: 1
-Explanation: There is only one possible result: 0.
-
-
-
Example 2:
-
-
-Input: arr = [1,1,2]
-Output: 3
-Explanation: The possible subarrays are [1], [1], [2], [1, 1], [1, 2], [1, 1, 2].
-These yield the results 1, 1, 2, 1, 3, 3.
-There are 3 unique values, so the answer is 3.
-
-
-
Example 3:
-
-
-Input: arr = [1,2,4]
-Output: 6
-Explanation: The possible results are 1, 2, 3, 4, 6, and 7.
-
You are given an array people where people[i] is the weight of the ith person, and an infinite number of boats where each boat can carry a maximum weight of limit. Each boat carries at most two people at the same time, provided the sum of the weight of those people is at most limit.
-
-
Return the minimum number of boats to carry every given person.
-Given a set of keywords words and a string S, make all appearances of all keywords in S bold. Any letters between <b> and </b> tags become bold.
-
-The returned string should use the least number of tags possible, and of course the tags should form a valid combination.
-
-
-For example, given that words = ["ab", "bc"] and S = "aabcd", we should return "a<b>abc</b>d". Note that returning "a<b>a<b>b</b>c</b>d" would use more tags, so it is incorrect.
-
-
-
Note:
-
words has length in range [0, 50].
-
words[i] has length in range [1, 10].
-
S has length in range [0, 500].
-
All characters in words[i] and S are lowercase letters.
-
-
-### Related Topics
- [[Trie](../../tag/trie/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
- [[String Matching](../../tag/string-matching/README.md)]
-
-### Hints
-
-Hint 1
-First, determine which letters are bold and store that information in mask[i] = if i-th character is bold.
-Then, insert the tags at the beginning and end of groups. The start of a group is if and only if (mask[i] and (i == 0 or not mask[i-1])), and the end of a group is similar.
-
diff --git a/problems/bold-words-in-string/bold_words_in_string.go b/problems/bold-words-in-string/bold_words_in_string.go
deleted file mode 100644
index 9e01008a2..000000000
--- a/problems/bold-words-in-string/bold_words_in_string.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem758
diff --git a/problems/bold-words-in-string/bold_words_in_string_test.go b/problems/bold-words-in-string/bold_words_in_string_test.go
deleted file mode 100644
index 9e01008a2..000000000
--- a/problems/bold-words-in-string/bold_words_in_string_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem758
diff --git a/problems/bomb-enemy/README.md b/problems/bomb-enemy/README.md
deleted file mode 100644
index d4e476cea..000000000
--- a/problems/bomb-enemy/README.md
+++ /dev/null
@@ -1,36 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../sort-transformed-array "Sort Transformed Array")
-
-[Next >](../design-hit-counter "Design Hit Counter")
-
-## [361. Bomb Enemy (Medium)](https://leetcode.com/problems/bomb-enemy "轰炸敌人")
-
-
Given a 2D grid, each cell is either a wall 'W', an enemy 'E' or empty '0' (the number zero), return the maximum enemies you can kill using one bomb.
-The bomb kills all the enemies in the same row and column from the planted point until it hits the wall since the wall is too strong to be destroyed.
-Note: You can only put the bomb at an empty cell.
-
-
Example:
-
-
-
-Input: [["0","E","0","0"],["E","0","W","E"],["0","E","0","0"]]
-Output: 3
-Explanation: For the given grid,
-
-0 E 0 0
-E 0 W E
-0 E 0 0
-
-Placing a bomb at (1,1) kills 3 enemies.
-
Given a binary tree, return the values of its boundary in anti-clockwise direction starting from root. Boundary includes left boundary, leaves, and right boundary in order without duplicate nodes. (The values of the nodes may still be duplicates.)
-
-
Left boundary is defined as the path from root to the left-most node. Right boundary is defined as the path from root to the right-most node. If the root doesn't have left subtree or right subtree, then the root itself is left boundary or right boundary. Note this definition only applies to the input binary tree, and not applies to any subtrees.
-
-
The left-most node is defined as a leaf node you could reach when you always firstly travel to the left subtree if exists. If not, travel to the right subtree. Repeat until you reach a leaf node.
-
-
The right-most node is also defined by the same way with left and right exchanged.
-
-
Example 1
-
-
-Input:
- 1
- \
- 2
- / \
- 3 4
-
-Ouput:
-[1, 3, 4, 2]
-
-Explanation:
-The root doesn't have left subtree, so the root itself is left boundary.
-The leaves are node 3 and 4.
-The right boundary are node 1,2,4. Note the anti-clockwise direction means you should output reversed right boundary.
-So order them in anti-clockwise without duplicates and we have [1,3,4,2].
-
-
-
-
-
Example 2
-
-
-Input:
- ____1_____
- / \
- 2 3
- / \ /
-4 5 6
- / \ / \
- 7 8 9 10
-
-Ouput:
-[1,2,4,7,8,9,10,6,3]
-
-Explanation:
-The left boundary are node 1,2,4. (4 is the left-most node according to definition)
-The leaves are node 4,7,8,9,10.
-The right boundary are node 1,3,6,10. (10 is the right-most node).
-So order them in anti-clockwise without duplicate nodes we have [1,2,4,7,8,9,10,6,3].
-
Under the grammar given below, strings can represent a set of lowercase words. Let R(expr) denote the set of words the expression represents.
-
-
The grammar can best be understood through simple examples:
-
-
-
Single letters represent a singleton set containing that word.
-
-
R("a") = {"a"}
-
R("w") = {"w"}
-
-
-
When we take a comma-delimited list of two or more expressions, we take the union of possibilities.
-
-
R("{a,b,c}") = {"a","b","c"}
-
R("{{a,b},{b,c}}") = {"a","b","c"} (notice the final set only contains each word at most once)
-
-
-
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.
-
For expressions e1, e2, ... , ek with k >= 2, we have R({e1, e2, ...}) = R(e1) ∪ R(e2) ∪ ...
-
For expressions e1 and e2, we have R(e1 + e2) = {a + b for (a, b) in R(e1) × R(e2)}, where + denotes concatenation, and × denotes the cartesian product.
-
-
-
Given an expression representing a set of words under the given grammar, return the sorted list of words that the expression represents.
-Input: expression = "{{a,z},a{b,c},{ab,z}}"
-Output: ["a","ab","ac","z"]
-Explanation: Each distinct word is written only once in the final answer.
-
-
-
-
Constraints:
-
-
-
1 <= expression.length <= 60
-
expression[i] consists of '{', '}', ','or lowercase English letters.
-
The given expression represents a set of words based on the grammar given in the description.
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
- [[Backtracking](../../tag/backtracking/README.md)]
- [[Stack](../../tag/stack/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
-
-### Similar Questions
- 1. [Brace Expansion](../brace-expansion) (Medium)
-
-### Hints
-
-Hint 1
-You can write helper methods to parse the next "chunk" of the expression. If you see eg. "a", the answer is just the set {a}. If you see "{", you parse until you complete the "}" (the number of { and } seen are equal) and that becomes a chunk that you find where the appropriate commas are, and parse each individual expression between the commas.
-
diff --git a/problems/brace-expansion-ii/brace_expansion_ii.go b/problems/brace-expansion-ii/brace_expansion_ii.go
deleted file mode 100644
index bc0559311..000000000
--- a/problems/brace-expansion-ii/brace_expansion_ii.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem1096
diff --git a/problems/brace-expansion/README.md b/problems/brace-expansion/README.md
deleted file mode 100644
index 7aec2e852..000000000
--- a/problems/brace-expansion/README.md
+++ /dev/null
@@ -1,67 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../high-five "High Five")
-
-[Next >](../confusing-number-ii "Confusing Number II")
-
-## [1087. Brace Expansion (Medium)](https://leetcode.com/problems/brace-expansion "花括号展开")
-
-
A string S represents a list of words.
-
-
Each letter in the word has 1 or more options. If there is one option, the letter is represented as is. If there is more than one option, then curly braces delimit the options. For example, "{a,b,c}" represents options ["a", "b", "c"].
-
-
For example, "{a,b,c}d{e,f}" represents the list ["ade", "adf", "bde", "bdf", "cde", "cdf"].
-
-
Return all words that can be formed in this manner, in lexicographical order.
All characters inside a pair of consecutive opening and ending curly brackets are different.
-
-
-### Related Topics
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[String](../../tag/string/README.md)]
- [[Backtracking](../../tag/backtracking/README.md)]
-
-### Similar Questions
- 1. [Decode String](../decode-string) (Medium)
- 1. [Letter Case Permutation](../letter-case-permutation) (Medium)
- 1. [Brace Expansion II](../brace-expansion-ii) (Hard)
-
-### Hints
-
-Hint 1
-All generated strings are of the same size. How can we generate all of these strings?
-
-
-
-Hint 2
-Do a backtracking on which each level of it has to choose one single (e.g. 'a') character or any character of the given parenthesized group (e.g. "{a,b,c}")
-
diff --git a/problems/break-a-palindrome/README.md b/problems/break-a-palindrome/README.md
deleted file mode 100644
index aaaae4da1..000000000
--- a/problems/break-a-palindrome/README.md
+++ /dev/null
@@ -1,69 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../list-the-products-ordered-in-a-period "List the Products Ordered in a Period")
-
-[Next >](../sort-the-matrix-diagonally "Sort the Matrix Diagonally")
-
-## [1328. Break a Palindrome (Medium)](https://leetcode.com/problems/break-a-palindrome "破坏回文串")
-
-
Given a palindromic string of lowercase English letters palindrome, replace exactly one character with any lowercase English letter so that the resulting string is not a palindrome and that it is the lexicographically smallest one possible.
-
-
Return the resulting string. If there is no way to replace a character to make it not a palindrome, return an empty string.
-
-
A string a is lexicographically smaller than a string b (of the same length) if in the first position where a and b differ, a has a character strictly smaller than the corresponding character in b. For example, "abcc" is lexicographically smaller than "abcd" because the first position they differ is at the fourth character, and 'c' is smaller than 'd'.
-
-
-
Example 1:
-
-
-Input: palindrome = "abccba"
-Output: "aaccba"
-Explanation: There are many ways to make "abccba" not a palindrome, such as "zbccba", "aaccba", and "abacba".
-Of all the ways, "aaccba" is the lexicographically smallest.
-
-
-
Example 2:
-
-
-Input: palindrome = "a"
-Output: ""
-Explanation: There is no way to replace a single character to make "a" not a palindrome, so return an empty string.
-
-
-
-
Constraints:
-
-
-
1 <= palindrome.length <= 1000
-
palindrome consists of only lowercase English letters.
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
- [[Greedy](../../tag/greedy/README.md)]
-
-### Hints
-
-Hint 1
-How to detect if there is impossible to perform the replacement? Only when the length = 1.
-
-
-
-Hint 2
-Change the first non 'a' character to 'a'.
-
-
-
-Hint 3
-What if the string has only 'a'?
-
-
-
-Hint 4
-Change the last character to 'b'.
-
diff --git a/problems/brick-wall/README.md b/problems/brick-wall/README.md
deleted file mode 100644
index 252c2432c..000000000
--- a/problems/brick-wall/README.md
+++ /dev/null
@@ -1,49 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../optimal-division "Optimal Division")
-
-[Next >](../split-concatenated-strings "Split Concatenated Strings")
-
-## [554. Brick Wall (Medium)](https://leetcode.com/problems/brick-wall "砖墙")
-
-
There is a rectangular brick wall in front of you with n rows of bricks. The ith row has some number of bricks each of the same height (i.e., one unit) but they can be of different widths. The total width of each row is the same.
-
-
Draw a vertical line from the top to the bottom and cross the least bricks. If your line goes through the edge of a brick, then the brick is not considered as crossed. You cannot draw a line just along one of the two vertical edges of the wall, in which case the line will obviously cross no bricks.
-
-
Given the 2D array wall that contains the information about the wall, return the minimum number of crossed bricks after drawing such a vertical line.
You are given an m x n binary grid, where each 1 represents a brick and 0 represents an empty space. A brick is stable if:
-
-
-
It is directly connected to the top of the grid, or
-
At least one other brick in its four adjacent cells is stable.
-
-
-
You are also given an array hits, which is a sequence of erasures we want to apply. Each time we want to erase the brick at the location hits[i] = (rowi, coli). The brick on that location (if it exists) will disappear. Some other bricks may no longer be stable because of that erasure and will fall. Once a brick falls, it is immediately erased from the grid (i.e., it does not land on other stable bricks).
-
-
Return an array result, where each result[i] is the number of bricks that will fall after the ith erasure is applied.
-
-
Note that an erasure may refer to a location with no brick, and if it does, no bricks drop.
-
-
-
Example 1:
-
-
-Input: grid = [[1,0,0,0],[1,1,1,0]], hits = [[1,0]]
-Output: [2]
-Explanation: Starting with the grid:
-[[1,0,0,0],
- [1,1,1,0]]
-We erase the underlined brick at (1,0), resulting in the grid:
-[[1,0,0,0],
- [0,1,1,0]]
-The two underlined bricks are no longer stable as they are no longer connected to the top nor adjacent to another stable brick, so they will fall. The resulting grid is:
-[[1,0,0,0],
- [0,0,0,0]]
-Hence the result is [2].
-
-
-
Example 2:
-
-
-Input: grid = [[1,0,0,0],[1,1,0,0]], hits = [[1,1],[1,0]]
-Output: [0,0]
-Explanation: Starting with the grid:
-[[1,0,0,0],
- [1,1,0,0]]
-We erase the underlined brick at (1,1), resulting in the grid:
-[[1,0,0,0],
- [1,0,0,0]]
-All remaining bricks are still stable, so no bricks fall. The grid remains the same:
-[[1,0,0,0],
- [1,0,0,0]]
-Next, we erase the underlined brick at (1,0), resulting in the grid:
-[[1,0,0,0],
- [0,0,0,0]]
-Once again, all remaining bricks are still stable, so no bricks fall.
-Hence the result is [0,0].
-
-
-
-
Constraints:
-
-
-
m == grid.length
-
n == grid[i].length
-
1 <= m, n <= 200
-
grid[i][j] is 0 or 1.
-
1 <= hits.length <= 4 * 104
-
hits[i].length == 2
-
0 <= xi <= m - 1
-
0 <= yi <= n - 1
-
All (xi, yi) are unique.
-
-
-### Related Topics
- [[Union Find](../../tag/union-find/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
diff --git a/problems/bricks-falling-when-hit/bricks_falling_when_hit.go b/problems/bricks-falling-when-hit/bricks_falling_when_hit.go
deleted file mode 100644
index ba1c94887..000000000
--- a/problems/bricks-falling-when-hit/bricks_falling_when_hit.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem803
diff --git a/problems/bricks-falling-when-hit/bricks_falling_when_hit_test.go b/problems/bricks-falling-when-hit/bricks_falling_when_hit_test.go
deleted file mode 100644
index ba1c94887..000000000
--- a/problems/bricks-falling-when-hit/bricks_falling_when_hit_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem803
diff --git a/problems/brightest-position-on-street/README.md b/problems/brightest-position-on-street/README.md
deleted file mode 100644
index 0aaf7cc50..000000000
--- a/problems/brightest-position-on-street/README.md
+++ /dev/null
@@ -1,35 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../number-of-accounts-that-did-not-stream "Number of Accounts That Did Not Stream")
-
-[Next >](../convert-1d-array-into-2d-array "Convert 1D Array Into 2D Array")
-
-## [2021. Brightest Position on Street (Medium)](https://leetcode.com/problems/brightest-position-on-street "街上最亮的位置")
-
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Ordered Set](../../tag/ordered-set/README.md)]
- [[Prefix Sum](../../tag/prefix-sum/README.md)]
-
-### Hints
-
-Hint 1
-Convert lights into an array of ranges representing the range where each street light can light up and sort the start and end points of the ranges.
-
-
-
-Hint 2
-Do we need to traverse all possible positions on the street?
-
-
-
-Hint 3
-No, we don't, we only need to go to the start and end points of the ranges for each streetlight.
-
diff --git a/problems/broken-calculator/README.md b/problems/broken-calculator/README.md
deleted file mode 100644
index cd680fffa..000000000
--- a/problems/broken-calculator/README.md
+++ /dev/null
@@ -1,68 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../satisfiability-of-equality-equations "Satisfiability of Equality Equations")
-
-[Next >](../subarrays-with-k-different-integers "Subarrays with K Different Integers")
-
-## [991. Broken Calculator (Medium)](https://leetcode.com/problems/broken-calculator "坏了的计算器")
-
-
There is a broken calculator that has the integer startValue on its display initially. In on operation you can:
-
-
-
multiply the number on the display by 2, or
-
subtract 1 from the number on the display.
-
-
-
Given two integers startValue and target, return the minimum number of operations needed to display target on the calculator.
-
-
-
Example 1:
-
-
-Input: startValue = 2, target = 3
-Output: 2
-Explanation: Use double operation and then decrement operation {2 -> 4 -> 3}.
-
-
-
Example 2:
-
-
-Input: startValue = 5, target = 8
-Output: 2
-Explanation: Use decrement and then double {5 -> 4 -> 8}.
-
Given two strings s and goal, return true if you can swap two letters in s so the result is equal to goal, otherwise, return false.
-
-
Swapping letters is defined as taking two indices i and j (0-indexed) such that i != j and swapping the characters at s[i] and s[j].
-
-
-
For example, swapping at indices 0 and 2 in "abcd" results in "cbad".
-
-
-
-
Example 1:
-
-
-Input: s = "ab", goal = "ba"
-Output: true
-Explanation: You can swap s[0] = 'a' and s[1] = 'b' to get "ba", which is equal to goal.
-
-
-
Example 2:
-
-
-Input: s = "ab", goal = "ab"
-Output: false
-Explanation: The only letters you can swap are s[0] = 'a' and s[1] = 'b', which results in "ba" != goal.
-
-
-
Example 3:
-
-
-Input: s = "aa", goal = "aa"
-Output: true
-Explanation: You can swap s[0] = 'a' and s[1] = 'a' to get "aa", which is equal to goal.
-
-
-
Example 4:
-
-
-Input: s = "aaaaaaabc", goal = "aaaaaaacb"
-Output: true
-
-
-
-
Constraints:
-
-
-
1 <= s.length, goal.length <= 2 * 104
-
s and goal consist of lowercase letters.
-
-
-### Related Topics
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
diff --git a/problems/buddy-strings/buddy_strings.go b/problems/buddy-strings/buddy_strings.go
deleted file mode 100644
index d21408dff..000000000
--- a/problems/buddy-strings/buddy_strings.go
+++ /dev/null
@@ -1,31 +0,0 @@
-package problem859
-
-func buddyStrings(A string, B string) bool {
- if len(A) != len(B) {
- return false
- }
- if A == B {
- exist := [26]bool{}
- for _, c := range A {
- k := c - 'a'
- if exist[k] {
- return true
- }
- exist[k] = true
- }
- return false
- }
- m, n := -1, -1
- for i, c := range A {
- if B[i] != byte(c) {
- if m == -1 {
- m = i
- } else if n == -1 {
- n = i
- } else {
- return false
- }
- }
- }
- return n != -1 && A[m] == B[n] && A[n] == B[m]
-}
diff --git a/problems/buddy-strings/buddy_strings_test.go b/problems/buddy-strings/buddy_strings_test.go
deleted file mode 100644
index 28ab9045e..000000000
--- a/problems/buddy-strings/buddy_strings_test.go
+++ /dev/null
@@ -1,55 +0,0 @@
-package problem859
-
-import "testing"
-
-type testType struct {
- a string
- b string
- want bool
-}
-
-func TestBuddyStrings(t *testing.T) {
- tests := [...]testType{
- {
- a: "ab",
- b: "ba",
- want: true,
- },
- {
- a: "aa",
- b: "aa",
- want: true,
- },
- {
- a: "ab",
- b: "ab",
- want: false,
- },
- {
- a: "aaaaaaabc",
- b: "aaaaaaacb",
- want: true,
- },
- {
- a: "",
- b: "aa",
- want: false,
- },
- {
- a: "hello",
- b: "h0lle",
- want: false,
- },
- {
- a: "hello",
- b: "hanna",
- want: false,
- },
- }
- for _, tt := range tests {
- got := buddyStrings(tt.a, tt.b)
- if got != tt.want {
- t.Fatalf("in: %v %v, got: %v, want: %v", tt.a, tt.b, got, tt.want)
- }
- }
-}
diff --git a/problems/build-an-array-with-stack-operations/README.md b/problems/build-an-array-with-stack-operations/README.md
deleted file mode 100644
index 15700b124..000000000
--- a/problems/build-an-array-with-stack-operations/README.md
+++ /dev/null
@@ -1,74 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../evaluate-boolean-expression "Evaluate Boolean Expression")
-
-[Next >](../count-triplets-that-can-form-two-arrays-of-equal-xor "Count Triplets That Can Form Two Arrays of Equal XOR")
-
-## [1441. Build an Array With Stack Operations (Easy)](https://leetcode.com/problems/build-an-array-with-stack-operations "用栈操作构建数组")
-
-
You are given an array target and an integer n.
-
-
In each iteration, you will read a number from list = [1, 2, 3, ..., n].
-
-
Build the target array using the following operations:
-
-
-
"Push": Reads a new element from the beginning list, and pushes it in the array.
-
"Pop": Deletes the last element of the array.
-
If the target array is already built, stop reading more elements.
-
-
-
Return a list of the operations needed to build target. The test cases are generated so that the answer is unique.
-
-
-
Example 1:
-
-
-Input: target = [1,3], n = 3
-Output: ["Push","Push","Pop","Push"]
-Explanation:
-Read number 1 and automatically push in the array -> [1]
-Read number 2 and automatically push in the array then Pop it -> [1]
-Read number 3 and automatically push in the array -> [1,3]
-
-
-
Example 2:
-
-
-Input: target = [1,2,3], n = 3
-Output: ["Push","Push","Push"]
-
-
-
Example 3:
-
-
-Input: target = [1,2], n = 4
-Output: ["Push","Push"]
-Explanation: You only need to read the first 2 numbers and stop.
-
-
-
-
Constraints:
-
-
-
1 <= target.length <= 100
-
1 <= n <= 100
-
1 <= target[i] <= n
-
target is strictly increasing.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Stack](../../tag/stack/README.md)]
- [[Simulation](../../tag/simulation/README.md)]
-
-### Hints
-
-Hint 1
-Use “Push” for numbers to be kept in target array and [“Push”, “Pop”] for numbers to be discarded.
-
diff --git a/problems/build-array-from-permutation/README.md b/problems/build-array-from-permutation/README.md
deleted file mode 100644
index e72aa6eb5..000000000
--- a/problems/build-array-from-permutation/README.md
+++ /dev/null
@@ -1,64 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../leetcodify-similar-friends "Leetcodify Similar Friends")
-
-[Next >](../eliminate-maximum-number-of-monsters "Eliminate Maximum Number of Monsters")
-
-## [1920. Build Array from Permutation (Easy)](https://leetcode.com/problems/build-array-from-permutation "基于排列构建数组")
-
-
Given a zero-based permutationnums (0-indexed), build an array ans of the same length where ans[i] = nums[nums[i]] for each 0 <= i < nums.length and return it.
-
-
A zero-based permutationnums is an array of distinct integers from 0 to nums.length - 1 (inclusive).
-
-
-
Example 1:
-
-
-Input: nums = [0,2,1,5,3,4]
-Output: [0,1,2,4,5,3]
-Explanation: The array ans is built as follows:
-ans = [nums[nums[0]], nums[nums[1]], nums[nums[2]], nums[nums[3]], nums[nums[4]], nums[nums[5]]]
- = [nums[0], nums[2], nums[1], nums[5], nums[3], nums[4]]
- = [0,1,2,4,5,3]
-
-
Example 2:
-
-
-Input: nums = [5,0,1,2,3,4]
-Output: [4,5,0,1,2,3]
-Explanation: The array ans is built as follows:
-ans = [nums[nums[0]], nums[nums[1]], nums[nums[2]], nums[nums[3]], nums[nums[4]], nums[nums[5]]]
- = [nums[5], nums[0], nums[1], nums[2], nums[3], nums[4]]
- = [4,5,0,1,2,3]
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 1000
-
0 <= nums[i] < nums.length
-
The elements in nums are distinct.
-
-
-
-
Follow-up: Can you solve it without using an extra space (i.e., O(1) memory)?
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Simulation](../../tag/simulation/README.md)]
-
-### Hints
-
-Hint 1
-Just apply what's said in the statement.
-
-
-
-Hint 2
-Notice that you can't apply it on the same array directly since some elements will change after application
-
diff --git a/problems/build-array-where-you-can-find-the-maximum-exactly-k-comparisons/README.md b/problems/build-array-where-you-can-find-the-maximum-exactly-k-comparisons/README.md
deleted file mode 100644
index a375d8613..000000000
--- a/problems/build-array-where-you-can-find-the-maximum-exactly-k-comparisons/README.md
+++ /dev/null
@@ -1,87 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-number-of-frogs-croaking "Minimum Number of Frogs Croaking")
-
-[Next >](../npv-queries "NPV Queries")
-
-## [1420. Build Array Where You Can Find The Maximum Exactly K Comparisons (Hard)](https://leetcode.com/problems/build-array-where-you-can-find-the-maximum-exactly-k-comparisons "生成数组")
-
-
Given three integers n, m and k. Consider the following algorithm to find the maximum element of an array of positive integers:
-
-
You should build the array arr which has the following properties:
-
-
-
arr has exactly n integers.
-
1 <= arr[i] <= m where (0 <= i < n).
-
After applying the mentioned algorithm to arr, the value search_cost is equal to k.
-
-
-
Return the number of ways to build the array arr under the mentioned conditions. As the answer may grow large, the answer must be computed modulo 10^9 + 7.
-
-
-
Example 1:
-
-
-Input: n = 2, m = 3, k = 1
-Output: 6
-Explanation: The possible arrays are [1, 1], [2, 1], [2, 2], [3, 1], [3, 2] [3, 3]
-
-
-
Example 2:
-
-
-Input: n = 5, m = 2, k = 3
-Output: 0
-Explanation: There are no possible arrays that satisify the mentioned conditions.
-
-
-
Example 3:
-
-
-Input: n = 9, m = 1, k = 1
-Output: 1
-Explanation: The only possible array is [1, 1, 1, 1, 1, 1, 1, 1, 1]
-
-
-
Example 4:
-
-
-Input: n = 50, m = 100, k = 25
-Output: 34549172
-Explanation: Don't forget to compute the answer modulo 1000000007
-
-
-
Example 5:
-
-
-Input: n = 37, m = 17, k = 7
-Output: 418930126
-
-
-
-
Constraints:
-
-
-
1 <= n <= 50
-
1 <= m <= 100
-
0 <= k <= n
-
-
-### Related Topics
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Hints
-
-Hint 1
-Use dynamic programming approach. Build dp table where dp[a][b][c] is the number of ways you can start building the array starting from index a where the search_cost = c and the maximum used integer was b.
-
-
-
-Hint 2
-Recursively, solve the small sub-problems first. Optimize your answer by stopping the search if you exceeded k changes.
-
diff --git a/problems/build-binary-expression-tree-from-infix-expression/README.md b/problems/build-binary-expression-tree-from-infix-expression/README.md
deleted file mode 100644
index ccb059a16..000000000
--- a/problems/build-binary-expression-tree-from-infix-expression/README.md
+++ /dev/null
@@ -1,35 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../the-most-frequently-ordered-products-for-each-customer "The Most Frequently Ordered Products for Each Customer")
-
-[Next >](../crawler-log-folder "Crawler Log Folder")
-
-## [1597. Build Binary Expression Tree From Infix Expression (Hard)](https://leetcode.com/problems/build-binary-expression-tree-from-infix-expression "根据中缀表达式构造二叉表达式树")
-
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
- [[Stack](../../tag/stack/README.md)]
- [[Tree](../../tag/tree/README.md)]
- [[Binary Tree](../../tag/binary-tree/README.md)]
-
-### Similar Questions
- 1. [Basic Calculator III](../basic-calculator-iii) (Hard)
- 1. [Check If Two Expression Trees are Equivalent](../check-if-two-expression-trees-are-equivalent) (Medium)
-
-### Hints
-
-Hint 1
-Convert infix expression to postfix expression.
-
-
-
-Hint 2
-Build an expression tree from the postfix expression.
-
diff --git a/problems/build-the-equation/README.md b/problems/build-the-equation/README.md
deleted file mode 100644
index 1a035a2c2..000000000
--- a/problems/build-the-equation/README.md
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../abbreviating-the-product-of-a-range "Abbreviating the Product of a Range")
-
-[Next >](../a-number-after-a-double-reversal "A Number After a Double Reversal")
-
-## [2118. Build the Equation (Hard)](https://leetcode.com/problems/build-the-equation "")
-
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/build-the-equation/mysql_schemas.sql b/problems/build-the-equation/mysql_schemas.sql
deleted file mode 100644
index 9cb986611..000000000
--- a/problems/build-the-equation/mysql_schemas.sql
+++ /dev/null
@@ -1,5 +0,0 @@
-Create table If Not Exists Terms (power int, factor int);
-Truncate table Terms;
-insert into Terms (power, factor) values ('2', '1');
-insert into Terms (power, factor) values ('1', '-4');
-insert into Terms (power, factor) values ('0', '2');
diff --git a/problems/building-boxes/README.md b/problems/building-boxes/README.md
deleted file mode 100644
index 55d42ffd8..000000000
--- a/problems/building-boxes/README.md
+++ /dev/null
@@ -1,77 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../find-kth-largest-xor-coordinate-value "Find Kth Largest XOR Coordinate Value")
-
-[Next >](../find-distance-in-a-binary-tree "Find Distance in a Binary Tree")
-
-## [1739. Building Boxes (Hard)](https://leetcode.com/problems/building-boxes "放置盒子")
-
-
You have a cubic storeroom where the width, length, and height of the room are all equal to n units. You are asked to place n boxes in this room where each box is a cube of unit side length. There are however some rules to placing the boxes:
-
-
-
You can place the boxes anywhere on the floor.
-
If box x is placed on top of the box y, then each side of the four vertical sides of the box ymust either be adjacent to another box or to a wall.
-
-
-
Given an integer n, return the minimum possible number of boxes touching the floor.
-
-
-
Example 1:
-
-
-
-
-Input: n = 3
-Output: 3
-Explanation: The figure above is for the placement of the three boxes.
-These boxes are placed in the corner of the room, where the corner is on the left side.
-
-
-
Example 2:
-
-
-
-
-Input: n = 4
-Output: 3
-Explanation: The figure above is for the placement of the four boxes.
-These boxes are placed in the corner of the room, where the corner is on the left side.
-
-
-
Example 3:
-
-
-
-
-Input: n = 10
-Output: 6
-Explanation: The figure above is for the placement of the ten boxes.
-These boxes are placed in the corner of the room, where the corner is on the back side.
-
-
-
Constraints:
-
-
-
1 <= n <= 109
-
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[Math](../../tag/math/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
-
-### Hints
-
-Hint 1
-Suppose We can put m boxes on the floor, within all the ways to put the boxes, what’s the maximum number of boxes we can put in?
-
-
-
-Hint 2
-The first box should always start in the corner
-
diff --git a/problems/building-h2o/README.md b/problems/building-h2o/README.md
deleted file mode 100644
index a449643cb..000000000
--- a/problems/building-h2o/README.md
+++ /dev/null
@@ -1,58 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../print-zero-even-odd "Print Zero Even Odd")
-
-[Next >](../number-of-days-in-a-month "Number of Days in a Month")
-
-## [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 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 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:
-
-
-
If an oxygen thread arrives at the barrier when no hydrogen threads are present, it must wait for two hydrogen threads.
-
If a hydrogen thread arrives at the barrier when no other threads are present, it must wait for an oxygen thread and another hydrogen thread.
-
-
-
We do not have to worry about matching the threads up explicitly; the threads do not necessarily know which other threads they are paired up with. The key is that threads pass the barriers in complete sets; thus, if we examine the sequence of threads that bind 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.
-
-
-
Example 1:
-
-
-Input: water = "HOH"
-Output: "HHO"
-Explanation: "HOH" and "OHH" are also valid answers.
-
-
-
Example 2:
-
-
-Input: water = "OOHHHH"
-Output: "HHOHHO"
-Explanation: "HOHHHO", "OHHHHO", "HHOHOH", "HOHHOH", "OHHHOH", "HHOOHH", "HOHOHH" and "OHHOHH" are also valid answers.
-
-
-
-
Constraints:
-
-
-
3 * n == water.length
-
1 <= n <= 20
-
water[i] is either 'H' or 'O'.
-
There will be exactly 2 * n'H' in water.
-
There will be exactly n'O' in water.
-
-
-### Related Topics
- [[Concurrency](../../tag/concurrency/README.md)]
diff --git a/problems/building-h2o/building_h2o.py b/problems/building-h2o/building_h2o.py
deleted file mode 100755
index d675daa14..000000000
--- a/problems/building-h2o/building_h2o.py
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/usr/bin/env python
-
-class H2O:
- def __init__(self):
- pass
-
-
- def hydrogen(self, releaseHydrogen: 'Callable[[], None]') -> None:
-
- # releaseHydrogen() outputs "H". Do not change or remove this line.
- releaseHydrogen()
-
-
- def oxygen(self, releaseOxygen: 'Callable[[], None]') -> None:
-
- # releaseOxygen() outputs "O". Do not change or remove this line.
- releaseOxygen()
\ No newline at end of file
diff --git a/problems/buildings-with-an-ocean-view/README.md b/problems/buildings-with-an-ocean-view/README.md
deleted file mode 100644
index 37792f25e..000000000
--- a/problems/buildings-with-an-ocean-view/README.md
+++ /dev/null
@@ -1,30 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-degree-of-a-connected-trio-in-a-graph "Minimum Degree of a Connected Trio in a Graph")
-
-[Next >](../longest-nice-substring "Longest Nice Substring")
-
-## [1762. Buildings With an Ocean View (Medium)](https://leetcode.com/problems/buildings-with-an-ocean-view "能看到海景的建筑物")
-
-
-
-### Related Topics
- [[Stack](../../tag/stack/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Monotonic Stack](../../tag/monotonic-stack/README.md)]
-
-### Hints
-
-Hint 1
-You can traverse the buildings from the nearest to the ocean to the furthest.
-
-
-
-Hint 2
-Keep with you the maximum to the right while traversing to determine if you can see the ocean or not.
-
diff --git a/problems/bulb-switcher-ii/README.md b/problems/bulb-switcher-ii/README.md
deleted file mode 100644
index c2af65e7a..000000000
--- a/problems/bulb-switcher-ii/README.md
+++ /dev/null
@@ -1,95 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../second-minimum-node-in-a-binary-tree "Second Minimum Node In a Binary Tree")
-
-[Next >](../number-of-longest-increasing-subsequence "Number of Longest Increasing Subsequence")
-
-## [672. Bulb Switcher II (Medium)](https://leetcode.com/problems/bulb-switcher-ii "灯泡开关 Ⅱ")
-
-
There is a room with n bulbs labeled from 1 to n that all are turned on initially, and four buttons on the wall. Each of the four buttons has a different functionality where:
-
-
-
Button 1: Flips the status of all the bulbs.
-
Button 2: Flips the status of all the bulbs with even labels (i.e., 2, 4, ...).
-
Button 3: Flips the status of all the bulbs with odd labels (i.e., 1, 3, ...).
-
Button 4: Flips the status of all the bulbs with a label j = 3k + 1 where k = 0, 1, 2, ... (i.e., 1, 4, 7, 10, ...).
-
-
-
You must make exactlypresses button presses in total. For each press, you may pick any of the four buttons to press.
-
-
Given the two integers n and presses, return the number of different possible statuses after performing all presses button presses.
-
-
-
Example 1:
-
-
-Input: n = 1, presses = 1
-Output: 2
-Explanation: Status can be:
-- [off] by pressing button 1
-- [on] by pressing button 2
-
-
-
Example 2:
-
-
-Input: n = 2, presses = 1
-Output: 3
-Explanation: Status can be:
-- [off, off] by pressing button 1
-- [on, off] by pressing button 2
-- [off, on] by pressing button 3
-
-
-
Example 3:
-
-
-Input: n = 3, presses = 1
-Output: 4
-Explanation: Status can be:
-- [off, off, off] by pressing button 1
-- [off, on, off] by pressing button 2
-- [on, off, on] by pressing button 3
-- [off, on, on] by pressing button 4
-
-
-
Example 4:
-
-
-Input: n = 1, presses = 0
-Output: 1
-Explanation: Status can only be [on] since you cannot press any of the buttons.
-
-
-
Example 5:
-
-
-Input: n = 1, presses = 2
-Output: 2
-Explanation: Status can be:
-- [off] by pressing button 1 then button 1 again
-- [on] by pressing button 1 then button 2
-
There is a room with n bulbs, numbered from 1 to n, arranged in a row from left to right. Initially, all the bulbs are turned off.
-
-
At moment k (for k from 0 to n - 1), we turn on the light[k] bulb. A bulb changes color to blue only if it is on and all the previous bulbs (to the left) are turned on too.
-
-
Return the number of moments in which all turned-on bulbs are blue.
-
-
-
Example 1:
-
-
-Input: light = [2,1,3,5,4]
-Output: 3
-Explanation: All bulbs turned on, are blue at the moment 1, 2 and 4.
-
-
-
Example 2:
-
-
-Input: light = [3,2,4,1,5]
-Output: 2
-Explanation: All bulbs turned on, are blue at the moment 3, and 4 (index-0).
-
-
-
Example 3:
-
-
-Input: light = [4,1,2,3]
-Output: 1
-Explanation: All bulbs turned on, are blue at the moment 3 (index-0).
-Bulb 4th changes to blue at the moment 3.
-
-
-
Example 4:
-
-
-Input: light = [2,1,4,3,6,5]
-Output: 3
-
-
-
Example 5:
-
-
-Input: light = [1,2,3,4,5,6]
-Output: 6
-
-
-
-
Constraints:
-
-
-
n == light.length
-
1 <= n <= 5 * 104
-
light is a permutation of the numbers in the range [1, n]
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
-
-### Similar Questions
- 1. [Bulb Switcher](../bulb-switcher) (Medium)
- 1. [Bulb Switcher II](../bulb-switcher-ii) (Medium)
-
-### Hints
-
-Hint 1
-If in the step x all bulb shines then bulbs 1,2,3,..,x should shines too.
-
diff --git a/problems/bulb-switcher-iv/README.md b/problems/bulb-switcher-iv/README.md
deleted file mode 100644
index dfaa2dd4f..000000000
--- a/problems/bulb-switcher-iv/README.md
+++ /dev/null
@@ -1,79 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../shuffle-string "Shuffle String")
-
-[Next >](../number-of-good-leaf-nodes-pairs "Number of Good Leaf Nodes Pairs")
-
-## [1529. Bulb Switcher IV (Medium)](https://leetcode.com/problems/bulb-switcher-iv "灯泡开关 IV")
-
-
There is a room with n bulbs, numbered from 0 to n - 1, arranged in a row from left to right. Initially, all the bulbs are turned off.
-
-
Your task is to obtain the configuration represented by target where target[i] is '1' if the ith bulb is turned on and is '0' if it is turned off.
-
-
You have a switch to flip the state of the bulb, a flip operation is defined as follows:
-
-
-
Choose any bulb (index i) of your current configuration.
-
Flip each bulb from index i to index n - 1.
-
-
-
When any bulb is flipped it means that if it is '0' it changes to '1' and if it is '1' it changes to '0'.
-
-
Return the minimum number of flips required to formtarget.
-
-
-
Example 1:
-
-
-Input: target = "10111"
-Output: 3
-Explanation: Initial configuration "00000".
-flip from the third bulb: "00000" -> "00111"
-flip from the first bulb: "00111" -> "11000"
-flip from the second bulb: "11000" -> "10111"
-We need at least 3 flip operations to form target.
-
-### Related Topics
- [[String](../../tag/string/README.md)]
- [[Greedy](../../tag/greedy/README.md)]
-
-### Hints
-
-Hint 1
-Consider a strategy where the choice of bulb with number i is increasing. In such a strategy, you no longer need to worry about bulbs that have been set to the left.
-
diff --git a/problems/bulb-switcher/README.md b/problems/bulb-switcher/README.md
deleted file mode 100644
index 646c4a73c..000000000
--- a/problems/bulb-switcher/README.md
+++ /dev/null
@@ -1,59 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-product-of-word-lengths "Maximum Product of Word Lengths")
-
-[Next >](../generalized-abbreviation "Generalized Abbreviation")
-
-## [319. Bulb Switcher (Medium)](https://leetcode.com/problems/bulb-switcher "灯泡开关")
-
-
There are n bulbs that are initially off. You first turn on all the bulbs, then you turn off every second bulb.
-
-
On the third round, you toggle every third bulb (turning on if it's off or turning off if it's on). For the ith round, you toggle every i bulb. For the nth round, you only toggle the last bulb.
-
-
Return the number of bulbs that are on after n rounds.
-
-
-
Example 1:
-
-
-Input: n = 3
-Output: 1
-Explanation: At first, the three bulbs are [off, off, off].
-After the first round, the three bulbs are [on, on, on].
-After the second round, the three bulbs are [on, off, on].
-After the third round, the three bulbs are [on, off, off].
-So you should return 1 because there is only one bulb is on.
You are playing the Bulls and Cows game with your friend.
-
-
You write down a secret number and ask your friend to guess what the number is. When your friend makes a guess, you provide a hint with the following info:
-
-
-
The number of "bulls", which are digits in the guess that are in the correct position.
-
The number of "cows", which are digits in the guess that are in your secret number but are located in the wrong position. Specifically, the non-bull digits in the guess that could be rearranged such that they become bulls.
-
-
-
Given the secret number secret and your friend's guess guess, return the hint for your friend's guess.
-
-
The hint should be formatted as "xAyB", where x is the number of bulls and y is the number of cows. Note that both secret and guess may contain duplicate digits.
-
-
-
Example 1:
-
-
-Input: secret = "1807", guess = "7810"
-Output: "1A3B"
-Explanation: Bulls are connected with a '|' and cows are underlined:
-"1807"
- |
-"7810"
-
-
Example 2:
-
-
-Input: secret = "1123", guess = "0111"
-Output: "1A1B"
-Explanation: Bulls are connected with a '|' and cows are underlined:
-"1123" "1123"
- | or |
-"0111" "0111"
-Note that only one of the two unmatched 1s is counted as a cow since the non-bull digits can only be rearranged to allow one 1 to be a bull.
-
You are given n balloons, indexed from 0 to n - 1. Each balloon is painted with a number on it represented by an array nums. You are asked to burst all the balloons.
-
-
If you burst the ith balloon, you will get nums[i - 1] * nums[i] * nums[i + 1] coins. If i - 1 or i + 1 goes out of bounds of the array, then treat it as if there is a balloon with a 1 painted on it.
-
-
Return the maximum coins you can collect by bursting the balloons wisely.
You are given an array routes representing bus routes where routes[i] is a bus route that the ith bus repeats forever.
-
-
-
For example, if routes[0] = [1, 5, 7], this means that the 0th bus travels in the sequence 1 -> 5 -> 7 -> 1 -> 5 -> 7 -> 1 -> ... forever.
-
-
-
You will start at the bus stop source (You are not on any bus initially), and you want to go to the bus stop target. You can travel between bus stops by buses only.
-
-
Return the least number of buses you must take to travel from source to target. Return -1 if it is not possible.
-
-
-
Example 1:
-
-
-Input: routes = [[1,2,7],[3,6,7]], source = 1, target = 6
-Output: 2
-Explanation: The best strategy is take the first bus to the bus stop 7, then take the second bus to the bus stop 6.
-
Hercy wants to save money for his first car. He puts money in the Leetcode bank every day.
-
-
He starts by putting in $1 on Monday, the first day. Every day from Tuesday to Sunday, he will put in $1 more than the day before. On every subsequent Monday, he will put in $1 more than the previous Monday.
-
-
Given n, return the total amount of money he will have in the Leetcode bank at the end of the nth day.
-
-
-
Example 1:
-
-
-Input: n = 4
-Output: 10
-Explanation: After the 4th day, the total is 1 + 2 + 3 + 4 = 10.
-
-
-
Example 2:
-
-
-Input: n = 10
-Output: 37
-Explanation: After the 10th day, the total is (1 + 2 + 3 + 4 + 5 + 6 + 7) + (2 + 3 + 4) = 37. Notice that on the 2nd Monday, Hercy only puts in $2.
-
-
-
Example 3:
-
-
-Input: n = 20
-Output: 96
-Explanation: After the 20th day, the total is (1 + 2 + 3 + 4 + 5 + 6 + 7) + (2 + 3 + 4 + 5 + 6 + 7 + 8) + (3 + 4 + 5 + 6 + 7 + 8) = 96.
-
-
-
-
Constraints:
-
-
-
1 <= n <= 1000
-
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
-
-### Hints
-
-Hint 1
-Simulate the process by keeping track of how much money John is putting in and which day of the week it is, and use this information to deduce how much money John will put in the next day.
-
diff --git a/problems/calculate-salaries/README.md b/problems/calculate-salaries/README.md
deleted file mode 100644
index 9f0654cc5..000000000
--- a/problems/calculate-salaries/README.md
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../probability-of-a-two-boxes-having-the-same-number-of-distinct-balls "Probability of a Two Boxes Having The Same Number of Distinct Balls")
-
-[Next >](../find-all-the-lonely-nodes "Find All The Lonely Nodes")
-
-## [1468. Calculate Salaries (Medium)](https://leetcode.com/problems/calculate-salaries "计算税后工资")
-
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/calculate-salaries/mysql_schemas.sql b/problems/calculate-salaries/mysql_schemas.sql
deleted file mode 100644
index a60a565aa..000000000
--- a/problems/calculate-salaries/mysql_schemas.sql
+++ /dev/null
@@ -1,12 +0,0 @@
-Create table If Not Exists Salaries (company_id int, employee_id int, employee_name varchar(13), salary int);
-Truncate table Salaries;
-insert into Salaries (company_id, employee_id, employee_name, salary) values ('1', '1', 'Tony', '2000');
-insert into Salaries (company_id, employee_id, employee_name, salary) values ('1', '2', 'Pronub', '21300');
-insert into Salaries (company_id, employee_id, employee_name, salary) values ('1', '3', 'Tyrrox', '10800');
-insert into Salaries (company_id, employee_id, employee_name, salary) values ('2', '1', 'Pam', '300');
-insert into Salaries (company_id, employee_id, employee_name, salary) values ('2', '7', 'Bassem', '450');
-insert into Salaries (company_id, employee_id, employee_name, salary) values ('2', '9', 'Hermione', '700');
-insert into Salaries (company_id, employee_id, employee_name, salary) values ('3', '7', 'Bocaben', '100');
-insert into Salaries (company_id, employee_id, employee_name, salary) values ('3', '2', 'Ognjen', '2200');
-insert into Salaries (company_id, employee_id, employee_name, salary) values ('3', '13', 'Nyancat', '3300');
-insert into Salaries (company_id, employee_id, employee_name, salary) values ('3', '15', 'Morninngcat', '7777');
diff --git a/problems/calculate-special-bonus/README.md b/problems/calculate-special-bonus/README.md
deleted file mode 100644
index 1fdb4c0d3..000000000
--- a/problems/calculate-special-bonus/README.md
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../stone-game-viii "Stone Game VIII")
-
-[Next >](../minimize-product-sum-of-two-arrays "Minimize Product Sum of Two Arrays")
-
-## [1873. Calculate Special Bonus (Easy)](https://leetcode.com/problems/calculate-special-bonus "计算特殊奖金")
-
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/calculate-special-bonus/mysql_schemas.sql b/problems/calculate-special-bonus/mysql_schemas.sql
deleted file mode 100644
index d5d505e6f..000000000
--- a/problems/calculate-special-bonus/mysql_schemas.sql
+++ /dev/null
@@ -1,7 +0,0 @@
-Create table If Not Exists Employees (employee_id int, name varchar(30), salary int);
-Truncate table Employees;
-insert into Employees (employee_id, name, salary) values ('2', 'Meir', '3000');
-insert into Employees (employee_id, name, salary) values ('3', 'Michael', '3800');
-insert into Employees (employee_id, name, salary) values ('7', 'Addilyn', '7400');
-insert into Employees (employee_id, name, salary) values ('8', 'Juan', '6100');
-insert into Employees (employee_id, name, salary) values ('9', 'Kannon', '7700');
diff --git a/problems/camelcase-matching/README.md b/problems/camelcase-matching/README.md
deleted file mode 100644
index 3d40dd3c7..000000000
--- a/problems/camelcase-matching/README.md
+++ /dev/null
@@ -1,76 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../sum-of-root-to-leaf-binary-numbers "Sum of Root To Leaf Binary Numbers")
-
-[Next >](../video-stitching "Video Stitching")
-
-## [1023. Camelcase Matching (Medium)](https://leetcode.com/problems/camelcase-matching "驼峰式匹配")
-
-
Given an array of strings queries and a string pattern, return a boolean array answer where answer[i] is true if queries[i] matches pattern, and false otherwise.
-
-
A query word queries[i] matches pattern if you can insert lowercase English letters pattern so that it equals the query. You may insert each character at any position and you may not insert any characters.
-
-
-
Example 1:
-
-
-Input: queries = ["FooBar","FooBarTest","FootBall","FrameBuffer","ForceFeedBack"], pattern = "FB"
-Output: [true,false,true,true,false]
-Explanation: "FooBar" can be generated like this "F" + "oo" + "B" + "ar".
-"FootBall" can be generated like this "F" + "oot" + "B" + "all".
-"FrameBuffer" can be generated like this "F" + "rame" + "B" + "uffer".
-
-
-
Example 2:
-
-
-Input: queries = ["FooBar","FooBarTest","FootBall","FrameBuffer","ForceFeedBack"], pattern = "FoBa"
-Output: [true,false,true,false,false]
-Explanation: "FooBar" can be generated like this "Fo" + "o" + "Ba" + "r".
-"FootBall" can be generated like this "Fo" + "ot" + "Ba" + "ll".
-
-
-
Example 3:
-
-
-Input: queries = ["FooBar","FooBarTest","FootBall","FrameBuffer","ForceFeedBack"], pattern = "FoBaT"
-Output: [false,true,false,false,false]
-Explanation: "FooBarTest" can be generated like this "Fo" + "o" + "Ba" + "r" + "T" + "est".
-
-
-
-
Constraints:
-
-
-
1 <= pattern.length, queries.length <= 100
-
1 <= queries[i].length <= 100
-
queries[i] and pattern consist of English letters.
-
-
-### Related Topics
- [[Trie](../../tag/trie/README.md)]
- [[Two Pointers](../../tag/two-pointers/README.md)]
- [[String](../../tag/string/README.md)]
- [[String Matching](../../tag/string-matching/README.md)]
-
-### Hints
-
-Hint 1
-Given a single pattern and word, how can we solve it?
-
-
-
-Hint 2
-One way to do it is using a DP (pos1, pos2) where pos1 is a pointer to the word and pos2 to the pattern and returns true if we can match the pattern with the given word.
-
-
-
-Hint 3
-We have two scenarios: The first one is when `word[pos1] == pattern[pos2]`, then the transition will be just DP(pos1 + 1, pos2 + 1). The second scenario is when `word[pos1]` is lowercase then we can add this character to the pattern so that the transition is just DP(pos1 + 1, pos2)
-The case base is `if (pos1 == n && pos2 == m) return true;` Where n and m are the sizes of the strings word and pattern respectively.
-
diff --git a/problems/camelcase-matching/camelcase_matching.go b/problems/camelcase-matching/camelcase_matching.go
deleted file mode 100644
index a4af3e89b..000000000
--- a/problems/camelcase-matching/camelcase_matching.go
+++ /dev/null
@@ -1,18 +0,0 @@
-package problem1023
-
-func camelMatch(queries []string, pattern string) []bool {
- ans := make([]bool, len(queries))
- for i, q := range queries {
- ptn := []rune(pattern)
- for _, r := range q {
- if len(ptn) > 0 && ptn[0] == r {
- ptn = ptn[1:]
- } else if r >= 'A' && r <= 'Z' {
- ptn = []rune{1}
- break
- }
- }
- ans[i] = len(ptn) == 0
- }
- return ans
-}
diff --git a/problems/camelcase-matching/camelcase_matching_test.go b/problems/camelcase-matching/camelcase_matching_test.go
deleted file mode 100644
index 550fd2226..000000000
--- a/problems/camelcase-matching/camelcase_matching_test.go
+++ /dev/null
@@ -1,48 +0,0 @@
-package problem1023
-
-import (
- "reflect"
- "testing"
-)
-
-type testType struct {
- queries []string
- pattern string
- want []bool
-}
-
-func TestCamelMatch(t *testing.T) {
- tests := [...]testType{
- {
- queries: []string{"FooBar", "FooBarTest", "FootBall", "FrameBuffer", "ForceFeedBack"},
- pattern: "FB",
- want: []bool{true, false, true, true, false},
- },
- {
- queries: []string{"FooBar", "FooBarTest", "FootBall", "FrameBuffer", "ForceFeedBack"},
- pattern: "FoBa",
- want: []bool{true, false, true, false, false},
- },
- {
- queries: []string{"FooBar", "FooBarTest", "FootBall", "FrameBuffer", "ForceFeedBack"},
- pattern: "FoBaT",
- want: []bool{false, true, false, false, false},
- },
- {
- queries: []string{"CompetitiveProgramming", "CounterPick", "ControlPanel"},
- pattern: "CooP",
- want: []bool{false, false, true},
- },
- {
- queries: []string{"aksvbjLiknuTzqon", "ksvjLimflkpnTzqn", "mmkasvjLiknTxzqn", "ksvjLiurknTzzqbn", "ksvsjLctikgnTzqn", "knzsvzjLiknTszqn"},
- pattern: "ksvjLiknTzqn",
- want: []bool{true, true, true, true, true, true},
- },
- }
- for _, tt := range tests {
- got := camelMatch(tt.queries, tt.pattern)
- if !reflect.DeepEqual(got, tt.want) {
- t.Fatalf("in: %v, got: %v, want: %v", tt.pattern, got, tt.want)
- }
- }
-}
diff --git a/problems/campus-bikes-ii/README.md b/problems/campus-bikes-ii/README.md
deleted file mode 100644
index e75cc52fc..000000000
--- a/problems/campus-bikes-ii/README.md
+++ /dev/null
@@ -1,70 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../index-pairs-of-a-string "Index Pairs of a String")
-
-[Next >](../digit-count-in-range "Digit Count in Range")
-
-## [1066. Campus Bikes II (Medium)](https://leetcode.com/problems/campus-bikes-ii "校园自行车分配 II")
-
-
On a campus represented as a 2D grid, there are N workers and M bikes, with N <= M. Each worker and bike is a 2D coordinate on this grid.
-
-
We assign one unique bike to each worker so that the sum of the Manhattan distances between each worker and their assigned bike is minimized.
-
-
The Manhattan distance between two points p1 and p2 is Manhattan(p1, p2) = |p1.x - p2.x| + |p1.y - p2.y|.
-
-
Return the minimum possible sum of Manhattan distances between each worker and their assigned bike.
-
-
-
-
Example 1:
-
-
-
-
-Input: workers = [[0,0],[2,1]], bikes = [[1,2],[3,3]]
-Output: 6
-Explanation:
-We assign bike 0 to worker 0, bike 1 to worker 1. The Manhattan distance of both assignments is 3, so the output is 6.
-
-
-
Example 2:
-
-
-
-
-Input: workers = [[0,0],[1,1],[2,0]], bikes = [[1,0],[2,2],[2,1]]
-Output: 4
-Explanation:
-We first assign bike 0 to worker 0, then assign bike 1 to worker 1 or worker 2, bike 2 to worker 2 or worker 1. Both assignments lead to sum of the Manhattan distances as 4.
-
-
-
-### Related Topics
- [[Bit Manipulation](../../tag/bit-manipulation/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Backtracking](../../tag/backtracking/README.md)]
- [[Bitmask](../../tag/bitmask/README.md)]
-
-### Similar Questions
- 1. [Campus Bikes](../campus-bikes) (Medium)
-
-### Hints
-
-Hint 1
-Model the problem with a dp(pos, mask) where pos represents the current bike to be assigned and mask the set of available workers.
-
diff --git a/problems/campus-bikes/README.md b/problems/campus-bikes/README.md
deleted file mode 100644
index 6e99c5415..000000000
--- a/problems/campus-bikes/README.md
+++ /dev/null
@@ -1,75 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../confusing-number "Confusing Number")
-
-[Next >](../minimize-rounding-error-to-meet-target "Minimize Rounding Error to Meet Target")
-
-## [1057. Campus Bikes (Medium)](https://leetcode.com/problems/campus-bikes "校园自行车分配")
-
-
On a campus represented as a 2D grid, there are N workers and M bikes, with N <= M. Each worker and bike is a 2D coordinate on this grid.
-
-
Our goal is to assign a bike to each worker. Among the available bikes and workers, we choose the (worker, bike) pair with the shortest Manhattan distance between each other, and assign the bike to that worker. (If there are multiple (worker, bike) pairs with the same shortest Manhattan distance, we choose the pair with the smallest worker index; if there are multiple ways to do that, we choose the pair with the smallest bike index). We repeat this process until there are no available workers.
-
-
The Manhattan distance between two points p1 and p2 is Manhattan(p1, p2) = |p1.x - p2.x| + |p1.y - p2.y|.
-
-
Return a vector ans of length N, where ans[i] is the index (0-indexed) of the bike that the i-th worker is assigned to.
-
-
-
-
Example 1:
-
-
-
-
-Input: workers = [[0,0],[2,1]], bikes = [[1,2],[3,3]]
-Output: [1,0]
-Explanation:
-Worker 1 grabs Bike 0 as they are closest (without ties), and Worker 0 is assigned Bike 1. So the output is [1, 0].
-
-
-
Example 2:
-
-
-
-
-Input: workers = [[0,0],[1,1],[2,0]], bikes = [[1,0],[2,2],[2,1]]
-Output: [0,2,1]
-Explanation:
-Worker 0 grabs Bike 0 at first. Worker 1 and Worker 2 share the same distance to Bike 2, thus Worker 1 is assigned to Bike 2, and Worker 2 will take Bike 1. So the output is [0,2,1].
-
Sort the elements by distance. In case of a tie, sort them by the index of the worker. After that, if there are still ties, sort them by the index of the bike.
-
-
Can you do this in less than O(nlogn) time, where n is the total number of pairs between workers and bikes?
-
-
-
-Hint 2
-Loop the sorted elements and match each pair of worker and bike if the given worker and bike where not used.
-
diff --git a/problems/can-convert-string-in-k-moves/README.md b/problems/can-convert-string-in-k-moves/README.md
deleted file mode 100644
index 38ce7036e..000000000
--- a/problems/can-convert-string-in-k-moves/README.md
+++ /dev/null
@@ -1,76 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../kth-missing-positive-number "Kth Missing Positive Number")
-
-[Next >](../minimum-insertions-to-balance-a-parentheses-string "Minimum Insertions to Balance a Parentheses String")
-
-## [1540. Can Convert String in K Moves (Medium)](https://leetcode.com/problems/can-convert-string-in-k-moves "K 次操作转变字符串")
-
-
Given two strings s and t, your goal is to convert s into t in kmoves or less.
-
-
During the ith (1 <= i <= k) move you can:
-
-
-
Choose any index j (1-indexed) from s, such that 1 <= j <= s.length and j has not been chosen in any previous move, and shift the character at that index i times.
-
Do nothing.
-
-
-
Shifting a character means replacing it by the next letter in the alphabet (wrapping around so that 'z' becomes 'a'). Shifting a character by i means applying the shift operations i times.
-
-
Remember that any index j can be picked at most once.
-
-
Return true if it's possible to convert s into t in no more than k moves, otherwise return false.
-
-
-
Example 1:
-
-
-Input: s = "input", t = "ouput", k = 9
-Output: true
-Explanation: In the 6th move, we shift 'i' 6 times to get 'o'. And in the 7th move we shift 'n' to get 'u'.
-
-
-
Example 2:
-
-
-Input: s = "abc", t = "bcd", k = 10
-Output: false
-Explanation: We need to shift each character in s one time to convert it into t. We can shift 'a' to 'b' during the 1st move. However, there is no way to shift the other characters in the remaining moves to obtain t from s.
-
-
-
Example 3:
-
-
-Input: s = "aab", t = "bbb", k = 27
-Output: true
-Explanation: In the 1st move, we shift the first 'a' 1 time to get 'b'. In the 27th move, we shift the second 'a' 27 times to get 'b'.
-
-
-
-
Constraints:
-
-
-
1 <= s.length, t.length <= 10^5
-
0 <= k <= 10^9
-
s, t contain only lowercase English letters.
-
-
-### Related Topics
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Hints
-
-Hint 1
-Observe that shifting a letter x times has the same effect of shifting the letter x + 26 times.
-
-
-
-Hint 2
-You need to check whether k is large enough to cover all shifts with the same remainder after modulo 26.
-
diff --git a/problems/can-i-win/README.md b/problems/can-i-win/README.md
deleted file mode 100644
index dd4163c8a..000000000
--- a/problems/can-i-win/README.md
+++ /dev/null
@@ -1,69 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../island-perimeter "Island Perimeter")
-
-[Next >](../optimal-account-balancing "Optimal Account Balancing")
-
-## [464. Can I Win (Medium)](https://leetcode.com/problems/can-i-win "我能赢吗")
-
-
In the "100 game" two players take turns adding, to a running total, any integer from 1 to 10. The player who first causes the running total to reach or exceed 100 wins.
-
-
What if we change the game so that players cannot re-use integers?
-
-
For example, two players might take turns drawing from a common pool of numbers from 1 to 15 without replacement until they reach a total >= 100.
-
-
Given two integers maxChoosableInteger and desiredTotal, return true if the first player to move can force a win, otherwise, return false. Assume both players play optimally.
-
-
-
Example 1:
-
-
-Input: maxChoosableInteger = 10, desiredTotal = 11
-Output: false
-Explanation:
-No matter which integer the first player choose, the first player will lose.
-The first player can choose an integer from 1 up to 10.
-If the first player choose 1, the second player can only choose integers from 2 up to 10.
-The second player will win by choosing 10 and get a total = 11, which is >= desiredTotal.
-Same with other integers chosen by the first player, the second player will always win.
-
-
-### Related Topics
- [[Bit Manipulation](../../tag/bit-manipulation/README.md)]
- [[Memoization](../../tag/memoization/README.md)]
- [[Math](../../tag/math/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Bitmask](../../tag/bitmask/README.md)]
- [[Game Theory](../../tag/game-theory/README.md)]
-
-### Similar Questions
- 1. [Flip Game II](../flip-game-ii) (Medium)
- 1. [Guess Number Higher or Lower II](../guess-number-higher-or-lower-ii) (Medium)
- 1. [Predict the Winner](../predict-the-winner) (Medium)
diff --git a/problems/can-i-win/can_i_win.go b/problems/can-i-win/can_i_win.go
deleted file mode 100644
index cf9f28b20..000000000
--- a/problems/can-i-win/can_i_win.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem464
diff --git a/problems/can-i-win/can_i_win_test.go b/problems/can-i-win/can_i_win_test.go
deleted file mode 100644
index cf9f28b20..000000000
--- a/problems/can-i-win/can_i_win_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem464
diff --git a/problems/can-make-arithmetic-progression-from-sequence/README.md b/problems/can-make-arithmetic-progression-from-sequence/README.md
deleted file mode 100644
index 8ab8e871e..000000000
--- a/problems/can-make-arithmetic-progression-from-sequence/README.md
+++ /dev/null
@@ -1,59 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../countries-you-can-safely-invest-in "Countries You Can Safely Invest In")
-
-[Next >](../last-moment-before-all-ants-fall-out-of-a-plank "Last Moment Before All Ants Fall Out of a Plank")
-
-## [1502. Can Make Arithmetic Progression From Sequence (Easy)](https://leetcode.com/problems/can-make-arithmetic-progression-from-sequence "判断能否形成等差数列")
-
-
A sequence of numbers is called an arithmetic progression if the difference between any two consecutive elements is the same.
-
-
Given an array of numbers arr, return trueif the array can be rearranged to form an arithmetic progression. Otherwise, returnfalse.
-
-
-
Example 1:
-
-
-Input: arr = [3,5,1]
-Output: true
-Explanation: We can reorder the elements as [1,3,5] or [5,3,1] with differences 2 and -2 respectively, between each consecutive elements.
-
-
-
Example 2:
-
-
-Input: arr = [1,2,4]
-Output: false
-Explanation: There is no way to reorder the elements to obtain an arithmetic progression.
-
-
-
-
Constraints:
-
-
-
2 <= arr.length <= 1000
-
-106 <= arr[i] <= 106
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Similar Questions
- 1. [Arithmetic Subarrays](../arithmetic-subarrays) (Medium)
-
-### Hints
-
-Hint 1
-Consider that any valid arithmetic progression will be in sorted order.
-
-
-
-Hint 2
-Sort the array, then check if the differences of all consecutive elements are equal.
-
diff --git a/problems/can-make-palindrome-from-substring/README.md b/problems/can-make-palindrome-from-substring/README.md
deleted file mode 100644
index 20ea8a9eb..000000000
--- a/problems/can-make-palindrome-from-substring/README.md
+++ /dev/null
@@ -1,83 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../diet-plan-performance "Diet Plan Performance")
-
-[Next >](../number-of-valid-words-for-each-puzzle "Number of Valid Words for Each Puzzle")
-
-## [1177. Can Make Palindrome from Substring (Medium)](https://leetcode.com/problems/can-make-palindrome-from-substring "构建回文串检测")
-
-
You are given a string s and array queries where queries[i] = [lefti, righti, ki]. We may rearrange the substring s[lefti...righti] for each query and then choose up to ki of them to replace with any lowercase English letter.
-
-
If the substring is possible to be a palindrome string after the operations above, the result of the query is true. Otherwise, the result is false.
-
-
Return a boolean array answer where answer[i] is the result of the ith query queries[i].
-
-
Note that each letter is counted individually for replacement, so if, for example s[lefti...righti] = "aaa", and ki = 2, we can only replace two of the letters. Also, note that no query modifies the initial string s.
-
-
-
Example :
-
-
-Input: s = "abcda", queries = [[3,3,0],[1,2,0],[0,3,1],[0,3,2],[0,4,1]]
-Output: [true,false,false,true,true]
-Explanation:
-queries[0]: substring = "d", is palidrome.
-queries[1]: substring = "bc", is not palidrome.
-queries[2]: substring = "abcd", is not palidrome after replacing only 1 character.
-queries[3]: substring = "abcd", could be changed to "abba" which is palidrome. Also this can be changed to "baab" first rearrange it "bacd" then replace "cd" with "ab".
-queries[4]: substring = "abcda", could be changed to "abcba" which is palidrome.
-
-
-
Example 2:
-
-
-Input: s = "lyb", queries = [[0,1,0],[2,2,1]]
-Output: [false,true]
-
-
-
-
Constraints:
-
-
-
1 <= s.length, queries.length <= 105
-
0 <= lefti <= righti < s.length
-
0 <= ki <= s.length
-
s consists of lowercase English letters.
-
-
-### Related Topics
- [[Bit Manipulation](../../tag/bit-manipulation/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
- [[Prefix Sum](../../tag/prefix-sum/README.md)]
-
-### Hints
-
-Hint 1
-Since we can rearrange the substring, all we care about is the frequency of each character in that substring.
-
-
-
-Hint 2
-How to find the character frequencies efficiently ?
-
-
-
-Hint 3
-As a preprocess, calculate the accumulate frequency of all characters for all prefixes of the string.
-
-
-
-Hint 4
-How to check if a substring can be changed to a palindrome given its characters frequency ?
-
-
-
-Hint 5
-Count the number of odd frequencies, there can be at most one odd frequency in a palindrome.
-
diff --git a/problems/can-place-flowers/README.md b/problems/can-place-flowers/README.md
deleted file mode 100644
index 2cf0c8bdd..000000000
--- a/problems/can-place-flowers/README.md
+++ /dev/null
@@ -1,42 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../design-compressed-string-iterator "Design Compressed String Iterator")
-
-[Next >](../construct-string-from-binary-tree "Construct String from Binary Tree")
-
-## [605. Can Place Flowers (Easy)](https://leetcode.com/problems/can-place-flowers "种花问题")
-
-
You have a long flowerbed in which some of the plots are planted, and some are not. However, flowers cannot be planted in adjacent plots.
-
-
Given an integer array flowerbed containing 0's and 1's, where 0 means empty and 1 means not empty, and an integer n, return ifn new flowers can be planted in the flowerbed without violating the no-adjacent-flowers rule.
-
-
-
Example 1:
-
Input: flowerbed = [1,0,0,0,1], n = 1
-Output: true
-
Example 2:
-
Input: flowerbed = [1,0,0,0,1], n = 2
-Output: false
-
You are given a (0-indexed) array of positive integers candiesCount where candiesCount[i] represents the number of candies of the ith type you have. You are also given a 2D array queries where queries[i] = [favoriteTypei, favoriteDayi, dailyCapi].
-
-
You play a game with the following rules:
-
-
-
You start eating candies on day 0.
-
You cannot eat any candy of type i unless you have eaten all candies of type i - 1.
-
You must eat at leastone candy per day until you have eaten all the candies.
-
-
-
Construct a boolean array answer such that answer.length == queries.length and answer[i] is true if you can eat a candy of type favoriteTypei on day favoriteDayi without eating more thandailyCapi candies on any day, and false otherwise. Note that you can eat different types of candy on the same day, provided that you follow rule 2.
-
-
Return the constructed array answer.
-
-
-
Example 1:
-
-
-Input: candiesCount = [7,4,5,3,8], queries = [[0,2,2],[4,2,4],[2,13,1000000000]]
-Output: [true,false,true]
-Explanation:
-1- If you eat 2 candies (type 0) on day 0 and 2 candies (type 0) on day 1, you will eat a candy of type 0 on day 2.
-2- You can eat at most 4 candies each day.
- If you eat 4 candies every day, you will eat 4 candies (type 0) on day 0 and 4 candies (type 0 and type 1) on day 1.
- On day 2, you can only eat 4 candies (type 1 and type 2), so you cannot eat a candy of type 4 on day 2.
-3- If you eat 1 candy each day, you will eat a candy of type 2 on day 13.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Prefix Sum](../../tag/prefix-sum/README.md)]
-
-### Hints
-
-Hint 1
-The query is true if and only if your favorite day is in between the earliest and latest possible days to eat your favorite candy.
-
-
-
-Hint 2
-To get the earliest day, you need to eat dailyCap candies every day. To get the latest day, you need to eat 1 candy every day.
-
-
-
-Hint 3
-The latest possible day is the total number of candies with a smaller type plus the number of your favorite candy minus 1.
-
-
-
-Hint 4
-The earliest possible day that you can eat your favorite candy is the total number of candies with a smaller type divided by dailyCap.
-
diff --git a/problems/candy-crush/README.md b/problems/candy-crush/README.md
deleted file mode 100644
index 1fe58d7ca..000000000
--- a/problems/candy-crush/README.md
+++ /dev/null
@@ -1,63 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../remove-comments "Remove Comments")
-
-[Next >](../find-pivot-index "Find Pivot Index")
-
-## [723. Candy Crush (Medium)](https://leetcode.com/problems/candy-crush "粉碎糖果")
-
-
This question is about implementing a basic elimination algorithm for Candy Crush.
-
-
Given a 2D integer array board representing the grid of candy, different positive integers board[i][j] represent different types of candies. A value of board[i][j] = 0 represents that the cell at position (i, j) is empty. The given board represents the state of the game following the player's move. Now, you need to restore the board to a stable state by crushing candies according to the following rules:
-
-
-
If three or more candies of the same type are adjacent vertically or horizontally, "crush" them all at the same time - these positions become empty.
-
After crushing all candies simultaneously, if an empty space on the board has candies on top of itself, then these candies will drop until they hit a candy or bottom at the same time. (No new candies will drop outside the top boundary.)
-
After the above steps, there may exist more candies that can be crushed. If so, you need to repeat the above steps.
-
If there does not exist more candies that can be crushed (ie. the board is stable), then return the current board.
-
-
-
You need to perform the above rules until the board becomes stable, then return the current board.
The length of board[i] will be in the range [3, 50].
-
Each board[i][j] will initially start as an integer in the range [1, 2000].
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Two Pointers](../../tag/two-pointers/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
- [[Simulation](../../tag/simulation/README.md)]
-
-### Hints
-
-Hint 1
-Carefully perform the "crush" and "gravity" steps. In the crush step, flag each candy that should be removed, then go through and crush each flagged candy. In the gravity step, collect the candy in each column and then rewrite the column appropriately. Do these steps repeatedly until there's no work left to do.
-
diff --git a/problems/candy-crush/candy_crush.go b/problems/candy-crush/candy_crush.go
deleted file mode 100644
index 4ff25967b..000000000
--- a/problems/candy-crush/candy_crush.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem723
diff --git a/problems/candy-crush/candy_crush_test.go b/problems/candy-crush/candy_crush_test.go
deleted file mode 100644
index 4ff25967b..000000000
--- a/problems/candy-crush/candy_crush_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem723
diff --git a/problems/candy/README.md b/problems/candy/README.md
deleted file mode 100644
index 870b0d873..000000000
--- a/problems/candy/README.md
+++ /dev/null
@@ -1,54 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../gas-station "Gas Station")
-
-[Next >](../single-number "Single Number")
-
-## [135. Candy (Hard)](https://leetcode.com/problems/candy "分发糖果")
-
-
There are n children standing in a line. Each child is assigned a rating value given in the integer array ratings.
-
-
You are giving candies to these children subjected to the following requirements:
-
-
-
Each child must have at least one candy.
-
Children with a higher rating get more candies than their neighbors.
-
-
-
Return the minimum number of candies you need to have to distribute the candies to the children.
-
-
-
Example 1:
-
-
-Input: ratings = [1,0,2]
-Output: 5
-Explanation: You can allocate to the first, second and third child with 2, 1, 2 candies respectively.
-
-
-
Example 2:
-
-
-Input: ratings = [1,2,2]
-Output: 4
-Explanation: You can allocate to the first, second and third child with 1, 2, 1 candies respectively.
-The third child gets 1 candy because it satisfies the above two conditions.
-
-
-
-
Constraints:
-
-
-
n == ratings.length
-
1 <= n <= 2 * 104
-
0 <= ratings[i] <= 2 * 104
-
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[Array](../../tag/array/README.md)]
diff --git a/problems/candy/candy.go b/problems/candy/candy.go
deleted file mode 100644
index 09c499563..000000000
--- a/problems/candy/candy.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem135
diff --git a/problems/candy/candy_test.go b/problems/candy/candy_test.go
deleted file mode 100644
index 09c499563..000000000
--- a/problems/candy/candy_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem135
diff --git a/problems/capacity-to-ship-packages-within-d-days/README.md b/problems/capacity-to-ship-packages-within-d-days/README.md
deleted file mode 100644
index 7bb5aba1c..000000000
--- a/problems/capacity-to-ship-packages-within-d-days/README.md
+++ /dev/null
@@ -1,76 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../pairs-of-songs-with-total-durations-divisible-by-60 "Pairs of Songs With Total Durations Divisible by 60")
-
-[Next >](../numbers-with-repeated-digits "Numbers With Repeated Digits")
-
-## [1011. Capacity To Ship Packages Within D Days (Medium)](https://leetcode.com/problems/capacity-to-ship-packages-within-d-days "在 D 天内送达包裹的能力")
-
-
A conveyor belt has packages that must be shipped from one port to another within days days.
-
-
The ith package on the conveyor belt has a weight of weights[i]. Each day, we load the ship with packages on the conveyor belt (in the order given by weights). We may not load more weight than the maximum weight capacity of the ship.
-
-
Return the least weight capacity of the ship that will result in all the packages on the conveyor belt being shipped within days days.
-
-
-
Example 1:
-
-
-Input: weights = [1,2,3,4,5,6,7,8,9,10], days = 5
-Output: 15
-Explanation: A ship capacity of 15 is the minimum to ship all the packages in 5 days like this:
-1st day: 1, 2, 3, 4, 5
-2nd day: 6, 7
-3rd day: 8
-4th day: 9
-5th day: 10
-
-Note that the cargo must be shipped in the order given, so using a ship of capacity 14 and splitting the packages into parts like (2, 3, 4, 5), (1, 6, 7), (8), (9), (10) is not allowed.
-
-
-
Example 2:
-
-
-Input: weights = [3,2,2,4,1,4], days = 3
-Output: 6
-Explanation: A ship capacity of 6 is the minimum to ship all the packages in 3 days like this:
-1st day: 3, 2
-2nd day: 2, 4
-3rd day: 1, 4
-
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
-
-### Hints
-
-Hint 1
-Binary search on the answer. We need a function possible(capacity) which returns true if and only if we can do the task in D days.
-
diff --git a/problems/capacity-to-ship-packages-within-d-days/capacity_to_ship_packages_within_d_days.go b/problems/capacity-to-ship-packages-within-d-days/capacity_to_ship_packages_within_d_days.go
deleted file mode 100644
index 50fc17390..000000000
--- a/problems/capacity-to-ship-packages-within-d-days/capacity_to_ship_packages_within_d_days.go
+++ /dev/null
@@ -1,35 +0,0 @@
-package problem1011
-
-func shipWithinDays(weights []int, D int) int {
- lo, hi := 0, 0
- for _, w := range weights {
- lo = max(lo, w)
- hi += w
- }
-
- for lo < hi {
- mid := (lo + hi) >> 1
- days, cur := 1, 0
- for _, w := range weights {
- if cur+w > mid {
- days++
- cur = 0
- }
- cur += w
- }
- if days > D {
- lo = mid + 1
- } else {
- hi = mid
- }
- }
-
- return lo
-}
-
-func max(a, b int) int {
- if a > b {
- return a
- }
- return b
-}
diff --git a/problems/capital-gainloss/README.md b/problems/capital-gainloss/README.md
deleted file mode 100644
index df3815de0..000000000
--- a/problems/capital-gainloss/README.md
+++ /dev/null
@@ -1,69 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../longest-happy-prefix "Longest Happy Prefix")
-
-[Next >](../find-lucky-integer-in-an-array "Find Lucky Integer in an Array")
-
-## [1393. Capital Gain/Loss (Medium)](https://leetcode.com/problems/capital-gainloss "股票的资本损益")
-
-
Table: Stocks
-
-+---------------+---------+
-| Column Name | Type |
-+---------------+---------+
-| stock_name | varchar |
-| operation | enum |
-| operation_day | int |
-| price | int |
-+---------------+---------+
-(stock_name, day) is the primary key for this table.
-The operation column is an ENUM of type ('Sell', 'Buy')
-Each row of this table indicates that the stock which has stock_name had an operation on the day operation_day with the price.
-It is guaranteed that each 'Sell' operation for a stock has a corresponding 'Buy' operation in a previous day.
-
-
-Write an SQL query to report the Capital gain/loss for each stock.
-
-The capital gain/loss of a stock is total gain or loss after buying and selling the stock one or many times.
-
-Return the result table in any order.
-
-The query result format is in the following example:
-
-
-Stocks table:
-+---------------+-----------+---------------+--------+
-| stock_name | operation | operation_day | price |
-+---------------+-----------+---------------+--------+
-| Leetcode | Buy | 1 | 1000 |
-| Corona Masks | Buy | 2 | 10 |
-| Leetcode | Sell | 5 | 9000 |
-| Handbags | Buy | 17 | 30000 |
-| Corona Masks | Sell | 3 | 1010 |
-| Corona Masks | Buy | 4 | 1000 |
-| Corona Masks | Sell | 5 | 500 |
-| Corona Masks | Buy | 6 | 1000 |
-| Handbags | Sell | 29 | 7000 |
-| Corona Masks | Sell | 10 | 10000 |
-+---------------+-----------+---------------+--------+
-
-Result table:
-+---------------+-------------------+
-| stock_name | capital_gain_loss |
-+---------------+-------------------+
-| Corona Masks | 9500 |
-| Leetcode | 8000 |
-| Handbags | -23000 |
-+---------------+-------------------+
-Leetcode stock was bought at day 1 for 1000$ and was sold at day 5 for 9000$. Capital gain = 9000 - 1000 = 8000$.
-Handbags stock was bought at day 17 for 30000$ and was sold at day 29 for 7000$. Capital loss = 7000 - 30000 = -23000$.
-Corona Masks stock was bought at day 1 for 10$ and was sold at day 3 for 1010$. It was bought again at day 4 for 1000$ and was sold at day 5 for 500$. At last, it was bought at day 6 for 1000$ and was sold at day 10 for 10000$. Capital gain/loss is the sum of capital gains/losses for each ('Buy' --> 'Sell') operation = (1010 - 10) + (500 - 1000) + (10000 - 1000) = 1000 - 500 + 9000 = 9500$.
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/capital-gainloss/mysql_schemas.sql b/problems/capital-gainloss/mysql_schemas.sql
deleted file mode 100644
index 8b782e9d7..000000000
--- a/problems/capital-gainloss/mysql_schemas.sql
+++ /dev/null
@@ -1,12 +0,0 @@
-Create Table If Not Exists Stocks (stock_name varchar(15), operation ENUM('Sell', 'Buy'), operation_day int, price int);
-Truncate table Stocks;
-insert into Stocks (stock_name, operation, operation_day, price) values ('Leetcode', 'Buy', '1', '1000');
-insert into Stocks (stock_name, operation, operation_day, price) values ('Corona Masks', 'Buy', '2', '10');
-insert into Stocks (stock_name, operation, operation_day, price) values ('Leetcode', 'Sell', '5', '9000');
-insert into Stocks (stock_name, operation, operation_day, price) values ('Handbags', 'Buy', '17', '30000');
-insert into Stocks (stock_name, operation, operation_day, price) values ('Corona Masks', 'Sell', '3', '1010');
-insert into Stocks (stock_name, operation, operation_day, price) values ('Corona Masks', 'Buy', '4', '1000');
-insert into Stocks (stock_name, operation, operation_day, price) values ('Corona Masks', 'Sell', '5', '500');
-insert into Stocks (stock_name, operation, operation_day, price) values ('Corona Masks', 'Buy', '6', '1000');
-insert into Stocks (stock_name, operation, operation_day, price) values ('Handbags', 'Sell', '29', '7000');
-insert into Stocks (stock_name, operation, operation_day, price) values ('Corona Masks', 'Sell', '10', '10000');
diff --git a/problems/capitalize-the-title/README.md b/problems/capitalize-the-title/README.md
deleted file mode 100644
index 390a33635..000000000
--- a/problems/capitalize-the-title/README.md
+++ /dev/null
@@ -1,74 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../remove-all-ones-with-row-and-column-flips "Remove All Ones With Row and Column Flips")
-
-[Next >](../maximum-twin-sum-of-a-linked-list "Maximum Twin Sum of a Linked List")
-
-## [2129. Capitalize the Title (Easy)](https://leetcode.com/problems/capitalize-the-title "将标题首字母大写")
-
-
You are given a string title consisting of one or more words separated by a single space, where each word consists of English letters. Capitalize the string by changing the capitalization of each word such that:
-
-
-
If the length of the word is 1 or 2 letters, change all letters to lowercase.
-
Otherwise, change the first letter to uppercase and the remaining letters to lowercase.
-
-
-
Return the capitalizedtitle.
-
-
-
Example 1:
-
-
-Input: title = "capiTalIze tHe titLe"
-Output: "Capitalize The Title"
-Explanation:
-Since all the words have a length of at least 3, the first letter of each word is uppercase, and the remaining letters are lowercase.
-
-
-
Example 2:
-
-
-Input: title = "First leTTeR of EACH Word"
-Output: "First Letter of Each Word"
-Explanation:
-The word "of" has length 2, so it is all lowercase.
-The remaining words have a length of at least 3, so the first letter of each remaining word is uppercase, and the remaining letters are lowercase.
-
-
-
Example 3:
-
-
-Input: title = "i lOve leetcode"
-Output: "i Love Leetcode"
-Explanation:
-The word "i" has length 1, so it is lowercase.
-The remaining words have a length of at least 3, so the first letter of each remaining word is uppercase, and the remaining letters are lowercase.
-
-
-
-
Constraints:
-
-
-
1 <= title.length <= 100
-
title consists of words separated by a single space without any leading or trailing spaces.
-
Each word consists of uppercase and lowercase English letters and is non-empty.
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
-
-### Hints
-
-Hint 1
-Firstly, try to find all the words present in the string.
-
-
-
-Hint 2
-On the basis of each word's lengths, simulate the process explained in Problem.
-
diff --git a/problems/car-fleet-ii/README.md b/problems/car-fleet-ii/README.md
deleted file mode 100644
index 49ff94884..000000000
--- a/problems/car-fleet-ii/README.md
+++ /dev/null
@@ -1,74 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../equal-sum-arrays-with-minimum-number-of-operations "Equal Sum Arrays With Minimum Number of Operations")
-
-[Next >](../products-price-for-each-store "Product's Price for Each Store")
-
-## [1776. Car Fleet II (Hard)](https://leetcode.com/problems/car-fleet-ii "车队 II")
-
-
There are n cars traveling at different speeds in the same direction along a one-lane road. You are given an array cars of length n, where cars[i] = [positioni, speedi] represents:
-
-
-
positioni is the distance between the ith car and the beginning of the road in meters. It is guaranteed that positioni < positioni+1.
-
speedi is the initial speed of the ith car in meters per second.
-
-
-
For simplicity, cars can be considered as points moving along the number line. Two cars collide when they occupy the same position. Once a car collides with another car, they unite and form a single car fleet. The cars in the formed fleet will have the same position and the same speed, which is the initial speed of the slowest car in the fleet.
-
-
Return an array answer, where answer[i] is the time, in seconds, at which the ith car collides with the next car, or -1 if the car does not collide with the next car. Answers within 10-5 of the actual answers are accepted.
-
-
-
Example 1:
-
-
-Input: cars = [[1,2],[2,1],[4,3],[7,2]]
-Output: [1.00000,-1.00000,3.00000,-1.00000]
-Explanation: After exactly one second, the first car will collide with the second car, and form a car fleet with speed 1 m/s. After exactly 3 seconds, the third car will collide with the fourth car, and form a car fleet with speed 2 m/s.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Math](../../tag/math/README.md)]
- [[Stack](../../tag/stack/README.md)]
- [[Heap (Priority Queue)](../../tag/heap-priority-queue/README.md)]
- [[Monotonic Stack](../../tag/monotonic-stack/README.md)]
-
-### Similar Questions
- 1. [Car Fleet](../car-fleet) (Medium)
-
-### Hints
-
-Hint 1
-We can simply ignore the merging of any car fleet, simply assume they cross each other. Now the aim is to find the first car to the right, which intersects with the current car before any other.
-
-
-
-Hint 2
-Assume we have already considered all cars to the right already, now the current car is to be considered. Let’s ignore all cars with speeds higher than the current car since the current car cannot intersect with those ones. Now, all cars to the right having speed strictly less than current car are to be considered. Now, for two cars c1 and c2 with positions p1 and p2 (p1 < p2) and speed s1 and s2 (s1 > s2), if c1 and c2 intersect before the current car and c2, then c1 can never be the first car of intersection for any car to the left of current car including current car. So we can remove that car from our consideration.
-
-
-
-Hint 3
-We can see that we can maintain candidate cars in this way using a stack, removing cars with speed greater than or equal to current car, and then removing cars which can never be first point of intersection. The first car after this process (if any) would be first point of intersection.
-
diff --git a/problems/car-fleet/README.md b/problems/car-fleet/README.md
deleted file mode 100644
index 3c65d371a..000000000
--- a/problems/car-fleet/README.md
+++ /dev/null
@@ -1,62 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../peak-index-in-a-mountain-array "Peak Index in a Mountain Array")
-
-[Next >](../k-similar-strings "K-Similar Strings")
-
-## [853. Car Fleet (Medium)](https://leetcode.com/problems/car-fleet "车队")
-
-
There are n cars going to the same destination along a one-lane road. The destination is target miles away.
-
-
You are given two integer array position and speed, both of length n, where position[i] is the position of the ith car and speed[i] is the speed of the ith car (in miles per hour).
-
-
A car can never pass another car ahead of it, but it can catch up to it, and drive bumper to bumper at the same speed.
-
-
The distance between these two cars is ignored (i.e., they are assumed to have the same position).
-
-
A car fleet is some non-empty set of cars driving at the same position and same speed. Note that a single car is also a car fleet.
-
-
If a car catches up to a car fleet right at the destination point, it will still be considered as one car fleet.
-
-
Return the number of car fleets that will arrive at the destination.
-
-
-
Example 1:
-
-
-Input: target = 12, position = [10,8,0,5,3], speed = [2,4,1,1,3]
-Output: 3
-Explanation:
-The cars starting at 10 and 8 become a fleet, meeting each other at 12.
-The car starting at 0 doesn't catch up to any other car, so it is a fleet by itself.
-The cars starting at 5 and 3 become a fleet, meeting each other at 6.
-Note that no other cars meet these fleets before the destination, so the answer is 3.
-
There is a car with capacity empty seats. The vehicle only drives east (i.e., it cannot turn around and drive west).
-
-
You are given the integer capacity and an array trips where trips[i] = [numPassengersi, fromi, toi] indicates that the ith trip has numPassengersi passengers and the locations to pick them up and drop them off are fromi and toi respectively. The locations are given as the number of kilometers due east from the car's initial location.
-
-
Return true if it is possible to pick up and drop off all passengers for all the given trips, or false otherwise.
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Prefix Sum](../../tag/prefix-sum/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
- [[Simulation](../../tag/simulation/README.md)]
- [[Heap (Priority Queue)](../../tag/heap-priority-queue/README.md)]
-
-### Similar Questions
- 1. [Meeting Rooms II](../meeting-rooms-ii) (Medium)
-
-### Hints
-
-Hint 1
-Sort the pickup and dropoff events by location, then process them in order.
-
diff --git a/problems/car-pooling/car_pooling.go b/problems/car-pooling/car_pooling.go
deleted file mode 100644
index c5254f4c5..000000000
--- a/problems/car-pooling/car_pooling.go
+++ /dev/null
@@ -1,19 +0,0 @@
-package problem1094
-
-func carPooling(trips [][]int, capacity int) bool {
- location := [1001]int{}
- for _, t := range trips {
- num, start, end := t[0], t[1], t[2]
- location[start] += num
- location[end] -= num
- }
-
- p := 0
- for _, c := range location {
- p += c
- if p > capacity {
- return false
- }
- }
- return true
-}
diff --git a/problems/card-flipping-game/README.md b/problems/card-flipping-game/README.md
deleted file mode 100644
index 90ae2335a..000000000
--- a/problems/card-flipping-game/README.md
+++ /dev/null
@@ -1,53 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../shortest-distance-to-a-character "Shortest Distance to a Character")
-
-[Next >](../binary-trees-with-factors "Binary Trees With Factors")
-
-## [822. Card Flipping Game (Medium)](https://leetcode.com/problems/card-flipping-game "翻转卡片游戏")
-
-
You are given n cards, with a positive integer printed on the front and back of each card (possibly different). You can flip any number of cards (possibly zero).
-
-
After choosing the front and the back of each card, you will pick each card, and if the integer printed on the back of this card is not printed on the front of any other card, then this integer is good.
-
-
You are given two integer array fronts and backs where fronts[i] and backs[i] are the integers printer on the front and the back of the ith card respectively.
-
-
Return the smallest good and integer after flipping the cards. If there are no good integers, return 0.
-
-
Note that a flip swaps the front and back numbers, so the value on the front is now on the back and vice versa.
-
-
-
Example 1:
-
-
-Input: fronts = [1,2,4,4,7], backs = [1,3,4,1,3]
-Output: 2
-Explanation: If we flip the second card, the fronts are [1,3,4,4,7] and the backs are [1,2,4,1,3].
-We choose the second card, which has the number 2 on the back, and it is not on the front of any card, so 2 is good.
-
A game is played by a cat and a mouse named Cat and Mouse.
-
-
The environment is represented by a grid of size rows x cols, where each element is a wall, floor, player (Cat, Mouse), or food.
-
-
-
Players are represented by the characters 'C'(Cat),'M'(Mouse).
-
Floors are represented by the character '.' and can be walked on.
-
Walls are represented by the character '#' and cannot be walked on.
-
Food is represented by the character 'F' and can be walked on.
-
There is only one of each character 'C', 'M', and 'F' in grid.
-
-
-
Mouse and Cat play according to the following rules:
-
-
-
Mouse moves first, then they take turns to move.
-
During each turn, Cat and Mouse can jump in one of the four directions (left, right, up, down). They cannot jump over the wall nor outside of the grid.
-
catJump, mouseJump are the maximum lengths Cat and Mouse can jump at a time, respectively. Cat and Mouse can jump less than the maximum length.
-
Staying in the same position is allowed.
-
Mouse can jump over Cat.
-
-
-
The game can end in 4 ways:
-
-
-
If Cat occupies the same position as Mouse, Cat wins.
-
If Cat reaches the food first, Cat wins.
-
If Mouse reaches the food first, Mouse wins.
-
If Mouse cannot get to the food within 1000 turns, Cat wins.
-
-
-
Given a rows x cols matrix grid and two integers catJump and mouseJump, return true if Mouse can win the game if both Cat and Mouse play optimally, otherwise return false.
-
-
-
Example 1:
-
-
-Input: grid = ["####F","#C...","M...."], catJump = 1, mouseJump = 2
-Output: true
-Explanation: Cat cannot catch Mouse on its turn nor can it get the food before Mouse.
-
grid[i][j] consist only of characters 'C', 'M', 'F', '.', and '#'.
-
There is only one of each character 'C', 'M', and 'F' in grid.
-
1 <= catJump, mouseJump <= 8
-
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Graph](../../tag/graph/README.md)]
- [[Memoization](../../tag/memoization/README.md)]
- [[Game Theory](../../tag/game-theory/README.md)]
-
-### Similar Questions
- 1. [Escape The Ghosts](../escape-the-ghosts) (Medium)
- 1. [Cat and Mouse](../cat-and-mouse) (Hard)
-
-### Hints
-
-Hint 1
-Try working backward: consider all trivial states you know to be winning or losing, and work backward to determine which other states can be labeled as winning or losing.
-
diff --git a/problems/cat-and-mouse/README.md b/problems/cat-and-mouse/README.md
deleted file mode 100644
index 20304f04b..000000000
--- a/problems/cat-and-mouse/README.md
+++ /dev/null
@@ -1,73 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../sort-an-array "Sort an Array")
-
-[Next >](../x-of-a-kind-in-a-deck-of-cards "X of a Kind in a Deck of Cards")
-
-## [913. Cat and Mouse (Hard)](https://leetcode.com/problems/cat-and-mouse "猫和老鼠")
-
-
A game on an undirected graph is played by two players, Mouse and Cat, who alternate turns.
-
-
The graph is given as follows: graph[a] is a list of all nodes b such that ab is an edge of the graph.
-
-
The mouse starts at node 1 and goes first, the cat starts at node 2 and goes second, and there is a hole at node 0.
-
-
During each player's turn, they must travel along one edge of the graph that meets where they are. For example, if the Mouse is at node 1, it must travel to any node in graph[1].
-
-
Additionally, it is not allowed for the Cat to travel to the Hole (node 0.)
-
-
Then, the game can end in three ways:
-
-
-
If ever the Cat occupies the same node as the Mouse, the Cat wins.
-
If ever the Mouse reaches the Hole, the Mouse wins.
-
If ever a position is repeated (i.e., the players are in the same position as a previous turn, and it is the same player's turn to move), the game is a draw.
-
-
-
Given a graph, and assuming both players play optimally, return
There is an m x n matrix that is initialized to all 0's. There is also a 2D array indices where each indices[i] = [ri, ci] represents a 0-indexed location to perform some increment operations on the matrix.
-
-
For each location indices[i], do both of the following:
-
-
-
Increment all the cells on row ri.
-
Increment all the cells on column ci.
-
-
-
Given m, n, and indices, return the number of odd-valued cells in the matrix after applying the increment to all locations in indices.
-
-
-
Example 1:
-
-
-Input: m = 2, n = 3, indices = [[0,1],[1,1]]
-Output: 6
-Explanation: Initial matrix = [[0,0,0],[0,0,0]].
-After applying first increment it becomes [[1,2,1],[0,1,0]].
-The final matrix is [[1,3,1],[1,3,1]], which contains 6 odd numbers.
-
-
-
Example 2:
-
-
-Input: m = 2, n = 2, indices = [[1,1],[0,0]]
-Output: 0
-Explanation: Final matrix = [[2,2],[2,2]]. There are no odd numbers in the final matrix.
-
-
-
-
Constraints:
-
-
-
1 <= m, n <= 50
-
1 <= indices.length <= 100
-
0 <= ri < m
-
0 <= ci < n
-
-
-
-
Follow up: Could you solve this in O(n + m + indices.length) time with only O(n + m) extra space?
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Math](../../tag/math/README.md)]
- [[Simulation](../../tag/simulation/README.md)]
-
-### Hints
-
-Hint 1
-Simulation : With small constraints, it is possible to apply changes to each row and column and count odd cells after applying it.
-
-
-
-Hint 2
-You can accumulate the number you should add to each row and column and then you can count the number of odd cells.
-
diff --git a/problems/chalkboard-xor-game/README.md b/problems/chalkboard-xor-game/README.md
deleted file mode 100644
index b3e8c6744..000000000
--- a/problems/chalkboard-xor-game/README.md
+++ /dev/null
@@ -1,61 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../expressive-words "Expressive Words")
-
-[Next >](../subdomain-visit-count "Subdomain Visit Count")
-
-## [810. Chalkboard XOR Game (Hard)](https://leetcode.com/problems/chalkboard-xor-game "黑板异或游戏")
-
-
You are given an array of integers nums represents the numbers written on a chalkboard.
-
-
Alice and Bob take turns erasing exactly one number from the chalkboard, with Alice starting first. If erasing a number causes the bitwise XOR of all the elements of the chalkboard to become 0, then that player loses. The bitwise XOR of one element is that element itself, and the bitwise XOR of no elements is 0.
-
-
Also, if any player starts their turn with the bitwise XOR of all the elements of the chalkboard equal to 0, then that player wins.
-
-
Return trueif and only if Alice wins the game, assuming both players play optimally.
-
-
-
Example 1:
-
-
-Input: nums = [1,1,2]
-Output: false
-Explanation:
-Alice has two choices: erase 1 or erase 2.
-If she erases 1, the nums array becomes [1, 2]. The bitwise XOR of all the elements of the chalkboard is 1 XOR 2 = 3. Now Bob can remove any element he wants, because Alice will be the one to erase the last element and she will lose.
-If Alice erases 2 first, now nums become [1, 1]. The bitwise XOR of all the elements of the chalkboard is 1 XOR 1 = 0. Alice will lose.
-
We stack glasses in a pyramid, where the first row has 1 glass, the second row has 2 glasses, and so on until the 100th row. Each glass holds one cup of champagne.
-
-
Then, some champagne is poured into the first glass at the top. When the topmost glass is full, any excess liquid poured will fall equally to the glass immediately to the left and right of it. When those glasses become full, any excess champagne will fall equally to the left and right of those glasses, and so on. (A glass at the bottom row has its excess champagne fall on the floor.)
-
-
For example, after one cup of champagne is poured, the top most glass is full. After two cups of champagne are poured, the two glasses on the second row are half full. After three cups of champagne are poured, those two cups become full - there are 3 full glasses total now. After four cups of champagne are poured, the third row has the middle glass half full, and the two outside glasses are a quarter full, as pictured below.
-
-
-
-
Now after pouring some non-negative integer cups of champagne, return how full the jth glass in the ith row is (both i and j are 0-indexed.)
-
-
-
Example 1:
-
-
-Input: poured = 1, query_row = 1, query_glass = 1
-Output: 0.00000
-Explanation: We poured 1 cup of champange to the top glass of the tower (which is indexed as (0, 0)). There will be no excess liquid so all the glasses under the top glass will remain empty.
-
-
-
Example 2:
-
-
-Input: poured = 2, query_row = 1, query_glass = 1
-Output: 0.50000
-Explanation: We poured 2 cups of champange to the top glass of the tower (which is indexed as (0, 0)). There is one cup of excess liquid. The glass indexed as (1, 0) and the glass indexed as (1, 1) will share the excess liquid equally, and each will get half cup of champange.
-
-
-### Related Topics
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
diff --git a/problems/champagne-tower/champagne_tower.go b/problems/champagne-tower/champagne_tower.go
deleted file mode 100644
index a54d9ee72..000000000
--- a/problems/champagne-tower/champagne_tower.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem799
diff --git a/problems/champagne-tower/champagne_tower_test.go b/problems/champagne-tower/champagne_tower_test.go
deleted file mode 100644
index a54d9ee72..000000000
--- a/problems/champagne-tower/champagne_tower_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem799
diff --git a/problems/change-minimum-characters-to-satisfy-one-of-three-conditions/README.md b/problems/change-minimum-characters-to-satisfy-one-of-three-conditions/README.md
deleted file mode 100644
index 98008661a..000000000
--- a/problems/change-minimum-characters-to-satisfy-one-of-three-conditions/README.md
+++ /dev/null
@@ -1,70 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../latest-time-by-replacing-hidden-digits "Latest Time by Replacing Hidden Digits")
-
-[Next >](../find-kth-largest-xor-coordinate-value "Find Kth Largest XOR Coordinate Value")
-
-## [1737. Change Minimum Characters to Satisfy One of Three Conditions (Medium)](https://leetcode.com/problems/change-minimum-characters-to-satisfy-one-of-three-conditions "满足三条件之一需改变的最少字符数")
-
-
You are given two strings a and b that consist of lowercase letters. In one operation, you can change any character in a or b to any lowercase letter.
-
-
Your goal is to satisfy one of the following three conditions:
-
-
-
Every letter in a is strictly less than every letter in b in the alphabet.
-
Every letter in b is strictly less than every letter in a in the alphabet.
-
Botha and b consist of only one distinct letter.
-
-
-
Return the minimum number of operations needed to achieve your goal.
-
-
-
Example 1:
-
-
-Input: a = "aba", b = "caa"
-Output: 2
-Explanation: Consider the best way to make each condition true:
-1) Change b to "ccc" in 2 operations, then every letter in a is less than every letter in b.
-2) Change a to "bbb" and b to "aaa" in 3 operations, then every letter in b is less than every letter in a.
-3) Change a to "aaa" and b to "aaa" in 2 operations, then a and b consist of one distinct letter.
-The best way was done in 2 operations (either condition 1 or condition 3).
-
-
-
Example 2:
-
-
-Input: a = "dabadd", b = "cda"
-Output: 3
-Explanation: The best way is to make condition 1 true by changing b to "eee".
-
-
-
-
Constraints:
-
-
-
1 <= a.length, b.length <= 105
-
a and b consist only of lowercase letters.
-
-
-### Related Topics
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
- [[Counting](../../tag/counting/README.md)]
- [[Prefix Sum](../../tag/prefix-sum/README.md)]
-
-### Hints
-
-Hint 1
-Iterate on each letter in the alphabet, and check the smallest number of operations needed to make it one of the following: the largest letter in a and smaller than the smallest one in b, vice versa, or let a and b consist only of this letter.
-
-
-
-Hint 2
-For the first 2 conditions, take care that you can only change characters to lowercase letters, so you can't make 'z' the smallest letter in one of the strings or 'a' the largest letter in one of them.
-
diff --git a/problems/change-the-root-of-a-binary-tree/README.md b/problems/change-the-root-of-a-binary-tree/README.md
deleted file mode 100644
index 532482af4..000000000
--- a/problems/change-the-root-of-a-binary-tree/README.md
+++ /dev/null
@@ -1,30 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-initial-energy-to-finish-tasks "Minimum Initial Energy to Finish Tasks")
-
-[Next >](../fix-names-in-a-table "Fix Names in a Table")
-
-## [1666. Change the Root of a Binary Tree (Medium)](https://leetcode.com/problems/change-the-root-of-a-binary-tree "改变二叉树的根节点")
-
-
-
-### Related Topics
- [[Tree](../../tag/tree/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Binary Tree](../../tag/binary-tree/README.md)]
-
-### Hints
-
-Hint 1
-Start traversing from the leaf. Always go up till you reach the root.
-
-
-
-Hint 2
-Change pointers as asked, make the current node's parent its left child, and make the left child the right one if needed.
-
diff --git a/problems/cheapest-flights-within-k-stops/README.md b/problems/cheapest-flights-within-k-stops/README.md
deleted file mode 100644
index 04469ee9c..000000000
--- a/problems/cheapest-flights-within-k-stops/README.md
+++ /dev/null
@@ -1,61 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../k-th-smallest-prime-fraction "K-th Smallest Prime Fraction")
-
-[Next >](../rotated-digits "Rotated Digits")
-
-## [787. Cheapest Flights Within K Stops (Medium)](https://leetcode.com/problems/cheapest-flights-within-k-stops "K 站中转内最便宜的航班")
-
-
There are n cities connected by some number of flights. You are given an array flights where flights[i] = [fromi, toi, pricei] indicates that there is a flight from city fromi to city toi with cost pricei.
-
-
You are also given three integers src, dst, and k, return the cheapest price from src to dst with at most k stops. If there is no such route, return-1.
-
-
-
Example 1:
-
-
-Input: n = 3, flights = [[0,1,100],[1,2,100],[0,2,500]], src = 0, dst = 2, k = 1
-Output: 200
-Explanation: The graph is shown.
-The cheapest price from city 0 to city 2 with at most 1 stop costs 200, as marked red in the picture.
-
-
-
Example 2:
-
-
-Input: n = 3, flights = [[0,1,100],[1,2,100],[0,2,500]], src = 0, dst = 2, k = 0
-Output: 500
-Explanation: The graph is shown.
-The cheapest price from city 0 to city 2 with at most 0 stop costs 500, as marked blue in the picture.
-
-
-
-
Constraints:
-
-
-
1 <= n <= 100
-
0 <= flights.length <= (n * (n - 1) / 2)
-
flights[i].length == 3
-
0 <= fromi, toi < n
-
fromi != toi
-
1 <= pricei <= 104
-
There will not be any multiple flights between two cities.
You are given an array of distinct integers arr and an array of integer arrays pieces, where the integers in pieces are distinct. Your goal is to form arr by concatenating the arrays in piecesin any order. However, you are not allowed to reorder the integers in each array pieces[i].
-
-
Return trueif it is possible to form the array arr from pieces. Otherwise, return false.
-Input: arr = [49,18,16], pieces = [[16,18,49]]
-Output: false
-Explanation: Even though the numbers match, we cannot reorder pieces[0].
-
-
-
Example 3:
-
-
-Input: arr = [91,4,64,78], pieces = [[78],[4,64],[91]]
-Output: true
-Explanation: Concatenate [91] then [4,64] then [78]
-
-
-
-
Constraints:
-
-
-
1 <= pieces.length <= arr.length <= 100
-
sum(pieces[i].length) == arr.length
-
1 <= pieces[i].length <= arr.length
-
1 <= arr[i], pieces[i][j] <= 100
-
The integers in arr are distinct.
-
The integers in pieces are distinct (i.e., If we flatten pieces in a 1D array, all the integers in this array are distinct).
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
-
-### Hints
-
-Hint 1
-Note that the distinct part means that every position in the array belongs to only one piece
-
-
-
-Hint 2
-Note that you can get the piece every position belongs to naively
-
diff --git a/problems/check-completeness-of-a-binary-tree/README.md b/problems/check-completeness-of-a-binary-tree/README.md
deleted file mode 100644
index e6538cb8f..000000000
--- a/problems/check-completeness-of-a-binary-tree/README.md
+++ /dev/null
@@ -1,46 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../prison-cells-after-n-days "Prison Cells After N Days")
-
-[Next >](../regions-cut-by-slashes "Regions Cut By Slashes")
-
-## [958. Check Completeness of a Binary Tree (Medium)](https://leetcode.com/problems/check-completeness-of-a-binary-tree "二叉树的完全性检验")
-
-
Given the root of a binary tree, determine if it is a complete binary tree.
-
-
In a complete binary tree, every level, except possibly the last, is completely filled, and all nodes in the last level are as far left as possible. It can have between 1 and 2h nodes inclusive at the last level h.
-
-
-
Example 1:
-
-
-Input: root = [1,2,3,4,5,6]
-Output: true
-Explanation: Every level before the last is full (ie. levels with node-values {1} and {2, 3}), and all nodes in the last level ({4, 5, 6}) are as far left as possible.
-
-
-
Example 2:
-
-
-Input: root = [1,2,3,4,5,null,7]
-Output: false
-Explanation: The node with value 7 isn't as far left as possible.
-
-
-
-
Constraints:
-
-
-
The number of nodes in the tree is in the range [1, 100].
-
1 <= Node.val <= 1000
-
-
-### Related Topics
- [[Tree](../../tag/tree/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Binary Tree](../../tag/binary-tree/README.md)]
diff --git a/problems/check-completeness-of-a-binary-tree/check_completeness_of_a_binary_tree.go b/problems/check-completeness-of-a-binary-tree/check_completeness_of_a_binary_tree.go
deleted file mode 100644
index 8bf9a0eea..000000000
--- a/problems/check-completeness-of-a-binary-tree/check_completeness_of_a_binary_tree.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem958
diff --git a/problems/check-completeness-of-a-binary-tree/check_completeness_of_a_binary_tree_test.go b/problems/check-completeness-of-a-binary-tree/check_completeness_of_a_binary_tree_test.go
deleted file mode 100644
index 8bf9a0eea..000000000
--- a/problems/check-completeness-of-a-binary-tree/check_completeness_of_a_binary_tree_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem958
diff --git a/problems/check-if-a-number-is-majority-element-in-a-sorted-array/README.md b/problems/check-if-a-number-is-majority-element-in-a-sorted-array/README.md
deleted file mode 100644
index ca9cb277e..000000000
--- a/problems/check-if-a-number-is-majority-element-in-a-sorted-array/README.md
+++ /dev/null
@@ -1,77 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../article-views-ii "Article Views II")
-
-[Next >](../minimum-swaps-to-group-all-1s-together "Minimum Swaps to Group All 1's Together")
-
-## [1150. Check If a Number Is Majority Element in a Sorted Array (Easy)](https://leetcode.com/problems/check-if-a-number-is-majority-element-in-a-sorted-array "检查一个数是否在数组中占绝大多数")
-
-
Given an array nums sorted in non-decreasing order, and a number target, return True if and only if target is a majority element.
-
-
A majority element is an element that appears more than N/2 times in an array of length N.
-
-
-
-
Example 1:
-
-
-Input: nums = [2,4,5,5,5,5,5,6,6], target = 5
-Output: true
-Explanation:
-The value 5 appears 5 times and the length of the array is 9.
-Thus, 5 is a majority element because 5 > 9/2 is true.
-
-
-
Example 2:
-
-
-Input: nums = [10,100,101,101], target = 101
-Output: false
-Explanation:
-The value 101 appears 2 times and the length of the array is 4.
-Thus, 101 is not a majority element because 2 > 4/2 is false.
-
-
-
-
-
Note:
-
-
-
1 <= nums.length <= 1000
-
1 <= nums[i] <= 10^9
-
1 <= target <= 10^9
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
-
-### Similar Questions
- 1. [Majority Element](../majority-element) (Easy)
- 1. [Majority Element II](../majority-element-ii) (Medium)
-
-### Hints
-
-Hint 1
-How to check if a given number target is a majority element?.
-
-
-
-Hint 2
-Find the frequency of target and compare it to the length of the array.
-
-
-
-Hint 3
-You can find the frequency of an element using Binary Search since the array is sorted.
-
-
-
-Hint 4
-Using Binary Search, find the first and last occurrences of A. Then just calculate the difference between the indexes of these occurrences.
-
diff --git a/problems/check-if-a-parentheses-string-can-be-valid/README.md b/problems/check-if-a-parentheses-string-can-be-valid/README.md
deleted file mode 100644
index 9145e429f..000000000
--- a/problems/check-if-a-parentheses-string-can-be-valid/README.md
+++ /dev/null
@@ -1,86 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../find-all-possible-recipes-from-given-supplies "Find All Possible Recipes from Given Supplies")
-
-[Next >](../abbreviating-the-product-of-a-range "Abbreviating the Product of a Range")
-
-## [2116. Check if a Parentheses String Can Be Valid (Medium)](https://leetcode.com/problems/check-if-a-parentheses-string-can-be-valid "判断一个括号字符串是否有效")
-
-
A parentheses string is a non-empty string consisting only of '(' and ')'. It is valid if any of the following conditions is true:
-
-
-
It is ().
-
It can be written as AB (A concatenated with B), where A and B are valid parentheses strings.
-
It can be written as (A), where A is a valid parentheses string.
-
-
-
You are given a parentheses string s and a string locked, both of length n. locked is a binary string consisting only of '0's and '1's. For each index i of locked,
-
-
-
If locked[i] is '1', you cannot change s[i].
-
But if locked[i] is '0', you can change s[i] to either '(' or ')'.
-
-
-
Return trueif you can make s a valid parentheses string. Otherwise, return false.
-
-
-
Example 1:
-
-
-Input: s = "))()))", locked = "010100"
-Output: true
-Explanation: locked[1] == '1' and locked[3] == '1', so we cannot change s[1] or s[3].
-We change s[0] and s[4] to '(' while leaving s[2] and s[5] unchanged to make s valid.
-
-
Example 2:
-
-
-Input: s = "()()", locked = "0000"
-Output: true
-Explanation: We do not need to make any changes because s is already valid.
-
-
-
Example 3:
-
-
-Input: s = ")", locked = "0"
-Output: false
-Explanation: locked permits us to change s[0].
-Changing s[0] to either '(' or ')' will not make s valid.
-
-
-
-
Constraints:
-
-
-
n == s.length == locked.length
-
1 <= n <= 105
-
s[i] is either '(' or ')'.
-
locked[i] is either '0' or '1'.
-
-
-### Related Topics
- [[Stack](../../tag/stack/README.md)]
- [[Greedy](../../tag/greedy/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Hints
-
-Hint 1
-Can an odd length string ever be valid?
-
-
-
-Hint 2
-From left to right, if a locked ')' is encountered, it must be balanced with either a locked '(' or an unlocked index on its left. If neither exist, what conclusion can be drawn? If both exist, which one is more preferable to use?
-
-
-
-Hint 3
-After the above, we may have locked indices of '(' and additional unlocked indices. How can you balance out the locked '(' now? What if you cannot balance any locked '('?
-
diff --git a/problems/check-if-a-string-can-break-another-string/README.md b/problems/check-if-a-string-can-break-another-string/README.md
deleted file mode 100644
index 967b846b1..000000000
--- a/problems/check-if-a-string-can-break-another-string/README.md
+++ /dev/null
@@ -1,61 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../max-difference-you-can-get-from-changing-an-integer "Max Difference You Can Get From Changing an Integer")
-
-[Next >](../number-of-ways-to-wear-different-hats-to-each-other "Number of Ways to Wear Different Hats to Each Other")
-
-## [1433. Check If a String Can Break Another String (Medium)](https://leetcode.com/problems/check-if-a-string-can-break-another-string "检查一个字符串是否可以打破另一个字符串")
-
-
Given two strings: s1 and s2 with the same size, check if some permutation of string s1 can break some permutation of string s2 or vice-versa. In other words s2 can break s1 or vice-versa.
-
-
A string x can break string y (both of size n) if x[i] >= y[i] (in alphabetical order) for all i between 0 and n-1.
-
-
-
Example 1:
-
-
-Input: s1 = "abc", s2 = "xya"
-Output: true
-Explanation: "ayx" is a permutation of s2="xya" which can break to string "abc" which is a permutation of s1="abc".
-
-
-
Example 2:
-
-
-Input: s1 = "abe", s2 = "acd"
-Output: false
-Explanation: All permutations for s1="abe" are: "abe", "aeb", "bae", "bea", "eab" and "eba" and all permutation for s2="acd" are: "acd", "adc", "cad", "cda", "dac" and "dca". However, there is not any permutation from s1 which can break some permutation from s2 and vice-versa.
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
- [[Greedy](../../tag/greedy/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Hints
-
-Hint 1
-Sort both strings and then check if one of them can break the other.
-
diff --git a/problems/check-if-a-string-contains-all-binary-codes-of-size-k/README.md b/problems/check-if-a-string-contains-all-binary-codes-of-size-k/README.md
deleted file mode 100644
index 1e1302333..000000000
--- a/problems/check-if-a-string-contains-all-binary-codes-of-size-k/README.md
+++ /dev/null
@@ -1,66 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../make-two-arrays-equal-by-reversing-sub-arrays "Make Two Arrays Equal by Reversing Sub-arrays")
-
-[Next >](../course-schedule-iv "Course Schedule IV")
-
-## [1461. Check If a String Contains All Binary Codes of Size K (Medium)](https://leetcode.com/problems/check-if-a-string-contains-all-binary-codes-of-size-k "检查一个字符串是否包含所有长度为 K 的二进制子串")
-
-
Given a binary string s and an integer k, return trueif every binary code of lengthkis a substring ofs. Otherwise, return false.
-
-
-
Example 1:
-
-
-Input: s = "00110110", k = 2
-Output: true
-Explanation: The binary codes of length 2 are "00", "01", "10" and "11". They can be all found as substrings at indices 0, 1, 3 and 2 respectively.
-
-
-
Example 2:
-
-
-Input: s = "0110", k = 1
-Output: true
-Explanation: The binary codes of length 1 are "0" and "1", it is clear that both exist as a substring.
-
-
-
Example 3:
-
-
-Input: s = "0110", k = 2
-Output: false
-Explanation: The binary code "00" is of length 2 and does not exist in the array.
-
-
-
-
Constraints:
-
-
-
1 <= s.length <= 5 * 105
-
s[i] is either '0' or '1'.
-
1 <= k <= 20
-
-
-### Related Topics
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
- [[Bit Manipulation](../../tag/bit-manipulation/README.md)]
- [[Rolling Hash](../../tag/rolling-hash/README.md)]
- [[Hash Function](../../tag/hash-function/README.md)]
-
-### Hints
-
-Hint 1
-We need only to check all sub-strings of length k.
-
-
-
-Hint 2
-The number of distinct sub-strings should be exactly 2^k.
-
diff --git a/problems/check-if-a-string-is-a-valid-sequence-from-root-to-leaves-path-in-a-binary-tree/README.md b/problems/check-if-a-string-is-a-valid-sequence-from-root-to-leaves-path-in-a-binary-tree/README.md
deleted file mode 100644
index 82be2ec2f..000000000
--- a/problems/check-if-a-string-is-a-valid-sequence-from-root-to-leaves-path-in-a-binary-tree/README.md
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../first-unique-number "First Unique Number")
-
-[Next >](../kids-with-the-greatest-number-of-candies "Kids With the Greatest Number of Candies")
-
-## [1430. Check If a String Is a Valid Sequence from Root to Leaves Path in a Binary Tree (Medium)](https://leetcode.com/problems/check-if-a-string-is-a-valid-sequence-from-root-to-leaves-path-in-a-binary-tree "判断给定的序列是否是二叉树从根到叶的路径")
-
-
-
-### Related Topics
- [[Tree](../../tag/tree/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Binary Tree](../../tag/binary-tree/README.md)]
-
-### Hints
-
-Hint 1
-Depth-first search (DFS) with the parameters: current node in the binary tree and current position in the array of integers.
-
-
-
-Hint 2
-When reaching at final position check if it is a leaf node.
-
diff --git a/problems/check-if-a-word-occurs-as-a-prefix-of-any-word-in-a-sentence/README.md b/problems/check-if-a-word-occurs-as-a-prefix-of-any-word-in-a-sentence/README.md
deleted file mode 100644
index 95c2506ca..000000000
--- a/problems/check-if-a-word-occurs-as-a-prefix-of-any-word-in-a-sentence/README.md
+++ /dev/null
@@ -1,73 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../active-users "Active Users")
-
-[Next >](../maximum-number-of-vowels-in-a-substring-of-given-length "Maximum Number of Vowels in a Substring of Given Length")
-
-## [1455. Check If a Word Occurs As a Prefix of Any Word in a Sentence (Easy)](https://leetcode.com/problems/check-if-a-word-occurs-as-a-prefix-of-any-word-in-a-sentence "检查单词是否为句中其他单词的前缀")
-
-
Given a sentence that consists of some words separated by a single space, and a searchWord, check if searchWord is a prefix of any word in sentence.
-
-
Return the index of the word in sentence (1-indexed) where searchWord is a prefix of this word. If searchWord is a prefix of more than one word, return the index of the first word (minimum index). If there is no such word return -1.
-
-
A prefix of a string s is any leading contiguous substring of s.
-
-
-
Example 1:
-
-
-Input: sentence = "i love eating burger", searchWord = "burg"
-Output: 4
-Explanation: "burg" is prefix of "burger" which is the 4th word in the sentence.
-
-
-
Example 2:
-
-
-Input: sentence = "this problem is an easy problem", searchWord = "pro"
-Output: 2
-Explanation: "pro" is prefix of "problem" which is the 2nd and the 6th word in the sentence, but we return 2 as it's the minimal index.
-
-
-
Example 3:
-
-
-Input: sentence = "i am tired", searchWord = "you"
-Output: -1
-Explanation: "you" is not a prefix of any word in the sentence.
-
-
-
-
Constraints:
-
-
-
1 <= sentence.length <= 100
-
1 <= searchWord.length <= 10
-
sentence consists of lowercase English letters and spaces.
-
searchWord consists of lowercase English letters.
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
- [[String Matching](../../tag/string-matching/README.md)]
-
-### Hints
-
-Hint 1
-First extract the words of the sentence.
-
-
-
-Hint 2
-Check for each word if searchWord occurs at index 0, if so return the index of this word (1-indexed)
-
-
-
-Hint 3
-If searchWord doesn't exist as a prefix of any word return the default value (-1).
-
diff --git a/problems/check-if-a-word-occurs-as-a-prefix-of-any-word-in-a-sentence/check_if_a_word_occurs_as_a_prefix_of_any_word_in_a_sentence.go b/problems/check-if-a-word-occurs-as-a-prefix-of-any-word-in-a-sentence/check_if_a_word_occurs_as_a_prefix_of_any_word_in_a_sentence.go
deleted file mode 100644
index 703b7c628..000000000
--- a/problems/check-if-a-word-occurs-as-a-prefix-of-any-word-in-a-sentence/check_if_a_word_occurs_as_a_prefix_of_any_word_in_a_sentence.go
+++ /dev/null
@@ -1,13 +0,0 @@
-package problem1455
-
-import "strings"
-
-func isPrefixOfWord(sentence string, searchWord string) int {
- items := strings.Fields(sentence)
- for i, item := range items {
- if strings.HasPrefix(item, searchWord) {
- return i + 1
- }
- }
- return -1
-}
diff --git a/problems/check-if-a-word-occurs-as-a-prefix-of-any-word-in-a-sentence/check_if_a_word_occurs_as_a_prefix_of_any_word_in_a_sentence_test.go b/problems/check-if-a-word-occurs-as-a-prefix-of-any-word-in-a-sentence/check_if_a_word_occurs_as_a_prefix_of_any_word_in_a_sentence_test.go
deleted file mode 100644
index 30813227d..000000000
--- a/problems/check-if-a-word-occurs-as-a-prefix-of-any-word-in-a-sentence/check_if_a_word_occurs_as_a_prefix_of_any_word_in_a_sentence_test.go
+++ /dev/null
@@ -1,45 +0,0 @@
-package problem1455
-
-import "testing"
-
-type testType struct {
- sentence string
- searchWord string
- want int
-}
-
-func TestIsPrefixOfWord(t *testing.T) {
- tests := [...]testType{
- {
- sentence: "i love eating burger",
- searchWord: "burg",
- want: 4,
- },
- {
- sentence: "this problem is an easy problem",
- searchWord: "pro",
- want: 2,
- },
- {
- sentence: "i am tired",
- searchWord: "you",
- want: -1,
- },
- {
- sentence: "i use triple pillow",
- searchWord: "pill",
- want: 4,
- },
- {
- sentence: "hello from the other side",
- searchWord: "they",
- want: -1,
- },
- }
- for _, tt := range tests {
- got := isPrefixOfWord(tt.sentence, tt.searchWord)
- if got != tt.want {
- t.Fatalf("in: %v, got: %v, want: %v", tt.sentence, got, tt.want)
- }
- }
-}
diff --git a/problems/check-if-all-1s-are-at-least-length-k-places-away/README.md b/problems/check-if-all-1s-are-at-least-length-k-places-away/README.md
deleted file mode 100644
index 7e7b72d6f..000000000
--- a/problems/check-if-all-1s-are-at-least-length-k-places-away/README.md
+++ /dev/null
@@ -1,66 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../destination-city "Destination City")
-
-[Next >](../longest-continuous-subarray-with-absolute-diff-less-than-or-equal-to-limit "Longest Continuous Subarray With Absolute Diff Less Than or Equal to Limit")
-
-## [1437. Check If All 1's Are at Least Length K Places Away (Easy)](https://leetcode.com/problems/check-if-all-1s-are-at-least-length-k-places-away "是否所有 1 都至少相隔 k 个元素")
-
-
Given an array nums of 0s and 1s and an integer k, return True if all 1's are at least k places away from each other, otherwise return False.
-
-
-
Example 1:
-
-
-
-
-Input: nums = [1,0,0,0,1,0,0,1], k = 2
-Output: true
-Explanation: Each of the 1s are at least 2 places away from each other.
-
-
-
Example 2:
-
-
-
-
-Input: nums = [1,0,0,1,0,1], k = 2
-Output: false
-Explanation: The second 1 and third 1 are only one apart from each other.
-
-
Example 3:
-
-
-Input: nums = [1,1,1,1,1], k = 0
-Output: true
-
-
-
Example 4:
-
-
-Input: nums = [0,1,0,1], k = 1
-Output: true
-
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 105
-
0 <= k <= nums.length
-
nums[i] is 0 or 1
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
-
-### Hints
-
-Hint 1
-Each time you find a number 1, check whether or not it is K or more places away from the next one. If it's not, return false.
-
diff --git a/problems/check-if-all-as-appears-before-all-bs/README.md b/problems/check-if-all-as-appears-before-all-bs/README.md
deleted file mode 100644
index a5c03bdf8..000000000
--- a/problems/check-if-all-as-appears-before-all-bs/README.md
+++ /dev/null
@@ -1,66 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-operations-to-remove-adjacent-ones-in-matrix "Minimum Operations to Remove Adjacent Ones in Matrix")
-
-[Next >](../number-of-laser-beams-in-a-bank "Number of Laser Beams in a Bank")
-
-## [2124. Check if All A's Appears Before All B's (Easy)](https://leetcode.com/problems/check-if-all-as-appears-before-all-bs "检查是否所有 A 都在 B 之前")
-
-
Given a string s consisting of only the characters 'a' and 'b', return trueif every'a'appears before every'b' in the string. Otherwise, return false.
-
-
-
Example 1:
-
-
-Input: s = "aaabbb"
-Output: true
-Explanation:
-The 'a's are at indices 0, 1, and 2, while the 'b's are at indices 3, 4, and 5.
-Hence, every 'a' appears before every 'b' and we return true.
-
-
-
Example 2:
-
-
-Input: s = "abab"
-Output: false
-Explanation:
-There is an 'a' at index 2 and a 'b' at index 1.
-Hence, not every 'a' appears before every 'b' and we return false.
-
-
-
Example 3:
-
-
-Input: s = "bbb"
-Output: true
-Explanation:
-There are no 'a's, hence, every 'a' appears before every 'b' and we return true.
-
-
-
-
Constraints:
-
-
-
1 <= s.length <= 100
-
s[i] is either 'a' or 'b'.
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
-
-### Hints
-
-Hint 1
-You can check the opposite: check if there is a ‘b’ before an ‘a’. Then, negate and return that answer.
-
-
-
-Hint 2
-s should not have any occurrences of “ba” as a substring.
-
diff --git a/problems/check-if-all-characters-have-equal-number-of-occurrences/README.md b/problems/check-if-all-characters-have-equal-number-of-occurrences/README.md
deleted file mode 100644
index aacdbbaa9..000000000
--- a/problems/check-if-all-characters-have-equal-number-of-occurrences/README.md
+++ /dev/null
@@ -1,61 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../longest-common-subsequence-between-sorted-arrays "Longest Common Subsequence Between Sorted Arrays")
-
-[Next >](../the-number-of-the-smallest-unoccupied-chair "The Number of the Smallest Unoccupied Chair")
-
-## [1941. Check if All Characters Have Equal Number of Occurrences (Easy)](https://leetcode.com/problems/check-if-all-characters-have-equal-number-of-occurrences "检查是否所有字符出现次数相同")
-
-
Given a string s, return true if s is a good string, or false otherwise.
-
-
A string s is good if all the characters that appear in s have the same number of occurrences (i.e., the same frequency).
-
-
-
Example 1:
-
-
-Input: s = "abacbc"
-Output: true
-Explanation: The characters that appear in s are 'a', 'b', and 'c'. All characters occur 2 times in s.
-
-
-
Example 2:
-
-
-Input: s = "aaabb"
-Output: false
-Explanation: The characters that appear in s are 'a' and 'b'.
-'a' occurs 3 times while 'b' occurs 2 times, which is not the same number of times.
-
-
-
-
Constraints:
-
-
-
1 <= s.length <= 1000
-
s consists of lowercase English letters.
-
-
-### Related Topics
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
- [[Counting](../../tag/counting/README.md)]
-
-### Similar Questions
- 1. [Rings and Rods](../rings-and-rods) (Easy)
-
-### Hints
-
-Hint 1
-Build a dictionary containing the frequency of each character appearing in s
-
-
-
-Hint 2
-Check if all values in the dictionary are the same.
-
diff --git a/problems/check-if-all-the-integers-in-a-range-are-covered/README.md b/problems/check-if-all-the-integers-in-a-range-are-covered/README.md
deleted file mode 100644
index d12d6aad3..000000000
--- a/problems/check-if-all-the-integers-in-a-range-are-covered/README.md
+++ /dev/null
@@ -1,63 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../page-recommendations-ii "Page Recommendations II")
-
-[Next >](../find-the-student-that-will-replace-the-chalk "Find the Student that Will Replace the Chalk")
-
-## [1893. Check if All the Integers in a Range Are Covered (Easy)](https://leetcode.com/problems/check-if-all-the-integers-in-a-range-are-covered "检查是否区域内所有整数都被覆盖")
-
-
You are given a 2D integer array ranges and two integers left and right. Each ranges[i] = [starti, endi] represents an inclusive interval between starti and endi.
-
-
Return trueif each integer in the inclusive range[left, right]is covered by at least one interval inranges. Return falseotherwise.
-
-
An integer x is covered by an interval ranges[i] = [starti, endi] if starti <= x <= endi.
-
-
-
Example 1:
-
-
-Input: ranges = [[1,2],[3,4],[5,6]], left = 2, right = 5
-Output: true
-Explanation: Every integer between 2 and 5 is covered:
-- 2 is covered by the first range.
-- 3 and 4 are covered by the second range.
-- 5 is covered by the third range.
-
-
-
Example 2:
-
-
-Input: ranges = [[1,10],[10,20]], left = 21, right = 21
-Output: false
-Explanation: 21 is not covered by any range.
-
-
-
-
Constraints:
-
-
-
1 <= ranges.length <= 50
-
1 <= starti <= endi <= 50
-
1 <= left <= right <= 50
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Prefix Sum](../../tag/prefix-sum/README.md)]
-
-### Hints
-
-Hint 1
-Iterate over every integer point in the range [left, right].
-
-
-
-Hint 2
-For each of these points check if it is included in one of the ranges.
-
diff --git a/problems/check-if-an-original-string-exists-given-two-encoded-strings/README.md b/problems/check-if-an-original-string-exists-given-two-encoded-strings/README.md
deleted file mode 100644
index caeebf97b..000000000
--- a/problems/check-if-an-original-string-exists-given-two-encoded-strings/README.md
+++ /dev/null
@@ -1,109 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-operations-to-convert-number "Minimum Operations to Convert Number")
-
-[Next >](../number-of-spaces-cleaning-robot-cleaned "Number of Spaces Cleaning Robot Cleaned")
-
-## [2060. Check if an Original String Exists Given Two Encoded Strings (Hard)](https://leetcode.com/problems/check-if-an-original-string-exists-given-two-encoded-strings "同源字符串检测")
-
-
An original string, consisting of lowercase English letters, can be encoded by the following steps:
-
-
-
Arbitrarily split it into a sequence of some number of non-empty substrings.
-
Arbitrarily choose some elements (possibly none) of the sequence, and replace each with its length (as a numeric string).
-
Concatenate the sequence as the encoded string.
-
-
-
For example, one way to encode an original string "abcdefghijklmnop" might be:
-
-
-
Split it as a sequence: ["ab", "cdefghijklmn", "o", "p"].
-
Choose the second and third elements to be replaced by their lengths, respectively. The sequence becomes ["ab", "12", "1", "p"].
-
Concatenate the elements of the sequence to get the encoded string: "ab121p".
-
-
-
Given two encoded strings s1 and s2, consisting of lowercase English letters and digits 1-9 (inclusive), return true if there exists an original string that could be encoded as boths1 and s2. Otherwise, return false.
-
-
Note: The test cases are generated such that the number of consecutive digits in s1 and s2 does not exceed 3.
-
-
-
Example 1:
-
-
-Input: s1 = "internationalization", s2 = "i18n"
-Output: true
-Explanation: It is possible that "internationalization" was the original string.
-- "internationalization"
- -> Split: ["internationalization"]
- -> Do not replace any element
- -> Concatenate: "internationalization", which is s1.
-- "internationalization"
- -> Split: ["i", "nternationalizatio", "n"]
- -> Replace: ["i", "18", "n"]
- -> Concatenate: "i18n", which is s2
-
-
-
Example 2:
-
-
-Input: s1 = "l123e", s2 = "44"
-Output: true
-Explanation: It is possible that "leetcode" was the original string.
-- "leetcode"
- -> Split: ["l", "e", "et", "cod", "e"]
- -> Replace: ["l", "1", "2", "3", "e"]
- -> Concatenate: "l123e", which is s1.
-- "leetcode"
- -> Split: ["leet", "code"]
- -> Replace: ["4", "4"]
- -> Concatenate: "44", which is s2.
-
-
-
Example 3:
-
-
-Input: s1 = "a5b", s2 = "c5b"
-Output: false
-Explanation: It is impossible.
-- The original string encoded as s1 must start with the letter 'a'.
-- The original string encoded as s2 must start with the letter 'c'.
-
-
-
-
Constraints:
-
-
-
1 <= s1.length, s2.length <= 40
-
s1 and s2 consist of digits 1-9 (inclusive), and lowercase English letters only.
-
The number of consecutive digits in s1 and s2 does not exceed 3.
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Hints
-
-Hint 1
-For s1 and s2, divide each into a sequence of single alphabet strings and digital strings. The problem now becomes comparing if two sequences are equal.
-
-
-
-Hint 2
-A single alphabet string has no variation, but a digital string has variations. For example: "124" can be interpreted as 1+2+4, 12+4, 1+24, and 124 wildcard characters.
-
-
-
-Hint 3
-There are four kinds of comparisons: a single alphabet vs another; a single alphabet vs a number, a number vs a single alphabet, and a number vs another number. In the case of a number vs another (a single alphabet or a number), can you decrease the number by the min length of both?
-
-
-
-Hint 4
-There is a recurrence relation in the search which ends when either a single alphabet != another, or one sequence ran out, or both sequences ran out.
-
diff --git a/problems/check-if-array-is-sorted-and-rotated/README.md b/problems/check-if-array-is-sorted-and-rotated/README.md
deleted file mode 100644
index 0db6947c5..000000000
--- a/problems/check-if-array-is-sorted-and-rotated/README.md
+++ /dev/null
@@ -1,62 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-number-of-events-that-can-be-attended-ii "Maximum Number of Events That Can Be Attended II")
-
-[Next >](../maximum-score-from-removing-stones "Maximum Score From Removing Stones")
-
-## [1752. Check if Array Is Sorted and Rotated (Easy)](https://leetcode.com/problems/check-if-array-is-sorted-and-rotated "检查数组是否经排序和轮转得到")
-
-
Given an array nums, return true if the array was originally sorted in non-decreasing order, then rotated some number of positions (including zero). Otherwise, return false.
-
-
There may be duplicates in the original array.
-
-
Note: An array A rotated by x positions results in an array B of the same length such that A[i] == B[(i+x) % A.length], where % is the modulo operation.
-
-
-
Example 1:
-
-
-Input: nums = [3,4,5,1,2]
-Output: true
-Explanation: [1,2,3,4,5] is the original sorted array.
-You can rotate the array by x = 3 positions to begin on the the element of value 3: [3,4,5,1,2].
-
-
-
Example 2:
-
-
-Input: nums = [2,1,3,4]
-Output: false
-Explanation: There is no sorted array once rotated that can make nums.
-
-
-
Example 3:
-
-
-Input: nums = [1,2,3]
-Output: true
-Explanation: [1,2,3] is the original sorted array.
-You can rotate the array by x = 0 positions (i.e. no rotation) to make nums.
-
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 100
-
1 <= nums[i] <= 100
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
-
-### Hints
-
-Hint 1
-Brute force and check if it is possible for a sorted array to start from each position.
-
diff --git a/problems/check-if-array-pairs-are-divisible-by-k/README.md b/problems/check-if-array-pairs-are-divisible-by-k/README.md
deleted file mode 100644
index 2eeb96e92..000000000
--- a/problems/check-if-array-pairs-are-divisible-by-k/README.md
+++ /dev/null
@@ -1,75 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../path-crossing "Path Crossing")
-
-[Next >](../number-of-subsequences-that-satisfy-the-given-sum-condition "Number of Subsequences That Satisfy the Given Sum Condition")
-
-## [1497. Check If Array Pairs Are Divisible by k (Medium)](https://leetcode.com/problems/check-if-array-pairs-are-divisible-by-k "检查数组对是否可以被 k 整除")
-
-
Given an array of integers arr of even length n and an integer k.
-
-
We want to divide the array into exactly n / 2 pairs such that the sum of each pair is divisible by k.
-
-
Return true If you can find a way to do that or false otherwise.
-
-
-
Example 1:
-
-
-Input: arr = [1,2,3,4,5,10,6,7,8,9], k = 5
-Output: true
-Explanation: Pairs are (1,9),(2,8),(3,7),(4,6) and (5,10).
-
-
-
Example 2:
-
-
-Input: arr = [1,2,3,4,5,6], k = 7
-Output: true
-Explanation: Pairs are (1,6),(2,5) and(3,4).
-
-
-
Example 3:
-
-
-Input: arr = [1,2,3,4,5,6], k = 10
-Output: false
-Explanation: You can try all possible pairs to see that there is no way to divide arr into 3 pairs each with sum divisible by 10.
-
-
-
-
Constraints:
-
-
-
arr.length == n
-
1 <= n <= 105
-
n is even.
-
-109 <= arr[i] <= 109
-
1 <= k <= 105
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Counting](../../tag/counting/README.md)]
-
-### Hints
-
-Hint 1
-Keep an array of the frequencies of ((x % k) + k) % k for each x in arr.
-
-
-
-Hint 2
-for each i in [0, k - 1] we need to check if freq[k] == freq[k - i]
-
-
-
-Hint 3
-Take care of the case when i == k - i and when i == 0
-
diff --git a/problems/check-if-binary-string-has-at-most-one-segment-of-ones/README.md b/problems/check-if-binary-string-has-at-most-one-segment-of-ones/README.md
deleted file mode 100644
index 60756572a..000000000
--- a/problems/check-if-binary-string-has-at-most-one-segment-of-ones/README.md
+++ /dev/null
@@ -1,55 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../grand-slam-titles "Grand Slam Titles")
-
-[Next >](../minimum-elements-to-add-to-form-a-given-sum "Minimum Elements to Add to Form a Given Sum")
-
-## [1784. Check if Binary String Has at Most One Segment of Ones (Easy)](https://leetcode.com/problems/check-if-binary-string-has-at-most-one-segment-of-ones "检查二进制字符串字段")
-
-
Given a binary string swithout leading zeros, return true if s contains at most one contiguous segment of ones. Otherwise, return false.
-
-
-
Example 1:
-
-
-Input: s = "1001"
-Output: false
-Explanation: The ones do not form a contiguous segment.
-
-
-
Example 2:
-
-
-Input: s = "110"
-Output: true
-
-
-
Constraints:
-
-
-
1 <= s.length <= 100
-
s[i] is either '0' or '1'.
-
s[0] is '1'.
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
-
-### Similar Questions
- 1. [Longer Contiguous Segments of Ones than Zeros](../longer-contiguous-segments-of-ones-than-zeros) (Easy)
-
-### Hints
-
-Hint 1
-It's guaranteed to have at least one segment
-
-
-
-Hint 2
-The string size is small so you can count all segments of ones with no that have no adjacent ones.
-
diff --git a/problems/check-if-every-row-and-column-contains-all-numbers/README.md b/problems/check-if-every-row-and-column-contains-all-numbers/README.md
deleted file mode 100644
index b3597801f..000000000
--- a/problems/check-if-every-row-and-column-contains-all-numbers/README.md
+++ /dev/null
@@ -1,60 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../stamping-the-grid "Stamping the Grid")
-
-[Next >](../minimum-swaps-to-group-all-1s-together-ii "Minimum Swaps to Group All 1's Together II")
-
-## [2133. Check if Every Row and Column Contains All Numbers (Easy)](https://leetcode.com/problems/check-if-every-row-and-column-contains-all-numbers "检查是否每一行每一列都包含全部整数")
-
-
An n x n matrix is valid if every row and every column contains all the integers from 1 to n (inclusive).
-
-
Given an n x n integer matrix matrix, return trueif the matrix is valid. Otherwise, return false.
-
-
-
Example 1:
-
-
-Input: matrix = [[1,2,3],[3,1,2],[2,3,1]]
-Output: true
-Explanation: In this case, n = 3, and every row and column contains the numbers 1, 2, and 3.
-Hence, we return true.
-
-
-
Example 2:
-
-
-Input: matrix = [[1,1,1],[1,2,3],[1,2,3]]
-Output: false
-Explanation: In this case, n = 3, but the first row and the first column do not contain the numbers 2 or 3.
-Hence, we return false.
-
-
-
-
Constraints:
-
-
-
n == matrix.length == matrix[i].length
-
1 <= n <= 100
-
1 <= matrix[i][j] <= n
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
-
-### Hints
-
-Hint 1
-Use for loops to check each row for every number from 1 to n. Similarly, do the same for each column.
-
-
-
-Hint 2
-For each check, you can keep a set of the unique elements in the checked row/col. By the end of the check, the size of the set should be n.
-
diff --git a/problems/check-if-it-is-a-good-array/README.md b/problems/check-if-it-is-a-good-array/README.md
deleted file mode 100644
index 289c87eae..000000000
--- a/problems/check-if-it-is-a-good-array/README.md
+++ /dev/null
@@ -1,66 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-remove-to-make-valid-parentheses "Minimum Remove to Make Valid Parentheses")
-
-[Next >](../average-selling-price "Average Selling Price")
-
-## [1250. Check If It Is a Good Array (Hard)](https://leetcode.com/problems/check-if-it-is-a-good-array "检查「好数组」")
-
-
Given an array nums of positive integers. Your task is to select some subset of nums, multiply each element by an integer and add all these numbers. The array is said to be good if you can obtain a sum of 1 from the array by any possible subset and multiplicand.
-
-
Return True if the array is good otherwise return False.
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Math](../../tag/math/README.md)]
- [[Number Theory](../../tag/number-theory/README.md)]
-
-### Hints
-
-Hint 1
-Eq. ax+by=1 has solution x, y if gcd(a,b) = 1.
-
-
-
-Hint 2
-Can you generalize the formula?. Check Bézout's lemma.
-
diff --git a/problems/check-if-it-is-a-straight-line/README.md b/problems/check-if-it-is-a-straight-line/README.md
deleted file mode 100644
index f56c7a5e8..000000000
--- a/problems/check-if-it-is-a-straight-line/README.md
+++ /dev/null
@@ -1,66 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../divide-chocolate "Divide Chocolate")
-
-[Next >](../remove-sub-folders-from-the-filesystem "Remove Sub-Folders from the Filesystem")
-
-## [1232. Check If It Is a Straight Line (Easy)](https://leetcode.com/problems/check-if-it-is-a-straight-line "缀点成线")
-
-
You are given an array coordinates, coordinates[i] = [x, y], where [x, y] represents the coordinate of a point. Check if these points make a straight line in the XY plane.
-
-### Related Topics
- [[Geometry](../../tag/geometry/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Math](../../tag/math/README.md)]
-
-### Hints
-
-Hint 1
-If there're only 2 points, return true.
-
-
-
-Hint 2
-Check if all other points lie on the line defined by the first 2 points.
-
-
-
-Hint 3
-Use cross product to check collinearity.
-
diff --git a/problems/check-if-move-is-legal/README.md b/problems/check-if-move-is-legal/README.md
deleted file mode 100644
index 026618369..000000000
--- a/problems/check-if-move-is-legal/README.md
+++ /dev/null
@@ -1,64 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../delete-characters-to-make-fancy-string "Delete Characters to Make Fancy String")
-
-[Next >](../minimum-total-space-wasted-with-k-resizing-operations "Minimum Total Space Wasted With K Resizing Operations")
-
-## [1958. Check if Move is Legal (Medium)](https://leetcode.com/problems/check-if-move-is-legal "检查操作是否合法")
-
-
You are given a 0-indexed8 x 8 grid board, where board[r][c] represents the cell (r, c) on a game board. On the board, free cells are represented by '.', white cells are represented by 'W', and black cells are represented by 'B'.
-
-
Each move in this game consists of choosing a free cell and changing it to the color you are playing as (either white or black). However, a move is only legal if, after changing it, the cell becomes the endpoint of a good line (horizontal, vertical, or diagonal).
-
-
A good line is a line of three or more cells (including the endpoints) where the endpoints of the line are one color, and the remaining cells in the middle are the opposite color (no cells in the line are free). You can find examples for good lines in the figure below:
-
-
Given two integers rMove and cMove and a character color representing the color you are playing as (white or black), return trueif changing cell (rMove, cMove)to colorcoloris a legal move, or false if it is not legal.
-
-
-
Example 1:
-
-
-Input: board = [[".",".",".","B",".",".",".","."],[".",".",".","W",".",".",".","."],[".",".",".","W",".",".",".","."],[".",".",".","W",".",".",".","."],["W","B","B",".","W","W","W","B"],[".",".",".","B",".",".",".","."],[".",".",".","B",".",".",".","."],[".",".",".","W",".",".",".","."]], rMove = 4, cMove = 3, color = "B"
-Output: true
-Explanation: '.', 'W', and 'B' are represented by the colors blue, white, and black respectively, and cell (rMove, cMove) is marked with an 'X'.
-The two good lines with the chosen cell as an endpoint are annotated above with the red rectangles.
-
-
-
Example 2:
-
-
-Input: board = [[".",".",".",".",".",".",".","."],[".","B",".",".","W",".",".","."],[".",".","W",".",".",".",".","."],[".",".",".","W","B",".",".","."],[".",".",".",".",".",".",".","."],[".",".",".",".","B","W",".","."],[".",".",".",".",".",".","W","."],[".",".",".",".",".",".",".","B"]], rMove = 4, cMove = 4, color = "W"
-Output: false
-Explanation: While there are good lines with the chosen cell as a middle cell, there are no good lines with the chosen cell as an endpoint.
-
-
-
-
Constraints:
-
-
-
board.length == board[r].length == 8
-
0 <= rMove, cMove < 8
-
board[rMove][cMove] == '.'
-
color is either 'B' or 'W'.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Enumeration](../../tag/enumeration/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
-
-### Hints
-
-Hint 1
-For each line starting at the given cell check if it's a good line
-
-
-
-Hint 2
-To do that iterate over all directions horizontal, vertical, and diagonals then check good lines naively
-
diff --git a/problems/check-if-n-and-its-double-exist/README.md b/problems/check-if-n-and-its-double-exist/README.md
deleted file mode 100644
index c54a20cf5..000000000
--- a/problems/check-if-n-and-its-double-exist/README.md
+++ /dev/null
@@ -1,76 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../jump-game-iv "Jump Game IV")
-
-[Next >](../minimum-number-of-steps-to-make-two-strings-anagram "Minimum Number of Steps to Make Two Strings Anagram")
-
-## [1346. Check If N and Its Double Exist (Easy)](https://leetcode.com/problems/check-if-n-and-its-double-exist "检查整数及其两倍数是否存在")
-
-
Given an array arr of integers, check if there exists two integers N and M such that N is the double of M ( i.e. N = 2 * M).
-
-
More formally check if there exists two indices i and j such that :
-
-
-
i != j
-
0 <= i, j < arr.length
-
arr[i] == 2 * arr[j]
-
-
-
-
Example 1:
-
-
-Input: arr = [10,2,5,3]
-Output: true
-Explanation: N = 10 is the double of M = 5,that is, 10 = 2 * 5.
-
-
-
Example 2:
-
-
-Input: arr = [7,1,14,11]
-Output: true
-Explanation: N = 14 is the double of M = 7,that is, 14 = 2 * 7.
-
-
-
Example 3:
-
-
-Input: arr = [3,1,7,11]
-Output: false
-Explanation: In this case does not exist N and M, such that N = 2 * M.
-
-
-
-
Constraints:
-
-
-
2 <= arr.length <= 500
-
-10^3 <= arr[i] <= 10^3
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Two Pointers](../../tag/two-pointers/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Similar Questions
- 1. [Keep Multiplying Found Values by Two](../keep-multiplying-found-values-by-two) (Easy)
-
-### Hints
-
-Hint 1
-Loop from i = 0 to arr.length, maintaining in a hashTable the array elements from [0, i - 1].
-
-
-
-Hint 2
-On each step of the loop check if we have seen the element 2 * arr[i] so far or arr[i] / 2 was seen if arr[i] % 2 == 0.
-
diff --git a/problems/check-if-number-is-a-sum-of-powers-of-three/README.md b/problems/check-if-number-is-a-sum-of-powers-of-three/README.md
deleted file mode 100644
index 85e10f36c..000000000
--- a/problems/check-if-number-is-a-sum-of-powers-of-three/README.md
+++ /dev/null
@@ -1,61 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../find-nearest-point-that-has-the-same-x-or-y-coordinate "Find Nearest Point That Has the Same X or Y Coordinate")
-
-[Next >](../sum-of-beauty-of-all-substrings "Sum of Beauty of All Substrings")
-
-## [1780. Check if Number is a Sum of Powers of Three (Medium)](https://leetcode.com/problems/check-if-number-is-a-sum-of-powers-of-three "判断一个数字是否可以表示成三的幂的和")
-
-
Given an integer n, return trueif it is possible to represent n as the sum of distinct powers of three. Otherwise, return false.
-
-
An integer y is a power of three if there exists an integer x such that y == 3x.
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
-
-### Hints
-
-Hint 1
-Let's note that the maximum power of 3 you'll use in your soln is 3^16
-
-
-
-Hint 2
-The number can not be represented as a sum of powers of 3 if it's ternary presentation has a 2 in it
-
diff --git a/problems/check-if-numbers-are-ascending-in-a-sentence/README.md b/problems/check-if-numbers-are-ascending-in-a-sentence/README.md
deleted file mode 100644
index f23398623..000000000
--- a/problems/check-if-numbers-are-ascending-in-a-sentence/README.md
+++ /dev/null
@@ -1,80 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../accepted-candidates-from-the-interviews "Accepted Candidates From the Interviews")
-
-[Next >](../simple-bank-system "Simple Bank System")
-
-## [2042. Check if Numbers Are Ascending in a Sentence (Easy)](https://leetcode.com/problems/check-if-numbers-are-ascending-in-a-sentence "检查句子中的数字是否递增")
-
-
A sentence is a list of tokens separated by a single space with no leading or trailing spaces. Every token is either a positive number consisting of digits 0-9 with no leading zeros, or a word consisting of lowercase English letters.
-
-
-
For example, "a puppy has 2 eyes 4 legs" is a sentence with seven tokens: "2" and "4" are numbers and the other tokens such as "puppy" are words.
-
-
-
Given a string s representing a sentence, you need to check if all the numbers in s are strictly increasing from left to right (i.e., other than the last number, each number is strictly smaller than the number on its right in s).
-
-
Return true if so, or false otherwise.
-
-
-
Example 1:
-
-
-Input: s = "1 box has 3 blue 4 red 6 green and 12 yellow marbles"
-Output: true
-Explanation: The numbers in s are: 1, 3, 4, 6, 12.
-They are strictly increasing from left to right: 1 < 3 < 4 < 6 < 12.
-
-
-
Example 2:
-
-
-Input: s = "hello world 5 x 5"
-Output: false
-Explanation: The numbers in s are: 5, 5. They are not strictly increasing.
-
-
-
Example 3:
-
-
-Input: s = "sunset is at 7 51 pm overnight lows will be in the low 50 and 60 s"
-Output: false
-Explanation: The numbers in s are: 7, 51, 50, 60. They are not strictly increasing.
-
-
-
-
Constraints:
-
-
-
3 <= s.length <= 200
-
s consists of lowercase English letters, spaces, and digits from 0 to 9, inclusive.
-
The number of tokens in s is between 2 and 100, inclusive.
-
The tokens in s are separated by a single space.
-
There are at least two numbers in s.
-
Each number in s is a positive number less than 100, with no leading zeros.
-
s contains no leading or trailing spaces.
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
-
-### Hints
-
-Hint 1
-Use string tokenization of your language to extract all the tokens of the string easily.
-
-
-
-Hint 2
-For each token extracted, how can you tell if it is a number? Does the first letter being a digit mean something?
-
-
-
-Hint 3
-Compare the number with the previously occurring number to check if ascending order is maintained.
-
diff --git a/problems/check-if-one-string-swap-can-make-strings-equal/README.md b/problems/check-if-one-string-swap-can-make-strings-equal/README.md
deleted file mode 100644
index 97904c0b9..000000000
--- a/problems/check-if-one-string-swap-can-make-strings-equal/README.md
+++ /dev/null
@@ -1,69 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../primary-department-for-each-employee "Primary Department for Each Employee")
-
-[Next >](../find-center-of-star-graph "Find Center of Star Graph")
-
-## [1790. Check if One String Swap Can Make Strings Equal (Easy)](https://leetcode.com/problems/check-if-one-string-swap-can-make-strings-equal "仅执行一次字符串交换能否使两个字符串相等")
-
-
You are given two strings s1 and s2 of equal length. A string swap is an operation where you choose two indices in a string (not necessarily different) and swap the characters at these indices.
-
-
Return trueif it is possible to make both strings equal by performing at most one string swap on exactly one of the strings. Otherwise, return false.
-
-
-
Example 1:
-
-
-Input: s1 = "bank", s2 = "kanb"
-Output: true
-Explanation: For example, swap the first character with the last character of s2 to make "bank".
-
-
-
Example 2:
-
-
-Input: s1 = "attack", s2 = "defend"
-Output: false
-Explanation: It is impossible to make them equal with one string swap.
-
-
-
Example 3:
-
-
-Input: s1 = "kelb", s2 = "kelb"
-Output: true
-Explanation: The two strings are already equal, so no string swap operation is required.
-
-
-
-
Constraints:
-
-
-
1 <= s1.length, s2.length <= 100
-
s1.length == s2.length
-
s1 and s2 consist of only lowercase English letters.
-
-
-### Related Topics
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
- [[Counting](../../tag/counting/README.md)]
-
-### Similar Questions
- 1. [Buddy Strings](../buddy-strings) (Easy)
-
-### Hints
-
-Hint 1
-The answer is false if the number of nonequal positions in the strings is not equal to 0 or 2.
-
-
-
-Hint 2
-Check that these positions have the same set of characters.
-
diff --git a/problems/check-if-string-is-a-prefix-of-array/README.md b/problems/check-if-string-is-a-prefix-of-array/README.md
deleted file mode 100644
index 9bf0c41d0..000000000
--- a/problems/check-if-string-is-a-prefix-of-array/README.md
+++ /dev/null
@@ -1,61 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-product-of-the-length-of-two-palindromic-substrings "Maximum Product of the Length of Two Palindromic Substrings")
-
-[Next >](../remove-stones-to-minimize-the-total "Remove Stones to Minimize the Total")
-
-## [1961. Check If String Is a Prefix of Array (Easy)](https://leetcode.com/problems/check-if-string-is-a-prefix-of-array "检查字符串是否为数组前缀")
-
-
Given a string s and an array of strings words, determine whether s is a prefix string of words.
-
-
A string s is a prefix string of words if s can be made by concatenating the first k strings in words for some positivek no larger than words.length.
-
-
Return true if s is a prefix string of words, or false otherwise.
-
-
-
Example 1:
-
-
-Input: s = "iloveleetcode", words = ["i","love","leetcode","apples"]
-Output: true
-Explanation:
-s can be made by concatenating "i", "love", and "leetcode" together.
-
-
-
Example 2:
-
-
-Input: s = "iloveleetcode", words = ["apples","i","love","leetcode"]
-Output: false
-Explanation:
-It is impossible to make s using a prefix of arr.
-
-
-
Constraints:
-
-
-
1 <= words.length <= 100
-
1 <= words[i].length <= 20
-
1 <= s.length <= 1000
-
words[i] and s consist of only lowercase English letters.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Hints
-
-Hint 1
-There are only words.length prefix strings.
-
-
-
-Hint 2
-Create all of them and see if s is one of them.
-
diff --git a/problems/check-if-string-is-decomposable-into-value-equal-substrings/README.md b/problems/check-if-string-is-decomposable-into-value-equal-substrings/README.md
deleted file mode 100644
index e984f649b..000000000
--- a/problems/check-if-string-is-decomposable-into-value-equal-substrings/README.md
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../merge-bsts-to-create-single-bst "Merge BSTs to Create Single BST")
-
-[Next >](../confirmation-rate "Confirmation Rate")
-
-## [1933. Check if String Is Decomposable Into Value-Equal Substrings (Easy)](https://leetcode.com/problems/check-if-string-is-decomposable-into-value-equal-substrings "判断字符串是否可分解为值均等的子串")
-
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
-
-### Hints
-
-Hint 1
-Keep looking for 3-equals, if you find a 3-equal, keep going. If you don't find a 3-equal, check if it is a 2-equal.
-
-
-
-Hint 2
-Make sure that it is the only 2-equal.
-
-
-
-Hint 3
-If it is neither a 3-equal nor a 2-equal, then it is impossible.
-
diff --git a/problems/check-if-string-is-transformable-with-substring-sort-operations/README.md b/problems/check-if-string-is-transformable-with-substring-sort-operations/README.md
deleted file mode 100644
index 59a65dbb5..000000000
--- a/problems/check-if-string-is-transformable-with-substring-sort-operations/README.md
+++ /dev/null
@@ -1,79 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../min-cost-to-connect-all-points "Min Cost to Connect All Points")
-
-[Next >](../binary-search-tree-iterator-ii "Binary Search Tree Iterator II")
-
-## [1585. Check If String Is Transformable With Substring Sort Operations (Hard)](https://leetcode.com/problems/check-if-string-is-transformable-with-substring-sort-operations "检查字符串是否可以通过排序子字符串得到另一个字符串")
-
-
Given two strings s and t, transform string s into string t using the following operation any number of times:
-
-
-
Choose a non-empty substring in s and sort it in place so the characters are in ascending order.
-
-
For example, applying the operation on the underlined substring in "14234" results in "12344".
-
-
-
-
-
Return true if it is possible to transform s into t. Otherwise, return false.
-
-
A substring is a contiguous sequence of characters within a string.
-
-
-
Example 1:
-
-
-Input: s = "84532", t = "34852"
-Output: true
-Explanation: You can transform s into t using the following sort operations:
-"84532" (from index 2 to 3) -> "84352"
-"84352" (from index 0 to 2) -> "34852"
-
-
-
Example 2:
-
-
-Input: s = "34521", t = "23415"
-Output: true
-Explanation: You can transform s into t using the following sort operations:
-"34521" -> "23451"
-"23451" -> "23415"
-
-
-
Example 3:
-
-
-Input: s = "12345", t = "12435"
-Output: false
-
-
-
-
Constraints:
-
-
-
s.length == t.length
-
1 <= s.length <= 105
-
s and t consist of only digits.
-
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[String](../../tag/string/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Hints
-
-Hint 1
-Suppose the first digit you need is 'd'. How can you determine if it's possible to get that digit there?
-
-
-
-Hint 2
-Consider swapping adjacent characters to maintain relative ordering.
-
diff --git a/problems/check-if-the-sentence-is-pangram/README.md b/problems/check-if-the-sentence-is-pangram/README.md
deleted file mode 100644
index c937655c0..000000000
--- a/problems/check-if-the-sentence-is-pangram/README.md
+++ /dev/null
@@ -1,55 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-transaction-each-day "Maximum Transaction Each Day")
-
-[Next >](../maximum-ice-cream-bars "Maximum Ice Cream Bars")
-
-## [1832. Check if the Sentence Is Pangram (Easy)](https://leetcode.com/problems/check-if-the-sentence-is-pangram "判断句子是否为全字母句")
-
-
A pangram is a sentence where every letter of the English alphabet appears at least once.
-
-
Given a string sentence containing only lowercase English letters, returntrue if sentence is a pangram, or false otherwise.
-
-
-
Example 1:
-
-
-Input: sentence = "thequickbrownfoxjumpsoverthelazydog"
-Output: true
-Explanation: sentence contains at least one of every letter of the English alphabet.
-
-
-
Example 2:
-
-
-Input: sentence = "leetcode"
-Output: false
-
-
-
-
Constraints:
-
-
-
1 <= sentence.length <= 1000
-
sentence consists of lowercase English letters.
-
-
-### Related Topics
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Hints
-
-Hint 1
-Iterate over the string and mark each character as found (using a boolean array, bitmask, or any other similar way).
-
-
-
-Hint 2
-Check if the number of found characters equals the alphabet length.
-
diff --git a/problems/check-if-there-is-a-valid-path-in-a-grid/README.md b/problems/check-if-there-is-a-valid-path-in-a-grid/README.md
deleted file mode 100644
index 1efa3602a..000000000
--- a/problems/check-if-there-is-a-valid-path-in-a-grid/README.md
+++ /dev/null
@@ -1,97 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../four-divisors "Four Divisors")
-
-[Next >](../longest-happy-prefix "Longest Happy Prefix")
-
-## [1391. Check if There is a Valid Path in a Grid (Medium)](https://leetcode.com/problems/check-if-there-is-a-valid-path-in-a-grid "检查网格中是否存在有效路径")
-
-Given a m x ngrid. Each cell of the grid represents a street. The street of grid[i][j] can be:
-
-
1 which means a street connecting the left cell and the right cell.
-
2 which means a street connecting the upper cell and the lower cell.
-
3 which means a street connecting the left cell and the lower cell.
-
4 which means a street connecting the right cell and the lower cell.
-
5 which means a street connecting the left cell and the upper cell.
-
6 which means a street connecting the right cell and the upper cell.
-
-
-
-
-
You will initially start at the street of the upper-left cell (0,0). A valid path in the grid is a path which starts from the upper left cell (0,0) and ends at the bottom-right cell (m - 1, n - 1). The path should only follow the streets.
-
-
Notice that you are not allowed to change any street.
-
-
Return true if there is a valid path in the grid or false otherwise.
-
-
-
Example 1:
-
-
-Input: grid = [[2,4,3],[6,5,2]]
-Output: true
-Explanation: As shown you can start at cell (0, 0) and visit all the cells of the grid to reach (m - 1, n - 1).
-
-
-
Example 2:
-
-
-Input: grid = [[1,2,1],[1,2,1]]
-Output: false
-Explanation: As shown you the street at cell (0, 0) is not connected with any street of any other cell and you will get stuck at cell (0, 0)
-
-
-
Example 3:
-
-
-Input: grid = [[1,1,2]]
-Output: false
-Explanation: You will get stuck at cell (0, 1) and you cannot reach cell (0, 2).
-
-
-### Related Topics
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Union Find](../../tag/union-find/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
-
-### Hints
-
-Hint 1
-Start DFS from the node (0, 0) and follow the path till you stop.
-
-
-
-Hint 2
-When you reach a cell and cannot move anymore check that this cell is (m - 1, n - 1) or not.
-
diff --git a/problems/check-if-two-expression-trees-are-equivalent/README.md b/problems/check-if-two-expression-trees-are-equivalent/README.md
deleted file mode 100644
index c25f72b60..000000000
--- a/problems/check-if-two-expression-trees-are-equivalent/README.md
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-one-bit-operations-to-make-integers-zero "Minimum One Bit Operations to Make Integers Zero")
-
-[Next >](../find-the-missing-ids "Find the Missing IDs")
-
-## [1612. Check If Two Expression Trees are Equivalent (Medium)](https://leetcode.com/problems/check-if-two-expression-trees-are-equivalent "检查两棵二叉表达式树是否等价")
-
-
-
-### Related Topics
- [[Tree](../../tag/tree/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Binary Tree](../../tag/binary-tree/README.md)]
-
-### Similar Questions
- 1. [Build Binary Expression Tree From Infix Expression](../build-binary-expression-tree-from-infix-expression) (Hard)
-
-### Hints
-
-Hint 1
-Count for each variable how many times it appeared in the first tree.
-
-
-
-Hint 2
-Do the same for the second tree and check if the count is the same for both tree.
-
diff --git a/problems/check-if-two-string-arrays-are-equivalent/README.md b/problems/check-if-two-string-arrays-are-equivalent/README.md
deleted file mode 100644
index 4a4b7f734..000000000
--- a/problems/check-if-two-string-arrays-are-equivalent/README.md
+++ /dev/null
@@ -1,66 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../average-time-of-process-per-machine "Average Time of Process per Machine")
-
-[Next >](../smallest-string-with-a-given-numeric-value "Smallest String With A Given Numeric Value")
-
-## [1662. Check If Two String Arrays are Equivalent (Easy)](https://leetcode.com/problems/check-if-two-string-arrays-are-equivalent "检查两个字符串数组是否相等")
-
-
Given two string arrays word1 and word2, returntrue if the two arrays represent the same string, and false otherwise.
-
-
A string is represented by an array if the array elements concatenated in order forms the string.
-
-
-
Example 1:
-
-
-Input: word1 = ["ab", "c"], word2 = ["a", "bc"]
-Output: true
-Explanation:
-word1 represents string "ab" + "c" -> "abc"
-word2 represents string "a" + "bc" -> "abc"
-The strings are the same, so return true.
word1[i] and word2[i] consist of lowercase letters.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Hints
-
-Hint 1
-Concatenate all strings in the first array into a single string in the given order, the same for the second array.
-
-
-
-Hint 2
-Both arrays represent the same string if and only if the generated strings are the same.
-
diff --git a/problems/check-if-two-string-arrays-are-equivalent/check_if_two_string_arrays_are_equivalent.go b/problems/check-if-two-string-arrays-are-equivalent/check_if_two_string_arrays_are_equivalent.go
deleted file mode 100644
index 2d596f45f..000000000
--- a/problems/check-if-two-string-arrays-are-equivalent/check_if_two_string_arrays_are_equivalent.go
+++ /dev/null
@@ -1,15 +0,0 @@
-package problem1662
-
-import "strings"
-
-func arrayStringsAreEqual(word1 []string, word2 []string) bool {
- str1 := strings.Builder{}
- for _, s := range word1 {
- str1.WriteString(s)
- }
- str2 := strings.Builder{}
- for _, s := range word2 {
- str2.WriteString(s)
- }
- return str1.String() == str2.String()
-}
diff --git a/problems/check-if-two-string-arrays-are-equivalent/check_if_two_string_arrays_are_equivalent_test.go b/problems/check-if-two-string-arrays-are-equivalent/check_if_two_string_arrays_are_equivalent_test.go
deleted file mode 100644
index 7fa5a0486..000000000
--- a/problems/check-if-two-string-arrays-are-equivalent/check_if_two_string_arrays_are_equivalent_test.go
+++ /dev/null
@@ -1,35 +0,0 @@
-package problem1662
-
-import "testing"
-
-type testType struct {
- word1 []string
- word2 []string
- want bool
-}
-
-func TestArrayStringsAreEqual(t *testing.T) {
- tests := [...]testType{
- {
- word1: []string{"ab", "c"},
- word2: []string{"a", "bc"},
- want: true,
- },
- {
- word1: []string{"a", "cb"},
- word2: []string{"ab", "c"},
- want: false,
- },
- {
- word1: []string{"abc", "d", "defg"},
- word2: []string{"abcddefg"},
- want: true,
- },
- }
- for _, tt := range tests {
- got := arrayStringsAreEqual(tt.word1, tt.word2)
- if got != tt.want {
- t.Fatalf("word1: %v, word2: %v, got: %v, want: %v", tt.word1, tt.word2, got, tt.want)
- }
- }
-}
diff --git a/problems/check-if-word-can-be-placed-in-crossword/README.md b/problems/check-if-word-can-be-placed-in-crossword/README.md
deleted file mode 100644
index b67375a41..000000000
--- a/problems/check-if-word-can-be-placed-in-crossword/README.md
+++ /dev/null
@@ -1,77 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../grid-game "Grid Game")
-
-[Next >](../the-score-of-students-solving-math-expression "The Score of Students Solving Math Expression")
-
-## [2018. Check if Word Can Be Placed In Crossword (Medium)](https://leetcode.com/problems/check-if-word-can-be-placed-in-crossword "判断单词是否能放入填字游戏内")
-
-
You are given an m x n matrix board, representing the current state of a crossword puzzle. The crossword contains lowercase English letters (from solved words), ' ' to represent any empty cells, and '#' to represent any blocked cells.
-
-
A word can be placed horizontally (left to right or right to left) or vertically (top to bottom or bottom to top) in the board if:
-
-
-
It does not occupy a cell containing the character '#'.
-
The cell each letter is placed in must either be ' ' (empty) or match the letter already on the board.
-
There must not be any empty cells ' ' or other lowercase letters directly left or rightof the word if the word was placed horizontally.
-
There must not be any empty cells ' ' or other lowercase letters directly above or below the word if the word was placed vertically.
-
-
-
Given a string word, return true if word can be placed in board, or falseotherwise.
-
-
-
Example 1:
-
-
-Input: board = [["#", " ", "#"], [" ", " ", "#"], ["#", "c", " "]], word = "abc"
-Output: true
-Explanation: The word "abc" can be placed as shown above (top to bottom).
-
-
-
Example 2:
-
-
-Input: board = [[" ", "#", "a"], [" ", "#", "c"], [" ", "#", "a"]], word = "ac"
-Output: false
-Explanation: It is impossible to place the word because there will always be a space/letter above or below it.
-
-
Example 3:
-
-
-Input: board = [["#", " ", "#"], [" ", " ", "#"], ["#", " ", "c"]], word = "ca"
-Output: true
-Explanation: The word "ca" can be placed as shown above (right to left).
-
-
-
-
Constraints:
-
-
-
m == board.length
-
n == board[i].length
-
1 <= m * n <= 2 * 105
-
board[i][j] will be ' ', '#', or a lowercase English letter.
-
1 <= word.length <= max(m, n)
-
word will contain only lowercase English letters.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Enumeration](../../tag/enumeration/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
-
-### Hints
-
-Hint 1
-Check all possible placements for the word.
-
-
-
-Hint 2
-There is a limited number of places where a word can start.
-
diff --git a/problems/check-if-word-equals-summation-of-two-words/README.md b/problems/check-if-word-equals-summation-of-two-words/README.md
deleted file mode 100644
index 65bbc3074..000000000
--- a/problems/check-if-word-equals-summation-of-two-words/README.md
+++ /dev/null
@@ -1,83 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-xor-sum-of-two-arrays "Minimum XOR Sum of Two Arrays")
-
-[Next >](../maximum-value-after-insertion "Maximum Value after Insertion")
-
-## [1880. Check if Word Equals Summation of Two Words (Easy)](https://leetcode.com/problems/check-if-word-equals-summation-of-two-words "检查某单词是否等于两单词之和")
-
-
The letter value of a letter is its position in the alphabet starting from 0 (i.e. 'a' -> 0, 'b' -> 1, 'c' -> 2, etc.).
-
-
The numerical value of some string of lowercase English letters s is the concatenation of the letter values of each letter in s, which is then converted into an integer.
-
-
-
For example, if s = "acb", we concatenate each letter's letter value, resulting in "021". After converting it, we get 21.
-
-
-
You are given three strings firstWord, secondWord, and targetWord, each consisting of lowercase English letters 'a' through 'j'inclusive.
-
-
Return trueif the summation of the numerical values of firstWord and secondWord equals the numerical value of targetWord, or false otherwise.
-
-
-
Example 1:
-
-
-Input: firstWord = "acb", secondWord = "cba", targetWord = "cdb"
-Output: true
-Explanation:
-The numerical value of firstWord is "acb" -> "021" -> 21.
-The numerical value of secondWord is "cba" -> "210" -> 210.
-The numerical value of targetWord is "cdb" -> "231" -> 231.
-We return true because 21 + 210 == 231.
-
-
-
Example 2:
-
-
-Input: firstWord = "aaa", secondWord = "a", targetWord = "aab"
-Output: false
-Explanation:
-The numerical value of firstWord is "aaa" -> "000" -> 0.
-The numerical value of secondWord is "a" -> "0" -> 0.
-The numerical value of targetWord is "aab" -> "001" -> 1.
-We return false because 0 + 0 != 1.
-
-
-
Example 3:
-
-
-Input: firstWord = "aaa", secondWord = "a", targetWord = "aaaa"
-Output: true
-Explanation:
-The numerical value of firstWord is "aaa" -> "000" -> 0.
-The numerical value of secondWord is "a" -> "0" -> 0.
-The numerical value of targetWord is "aaaa" -> "0000" -> 0.
-We return true because 0 + 0 == 0.
-
firstWord, secondWord, and targetWord consist of lowercase English letters from 'a' to 'j'inclusive.
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
-
-### Hints
-
-Hint 1
-Convert each character of each word to its numerical value.
-
-
-
-Hint 2
-Check if the numerical values satisfies the condition.
-
diff --git a/problems/check-if-word-is-valid-after-substitutions/README.md b/problems/check-if-word-is-valid-after-substitutions/README.md
deleted file mode 100644
index 25bd6c60f..000000000
--- a/problems/check-if-word-is-valid-after-substitutions/README.md
+++ /dev/null
@@ -1,73 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../find-common-characters "Find Common Characters")
-
-[Next >](../max-consecutive-ones-iii "Max Consecutive Ones III")
-
-## [1003. Check If Word Is Valid After Substitutions (Medium)](https://leetcode.com/problems/check-if-word-is-valid-after-substitutions "检查替换后的词是否有效")
-
-
Given a string s, determine if it is valid.
-
-
A string s is valid if, starting with an empty string t = "", you can transform t into s after performing the following operation any number of times:
-
-
-
Insert string "abc" into any position in t. More formally, t becomes tleft + "abc" + tright, where t == tleft + tright. Note that tleft and tright may be empty.
-
-
-
Return trueif s is a valid string, otherwise, returnfalse.
-
-
-
Example 1:
-
-
-Input: s = "aabcbc"
-Output: true
-Explanation:
-"" -> "abc" -> "aabcbc"
-Thus, "aabcbc" is valid.
-Input: s = "abccba"
-Output: false
-Explanation: It is impossible to get "abccba" using the operation.
-
-
-
Example 4:
-
-
-Input: s = "cababc"
-Output: false
-Explanation: It is impossible to get "cababc" using the operation.
-
-
-
-
Constraints:
-
-
-
1 <= s.length <= 2 * 104
-
s consists of letters 'a', 'b', and 'c'
-
-
-### Related Topics
- [[Stack](../../tag/stack/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Similar Questions
- 1. [Valid Parentheses](../valid-parentheses) (Easy)
diff --git a/problems/check-if-word-is-valid-after-substitutions/check_if_word_is_valid_after_substitutions.go b/problems/check-if-word-is-valid-after-substitutions/check_if_word_is_valid_after_substitutions.go
deleted file mode 100644
index 8f27a8410..000000000
--- a/problems/check-if-word-is-valid-after-substitutions/check_if_word_is_valid_after_substitutions.go
+++ /dev/null
@@ -1,27 +0,0 @@
-package problem1003
-
-func isValid(S string) bool {
- bs := []byte(S)
- stack := make([]byte, len(S))
- top := -1
-
- for _, b := range bs {
- top++
- stack[top] = b
- switch top {
- case 0:
- if b != 'a' {
- return false
- }
- case 1:
- default:
- if b == 'c' &&
- stack[top-1] == 'b' &&
- stack[top-2] == 'a' {
- top -= 3
- }
- }
- }
-
- return top == -1
-}
diff --git a/problems/check-whether-two-strings-are-almost-equivalent/README.md b/problems/check-whether-two-strings-are-almost-equivalent/README.md
deleted file mode 100644
index 00b1bcd6e..000000000
--- a/problems/check-whether-two-strings-are-almost-equivalent/README.md
+++ /dev/null
@@ -1,79 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../number-of-equal-count-substrings "Number of Equal Count Substrings")
-
-[Next >](../walking-robot-simulation-ii "Walking Robot Simulation II")
-
-## [2068. Check Whether Two Strings are Almost Equivalent (Easy)](https://leetcode.com/problems/check-whether-two-strings-are-almost-equivalent "检查两个字符串是否几乎相等")
-
-
Two strings word1 and word2 are considered almost equivalent if the differences between the frequencies of each letter from 'a' to 'z' between word1 and word2 is at most3.
-
-
Given two strings word1 and word2, each of length n, return trueif word1andword2are almost equivalent, orfalseotherwise.
-
-
The frequency of a letter x is the number of times it occurs in the string.
-
-
-
Example 1:
-
-
-Input: word1 = "aaaa", word2 = "bccb"
-Output: false
-Explanation: There are 4 'a's in "aaaa" but 0 'a's in "bccb".
-The difference is 4, which is more than the allowed 3.
-
-
-
Example 2:
-
-
-Input: word1 = "abcdeef", word2 = "abaaacc"
-Output: true
-Explanation: The differences between the frequencies of each letter in word1 and word2 are at most 3:
-- 'a' appears 1 time in word1 and 4 times in word2. The difference is 3.
-- 'b' appears 1 time in word1 and 1 time in word2. The difference is 0.
-- 'c' appears 1 time in word1 and 2 times in word2. The difference is 1.
-- 'd' appears 1 time in word1 and 0 times in word2. The difference is 1.
-- 'e' appears 2 times in word1 and 0 times in word2. The difference is 2.
-- 'f' appears 1 time in word1 and 0 times in word2. The difference is 1.
-
-
-
Example 3:
-
-
-Input: word1 = "cccddabba", word2 = "babababab"
-Output: true
-Explanation: The differences between the frequencies of each letter in word1 and word2 are at most 3:
-- 'a' appears 2 times in word1 and 4 times in word2. The difference is 2.
-- 'b' appears 2 times in word1 and 5 times in word2. The difference is 3.
-- 'c' appears 3 times in word1 and 0 times in word2. The difference is 3.
-- 'd' appears 2 times in word1 and 0 times in word2. The difference is 2.
-
-
-
-
Constraints:
-
-
-
n == word1.length == word2.length
-
1 <= n <= 100
-
word1 and word2 consist only of lowercase English letters.
-
-
-### Related Topics
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
- [[Counting](../../tag/counting/README.md)]
-
-### Hints
-
-Hint 1
-What data structure can we use to count the frequency of each character?
-
-
-
-Hint 2
-Are there edge cases where a character is present in one string but not the other?
-
diff --git a/problems/checking-existence-of-edge-length-limited-paths-ii/README.md b/problems/checking-existence-of-edge-length-limited-paths-ii/README.md
deleted file mode 100644
index c1bdb7548..000000000
--- a/problems/checking-existence-of-edge-length-limited-paths-ii/README.md
+++ /dev/null
@@ -1,35 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../find-minimum-time-to-finish-all-jobs "Find Minimum Time to Finish All Jobs")
-
-[Next >](../number-of-rectangles-that-can-form-the-largest-square "Number Of Rectangles That Can Form The Largest Square")
-
-## [1724. Checking Existence of Edge Length Limited Paths II (Hard)](https://leetcode.com/problems/checking-existence-of-edge-length-limited-paths-ii "检查边长度限制的路径是否存在 II")
-
-
-
-### Related Topics
- [[Union Find](../../tag/union-find/README.md)]
- [[Graph](../../tag/graph/README.md)]
- [[Minimum Spanning Tree](../../tag/minimum-spanning-tree/README.md)]
-
-### Hints
-
-Hint 1
-Find the minimum spanning tree of the given graph.
-
-
-
-Hint 2
-Root the tree in an arbitrary node and calculate the maximum weight of the edge from each node to the chosen root.
-
-
-
-Hint 3
-To answer a query, find the lca between the two nodes, and find the maximum weight from each of the query nodes to their lca and compare it to the given limit.
-
diff --git a/problems/checking-existence-of-edge-length-limited-paths/README.md b/problems/checking-existence-of-edge-length-limited-paths/README.md
deleted file mode 100644
index cb9115df3..000000000
--- a/problems/checking-existence-of-edge-length-limited-paths/README.md
+++ /dev/null
@@ -1,64 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../jump-game-vi "Jump Game VI")
-
-[Next >](../number-of-distinct-substrings-in-a-string "Number of Distinct Substrings in a String")
-
-## [1697. Checking Existence of Edge Length Limited Paths (Hard)](https://leetcode.com/problems/checking-existence-of-edge-length-limited-paths "检查边长度限制的路径是否存在")
-
-
An undirected graph of n nodes is defined by edgeList, where edgeList[i] = [ui, vi, disi] denotes an edge between nodes ui and vi with distance disi. Note that there may be multiple edges between two nodes.
-
-
Given an array queries, where queries[j] = [pj, qj, limitj], your task is to determine for each queries[j] whether there is a path between pj and qjsuch that each edge on the path has a distance strictly less thanlimitj .
-
-
Return a boolean arrayanswer, where answer.length == queries.lengthand the jthvalue of answeris true if there is a path for queries[j] is true, and false otherwise.
-
-
-
Example 1:
-
-
-Input: n = 3, edgeList = [[0,1,2],[1,2,4],[2,0,8],[1,0,16]], queries = [[0,1,2],[0,2,5]]
-Output: [false,true]
-Explanation: The above figure shows the given graph. Note that there are two overlapping edges between 0 and 1 with distances 2 and 16.
-For the first query, between 0 and 1 there is no path where each distance is less than 2, thus we return false for this query.
-For the second query, there is a path (0 -> 1 -> 2) of two edges with distances less than 5, thus we return true for this query.
-
-
-
Example 2:
-
-
-Input: n = 5, edgeList = [[0,1,10],[1,2,5],[2,3,9],[3,4,13]], queries = [[0,4,14],[1,4,13]]
-Output: [true,false]
-Exaplanation: The above figure shows the given graph.
-
-
-
-
Constraints:
-
-
-
2 <= n <= 105
-
1 <= edgeList.length, queries.length <= 105
-
edgeList[i].length == 3
-
queries[j].length == 3
-
0 <= ui, vi, pj, qj <= n - 1
-
ui != vi
-
pj != qj
-
1 <= disi, limitj <= 109
-
There may be multiple edges between two nodes.
-
-
-### Related Topics
- [[Union Find](../../tag/union-find/README.md)]
- [[Graph](../../tag/graph/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Hints
-
-Hint 1
-All the queries are given in advance. Is there a way you can reorder the queries to avoid repeated computations?
-
diff --git a/problems/cherry-pickup-ii/README.md b/problems/cherry-pickup-ii/README.md
deleted file mode 100644
index e44b8c7f0..000000000
--- a/problems/cherry-pickup-ii/README.md
+++ /dev/null
@@ -1,75 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../course-schedule-iv "Course Schedule IV")
-
-[Next >](../maximum-product-of-two-elements-in-an-array "Maximum Product of Two Elements in an Array")
-
-## [1463. Cherry Pickup II (Hard)](https://leetcode.com/problems/cherry-pickup-ii "摘樱桃 II")
-
-
You are given a rows x cols matrix grid representing a field of cherries where grid[i][j] represents the number of cherries that you can collect from the (i, j) cell.
-
-
You have two robots that can collect cherries for you:
-
-
-
Robot #1 is located at the top-left corner(0, 0), and
-
Robot #2 is located at the top-right corner(0, cols - 1).
-
-
-
Return the maximum number of cherries collection using both robots by following the rules below:
-
-
-
From a cell (i, j), robots can move to cell (i + 1, j - 1), (i + 1, j), or (i + 1, j + 1).
-
When any robot passes through a cell, It picks up all cherries, and the cell becomes an empty cell.
-
When both robots stay in the same cell, only one takes the cherries.
-
Both robots cannot move outside of the grid at any moment.
-
Both robots should reach the bottom row in grid.
-
-
-
-
Example 1:
-
-
-Input: grid = [[3,1,1],[2,5,1],[1,5,5],[2,1,1]]
-Output: 24
-Explanation: Path of robot #1 and #2 are described in color green and blue respectively.
-Cherries taken by Robot #1, (3 + 2 + 5 + 2) = 12.
-Cherries taken by Robot #2, (1 + 5 + 5 + 1) = 12.
-Total of cherries: 12 + 12 = 24.
-
-
-
Example 2:
-
-
-Input: grid = [[1,0,0,0,0,0,1],[2,0,0,0,0,3,0],[2,0,9,0,0,0,0],[0,3,0,5,4,0,0],[1,0,2,3,0,0,6]]
-Output: 28
-Explanation: Path of robot #1 and #2 are described in color green and blue respectively.
-Cherries taken by Robot #1, (1 + 9 + 5 + 2) = 17.
-Cherries taken by Robot #2, (1 + 3 + 4 + 3) = 11.
-Total of cherries: 17 + 11 = 28.
-
-
-
-
Constraints:
-
-
-
rows == grid.length
-
cols == grid[i].length
-
2 <= rows, cols <= 70
-
0 <= grid[i][j] <= 100
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
-
-### Hints
-
-Hint 1
-Use dynammic programming, define DP[i][j][k]: The maximum cherries that both robots can take starting on the ith row, and column j and k of Robot 1 and 2 respectively.
-
diff --git a/problems/cherry-pickup/README.md b/problems/cherry-pickup/README.md
deleted file mode 100644
index 07f1b153f..000000000
--- a/problems/cherry-pickup/README.md
+++ /dev/null
@@ -1,69 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../delete-and-earn "Delete and Earn")
-
-[Next >](../closest-leaf-in-a-binary-tree "Closest Leaf in a Binary Tree")
-
-## [741. Cherry Pickup (Hard)](https://leetcode.com/problems/cherry-pickup "摘樱桃")
-
-
You are given an n x ngrid representing a field of cherries, each cell is one of three possible integers.
-
-
-
0 means the cell is empty, so you can pass through,
-
1 means the cell contains a cherry that you can pick up and pass through, or
-
-1 means the cell contains a thorn that blocks your way.
-
-
-
Return the maximum number of cherries you can collect by following the rules below:
-
-
-
Starting at the position (0, 0) and reaching (n - 1, n - 1) by moving right or down through valid path cells (cells with value 0 or 1).
-
After reaching (n - 1, n - 1), returning to (0, 0) by moving left or up through valid path cells.
-
When passing through a path cell containing a cherry, you pick it up, and the cell becomes an empty cell 0.
-
If there is no valid path between (0, 0) and (n - 1, n - 1), then no cherries can be collected.
-
-
-
-
Example 1:
-
-
-Input: grid = [[0,1,-1],[1,0,-1],[1,1,1]]
-Output: 5
-Explanation: The player started at (0, 0) and went down, down, right right to reach (2, 2).
-4 cherries were picked up during this single trip, and the matrix becomes [[0,1,-1],[0,0,-1],[0,0,0]].
-Then, the player went left, up, up, left to return home, picking up one more cherry.
-The total number of cherries picked up is 5, and this is the maximum possible.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
-
-### Similar Questions
- 1. [Minimum Path Sum](../minimum-path-sum) (Medium)
- 1. [Dungeon Game](../dungeon-game) (Hard)
diff --git a/problems/cherry-pickup/cherry_pickup.go b/problems/cherry-pickup/cherry_pickup.go
deleted file mode 100644
index ee1416c2e..000000000
--- a/problems/cherry-pickup/cherry_pickup.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem741
diff --git a/problems/cherry-pickup/cherry_pickup_test.go b/problems/cherry-pickup/cherry_pickup_test.go
deleted file mode 100644
index ee1416c2e..000000000
--- a/problems/cherry-pickup/cherry_pickup_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem741
diff --git a/problems/choose-numbers-from-two-arrays-in-range/README.md b/problems/choose-numbers-from-two-arrays-in-range/README.md
deleted file mode 100644
index d35ea7619..000000000
--- a/problems/choose-numbers-from-two-arrays-in-range/README.md
+++ /dev/null
@@ -1,34 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../the-number-of-passengers-in-each-bus-i "The Number of Passengers in Each Bus I")
-
-[Next >](../minimum-cost-of-buying-candies-with-discount "Minimum Cost of Buying Candies With Discount")
-
-## [2143. Choose Numbers From Two Arrays in Range (Hard)](https://leetcode.com/problems/choose-numbers-from-two-arrays-in-range "")
-
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Hints
-
-Hint 1
-If you know the possible sums you can get for a range [l, r], how can you use this information to calculate the possible sums you can get for a range [l, r + 1]?
-
-
-
-Hint 2
-For the range [l, r], if it is possible to choose elements such that the sum of elements you picked from nums1 is x and the sum of elements you picked from nums2 is y, then (x + nums1[r + 1], y) and (x, y + nums2[r + 1]) are possible sums you can get in the range [l, r + 1].
-
-
-
-Hint 3
-How can we save the possible sums obtainable at a given index so that we can reuse this information later?
-
diff --git a/problems/cinema-seat-allocation/README.md b/problems/cinema-seat-allocation/README.md
deleted file mode 100644
index 2a9094e0f..000000000
--- a/problems/cinema-seat-allocation/README.md
+++ /dev/null
@@ -1,79 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../find-the-distance-value-between-two-arrays "Find the Distance Value Between Two Arrays")
-
-[Next >](../sort-integers-by-the-power-value "Sort Integers by The Power Value")
-
-## [1386. Cinema Seat Allocation (Medium)](https://leetcode.com/problems/cinema-seat-allocation "安排电影院座位")
-
-
-
-
A cinema has n rows of seats, numbered from 1 to n and there are ten seats in each row, labelled from 1 to 10 as shown in the figure above.
-
-
Given the array reservedSeats containing the numbers of seats already reserved, for example, reservedSeats[i] = [3,8] means the seat located in row 3 and labelled with 8 is already reserved.
-
-
Return the maximum number of four-person groups you can assign on the cinema seats. A four-person group occupies four adjacent seats in one single row. Seats across an aisle (such as [3,3] and [3,4]) are not considered to be adjacent, but there is an exceptional case on which an aisle split a four-person group, in that case, the aisle split a four-person group in the middle, which means to have two people on each side.
-
-
-
Example 1:
-
-
-
-
-Input: n = 3, reservedSeats = [[1,2],[1,3],[1,8],[2,6],[3,1],[3,10]]
-Output: 4
-Explanation: The figure above shows the optimal allocation for four groups, where seats mark with blue are already reserved and contiguous seats mark with orange are for one group.
-
-
-
Example 2:
-
-
-Input: n = 2, reservedSeats = [[2,1],[1,8],[2,6]]
-Output: 2
-
-
-
Example 3:
-
-
-Input: n = 4, reservedSeats = [[4,3],[1,4],[4,6],[1,7]]
-Output: 4
-
-
-
-
Constraints:
-
-
-
1 <= n <= 10^9
-
1 <= reservedSeats.length <= min(10*n, 10^4)
-
reservedSeats[i].length == 2
-
1 <= reservedSeats[i][0] <= n
-
1 <= reservedSeats[i][1] <= 10
-
All reservedSeats[i] are distinct.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Greedy](../../tag/greedy/README.md)]
- [[Bit Manipulation](../../tag/bit-manipulation/README.md)]
-
-### Hints
-
-Hint 1
-Note you can allocate at most two families in one row.
-
-
-
-Hint 2
-Greedily check if you can allocate seats for two families, one family or none.
-
-
-
-Hint 3
-Process only rows that appear in the input, for other rows you can always allocate seats for two families.
-
diff --git a/problems/circle-and-rectangle-overlapping/README.md b/problems/circle-and-rectangle-overlapping/README.md
deleted file mode 100644
index 546cedeb1..000000000
--- a/problems/circle-and-rectangle-overlapping/README.md
+++ /dev/null
@@ -1,59 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../construct-k-palindrome-strings "Construct K Palindrome Strings")
-
-[Next >](../reducing-dishes "Reducing Dishes")
-
-## [1401. Circle and Rectangle Overlapping (Medium)](https://leetcode.com/problems/circle-and-rectangle-overlapping "圆和矩形是否有重叠")
-
-
You are given a circle represented as (radius, xCenter, yCenter) and an axis-aligned rectangle represented as (x1, y1, x2, y2), where (x1, y1) are the coordinates of the bottom-left corner, and (x2, y2) are the coordinates of the top-right corner of the rectangle.
-
-
Return true if the circle and rectangle are overlapped otherwise return false. In other words, check if there is any point (xi, yi) that belongs to the circle and the rectangle at the same time.
-
-
-
Example 1:
-
-
-Input: radius = 1, xCenter = 0, yCenter = 0, x1 = 1, y1 = -1, x2 = 3, y2 = 1
-Output: true
-Explanation: Circle and rectangle share the point (1,0).
-
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
- [[Geometry](../../tag/geometry/README.md)]
-
-### Hints
-
-Hint 1
-Locate the closest point of the square to the circle, you can then find the distance from this point to the center of the circle and check if this is less than or equal to the radius.
-
diff --git a/problems/circular-array-loop/README.md b/problems/circular-array-loop/README.md
deleted file mode 100644
index 48326bf27..000000000
--- a/problems/circular-array-loop/README.md
+++ /dev/null
@@ -1,79 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../132-pattern "132 Pattern")
-
-[Next >](../poor-pigs "Poor Pigs")
-
-## [457. Circular Array Loop (Medium)](https://leetcode.com/problems/circular-array-loop "环形数组是否存在循环")
-
-
You are playing a game involving a circular array of non-zero integers nums. Each nums[i] denotes the number of indices forward/backward you must move if you are located at index i:
-
-
-
If nums[i] is positive, move nums[i] steps forward, and
-
If nums[i] is negative, move nums[i] steps backward.
-
-
-
Since the array is circular, you may assume that moving forward from the last element puts you on the first element, and moving backwards from the first element puts you on the last element.
-
-
A cycle in the array consists of a sequence of indices seq of length k where:
-
-
-
Following the movement rules above results in the repeating index sequence seq[0] -> seq[1] -> ... -> seq[k - 1] -> seq[0] -> ...
-
Every nums[seq[j]] is either all positive or all negative.
-
k > 1
-
-
-
Return true if there is a cycle in nums, or false otherwise.
-
-
-
Example 1:
-
-
-Input: nums = [2,-1,1,2,2]
-Output: true
-Explanation:
-There is a cycle from index 0 -> 2 -> 3 -> 0 -> ...
-The cycle's length is 3.
-
-
-
Example 2:
-
-
-Input: nums = [-1,2]
-Output: false
-Explanation:
-The sequence from index 1 -> 1 -> 1 -> ... is not a cycle because the sequence's length is 1.
-By definition the sequence's length must be strictly greater than 1 to be a cycle.
-
-
-
Example 3:
-
-
-Input: nums = [-2,1,-1,-2,-2]
-Output: false
-Explanation:
-The sequence from index 1 -> 2 -> 1 -> ... is not a cycle because nums[1] is positive, but nums[2] is negative.
-Every nums[seq[j]] must be either all positive or all negative.
-
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 5000
-
-1000 <= nums[i] <= 1000
-
nums[i] != 0
-
-
-
-
Follow up: Could you solve it in O(n) time complexity and O(1) extra space complexity?
Given 2 integers n and start. Your task is return any permutation p of (0,1,2.....,2^n -1) such that :
-
-
-
p[0] = start
-
p[i] and p[i+1] differ by only one bit in their binary representation.
-
p[0] and p[2^n -1] must also differ by only one bit in their binary representation.
-
-
-
-
Example 1:
-
-
-Input: n = 2, start = 3
-Output: [3,2,0,1]
-Explanation: The binary representation of the permutation is (11,10,00,01).
-All the adjacent element differ by one bit. Another valid permutation is [3,1,0,2]
-
-
-
Example 2:
-
-
-Input: n = 3, start = 2
-Output: [2,6,7,5,4,0,1,3]
-Explanation: The binary representation of the permutation is (010,110,111,101,100,000,001,011).
-
-
-
-
Constraints:
-
-
-
1 <= n <= 16
-
0 <= start < 2 ^ n
-
-
-### Related Topics
- [[Bit Manipulation](../../tag/bit-manipulation/README.md)]
- [[Math](../../tag/math/README.md)]
- [[Backtracking](../../tag/backtracking/README.md)]
-
-### Hints
-
-Hint 1
-Use gray code to generate a n-bit sequence.
-
-
-
-Hint 2
-Rotate the sequence such that its first element is start.
-
diff --git a/problems/classes-more-than-5-students/README.md b/problems/classes-more-than-5-students/README.md
deleted file mode 100644
index 4f131c182..000000000
--- a/problems/classes-more-than-5-students/README.md
+++ /dev/null
@@ -1,68 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../big-countries "Big Countries")
-
-[Next >](../friend-requests-i-overall-acceptance-rate "Friend Requests I: Overall Acceptance Rate")
-
-## [596. Classes More Than 5 Students (Easy)](https://leetcode.com/problems/classes-more-than-5-students "超过5名学生的课")
-
-
Table: Courses
-
-
-+-------------+---------+
-| Column Name | Type |
-+-------------+---------+
-| student | varchar |
-| class | varchar |
-+-------------+---------+
-(student, class) is the primary key column for this table.
-Each row of this table indicates the name of a student and the class in which they are enrolled.
-
-
-
-
-
Write an SQL query to report all the classes that have at least five students.
-
-
Return the result table in any order.
-
-
The query result format is in the following example.
-
-
-
Example 1:
-
-
-Input:
-Courses table:
-+---------+----------+
-| student | class |
-+---------+----------+
-| A | Math |
-| B | English |
-| C | Math |
-| D | Biology |
-| E | Math |
-| F | Computer |
-| G | Math |
-| H | Math |
-| I | Math |
-+---------+----------+
-Output:
-+---------+
-| class |
-+---------+
-| Math |
-+---------+
-Explanation:
-- Math has 6 students, so we include it.
-- English has 1 student, so we do not include it.
-- Biology has 1 student, so we do not include it.
-- Computer has 1 student, so we do not include it.
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/classes-more-than-5-students/classes_more_than_5_students.sql b/problems/classes-more-than-5-students/classes_more_than_5_students.sql
deleted file mode 100644
index bae62cf19..000000000
--- a/problems/classes-more-than-5-students/classes_more_than_5_students.sql
+++ /dev/null
@@ -1 +0,0 @@
-# Write your MySQL query statement below
diff --git a/problems/classes-more-than-5-students/mysql_schemas.sql b/problems/classes-more-than-5-students/mysql_schemas.sql
deleted file mode 100644
index b063c3153..000000000
--- a/problems/classes-more-than-5-students/mysql_schemas.sql
+++ /dev/null
@@ -1,11 +0,0 @@
-Create table If Not Exists Courses (student varchar(255), class varchar(255));
-Truncate table Courses;
-insert into Courses (student, class) values ('A', 'Math');
-insert into Courses (student, class) values ('B', 'English');
-insert into Courses (student, class) values ('C', 'Math');
-insert into Courses (student, class) values ('D', 'Biology');
-insert into Courses (student, class) values ('E', 'Math');
-insert into Courses (student, class) values ('F', 'Computer');
-insert into Courses (student, class) values ('G', 'Math');
-insert into Courses (student, class) values ('H', 'Math');
-insert into Courses (student, class) values ('I', 'Math');
diff --git a/problems/climbing-stairs/README.md b/problems/climbing-stairs/README.md
deleted file mode 100644
index 5a7ddf992..000000000
--- a/problems/climbing-stairs/README.md
+++ /dev/null
@@ -1,61 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../sqrtx "Sqrt(x)")
-
-[Next >](../simplify-path "Simplify Path")
-
-## [70. Climbing Stairs (Easy)](https://leetcode.com/problems/climbing-stairs "爬楼梯")
-
-
You are climbing a staircase. It takes n steps to reach the top.
-
-
Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top?
-
-
-
Example 1:
-
-
-Input: n = 2
-Output: 2
-Explanation: There are two ways to climb to the top.
-1. 1 step + 1 step
-2. 2 steps
-
-
-
Example 2:
-
-
-Input: n = 3
-Output: 3
-Explanation: There are three ways to climb to the top.
-1. 1 step + 1 step + 1 step
-2. 1 step + 2 steps
-3. 2 steps + 1 step
-
-
-
-
Constraints:
-
-
-
1 <= n <= 45
-
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Memoization](../../tag/memoization/README.md)]
-
-### Similar Questions
- 1. [Min Cost Climbing Stairs](../min-cost-climbing-stairs) (Easy)
- 1. [Fibonacci Number](../fibonacci-number) (Easy)
- 1. [N-th Tribonacci Number](../n-th-tribonacci-number) (Easy)
-
-### Hints
-
-Hint 1
-To reach nth step, what could have been your previous steps? (Think about the step sizes)
-
diff --git a/problems/climbing-stairs/climbing_stairs.go b/problems/climbing-stairs/climbing_stairs.go
deleted file mode 100644
index 5934d0c4a..000000000
--- a/problems/climbing-stairs/climbing_stairs.go
+++ /dev/null
@@ -1,12 +0,0 @@
-package problem70
-
-func climbStairs(n int) int {
- if n == 1 {
- return 1
- }
- first, second := 1, 2
- for i := 3; i <= n; i++ {
- first, second = second, first+second
- }
- return second
-}
diff --git a/problems/climbing-stairs/climbing_stairs_test.go b/problems/climbing-stairs/climbing_stairs_test.go
deleted file mode 100644
index 9f9aba81b..000000000
--- a/problems/climbing-stairs/climbing_stairs_test.go
+++ /dev/null
@@ -1,31 +0,0 @@
-package problem70
-
-import "testing"
-
-type testType struct {
- in int
- want int
-}
-
-func TestClimbStairs(t *testing.T) {
- tests := [...]testType{
- {
- in: 1,
- want: 1,
- },
- {
- in: 2,
- want: 2,
- },
- {
- in: 3,
- want: 3,
- },
- }
- for _, tt := range tests {
- got := climbStairs(tt.in)
- if got != tt.want {
- t.Fatalf("in: %v, got: %v, want: %v", tt.in, got, tt.want)
- }
- }
-}
diff --git a/problems/clone-binary-tree-with-random-pointer/README.md b/problems/clone-binary-tree-with-random-pointer/README.md
deleted file mode 100644
index e50978b09..000000000
--- a/problems/clone-binary-tree-with-random-pointer/README.md
+++ /dev/null
@@ -1,37 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../group-sold-products-by-the-date "Group Sold Products By The Date")
-
-[Next >](../xor-operation-in-an-array "XOR Operation in an Array")
-
-## [1485. Clone Binary Tree With Random Pointer (Medium)](https://leetcode.com/problems/clone-binary-tree-with-random-pointer "克隆含随机指针的二叉树")
-
-
-
-### Related Topics
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Tree](../../tag/tree/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Binary Tree](../../tag/binary-tree/README.md)]
-
-### Similar Questions
- 1. [Clone Graph](../clone-graph) (Medium)
- 1. [Copy List with Random Pointer](../copy-list-with-random-pointer) (Medium)
- 1. [Clone N-ary Tree](../clone-n-ary-tree) (Medium)
-
-### Hints
-
-Hint 1
-Traverse the tree, keep a hashtable with you and create a nodecopy for each node in the tree.
-
-
-
-Hint 2
-Start traversing the original tree again and connect the left, right and random pointers in the cloned tree the same way as the original tree with the help of the hashtable.
-
diff --git a/problems/clone-graph/README.md b/problems/clone-graph/README.md
deleted file mode 100644
index 4c7683c89..000000000
--- a/problems/clone-graph/README.md
+++ /dev/null
@@ -1,91 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../palindrome-partitioning-ii "Palindrome Partitioning II")
-
-[Next >](../gas-station "Gas Station")
-
-## [133. Clone Graph (Medium)](https://leetcode.com/problems/clone-graph "克隆图")
-
-
Given a reference of a node in a connected undirected graph.
Each node in the graph contains a value (int) and a list (List[Node]) of its neighbors.
-
-
-class Node {
- public int val;
- public List<Node> neighbors;
-}
-
-
-
-
-
Test case format:
-
-
For simplicity, each node's value is the same as the node's index (1-indexed). For example, the first node with val == 1, the second node with val == 2, and so on. The graph is represented in the test case using an adjacency list.
-
-
An adjacency list is a collection of unordered lists used to represent a finite graph. Each list describes the set of neighbors of a node in the graph.
-
-
The given node will always be the first node with val = 1. You must return the copy of the given node as a reference to the cloned graph.
-
-
-
Example 1:
-
-
-Input: adjList = [[2,4],[1,3],[2,4],[1,3]]
-Output: [[2,4],[1,3],[2,4],[1,3]]
-Explanation: There are 4 nodes in the graph.
-1st node (val = 1)'s neighbors are 2nd node (val = 2) and 4th node (val = 4).
-2nd node (val = 2)'s neighbors are 1st node (val = 1) and 3rd node (val = 3).
-3rd node (val = 3)'s neighbors are 2nd node (val = 2) and 4th node (val = 4).
-4th node (val = 4)'s neighbors are 1st node (val = 1) and 3rd node (val = 3).
-
-
-
Example 2:
-
-
-Input: adjList = [[]]
-Output: [[]]
-Explanation: Note that the input contains one empty list. The graph consists of only one node with val = 1 and it does not have any neighbors.
-
-
-
Example 3:
-
-
-Input: adjList = []
-Output: []
-Explanation: This an empty graph, it does not have any nodes.
-
-
-
Example 4:
-
-
-Input: adjList = [[2],[1]]
-Output: [[2],[1]]
-
-
-
-
Constraints:
-
-
-
The number of nodes in the graph is in the range [0, 100].
-
1 <= Node.val <= 100
-
Node.val is unique for each node.
-
There are no repeated edges and no self-loops in the graph.
-
The Graph is connected and all nodes can be visited starting from the given node.
-
-
-### Related Topics
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Graph](../../tag/graph/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
-
-### Similar Questions
- 1. [Copy List with Random Pointer](../copy-list-with-random-pointer) (Medium)
diff --git a/problems/clone-graph/clone_graph.go b/problems/clone-graph/clone_graph.go
deleted file mode 100644
index 930f0f2fe..000000000
--- a/problems/clone-graph/clone_graph.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem133
diff --git a/problems/clone-graph/clone_graph.py b/problems/clone-graph/clone_graph.py
deleted file mode 100755
index 302ce22d5..000000000
--- a/problems/clone-graph/clone_graph.py
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/usr/bin/env python
-
-"""
-# Definition for a Node.
-class Node:
- def __init__(self, val, neighbors):
- self.val = val
- self.neighbors = neighbors
-"""
-class Solution:
- def cloneGraph(self, node: 'Node') -> 'Node':
-
\ No newline at end of file
diff --git a/problems/clone-graph/clone_graph_test.go b/problems/clone-graph/clone_graph_test.go
deleted file mode 100644
index 930f0f2fe..000000000
--- a/problems/clone-graph/clone_graph_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem133
diff --git a/problems/clone-n-ary-tree/README.md b/problems/clone-n-ary-tree/README.md
deleted file mode 100644
index d1d37b8bd..000000000
--- a/problems/clone-n-ary-tree/README.md
+++ /dev/null
@@ -1,36 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../find-critical-and-pseudo-critical-edges-in-minimum-spanning-tree "Find Critical and Pseudo-Critical Edges in Minimum Spanning Tree")
-
-[Next >](../average-salary-excluding-the-minimum-and-maximum-salary "Average Salary Excluding the Minimum and Maximum Salary")
-
-## [1490. Clone N-ary Tree (Medium)](https://leetcode.com/problems/clone-n-ary-tree "克隆 N 叉树")
-
-
-
-### Related Topics
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Tree](../../tag/tree/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
-
-### Similar Questions
- 1. [Clone Graph](../clone-graph) (Medium)
- 1. [Copy List with Random Pointer](../copy-list-with-random-pointer) (Medium)
- 1. [Clone Binary Tree With Random Pointer](../clone-binary-tree-with-random-pointer) (Medium)
-
-### Hints
-
-Hint 1
-Traverse the tree, keep a hashtable with you and create a clone node for each node in the tree.
-
-
-
-Hint 2
-Start traversing the original tree again and connect each child pointer in the cloned tree the same way as the original tree with the help of the hashtable.
-
diff --git a/problems/closest-binary-search-tree-value-ii/README.md b/problems/closest-binary-search-tree-value-ii/README.md
deleted file mode 100644
index 441168f84..000000000
--- a/problems/closest-binary-search-tree-value-ii/README.md
+++ /dev/null
@@ -1,75 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../encode-and-decode-strings "Encode and Decode Strings")
-
-[Next >](../integer-to-english-words "Integer to English Words")
-
-## [272. Closest Binary Search Tree Value II (Hard)](https://leetcode.com/problems/closest-binary-search-tree-value-ii "最接近的二叉搜索树值 II")
-
-
Given a non-empty binary search tree and a target value, find k values in the BST that are closest to the target.
-
-
Note:
-
-
-
Given target value is a floating point.
-
You may assume k is always valid, that is: k ≤ total nodes.
-
You are guaranteed to have only one unique set of k values in the BST that are closest to the target.
Follow up:
-Assume that the BST is balanced, could you solve it in less than O(n) runtime (where n = total nodes)?
-
-### Related Topics
- [[Stack](../../tag/stack/README.md)]
- [[Tree](../../tag/tree/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Binary Search Tree](../../tag/binary-search-tree/README.md)]
- [[Two Pointers](../../tag/two-pointers/README.md)]
- [[Binary Tree](../../tag/binary-tree/README.md)]
- [[Heap (Priority Queue)](../../tag/heap-priority-queue/README.md)]
-
-### Similar Questions
- 1. [Binary Tree Inorder Traversal](../binary-tree-inorder-traversal) (Easy)
- 1. [Closest Binary Search Tree Value](../closest-binary-search-tree-value) (Easy)
-
-### Hints
-
-Hint 1
-Consider implement these two helper functions:
-
getPredecessor(N), which returns the next smaller node to N.
-
getSuccessor(N), which returns the next larger node to N.
-
-
-
-
-Hint 2
-Try to assume that each node has a parent pointer, it makes the problem much easier.
-
-
-
-Hint 3
-Without parent pointer we just need to keep track of the path from the root to the current node using a stack.
-
-
-
-Hint 4
-You would need two stacks to track the path in finding predecessor and successor node separately.
-
diff --git a/problems/closest-binary-search-tree-value-ii/closest_binary_search_tree_value_ii.go b/problems/closest-binary-search-tree-value-ii/closest_binary_search_tree_value_ii.go
deleted file mode 100644
index 15c7eb7c1..000000000
--- a/problems/closest-binary-search-tree-value-ii/closest_binary_search_tree_value_ii.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem272
diff --git a/problems/closest-binary-search-tree-value-ii/closest_binary_search_tree_value_ii_test.go b/problems/closest-binary-search-tree-value-ii/closest_binary_search_tree_value_ii_test.go
deleted file mode 100644
index 15c7eb7c1..000000000
--- a/problems/closest-binary-search-tree-value-ii/closest_binary_search_tree_value_ii_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem272
diff --git a/problems/closest-binary-search-tree-value/README.md b/problems/closest-binary-search-tree-value/README.md
deleted file mode 100644
index 6178001ff..000000000
--- a/problems/closest-binary-search-tree-value/README.md
+++ /dev/null
@@ -1,47 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../alien-dictionary "Alien Dictionary")
-
-[Next >](../encode-and-decode-strings "Encode and Decode Strings")
-
-## [270. Closest Binary Search Tree Value (Easy)](https://leetcode.com/problems/closest-binary-search-tree-value "最接近的二叉搜索树值")
-
-
Given a non-empty binary search tree and a target value, find the value in the BST that is closest to the target.
-
-
Note:
-
-
-
Given target value is a floating point.
-
You are guaranteed to have only one unique value in the BST that is closest to the target.
-
-### Related Topics
- [[Binary Search](../../tag/binary-search/README.md)]
- [[Tree](../../tag/tree/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Binary Search Tree](../../tag/binary-search-tree/README.md)]
- [[Binary Tree](../../tag/binary-tree/README.md)]
-
-### Similar Questions
- 1. [Count Complete Tree Nodes](../count-complete-tree-nodes) (Medium)
- 1. [Closest Binary Search Tree Value II](../closest-binary-search-tree-value-ii) (Hard)
- 1. [Search in a Binary Search Tree](../search-in-a-binary-search-tree) (Easy)
diff --git a/problems/closest-binary-search-tree-value/closest_binary_search_tree_value.go b/problems/closest-binary-search-tree-value/closest_binary_search_tree_value.go
deleted file mode 100644
index 349405545..000000000
--- a/problems/closest-binary-search-tree-value/closest_binary_search_tree_value.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem270
diff --git a/problems/closest-binary-search-tree-value/closest_binary_search_tree_value_test.go b/problems/closest-binary-search-tree-value/closest_binary_search_tree_value_test.go
deleted file mode 100644
index 349405545..000000000
--- a/problems/closest-binary-search-tree-value/closest_binary_search_tree_value_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem270
diff --git a/problems/closest-dessert-cost/README.md b/problems/closest-dessert-cost/README.md
deleted file mode 100644
index 876fe6d2c..000000000
--- a/problems/closest-dessert-cost/README.md
+++ /dev/null
@@ -1,88 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../count-items-matching-a-rule "Count Items Matching a Rule")
-
-[Next >](../equal-sum-arrays-with-minimum-number-of-operations "Equal Sum Arrays With Minimum Number of Operations")
-
-## [1774. Closest Dessert Cost (Medium)](https://leetcode.com/problems/closest-dessert-cost "最接近目标价格的甜点成本")
-
-
You would like to make dessert and are preparing to buy the ingredients. You have n ice cream base flavors and m types of toppings to choose from. You must follow these rules when making your dessert:
-
-
-
There must be exactly one ice cream base.
-
You can add one or more types of topping or have no toppings at all.
-
There are at most two of each type of topping.
-
-
-
You are given three inputs:
-
-
-
baseCosts, an integer array of length n, where each baseCosts[i] represents the price of the ith ice cream base flavor.
-
toppingCosts, an integer array of length m, where each toppingCosts[i] is the price of one of the ith topping.
-
target, an integer representing your target price for dessert.
-
-
-
You want to make a dessert with a total cost as close to target as possible.
-
-
Return the closest possible cost of the dessert to target. If there are multiple, return the lower one.
-
-
-
Example 1:
-
-
-Input: baseCosts = [1,7], toppingCosts = [3,4], target = 10
-Output: 10
-Explanation: Consider the following combination (all 0-indexed):
-- Choose base 1: cost 7
-- Take 1 of topping 0: cost 1 x 3 = 3
-- Take 0 of topping 1: cost 0 x 4 = 0
-Total: 7 + 3 + 0 = 10.
-
-
-
Example 2:
-
-
-Input: baseCosts = [2,3], toppingCosts = [4,5,100], target = 18
-Output: 17
-Explanation: Consider the following combination (all 0-indexed):
-- Choose base 1: cost 3
-- Take 1 of topping 0: cost 1 x 4 = 4
-- Take 2 of topping 1: cost 2 x 5 = 10
-- Take 0 of topping 2: cost 0 x 100 = 0
-Total: 3 + 4 + 10 + 0 = 17. You cannot make a dessert with a total cost of 18.
-
-
-
Example 3:
-
-
-Input: baseCosts = [3,10], toppingCosts = [2,5], target = 9
-Output: 8
-Explanation: It is possible to make desserts with cost 8 and 10. Return 8 as it is the lower cost.
-
-
-
-
Constraints:
-
-
-
n == baseCosts.length
-
m == toppingCosts.length
-
1 <= n, m <= 10
-
1 <= baseCosts[i], toppingCosts[i] <= 104
-
1 <= target <= 104
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Backtracking](../../tag/backtracking/README.md)]
-
-### Hints
-
-Hint 1
-As the constraints are not large, you can brute force and enumerate all the possibilities.
-
diff --git a/problems/closest-divisors/README.md b/problems/closest-divisors/README.md
deleted file mode 100644
index 85e11e737..000000000
--- a/problems/closest-divisors/README.md
+++ /dev/null
@@ -1,60 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../validate-binary-tree-nodes "Validate Binary Tree Nodes")
-
-[Next >](../largest-multiple-of-three "Largest Multiple of Three")
-
-## [1362. Closest Divisors (Medium)](https://leetcode.com/problems/closest-divisors "最接近的因数")
-
-
Given an integer num, find the closest two integers in absolute difference whose product equals num + 1 or num + 2.
-
-
Return the two integers in any order.
-
-
-
Example 1:
-
-
-Input: num = 8
-Output: [3,3]
-Explanation: For num + 1 = 9, the closest divisors are 3 & 3, for num + 2 = 10, the closest divisors are 2 & 5, hence 3 & 3 is chosen.
-
-
-
Example 2:
-
-
-Input: num = 123
-Output: [5,25]
-
-
-
Example 3:
-
-
-Input: num = 999
-Output: [40,25]
-
-
-
-
Constraints:
-
-
-
1 <= num <= 10^9
-
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
-
-### Hints
-
-Hint 1
-Find the divisors of n+1 and n+2.
-
-
-
-Hint 2
-To find the divisors of a number, you only need to iterate to the square root of that number.
-
diff --git a/problems/closest-leaf-in-a-binary-tree/README.md b/problems/closest-leaf-in-a-binary-tree/README.md
deleted file mode 100644
index 417cfb5a6..000000000
--- a/problems/closest-leaf-in-a-binary-tree/README.md
+++ /dev/null
@@ -1,84 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../cherry-pickup "Cherry Pickup")
-
-[Next >](../network-delay-time "Network Delay Time")
-
-## [742. Closest Leaf in a Binary Tree (Medium)](https://leetcode.com/problems/closest-leaf-in-a-binary-tree "二叉树最近的叶节点")
-
-
Given a binary tree where every node has a unique value, and a target key k, find the value of the nearest leaf node to target k in the tree.
-
-Here, nearest to a leaf means the least number of edges travelled on the binary tree to reach any leaf of the tree. Also, a node is called a leaf if it has no children.
-
-In the following examples, the input tree is represented in flattened form row by row.
-The actual root tree given will be a TreeNode object.
-
-Example 1:
-
-Input:
-root = [1, 3, 2], k = 1
-Diagram of binary tree:
- 1
- / \
- 3 2
-
-Output: 2 (or 3)
-
-Explanation: Either 2 or 3 is the nearest leaf node to the target of 1.
-
-
-Example 2:
-
-Input:
-root = [1], k = 1
-Output: 1
-
-Explanation: The nearest leaf node is the root node itself.
-
-
-
-
-Example 3:
-
-Input:
-root = [1,2,3,4,null,null,null,5,null,6], k = 2
-Diagram of binary tree:
- 1
- / \
- 2 3
- /
- 4
- /
- 5
- /
- 6
-
-Output: 3
-Explanation: The leaf node with value 3 (and not the leaf node with value 6) is nearest to the node with value 2.
-
-
-
-
Note:
-
-
root represents a binary tree with at least 1 node and at most 1000 nodes.
-
Every node has a unique node.val in range [1, 1000].
-
There exists some node in the given binary tree for which node.val == k.
-
-
-
-### Related Topics
- [[Tree](../../tag/tree/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Binary Tree](../../tag/binary-tree/README.md)]
-
-### Hints
-
-Hint 1
-Convert the tree to a general graph, and do a breadth-first search. Alternatively, find the closest leaf for every node on the path from root to target.
-
diff --git a/problems/closest-leaf-in-a-binary-tree/closest_leaf_in_a_binary_tree.go b/problems/closest-leaf-in-a-binary-tree/closest_leaf_in_a_binary_tree.go
deleted file mode 100644
index 3fa1fe338..000000000
--- a/problems/closest-leaf-in-a-binary-tree/closest_leaf_in_a_binary_tree.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem742
diff --git a/problems/closest-leaf-in-a-binary-tree/closest_leaf_in_a_binary_tree_test.go b/problems/closest-leaf-in-a-binary-tree/closest_leaf_in_a_binary_tree_test.go
deleted file mode 100644
index 3fa1fe338..000000000
--- a/problems/closest-leaf-in-a-binary-tree/closest_leaf_in_a_binary_tree_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem742
diff --git a/problems/closest-room/README.md b/problems/closest-room/README.md
deleted file mode 100644
index 6b25587c4..000000000
--- a/problems/closest-room/README.md
+++ /dev/null
@@ -1,74 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-element-after-decreasing-and-rearranging "Maximum Element After Decreasing and Rearranging")
-
-[Next >](../minimum-distance-to-the-target-element "Minimum Distance to the Target Element")
-
-## [1847. Closest Room (Hard)](https://leetcode.com/problems/closest-room "最近的房间")
-
-
There is a hotel with n rooms. The rooms are represented by a 2D integer array rooms where rooms[i] = [roomIdi, sizei] denotes that there is a room with room number roomIdi and size equal to sizei. Each roomIdi is guaranteed to be unique.
-
-
You are also given k queries in a 2D array queries where queries[j] = [preferredj, minSizej]. The answer to the jth query is the room number id of a room such that:
-
-
-
The room has a size of at leastminSizej, and
-
abs(id - preferredj) is minimized, where abs(x) is the absolute value of x.
-
-
-
If there is a tie in the absolute difference, then use the room with the smallest such id. If there is no such room, the answer is -1.
-
-
Return an array answer of length k where answer[j] contains the answer to the jth query.
-
-
-
Example 1:
-
-
-Input: rooms = [[2,2],[1,2],[3,2]], queries = [[3,1],[3,3],[5,2]]
-Output: [3,-1,3]
-Explanation: The answers to the queries are as follows:
-Query = [3,1]: Room number 3 is the closest as abs(3 - 3) = 0, and its size of 2 is at least 1. The answer is 3.
-Query = [3,3]: There are no rooms with a size of at least 3, so the answer is -1.
-Query = [5,2]: Room number 3 is the closest as abs(3 - 5) = 2, and its size of 2 is at least 2. The answer is 3.
-
-
Example 2:
-
-
-Input: rooms = [[1,4],[2,3],[3,5],[4,1],[5,2]], queries = [[2,3],[2,4],[2,5]]
-Output: [2,1,3]
-Explanation: The answers to the queries are as follows:
-Query = [2,3]: Room number 2 is the closest as abs(2 - 2) = 0, and its size of 3 is at least 3. The answer is 2.
-Query = [2,4]: Room numbers 1 and 3 both have sizes of at least 4. The answer is 1 since it is smaller.
-Query = [2,5]: Room number 3 is the only room with a size of at least 5. The answer is 3.
-
-
-
Constraints:
-
-
-
n == rooms.length
-
1 <= n <= 105
-
k == queries.length
-
1 <= k <= 104
-
1 <= roomIdi, preferredj <= 107
-
1 <= sizei, minSizej <= 107
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Hints
-
-Hint 1
-Is there a way to sort the queries so it's easier to search the closest room larger than the size?
-
-
-
-Hint 2
-Use binary search to speed up the search time.
-
diff --git a/problems/closest-subsequence-sum/README.md b/problems/closest-subsequence-sum/README.md
deleted file mode 100644
index 1f41fe465..000000000
--- a/problems/closest-subsequence-sum/README.md
+++ /dev/null
@@ -1,83 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../largest-merge-of-two-strings "Largest Merge Of Two Strings")
-
-[Next >](../design-most-recently-used-queue "Design Most Recently Used Queue")
-
-## [1755. Closest Subsequence Sum (Hard)](https://leetcode.com/problems/closest-subsequence-sum "最接近目标值的子序列和")
-
-
You are given an integer array nums and an integer goal.
-
-
You want to choose a subsequence of nums such that the sum of its elements is the closest possible to goal. That is, if the sum of the subsequence's elements is sum, then you want to minimize the absolute differenceabs(sum - goal).
-
-
Return the minimum possible value ofabs(sum - goal).
-
-
Note that a subsequence of an array is an array formed by removing some elements (possibly all or none) of the original array.
-
-
-
Example 1:
-
-
-Input: nums = [5,-7,3,5], goal = 6
-Output: 0
-Explanation: Choose the whole array as a subsequence, with a sum of 6.
-This is equal to the goal, so the absolute difference is 0.
-
-
-
Example 2:
-
-
-Input: nums = [7,-9,15,-2], goal = -5
-Output: 1
-Explanation: Choose the subsequence [7,-9,-2], with a sum of -4.
-The absolute difference is abs(-4 - (-5)) = abs(1) = 1, which is the minimum.
-
-
-
Example 3:
-
-
-Input: nums = [1,2,3], goal = -7
-Output: 7
-
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 40
-
-107 <= nums[i] <= 107
-
-109 <= goal <= 109
-
-
-### Related Topics
- [[Bit Manipulation](../../tag/bit-manipulation/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Two Pointers](../../tag/two-pointers/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Bitmask](../../tag/bitmask/README.md)]
-
-### Hints
-
-Hint 1
-The naive solution is to check all possible subsequences. This works in O(2^n).
-
-
-
-Hint 2
-Divide the array into two parts of nearly is equal size.
-
-
-
-Hint 3
-Consider all subsets of one part and make a list of all possible subset sums and sort this list.
-
-
-
-Hint 4
-Consider all subsets of the other part, and for each one, let its sum = x, do binary search to get the nearest possible value to goal - x in the first part.
-
diff --git a/problems/clumsy-factorial/README.md b/problems/clumsy-factorial/README.md
deleted file mode 100644
index b6ca2e085..000000000
--- a/problems/clumsy-factorial/README.md
+++ /dev/null
@@ -1,59 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximize-sum-of-array-after-k-negations "Maximize Sum Of Array After K Negations")
-
-[Next >](../minimum-domino-rotations-for-equal-row "Minimum Domino Rotations For Equal Row")
-
-## [1006. Clumsy Factorial (Medium)](https://leetcode.com/problems/clumsy-factorial "笨阶乘")
-
-
The factorial of a positive integer n is the product of all positive integers less than or equal to n.
We make a clumsy factorial using the integers in decreasing order by swapping out the multiply operations for a fixed rotation of operations with multiply '*', divide '/', add '+', and subtract '-' in this order.
However, these operations are still applied using the usual order of operations of arithmetic. We do all multiplication and division steps before any addition or subtraction steps, and multiplication and division steps are processed left to right.
-
-
Additionally, the division that we use is floor division such that 10 * 9 / 8 = 90 / 8 = 11.
-
-
Given an integer n, return the clumsy factorial of n.
You are given an integer array coins representing coins of different denominations and an integer amount representing a total amount of money.
-
-
Return the fewest number of coins that you need to make up that amount. If that amount of money cannot be made up by any combination of the coins, return -1.
-
-
You may assume that you have an infinite number of each kind of coin.
Given an array A (index starts at 1) consisting of N integers: A1, A2, ..., AN and an integer B. The integer B denotes that from any place (suppose the index is i) in the array A, you can jump to any one of the place in the array A indexed i+1, i+2, …, i+B if this place can be jumped to. Also, if you step on the index i, you have to pay Ai coins. If Ai is -1, it means you can’t jump to the place indexed i in the array.
-
-
Now, you start from the place indexed 1 in the array A, and your aim is to reach the place indexed N using the minimum coins. You need to return the path of indexes (starting from 1 to N) in the array you should take to get to the place indexed N using minimum coins.
-
-
If there are multiple paths with the same cost, return the lexicographically smallest such path.
-
-
If it's not possible to reach the place indexed N then you need to return an empty array.
-
-
Example 1:
-
-
-Input: [1,2,4,-1,2], 2
-Output: [1,3,5]
-
-
-
-
-
Example 2:
-
-
-Input: [1,2,4,-1,2], 1
-Output: []
-
-
-
-
-
Note:
-
-
-
Path Pa1, Pa2, ..., Pan is lexicographically smaller than Pb1, Pb2, ..., Pbm, if and only if at the first i where Pai and Pbi differ, Pai < Pbi; when no such i exists, then n < m.
-
A1 >= 0. A2, ..., AN (if exist) will in the range of [-1, 100].
You are given an m x n integer matrix grid, and three integers row, col, and color. Each value in the grid represents the color of the grid square at that location.
-
-
Two squares belong to the same connected component if they have the same color and are next to each other in any of the 4 directions.
-
-
The border of a connected component is all the squares in the connected component that are either 4-directionally adjacent to a square not in the component, or on the boundary of the grid (the first or last row or column).
-
-
You should color the border of the connected component that contains the square grid[row][col] with color.
-
-
Return the final grid.
-
-
-
Example 1:
-
Input: grid = [[1,1],[1,2]], row = 0, col = 0, color = 3
-Output: [[3,3],[3,2]]
-
Example 2:
-
Input: grid = [[1,2,2],[2,3,2]], row = 0, col = 1, color = 3
-Output: [[1,3,3],[2,3,3]]
-
Example 3:
-
Input: grid = [[1,1,1],[1,1,1],[1,1,1]], row = 1, col = 1, color = 2
-Output: [[2,2,2],[2,1,2],[2,2,2]]
-
-
-
Constraints:
-
-
-
m == grid.length
-
n == grid[i].length
-
1 <= m, n <= 50
-
1 <= grid[i][j], color <= 1000
-
0 <= row < m
-
0 <= col < n
-
-
-### Related Topics
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
-
-### Similar Questions
- 1. [Island Perimeter](../island-perimeter) (Easy)
-
-### Hints
-
-Hint 1
-Use a DFS to find every square in the component. Then for each square, color it if it has a neighbor that is outside the grid or a different color.
-
diff --git a/problems/coloring-a-border/coloring_a_border.go b/problems/coloring-a-border/coloring_a_border.go
deleted file mode 100644
index a66158b22..000000000
--- a/problems/coloring-a-border/coloring_a_border.go
+++ /dev/null
@@ -1,52 +0,0 @@
-package problem1034
-
-var dx = []int{0, 0, 1, -1}
-var dy = []int{1, -1, 0, 0}
-
-func colorBorder(grid [][]int, x0 int, y0 int, color int) [][]int {
- m, n := len(grid), len(grid[0])
- c := grid[x0][y0]
-
- isBorder := func(x, y int) bool {
- return x == 0 || x == m-1 ||
- y == 0 || y == n-1 ||
- grid[x][y-1] != c ||
- grid[x][y+1] != c ||
- grid[x-1][y] != c ||
- grid[x+1][y] != c
- }
-
- connected := make([][2]int, 1, 1024)
- hasSeen := [51][51]bool{}
-
- connected[0] = [2]int{x0, y0}
- hasSeen[x0][y0] = true
-
- borders := make([][2]int, 0, 1024)
- for len(connected) > 0 {
- size := len(connected)
- for i := 0; i < size; i++ {
- p := connected[i]
- if isBorder(p[0], p[1]) {
- borders = append(borders, p)
- }
- for k := 0; k < 4; k++ {
- x, y := p[0]+dx[k], p[1]+dy[k]
- if 0 <= x && x < m &&
- 0 <= y && y < n &&
- grid[x][y] == c &&
- !hasSeen[x][y] {
- connected = append(connected, [2]int{x, y})
- hasSeen[x][y] = true
- }
- }
- }
- connected = connected[size:]
- }
-
- for _, b := range borders {
- grid[b[0]][b[1]] = color
- }
-
- return grid
-}
diff --git a/problems/combination-sum-ii/README.md b/problems/combination-sum-ii/README.md
deleted file mode 100644
index fa8221b01..000000000
--- a/problems/combination-sum-ii/README.md
+++ /dev/null
@@ -1,59 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../combination-sum "Combination Sum")
-
-[Next >](../first-missing-positive "First Missing Positive")
-
-## [40. Combination Sum II (Medium)](https://leetcode.com/problems/combination-sum-ii "组合总和 II")
-
-
Given a collection of candidate numbers (candidates) and a target number (target), find all unique combinations in candidates where the candidate numbers sum to target.
-
-
Each number in candidates may only be used once in the combination.
-
-
Note: The solution set must not contain duplicate combinations.
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Backtracking](../../tag/backtracking/README.md)]
-
-### Similar Questions
- 1. [Combination Sum](../combination-sum) (Medium)
diff --git a/problems/combination-sum-ii/combination_sum_ii.go b/problems/combination-sum-ii/combination_sum_ii.go
deleted file mode 100644
index b3a3fdcf7..000000000
--- a/problems/combination-sum-ii/combination_sum_ii.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem40
diff --git a/problems/combination-sum-ii/combination_sum_ii_test.go b/problems/combination-sum-ii/combination_sum_ii_test.go
deleted file mode 100644
index b3a3fdcf7..000000000
--- a/problems/combination-sum-ii/combination_sum_ii_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem40
diff --git a/problems/combination-sum-iii/README.md b/problems/combination-sum-iii/README.md
deleted file mode 100644
index 4f08564db..000000000
--- a/problems/combination-sum-iii/README.md
+++ /dev/null
@@ -1,85 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../kth-largest-element-in-an-array "Kth Largest Element in an Array")
-
-[Next >](../contains-duplicate "Contains Duplicate")
-
-## [216. Combination Sum III (Medium)](https://leetcode.com/problems/combination-sum-iii "组合总和 III")
-
-
Find all valid combinations of k numbers that sum up to n such that the following conditions are true:
-
-
-
Only numbers 1 through 9 are used.
-
Each number is used at most once.
-
-
-
Return a list of all possible valid combinations. The list must not contain the same combination twice, and the combinations may be returned in any order.
-
-
-
Example 1:
-
-
-Input: k = 3, n = 7
-Output: [[1,2,4]]
-Explanation:
-1 + 2 + 4 = 7
-There are no other valid combinations.
-
-
Example 2:
-
-
-Input: k = 3, n = 9
-Output: [[1,2,6],[1,3,5],[2,3,4]]
-Explanation:
-1 + 2 + 6 = 9
-1 + 3 + 5 = 9
-2 + 3 + 4 = 9
-There are no other valid combinations.
-
-
-
Example 3:
-
-
-Input: k = 4, n = 1
-Output: []
-Explanation: There are no valid combinations.
-Using 4 different numbers in the range [1,9], the smallest sum we can get is 1+2+3+4 = 10 and since 10 > 1, there are no valid combination.
-
-
-
Example 4:
-
-
-Input: k = 3, n = 2
-Output: []
-Explanation: There are no valid combinations.
-
-
-
Example 5:
-
-
-Input: k = 9, n = 45
-Output: [[1,2,3,4,5,6,7,8,9]]
-Explanation:
-1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 = 45
-There are no other valid combinations.
-
Given an array of distinct integers nums and a target integer target, return the number of possible combinations that add up totarget.
-
-
The answer is guaranteed to fit in a 32-bit integer.
-
-
-
Example 1:
-
-
-Input: nums = [1,2,3], target = 4
-Output: 7
-Explanation:
-The possible combination ways are:
-(1, 1, 1, 1)
-(1, 1, 2)
-(1, 2, 1)
-(1, 3)
-(2, 1, 1)
-(2, 2)
-(3, 1)
-Note that different sequences are counted as different combinations.
-
-
-
Example 2:
-
-
-Input: nums = [9], target = 3
-Output: 0
-
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 200
-
1 <= nums[i] <= 1000
-
All the elements of nums are unique.
-
1 <= target <= 1000
-
-
-
-
Follow up: What if negative numbers are allowed in the given array? How does it change the problem? What limitation we need to add to the question to allow negative numbers?
Given an array of distinct integers candidates and a target integer target, return a list of all unique combinations of candidates where the chosen numbers sum to target. You may return the combinations in any order.
-
-
The same number may be chosen from candidates an unlimited number of times. Two combinations are unique if the frequency of at least one of the chosen numbers is different.
-
-
It is guaranteed that the number of unique combinations that sum up to target is less than 150 combinations for the given input.
-
-
-
Example 1:
-
-
-Input: candidates = [2,3,6,7], target = 7
-Output: [[2,2,3],[7]]
-Explanation:
-2 and 3 are candidates, and 2 + 2 + 3 = 7. Note that 2 can be used multiple times.
-7 is a candidate, and 7 = 7.
-These are the only two combinations.
-
-+-------------+---------+
-| Column Name | Type |
-+-------------+---------+
-| personId | int |
-| lastName | varchar |
-| firstName | varchar |
-+-------------+---------+
-personId is the primary key column for this table.
-This table contains information about the ID of some persons and their first and last names.
-
-
-
-
-
Table: Address
-
-
-+-------------+---------+
-| Column Name | Type |
-+-------------+---------+
-| addressId | int |
-| personId | int |
-| city | varchar |
-| state | varchar |
-+-------------+---------+
-addressId is the primary key column for this table.
-Each row of this table contains information about the city and state of one person with ID = PersonId.
-
-
-
-
-
Write an SQL query to report the first name, last name, city, and state of each person in the Person table. If the address of a personId is not present in the Address table, report null instead.
-
-
Return the result table in any order.
-
-
The query result format is in the following example.
-
-
-
Example 1:
-
-
-Input:
-Person table:
-+----------+----------+-----------+
-| personId | lastName | firstName |
-+----------+----------+-----------+
-| 1 | Wang | Allen |
-| 2 | Alice | Bob |
-+----------+----------+-----------+
-Address table:
-+-----------+----------+---------------+------------+
-| addressId | personId | city | state |
-+-----------+----------+---------------+------------+
-| 1 | 2 | New York City | New York |
-| 2 | 3 | Leetcode | California |
-+-----------+----------+---------------+------------+
-Output:
-+-----------+----------+---------------+----------+
-| firstName | lastName | city | state |
-+-----------+----------+---------------+----------+
-| Allen | Wang | Null | Null |
-| Bob | Alice | New York City | New York |
-+-----------+----------+---------------+----------+
-Explanation:
-There is no address in the address table for the personId = 1 so we return null in their city and state.
-addressId = 1 contains information about the address of personId = 2.
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
-
-### Similar Questions
- 1. [Employee Bonus](../employee-bonus) (Easy)
diff --git a/problems/combine-two-tables/combine_two_tables.sql b/problems/combine-two-tables/combine_two_tables.sql
deleted file mode 100644
index eb8813415..000000000
--- a/problems/combine-two-tables/combine_two_tables.sql
+++ /dev/null
@@ -1,10 +0,0 @@
-# Write your MySQL query statement below
-
-SELECT
- Person.FirstName,
- Person.LastName,
- Address.City,
- Address.State
-FROM
- Person
-LEFT JOIN Address ON Person.PersonId = Address.PersonId;
diff --git a/problems/combine-two-tables/mysql_schemas.sql b/problems/combine-two-tables/mysql_schemas.sql
deleted file mode 100644
index b6d12b76c..000000000
--- a/problems/combine-two-tables/mysql_schemas.sql
+++ /dev/null
@@ -1,8 +0,0 @@
-Create table If Not Exists Person (personId int, firstName varchar(255), lastName varchar(255));
-Create table If Not Exists Address (addressId int, personId int, city varchar(255), state varchar(255));
-Truncate table Person;
-insert into Person (personId, lastName, firstName) values ('1', 'Wang', 'Allen');
-insert into Person (personId, lastName, firstName) values ('2', 'Alice', 'Bob');
-Truncate table Address;
-insert into Address (addressId, personId, city, state) values ('1', '2', 'New York City', 'New York');
-insert into Address (addressId, personId, city, state) values ('2', '3', 'Leetcode', 'California');
diff --git a/problems/compare-strings-by-frequency-of-the-smallest-character/README.md b/problems/compare-strings-by-frequency-of-the-smallest-character/README.md
deleted file mode 100644
index faac7ff0d..000000000
--- a/problems/compare-strings-by-frequency-of-the-smallest-character/README.md
+++ /dev/null
@@ -1,63 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../invalid-transactions "Invalid Transactions")
-
-[Next >](../remove-zero-sum-consecutive-nodes-from-linked-list "Remove Zero Sum Consecutive Nodes from Linked List")
-
-## [1170. Compare Strings by Frequency of the Smallest Character (Medium)](https://leetcode.com/problems/compare-strings-by-frequency-of-the-smallest-character "比较字符串最小字母出现频次")
-
-
Let the function f(s) be the frequency of the lexicographically smallest character in a non-empty string s. For example, if s = "dcce" then f(s) = 2 because the lexicographically smallest character is 'c', which has a frequency of 2.
-
-
You are given an array of strings words and another array of query strings queries. For each query queries[i], count the number of words in words such that f(queries[i]) < f(W) for each W in words.
-
-
Return an integer array answer, where each answer[i] is the answer to the ith query.
-
-
-
Example 1:
-
-
-Input: queries = ["cbd"], words = ["zaaaz"]
-Output: [1]
-Explanation: On the first query we have f("cbd") = 1, f("zaaaz") = 3 so f("cbd") < f("zaaaz").
-
-
-
Example 2:
-
-
-Input: queries = ["bbb","cc"], words = ["a","aa","aaa","aaaa"]
-Output: [1,2]
-Explanation: On the first query only f("bbb") < f("aaaa"). On the second query both f("aaa") and f("aaaa") are both > f("cc").
-
-
-
-
Constraints:
-
-
-
1 <= queries.length <= 2000
-
1 <= words.length <= 2000
-
1 <= queries[i].length, words[i].length <= 10
-
queries[i][j], words[i][j] consist of lowercase English letters.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Hints
-
-Hint 1
-For each string from words calculate the leading count and store it in an array, then sort the integer array.
-
-
-
-Hint 2
-For each string from queries calculate the leading count "p" and in base of the sorted array calculated on the step 1 do a binary search to count the number of items greater than "p".
-
diff --git a/problems/compare-strings-by-frequency-of-the-smallest-character/compare_strings_by_frequency_of_the_smallest_character.go b/problems/compare-strings-by-frequency-of-the-smallest-character/compare_strings_by_frequency_of_the_smallest_character.go
deleted file mode 100644
index 5434d51ab..000000000
--- a/problems/compare-strings-by-frequency-of-the-smallest-character/compare_strings_by_frequency_of_the_smallest_character.go
+++ /dev/null
@@ -1,33 +0,0 @@
-package problem1170
-
-import "sort"
-
-func numSmallerByFrequency(queries []string, words []string) []int {
- ans, m := make([]int, len(queries)), make([]int, len(words))
- for i, w := range words {
- m[i] = f(w)
- }
- sort.Ints(m)
- for i, q := range queries {
- t := f(q)
- for j := len(m) - 1; j >= 0; j-- {
- if t >= m[j] {
- break
- }
- ans[i]++
- }
- }
- return ans
-}
-
-func f(s string) int {
- m, p := [26]int{}, byte(25)
- for i := 0; i < len(s); i++ {
- k := s[i] - 'a'
- m[k]++
- if p > k {
- p = k
- }
- }
- return m[p]
-}
diff --git a/problems/compare-strings-by-frequency-of-the-smallest-character/compare_strings_by_frequency_of_the_smallest_character_test.go b/problems/compare-strings-by-frequency-of-the-smallest-character/compare_strings_by_frequency_of_the_smallest_character_test.go
deleted file mode 100644
index 6aa450488..000000000
--- a/problems/compare-strings-by-frequency-of-the-smallest-character/compare_strings_by_frequency_of_the_smallest_character_test.go
+++ /dev/null
@@ -1,33 +0,0 @@
-package problem1170
-
-import (
- "reflect"
- "testing"
-)
-
-type testType struct {
- in []string
- w []string
- want []int
-}
-
-func TestNumSmallerByFrequency(t *testing.T) {
- tests := [...]testType{
- {
- in: []string{"cbd"},
- w: []string{"zaaaz"},
- want: []int{1},
- },
- {
- in: []string{"bbb", "cc"},
- w: []string{"a", "aa", "aaa", "aaaa"},
- want: []int{1, 2},
- },
- }
- for _, tt := range tests {
- got := numSmallerByFrequency(tt.in, tt.w)
- if !reflect.DeepEqual(got, tt.want) {
- t.Fatalf("in: %v, got: %v, want: %v", tt.in, got, tt.want)
- }
- }
-}
diff --git a/problems/compare-version-numbers/README.md b/problems/compare-version-numbers/README.md
deleted file mode 100644
index 08840605a..000000000
--- a/problems/compare-version-numbers/README.md
+++ /dev/null
@@ -1,82 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-gap "Maximum Gap")
-
-[Next >](../fraction-to-recurring-decimal "Fraction to Recurring Decimal")
-
-## [165. Compare Version Numbers (Medium)](https://leetcode.com/problems/compare-version-numbers "比较版本号")
-
-
Given two version numbers, version1 and version2, compare them.
-
-
-
-
-
Version numbers consist of one or more revisions joined by a dot '.'. Each revision consists of digits and may contain leading zeros. Every revision contains at least one character. Revisions are 0-indexed from left to right, with the leftmost revision being revision 0, the next revision being revision 1, and so on. For example 2.5.33 and 0.1 are valid version numbers.
-
-
To compare version numbers, compare their revisions in left-to-right order. Revisions are compared using their integer value ignoring any leading zeros. This means that revisions 1 and 001 are considered equal. If a version number does not specify a revision at an index, then treat the revision as 0. For example, version 1.0 is less than version 1.1 because their revision 0s are the same, but their revision 1s are 0 and 1 respectively, and 0 < 1.
-
-
Return the following:
-
-
-
If version1 < version2, return -1.
-
If version1 > version2, return 1.
-
Otherwise, return 0.
-
-
-
-
Example 1:
-
-
-Input: version1 = "1.01", version2 = "1.001"
-Output: 0
-Explanation: Ignoring leading zeroes, both "01" and "001" represent the same integer "1".
-
-
-
Example 2:
-
-
-Input: version1 = "1.0", version2 = "1.0.0"
-Output: 0
-Explanation: version1 does not specify revision 2, which means it is treated as "0".
-
-
-
Example 3:
-
-
-Input: version1 = "0.1", version2 = "1.1"
-Output: -1
-Explanation: version1's revision 0 is "0", while version2's revision 0 is "1". 0 < 1, so version1 < version2.
-
-
-### Related Topics
- [[Bit Manipulation](../../tag/bit-manipulation/README.md)]
-
-### Hints
-
-Hint 1
-A binary number plus its complement will equal 111....111 in binary. Also, N = 0 is a corner case.
-
diff --git a/problems/complement-of-base-10-integer/complement_of_base_10_integer.go b/problems/complement-of-base-10-integer/complement_of_base_10_integer.go
deleted file mode 100644
index cd26526f1..000000000
--- a/problems/complement-of-base-10-integer/complement_of_base_10_integer.go
+++ /dev/null
@@ -1,15 +0,0 @@
-package problem1009
-
-func bitwiseComplement(N int) int {
- if N == 0 {
- return 1
- }
- ans, base := 0, 1
- for N > 0 {
- if N&1 == 0 {
- ans += base
- }
- base, N = base<<1, N>>1
- }
- return ans
-}
diff --git a/problems/complement-of-base-10-integer/complement_of_base_10_integer_test.go b/problems/complement-of-base-10-integer/complement_of_base_10_integer_test.go
deleted file mode 100644
index 02f48e6ce..000000000
--- a/problems/complement-of-base-10-integer/complement_of_base_10_integer_test.go
+++ /dev/null
@@ -1,35 +0,0 @@
-package problem1009
-
-import "testing"
-
-type testType struct {
- in int
- want int
-}
-
-func TestBitwiseComplement(t *testing.T) {
- tests := [...]testType{
- {
- in: 5,
- want: 2,
- },
- {
- in: 7,
- want: 0,
- },
- {
- in: 10,
- want: 5,
- },
- {
- in: 0,
- want: 1,
- },
- }
- for _, tt := range tests {
- got := bitwiseComplement(tt.in)
- if got != tt.want {
- t.Fatalf("in: %v, got: %v, want: %v", tt.in, got, tt.want)
- }
- }
-}
diff --git a/problems/complete-binary-tree-inserter/README.md b/problems/complete-binary-tree-inserter/README.md
deleted file mode 100644
index 976e635a4..000000000
--- a/problems/complete-binary-tree-inserter/README.md
+++ /dev/null
@@ -1,58 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-sum-circular-subarray "Maximum Sum Circular Subarray")
-
-[Next >](../number-of-music-playlists "Number of Music Playlists")
-
-## [919. Complete Binary Tree Inserter (Medium)](https://leetcode.com/problems/complete-binary-tree-inserter "完全二叉树插入器")
-
-
A complete binary tree is a binary tree in which every level, except possibly the last, is completely filled, and all nodes are as far left as possible.
-
-
Design an algorithm to insert a new node to a complete binary tree keeping it complete after the insertion.
-
-
Implement the CBTInserter class:
-
-
-
CBTInserter(TreeNode root) Initializes the data structure with the root of the complete binary tree.
-
int insert(int v) Inserts a TreeNode into the tree with value Node.val == val so that the tree remains complete, and returns the value of the parent of the inserted TreeNode.
-
TreeNode get_root() Returns the root node of the tree.
A complex number can be represented as a string on the form "real+imaginaryi" where:
-
-
-
real is the real part and is an integer in the range [-100, 100].
-
imaginary is the imaginary part and is an integer in the range [-100, 100].
-
i2 == -1.
-
-
-
Given two complex numbers num1 and num2 as strings, return a string of the complex number that represents their multiplications.
-
-
-
Example 1:
-
-
-Input: num1 = "1+1i", num2 = "1+1i"
-Output: "0+2i"
-Explanation: (1 + i) * (1 + i) = 1 + i2 + 2 * i = 2i, and you need convert it to the form of 0+2i.
-
-
-
Example 2:
-
-
-Input: num1 = "1+-1i", num2 = "1+-1i"
-Output: "0+-2i"
-Explanation: (1 - i) * (1 - i) = 1 + i2 - 2 * i = -2i, and you need convert it to the form of 0+-2i.
-
Given an array of strings words (without duplicates), return all the concatenated words in the given list ofwords.
-
-
A concatenated word is defined as a string that is comprised entirely of at least two shorter words in the given array.
-
-
-
Example 1:
-
-
-Input: words = ["cat","cats","catsdogcats","dog","dogcatsdog","hippopotamuses","rat","ratcatdogcat"]
-Output: ["catsdogcats","dogcatsdog","ratcatdogcat"]
-Explanation: "catsdogcats" can be concatenated by "cats", "dog" and "cats";
-"dogcatsdog" can be concatenated by "dog", "cats" and "dog";
-"ratcatdogcat" can be concatenated by "rat", "cat", "dog" and "cat".
-
-
Example 2:
-
-
-Input: words = ["cat","dog","catdog"]
-Output: ["catdog"]
-
-
-
-
Constraints:
-
-
-
1 <= words.length <= 104
-
0 <= words[i].length <= 1000
-
words[i] consists of only lowercase English letters.
Given an integer array nums of length n, you want to create an array ans of length 2n where ans[i] == nums[i] and ans[i + n] == nums[i] for 0 <= i < n (0-indexed).
-
-
Specifically, ans is the concatenation of two nums arrays.
-
-
Return the array ans.
-
-
-
Example 1:
-
-
-Input: nums = [1,2,1]
-Output: [1,2,1,1,2,1]
-Explanation: The array ans is formed as follows:
-- ans = [nums[0],nums[1],nums[2],nums[0],nums[1],nums[2]]
-- ans = [1,2,1,1,2,1]
-
-
Example 2:
-
-
-Input: nums = [1,3,2,1]
-Output: [1,3,2,1,1,3,2,1]
-Explanation: The array ans is formed as follows:
-- ans = [nums[0],nums[1],nums[2],nums[3],nums[0],nums[1],nums[2],nums[3]]
-- ans = [1,3,2,1,1,3,2,1]
-
-
-
-
Constraints:
-
-
-
n == nums.length
-
1 <= n <= 1000
-
1 <= nums[i] <= 1000
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
-
-### Hints
-
-Hint 1
-Build an array of size 2 * n and assign num[i] to ans[i] and ans[i + n]
-
diff --git a/problems/concatenation-of-consecutive-binary-numbers/README.md b/problems/concatenation-of-consecutive-binary-numbers/README.md
deleted file mode 100644
index c79a5b348..000000000
--- a/problems/concatenation-of-consecutive-binary-numbers/README.md
+++ /dev/null
@@ -1,60 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../max-number-of-k-sum-pairs "Max Number of K-Sum Pairs")
-
-[Next >](../minimum-incompatibility "Minimum Incompatibility")
-
-## [1680. Concatenation of Consecutive Binary Numbers (Medium)](https://leetcode.com/problems/concatenation-of-consecutive-binary-numbers "连接连续二进制数字")
-
-
Given an integer n, return the decimal value of the binary string formed by concatenating the binary representations of 1 to n in order, modulo 109 + 7.
-
-
-
Example 1:
-
-
-Input: n = 1
-Output: 1
-Explanation: "1" in binary corresponds to the decimal value 1.
-
-
-
Example 2:
-
-
-Input: n = 3
-Output: 27
-Explanation: In binary, 1, 2, and 3 corresponds to "1", "10", and "11".
-After concatenating them, we have "11011", which corresponds to the decimal value 27.
-
-
-
Example 3:
-
-
-Input: n = 12
-Output: 505379714
-Explanation: The concatenation results in "1101110010111011110001001101010111100".
-The decimal value of that is 118505380540.
-After modulo 109 + 7, the result is 505379714.
-
-
-
-
Constraints:
-
-
-
1 <= n <= 105
-
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
- [[Bit Manipulation](../../tag/bit-manipulation/README.md)]
- [[Simulation](../../tag/simulation/README.md)]
-
-### Hints
-
-Hint 1
-Express the nth number value in a recursion formula and think about how we can do a fast evaluation.
-
diff --git a/problems/confirmation-rate/README.md b/problems/confirmation-rate/README.md
deleted file mode 100644
index 4f0f62c6c..000000000
--- a/problems/confirmation-rate/README.md
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../check-if-string-is-decomposable-into-value-equal-substrings "Check if String Is Decomposable Into Value-Equal Substrings")
-
-[Next >](../maximum-number-of-words-you-can-type "Maximum Number of Words You Can Type")
-
-## [1934. Confirmation Rate (Medium)](https://leetcode.com/problems/confirmation-rate "")
-
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/confirmation-rate/mysql_schemas.sql b/problems/confirmation-rate/mysql_schemas.sql
deleted file mode 100644
index f7683cd9e..000000000
--- a/problems/confirmation-rate/mysql_schemas.sql
+++ /dev/null
@@ -1,15 +0,0 @@
-Create table If Not Exists Signups (user_id int, time_stamp datetime);
-Create table If Not Exists Confirmations (user_id int, time_stamp datetime, action ENUM('confirmed','timeout'));
-Truncate table Signups;
-insert into Signups (user_id, time_stamp) values ('3', '2020-03-21 10:16:13');
-insert into Signups (user_id, time_stamp) values ('7', '2020-01-04 13:57:59');
-insert into Signups (user_id, time_stamp) values ('2', '2020-07-29 23:09:44');
-insert into Signups (user_id, time_stamp) values ('6', '2020-12-09 10:39:37');
-Truncate table Confirmations;
-insert into Confirmations (user_id, time_stamp, action) values ('3', '2021-01-06 03:30:46', 'timeout');
-insert into Confirmations (user_id, time_stamp, action) values ('3', '2021-07-14 14:00:00', 'timeout');
-insert into Confirmations (user_id, time_stamp, action) values ('7', '2021-06-12 11:57:29', 'confirmed');
-insert into Confirmations (user_id, time_stamp, action) values ('7', '2021-06-13 12:58:28', 'confirmed');
-insert into Confirmations (user_id, time_stamp, action) values ('7', '2021-06-14 13:59:27', 'confirmed');
-insert into Confirmations (user_id, time_stamp, action) values ('2', '2021-01-22 00:00:00', 'confirmed');
-insert into Confirmations (user_id, time_stamp, action) values ('2', '2021-02-28 23:59:59', 'timeout');
diff --git a/problems/confusing-number-ii/README.md b/problems/confusing-number-ii/README.md
deleted file mode 100644
index 22064adde..000000000
--- a/problems/confusing-number-ii/README.md
+++ /dev/null
@@ -1,70 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../brace-expansion "Brace Expansion")
-
-[Next >](../duplicate-zeros "Duplicate Zeros")
-
-## [1088. Confusing Number II (Hard)](https://leetcode.com/problems/confusing-number-ii "易混淆数 II")
-
-
We can rotate digits by 180 degrees to form new digits. When 0, 1, 6, 8, 9 are rotated 180 degrees, they become 0, 1, 9, 8, 6 respectively. When 2, 3, 4, 5 and 7 are rotated 180 degrees, they become invalid.
-
-
A confusing number is a number that when rotated 180 degrees becomes a different number with each digit valid.(Note that the rotated number can be greater than the original number.)
-
-
Given a positive integer N, return the number of confusing numbers between 1 and N inclusive.
-
-
-
-
Example 1:
-
-
-Input: 20
-Output: 6
-Explanation:
-The confusing numbers are [6,9,10,16,18,19].
-6 converts to 9.
-9 converts to 6.
-10 converts to 01 which is just 1.
-16 converts to 91.
-18 converts to 81.
-19 converts to 61.
-
-
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
- [[Backtracking](../../tag/backtracking/README.md)]
-
-### Similar Questions
- 1. [Confusing Number](../confusing-number) (Easy)
-
-### Hints
-
-Hint 1
-Which set of digits have the valid numbers?
-
-
-
-Hint 2
-Only 0, 1, 6, 8, 9 are the valid set of digits, do a backtracking to generate all the numbers containing this digits and check they are valid.
-
diff --git a/problems/confusing-number/README.md b/problems/confusing-number/README.md
deleted file mode 100644
index 2dab50cf9..000000000
--- a/problems/confusing-number/README.md
+++ /dev/null
@@ -1,84 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../shortest-way-to-form-string "Shortest Way to Form String")
-
-[Next >](../campus-bikes "Campus Bikes")
-
-## [1056. Confusing Number (Easy)](https://leetcode.com/problems/confusing-number "易混淆数")
-
-
Given a number N, return true if and only if it is a confusing number, which satisfies the following condition:
-
-
We can rotate digits by 180 degrees to form new digits. When 0, 1, 6, 8, 9 are rotated 180 degrees, they become 0, 1, 9, 8, 6 respectively. When 2, 3, 4, 5 and 7 are rotated 180 degrees, they become invalid. A confusing number is a number that when rotated 180 degrees becomes a different number with each digit valid.
-
-
-
-
Example 1:
-
-
-
-
-Input: 6
-Output: true
-Explanation:
-We get 9 after rotating 6, 9 is a valid number and 9!=6.
-
-
-
Example 2:
-
-
-
-
-Input: 89
-Output: true
-Explanation:
-We get 68 after rotating 89, 86 is a valid number and 86!=89.
-
-
-
Example 3:
-
-
-
-
-Input: 11
-Output: false
-Explanation:
-We get 11 after rotating 11, 11 is a valid number but the value remains the same, thus 11 is not a confusing number.
-
-
-
Example 4:
-
-
-
-
-Input: 25
-Output: false
-Explanation:
-We get an invalid number after rotating 25.
-
-
-
-
-
Note:
-
-
-
0 <= N <= 10^9
-
After the rotation we can ignore leading zeros, for example if after rotation we have 0008 then this number is considered as just 8.
-
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
-
-### Similar Questions
- 1. [Strobogrammatic Number](../strobogrammatic-number) (Easy)
- 1. [Confusing Number II](../confusing-number-ii) (Hard)
-
-### Hints
-
-Hint 1
-Reverse each digit with their corresponding new digit if an invalid digit is found the return -1. After reversing the digits just compare the reversed number with the original number.
-
diff --git a/problems/connecting-cities-with-minimum-cost/README.md b/problems/connecting-cities-with-minimum-cost/README.md
deleted file mode 100644
index 10856ca12..000000000
--- a/problems/connecting-cities-with-minimum-cost/README.md
+++ /dev/null
@@ -1,91 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../armstrong-number "Armstrong Number")
-
-[Next >](../parallel-courses "Parallel Courses")
-
-## [1135. Connecting Cities With Minimum Cost (Medium)](https://leetcode.com/problems/connecting-cities-with-minimum-cost "最低成本联通所有城市")
-
-
There are N cities numbered from 1 to N.
-
-
You are given connections, where each connections[i] = [city1, city2, cost] represents the cost to connect city1 and city2 together. (A connection is bidirectional: connecting city1 and city2 is the same as connecting city2 and city1.)
-
-
Return the minimum cost so that for every pair of cities, there exists a path of connections (possibly of length 1) that connects those two cities together. The cost is the sum of the connection costs used. If the task is impossible, return -1.
-
-
-
-
Example 1:
-
-
-
-
-Input: N = 3, connections = [[1,2,5],[1,3,6],[2,3,1]]
-Output: 6
-Explanation:
-Choosing any 2 edges will connect all cities so we choose the minimum 2.
-
-
-
Example 2:
-
-
-
-
-Input: N = 4, connections = [[1,2,3],[3,4,4]]
-Output: -1
-Explanation:
-There is no way to connect all cities even if all edges are used.
-
-
-
-
-
Note:
-
-
-
1 <= N <= 10000
-
1 <= connections.length <= 10000
-
1 <= connections[i][0], connections[i][1] <= N
-
0 <= connections[i][2] <= 10^5
-
connections[i][0] != connections[i][1]
-
-
-### Related Topics
- [[Union Find](../../tag/union-find/README.md)]
- [[Graph](../../tag/graph/README.md)]
- [[Heap (Priority Queue)](../../tag/heap-priority-queue/README.md)]
- [[Minimum Spanning Tree](../../tag/minimum-spanning-tree/README.md)]
-
-### Hints
-
-Hint 1
-What if we model the cities as a graph?
-
-
-
-Hint 2
-Build a graph of cities and find the minimum spanning tree.
-
-
-
-Hint 3
-You can use a variation of the Kruskal's algorithm for that.
-
-
-
-Hint 4
-Sort the edges by their cost and use a union-find data structure.
-
-
-
-Hint 5
-How to check all cities are connected?
-
-
-
-Hint 6
-At the beginning we have n connected components, each time we connect two components the number of connected components is reduced by one. At the end we should end with only a single component otherwise return -1.
-
diff --git a/problems/consecutive-available-seats/README.md b/problems/consecutive-available-seats/README.md
deleted file mode 100644
index 867f312e7..000000000
--- a/problems/consecutive-available-seats/README.md
+++ /dev/null
@@ -1,46 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../friend-requests-ii-who-has-the-most-friends "Friend Requests II: Who Has the Most Friends")
-
-[Next >](../design-compressed-string-iterator "Design Compressed String Iterator")
-
-## [603. Consecutive Available Seats (Easy)](https://leetcode.com/problems/consecutive-available-seats "连续空余座位")
-
-Several friends at a cinema ticket office would like to reserve consecutive available seats.
-Can you help to query all the consecutive available seats order by the seat_id using the following cinema table?
-
The power of the string is the maximum length of a non-empty substring that contains only one unique character.
-
-
Given a string s, return the power ofs.
-
-
-
Example 1:
-
-
-Input: s = "leetcode"
-Output: 2
-Explanation: The substring "ee" is of length 2 with the character 'e' only.
-
-
-
Example 2:
-
-
-Input: s = "abbcccddddeeeeedcba"
-Output: 5
-Explanation: The substring "eeeee" is of length 5 with the character 'e' only.
-
-
-
-
Constraints:
-
-
-
1 <= s.length <= 500
-
s consists of only lowercase English letters.
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
-
-### Hints
-
-Hint 1
-Keep an array power where power[i] is the maximum power of the i-th character.
-
-
-
-Hint 2
-The answer is max(power[i]).
-
diff --git a/problems/consecutive-numbers-sum/README.md b/problems/consecutive-numbers-sum/README.md
deleted file mode 100644
index 7eae4e37c..000000000
--- a/problems/consecutive-numbers-sum/README.md
+++ /dev/null
@@ -1,50 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../count-unique-characters-of-all-substrings-of-a-given-string "Count Unique Characters of All Substrings of a Given String")
-
-[Next >](../positions-of-large-groups "Positions of Large Groups")
-
-## [829. Consecutive Numbers Sum (Hard)](https://leetcode.com/problems/consecutive-numbers-sum "连续整数求和")
-
-
Given an integer n, return the number of ways you can write n as the sum of consecutive positive integers.
-+-------------+---------+
-| Column Name | Type |
-+-------------+---------+
-| id | int |
-| num | varchar |
-+-------------+---------+
-id is the primary key for this table.
-
-
-
-
-
Write an SQL query to find all numbers that appear at least three times consecutively.
-
-
Return the result table in any order.
-
-
The query result format is in the following example.
-
-
-
Example 1:
-
-
-Input:
-Logs table:
-+----+-----+
-| id | num |
-+----+-----+
-| 1 | 1 |
-| 2 | 1 |
-| 3 | 1 |
-| 4 | 2 |
-| 5 | 1 |
-| 6 | 2 |
-| 7 | 2 |
-+----+-----+
-Output:
-+-----------------+
-| ConsecutiveNums |
-+-----------------+
-| 1 |
-+-----------------+
-Explanation: 1 is the only number that appears consecutively for at least three times.
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/consecutive-numbers/consecutive_numbers.sql b/problems/consecutive-numbers/consecutive_numbers.sql
deleted file mode 100644
index bae62cf19..000000000
--- a/problems/consecutive-numbers/consecutive_numbers.sql
+++ /dev/null
@@ -1 +0,0 @@
-# Write your MySQL query statement below
diff --git a/problems/consecutive-numbers/mysql_schemas.sql b/problems/consecutive-numbers/mysql_schemas.sql
deleted file mode 100644
index 0576b97dd..000000000
--- a/problems/consecutive-numbers/mysql_schemas.sql
+++ /dev/null
@@ -1,9 +0,0 @@
-Create table If Not Exists Logs (id int, num int);
-Truncate table Logs;
-insert into Logs (id, num) values ('1', '1');
-insert into Logs (id, num) values ('2', '1');
-insert into Logs (id, num) values ('3', '1');
-insert into Logs (id, num) values ('4', '2');
-insert into Logs (id, num) values ('5', '1');
-insert into Logs (id, num) values ('6', '2');
-insert into Logs (id, num) values ('7', '2');
diff --git a/problems/constrained-subsequence-sum/README.md b/problems/constrained-subsequence-sum/README.md
deleted file mode 100644
index 007e5bc29..000000000
--- a/problems/constrained-subsequence-sum/README.md
+++ /dev/null
@@ -1,78 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../diagonal-traverse-ii "Diagonal Traverse II")
-
-[Next >](../counting-elements "Counting Elements")
-
-## [1425. Constrained Subsequence Sum (Hard)](https://leetcode.com/problems/constrained-subsequence-sum "带限制的子序列和")
-
-
Given an integer array nums and an integer k, return the maximum sum of a non-empty subsequence of that array such that for every two consecutive integers in the subsequence, nums[i] and nums[j], where i < j, the condition j - i <= k is satisfied.
-
-
A subsequence of an array is obtained by deleting some number of elements (can be zero) from the array, leaving the remaining elements in their original order.
-
-
-
Example 1:
-
-
-Input: nums = [10,2,-10,5,20], k = 2
-Output: 37
-Explanation: The subsequence is [10, 2, 5, 20].
-
-
-
Example 2:
-
-
-Input: nums = [-1,-2,-3], k = 1
-Output: -1
-Explanation: The subsequence must be non-empty, so we choose the largest number.
-
-
-
Example 3:
-
-
-Input: nums = [10,-2,-10,-5,20], k = 2
-Output: 23
-Explanation: The subsequence is [10, -2, -5, 20].
-
-
-
-
Constraints:
-
-
-
1 <= k <= nums.length <= 105
-
-104 <= nums[i] <= 104
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Queue](../../tag/queue/README.md)]
- [[Sliding Window](../../tag/sliding-window/README.md)]
- [[Heap (Priority Queue)](../../tag/heap-priority-queue/README.md)]
- [[Monotonic Queue](../../tag/monotonic-queue/README.md)]
-
-### Hints
-
-Hint 1
-Use dynamic programming.
-
-
-
-Hint 2
-Let dp[i] be the solution for the prefix of the array that ends at index i, if the element at index i is in the subsequence.
-
-
-
-Hint 3
-dp[i] = nums[i] + max(0, dp[i-k], dp[i-k+1], ..., dp[i-1])
-
-
-
-Hint 4
-Use a heap with the sliding window technique to optimize the dp.
-
diff --git a/problems/construct-binary-search-tree-from-preorder-traversal/README.md b/problems/construct-binary-search-tree-from-preorder-traversal/README.md
deleted file mode 100644
index e40306a8c..000000000
--- a/problems/construct-binary-search-tree-from-preorder-traversal/README.md
+++ /dev/null
@@ -1,52 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-domino-rotations-for-equal-row "Minimum Domino Rotations For Equal Row")
-
-[Next >](../complement-of-base-10-integer "Complement of Base 10 Integer")
-
-## [1008. Construct Binary Search Tree from Preorder Traversal (Medium)](https://leetcode.com/problems/construct-binary-search-tree-from-preorder-traversal "前序遍历构造二叉搜索树")
-
-
Given an array of integers preorder, which represents the preorder traversal of a BST (i.e., binary search tree), construct the tree and return its root.
-
-
It is guaranteed that there is always possible to find a binary search tree with the given requirements for the given test cases.
-
-
A binary search tree is a binary tree where for every node, any descendant of Node.left has a value strictly less thanNode.val, and any descendant of Node.right has a value strictly greater thanNode.val.
-
-
A preorder traversal of a binary tree displays the value of the node first, then traverses Node.left, then traverses Node.right.
-
-### Related Topics
- [[Stack](../../tag/stack/README.md)]
- [[Tree](../../tag/tree/README.md)]
- [[Binary Search Tree](../../tag/binary-search-tree/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Binary Tree](../../tag/binary-tree/README.md)]
- [[Monotonic Stack](../../tag/monotonic-stack/README.md)]
diff --git a/problems/construct-binary-tree-from-inorder-and-postorder-traversal/README.md b/problems/construct-binary-tree-from-inorder-and-postorder-traversal/README.md
deleted file mode 100644
index f48710384..000000000
--- a/problems/construct-binary-tree-from-inorder-and-postorder-traversal/README.md
+++ /dev/null
@@ -1,52 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../construct-binary-tree-from-preorder-and-inorder-traversal "Construct Binary Tree from Preorder and Inorder Traversal")
-
-[Next >](../binary-tree-level-order-traversal-ii "Binary Tree Level Order Traversal II")
-
-## [106. Construct Binary Tree from Inorder and Postorder Traversal (Medium)](https://leetcode.com/problems/construct-binary-tree-from-inorder-and-postorder-traversal "从中序与后序遍历序列构造二叉树")
-
-
Given two integer arrays inorder and postorder where inorder is the inorder traversal of a binary tree and postorder is the postorder traversal of the same tree, construct and return the binary tree.
inorder is guaranteed to be the inorder traversal of the tree.
-
postorder is guaranteed to be the postorder traversal of the tree.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Divide and Conquer](../../tag/divide-and-conquer/README.md)]
- [[Tree](../../tag/tree/README.md)]
- [[Binary Tree](../../tag/binary-tree/README.md)]
-
-### Similar Questions
- 1. [Construct Binary Tree from Preorder and Inorder Traversal](../construct-binary-tree-from-preorder-and-inorder-traversal) (Medium)
diff --git a/problems/construct-binary-tree-from-inorder-and-postorder-traversal/construct_binary_tree_from_inorder_and_postorder_traversal.go b/problems/construct-binary-tree-from-inorder-and-postorder-traversal/construct_binary_tree_from_inorder_and_postorder_traversal.go
deleted file mode 100644
index 262e373f1..000000000
--- a/problems/construct-binary-tree-from-inorder-and-postorder-traversal/construct_binary_tree_from_inorder_and_postorder_traversal.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem106
diff --git a/problems/construct-binary-tree-from-inorder-and-postorder-traversal/construct_binary_tree_from_inorder_and_postorder_traversal_test.go b/problems/construct-binary-tree-from-inorder-and-postorder-traversal/construct_binary_tree_from_inorder_and_postorder_traversal_test.go
deleted file mode 100644
index 262e373f1..000000000
--- a/problems/construct-binary-tree-from-inorder-and-postorder-traversal/construct_binary_tree_from_inorder_and_postorder_traversal_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem106
diff --git a/problems/construct-binary-tree-from-preorder-and-inorder-traversal/README.md b/problems/construct-binary-tree-from-preorder-and-inorder-traversal/README.md
deleted file mode 100644
index a9cb8e9ca..000000000
--- a/problems/construct-binary-tree-from-preorder-and-inorder-traversal/README.md
+++ /dev/null
@@ -1,52 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-depth-of-binary-tree "Maximum Depth of Binary Tree")
-
-[Next >](../construct-binary-tree-from-inorder-and-postorder-traversal "Construct Binary Tree from Inorder and Postorder Traversal")
-
-## [105. Construct Binary Tree from Preorder and Inorder Traversal (Medium)](https://leetcode.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal "从前序与中序遍历序列构造二叉树")
-
-
Given two integer arrays preorder and inorder where preorder is the preorder traversal of a binary tree and inorder is the inorder traversal of the same tree, construct and return the binary tree.
preorder is guaranteed to be the preorder traversal of the tree.
-
inorder is guaranteed to be the inorder traversal of the tree.
-
-
-### Related Topics
- [[Tree](../../tag/tree/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Divide and Conquer](../../tag/divide-and-conquer/README.md)]
- [[Binary Tree](../../tag/binary-tree/README.md)]
-
-### Similar Questions
- 1. [Construct Binary Tree from Inorder and Postorder Traversal](../construct-binary-tree-from-inorder-and-postorder-traversal) (Medium)
diff --git a/problems/construct-binary-tree-from-preorder-and-inorder-traversal/construct_binary_tree_from_preorder_and_inorder_traversal.go b/problems/construct-binary-tree-from-preorder-and-inorder-traversal/construct_binary_tree_from_preorder_and_inorder_traversal.go
deleted file mode 100644
index 0f02508ad..000000000
--- a/problems/construct-binary-tree-from-preorder-and-inorder-traversal/construct_binary_tree_from_preorder_and_inorder_traversal.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem105
diff --git a/problems/construct-binary-tree-from-preorder-and-inorder-traversal/construct_binary_tree_from_preorder_and_inorder_traversal_test.go b/problems/construct-binary-tree-from-preorder-and-inorder-traversal/construct_binary_tree_from_preorder_and_inorder_traversal_test.go
deleted file mode 100644
index 0f02508ad..000000000
--- a/problems/construct-binary-tree-from-preorder-and-inorder-traversal/construct_binary_tree_from_preorder_and_inorder_traversal_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem105
diff --git a/problems/construct-binary-tree-from-preorder-and-postorder-traversal/README.md b/problems/construct-binary-tree-from-preorder-and-postorder-traversal/README.md
deleted file mode 100644
index eb1be2100..000000000
--- a/problems/construct-binary-tree-from-preorder-and-postorder-traversal/README.md
+++ /dev/null
@@ -1,51 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../fair-candy-swap "Fair Candy Swap")
-
-[Next >](../find-and-replace-pattern "Find and Replace Pattern")
-
-## [889. Construct Binary Tree from Preorder and Postorder Traversal (Medium)](https://leetcode.com/problems/construct-binary-tree-from-preorder-and-postorder-traversal "根据前序和后序遍历构造二叉树")
-
-
Given two integer arrays, preorder and postorder where preorder is the preorder traversal of a binary tree of distinct values and postorder is the postorder traversal of the same tree, reconstruct and return the binary tree.
-
-
If there exist multiple answers, you can return any of them.
You need to construct a binary tree from a string consisting of parenthesis and integers.
-
-
The whole input represents a binary tree. It contains an integer followed by zero, one or two pairs of parenthesis. The integer represents the root's value and a pair of parenthesis contains a child binary tree with the same structure.
-
-
You always start to construct the left child node of the parent first if it exists.
-
-
Example:
-
-Input: "4(2(3)(1))(6(5))"
-Output: return the tree root node representing the following tree:
-
- 4
- / \
- 2 6
- / \ /
- 3 1 5
-
-
-
-
Note:
-
-
There will only be '(', ')', '-' and '0' ~ '9' in the input string.
-
An empty tree is represented by "" instead of "()".
Given a string s and an integer k. You should construct k non-empty palindrome strings using all the characters in s.
-
-
Return True if you can use all the characters in s to construct k palindrome strings or False otherwise.
-
-
-
Example 1:
-
-
-Input: s = "annabelle", k = 2
-Output: true
-Explanation: You can construct two palindromes using all characters in s.
-Some possible constructions "anna" + "elble", "anbna" + "elle", "anellena" + "b"
-
-
-
Example 2:
-
-
-Input: s = "leetcode", k = 3
-Output: false
-Explanation: It is impossible to construct 3 palindromes using all the characters of s.
-
-
-
Example 3:
-
-
-Input: s = "true", k = 4
-Output: true
-Explanation: The only possible solution is to put each character in a separate string.
-
-
-
Example 4:
-
-
-Input: s = "yzyzyzyzyzyzyzy", k = 2
-Output: true
-Explanation: Simply you can put all z's in one string and all y's in the other string. Both strings will be palindrome.
-
-
-
Example 5:
-
-
-Input: s = "cr", k = 7
-Output: false
-Explanation: We don't have enough characters in s to construct 7 palindromes.
-
-
-
-
Constraints:
-
-
-
1 <= s.length <= 10^5
-
All characters in s are lower-case English letters.
-
1 <= k <= 10^5
-
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
- [[Counting](../../tag/counting/README.md)]
-
-### Hints
-
-Hint 1
-If the s.length < k we cannot construct k strings from s and answer is false.
-
-
-
-Hint 2
-If the number of characters that have odd counts is > k then the minimum number of palindrome strings we can construct is > k and answer is false.
-
-
-
-Hint 3
-Otherwise you can construct exactly k palindrome strings and answer is true (why ?).
-
diff --git a/problems/construct-quad-tree/README.md b/problems/construct-quad-tree/README.md
deleted file mode 100644
index 54e92d898..000000000
--- a/problems/construct-quad-tree/README.md
+++ /dev/null
@@ -1,113 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../convert-binary-search-tree-to-sorted-doubly-linked-list "Convert Binary Search Tree to Sorted Doubly Linked List")
-
-[Next >](../serialize-and-deserialize-n-ary-tree "Serialize and Deserialize N-ary Tree")
-
-## [427. Construct Quad Tree (Medium)](https://leetcode.com/problems/construct-quad-tree "建立四叉树")
-
-
Given a n * n matrix grid of 0's and 1's only. We want to represent the grid with a Quad-Tree.
-
-
Return the root of the Quad-Tree representing the grid.
-
-
Notice that you can assign the value of a node to True or False when isLeaf is False, and both are accepted in the answer.
-
-
A Quad-Tree is a tree data structure in which each internal node has exactly four children. Besides, each node has two attributes:
-
-
-
val: True if the node represents a grid of 1's or False if the node represents a grid of 0's.
-
isLeaf: True if the node is leaf node on the tree or False if the node has the four children.
-
-
-
-class Node {
- public boolean val;
- public boolean isLeaf;
- public Node topLeft;
- public Node topRight;
- public Node bottomLeft;
- public Node bottomRight;
-}
-
-
We can construct a Quad-Tree from a two-dimensional area using the following steps:
-
-
-
If the current grid has the same value (i.e all 1's or all 0's) set isLeaf True and set val to the value of the grid and set the four children to Null and stop.
-
If the current grid has different values, set isLeaf to False and set val to any value and divide the current grid into four sub-grids as shown in the photo.
-
Recurse for each of the children with the proper sub-grid.
-
-
-
If you want to know more about the Quad-Tree, you can refer to the wiki.
-
-
Quad-Tree format:
-
-
The output represents the serialized format of a Quad-Tree using level order traversal, where null signifies a path terminator where no node exists below.
-
-
It is very similar to the serialization of the binary tree. The only difference is that the node is represented as a list [isLeaf, val].
-
-
If the value of isLeaf or val is True we represent it as 1 in the list [isLeaf, val] and if the value of isLeaf or val is False we represent it as 0.
-
-
-
Example 1:
-
-
-Input: grid = [[0,1],[1,0]]
-Output: [[0,1],[1,0],[1,1],[1,1],[1,0]]
-Explanation: The explanation of this example is shown below:
-Notice that 0 represnts False and 1 represents True in the photo representing the Quad-Tree.
-
-
-
-
Example 2:
-
-
-
-
-Input: grid = [[1,1,1,1,0,0,0,0],[1,1,1,1,0,0,0,0],[1,1,1,1,1,1,1,1],[1,1,1,1,1,1,1,1],[1,1,1,1,0,0,0,0],[1,1,1,1,0,0,0,0],[1,1,1,1,0,0,0,0],[1,1,1,1,0,0,0,0]]
-Output: [[0,1],[1,1],[0,1],[1,1],[1,0],null,null,null,null,[1,0],[1,0],[1,1],[1,1]]
-Explanation: All values in the grid are not the same. We divide the grid into four sub-grids.
-The topLeft, bottomLeft and bottomRight each has the same value.
-The topRight have different values so we divide it into 4 sub-grids where each has the same value.
-Explanation is shown in the photo below:
-
-
Given the root of a binary tree, construct a string consisting of parenthesis and integers from a binary tree with the preorder traversal way, and return it.
-
-
Omit all the empty parenthesis pairs that do not affect the one-to-one mapping relationship between the string and the original binary tree.
-
-
-
Example 1:
-
-
-Input: root = [1,2,3,4]
-Output: "1(2(4))(3)"
-Explanation: Originally, it needs to be "1(2(4)())(3()())", but you need to omit all the unnecessary empty parenthesis pairs. And it will be "1(2(4))(3)"
-
-
-
Example 2:
-
-
-Input: root = [1,2,3,null,4]
-Output: "1(2()(4))(3)"
-Explanation: Almost the same as the first example, except we cannot omit the first parenthesis pair to break the one-to-one mapping relationship between the input and the output.
-
-
-
-
Constraints:
-
-
-
The number of nodes in the tree is in the range [1, 104].
-
-1000 <= Node.val <= 1000
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
- [[Tree](../../tag/tree/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Binary Tree](../../tag/binary-tree/README.md)]
-
-### Similar Questions
- 1. [Construct Binary Tree from String](../construct-binary-tree-from-string) (Medium)
- 1. [Find Duplicate Subtrees](../find-duplicate-subtrees) (Medium)
diff --git a/problems/construct-string-from-binary-tree/construct_string_from_binary_tree.go b/problems/construct-string-from-binary-tree/construct_string_from_binary_tree.go
deleted file mode 100644
index 870bb6aad..000000000
--- a/problems/construct-string-from-binary-tree/construct_string_from_binary_tree.go
+++ /dev/null
@@ -1,34 +0,0 @@
-package problem606
-
-import (
- "strconv"
-
- "github.com/awesee/leetcode/internal/kit"
-)
-
-// TreeNode - Definition for a binary tree node.
-type TreeNode = kit.TreeNode
-
-/**
- * Definition for a binary tree node.
- * type TreeNode struct {
- * Val int
- * Left *TreeNode
- * Right *TreeNode
- * }
- */
-func tree2str(t *TreeNode) string {
- ans := ""
- if t != nil {
- ans += strconv.Itoa(t.Val)
- if t.Left != nil {
- ans += "(" + tree2str(t.Left) + ")"
- } else if t.Right != nil {
- ans += "()"
- }
- if t.Right != nil {
- ans += "(" + tree2str(t.Right) + ")"
- }
- }
- return ans
-}
diff --git a/problems/construct-string-from-binary-tree/construct_string_from_binary_tree_test.go b/problems/construct-string-from-binary-tree/construct_string_from_binary_tree_test.go
deleted file mode 100644
index a91f07506..000000000
--- a/problems/construct-string-from-binary-tree/construct_string_from_binary_tree_test.go
+++ /dev/null
@@ -1,31 +0,0 @@
-package problem606
-
-import (
- "testing"
-
- "github.com/awesee/leetcode/internal/kit"
-)
-
-type testType struct {
- in []int
- want string
-}
-
-func TestTree2str(t *testing.T) {
- tests := [...]testType{
- {
- in: []int{1, 2, 3, 4},
- want: "1(2(4))(3)",
- },
- {
- in: []int{1, 2, 3, kit.NULL, 4},
- want: "1(2()(4))(3)",
- },
- }
- for _, tt := range tests {
- got := tree2str(kit.SliceInt2TreeNode(tt.in))
- if got != tt.want {
- t.Fatalf("in: %v, got: %v, want: %v", tt.in, got, tt.want)
- }
- }
-}
diff --git a/problems/construct-target-array-with-multiple-sums/README.md b/problems/construct-target-array-with-multiple-sums/README.md
deleted file mode 100644
index 31a390147..000000000
--- a/problems/construct-target-array-with-multiple-sums/README.md
+++ /dev/null
@@ -1,74 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-number-of-events-that-can-be-attended "Maximum Number of Events That Can Be Attended")
-
-[Next >](../activity-participants "Activity Participants")
-
-## [1354. Construct Target Array With Multiple Sums (Hard)](https://leetcode.com/problems/construct-target-array-with-multiple-sums "多次求和构造目标数组")
-
-
You are given an array target of n integers. From a starting array arr consisting of n 1's, you may perform the following procedure :
-
-
-
let x be the sum of all elements currently in your array.
-
choose index i, such that 0 <= i < n and set the value of arr at index i to x.
-
You may repeat this procedure as many times as needed.
-
-
-
Return trueif it is possible to construct thetargetarray fromarr, otherwise, returnfalse.
-
-
-
Example 1:
-
-
-Input: target = [9,3,5]
-Output: true
-Explanation: Start with arr = [1, 1, 1]
-[1, 1, 1], sum = 3 choose index 1
-[1, 3, 1], sum = 5 choose index 2
-[1, 3, 5], sum = 9 choose index 0
-[9, 3, 5] Done
-
-
-
Example 2:
-
-
-Input: target = [1,1,1,2]
-Output: false
-Explanation: Impossible to create target array from [1,1,1,1].
-
-
-
Example 3:
-
-
-Input: target = [8,5]
-Output: true
-
-
-
-
Constraints:
-
-
-
n == target.length
-
1 <= n <= 5 * 104
-
1 <= target[i] <= 109
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Heap (Priority Queue)](../../tag/heap-priority-queue/README.md)]
-
-### Hints
-
-Hint 1
-Given that the sum is strictly increasing, the largest element in the target must be formed in the last step by adding the total sum in the previous step. Thus, we can simulate the process in a reversed way.
-
-
-
-Hint 2
-Subtract the largest with the rest of the array, and put the new element into the array. Repeat until all elements become one
-
diff --git a/problems/construct-the-lexicographically-largest-valid-sequence/README.md b/problems/construct-the-lexicographically-largest-valid-sequence/README.md
deleted file mode 100644
index 7a7a64fd4..000000000
--- a/problems/construct-the-lexicographically-largest-valid-sequence/README.md
+++ /dev/null
@@ -1,59 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-score-from-removing-substrings "Maximum Score From Removing Substrings")
-
-[Next >](../number-of-ways-to-reconstruct-a-tree "Number Of Ways To Reconstruct A Tree")
-
-## [1718. Construct the Lexicographically Largest Valid Sequence (Medium)](https://leetcode.com/problems/construct-the-lexicographically-largest-valid-sequence "构建字典序最大的可行序列")
-
-
Given an integer n, find a sequence that satisfies all of the following:
-
-
-
The integer 1 occurs once in the sequence.
-
Each integer between 2 and n occurs twice in the sequence.
-
For every integer i between 2 and n, the distance between the two occurrences of i is exactly i.
-
-
-
The distance between two numbers on the sequence, a[i] and a[j], is the absolute difference of their indices, |j - i|.
-
-
Return the lexicographically largest sequence. It is guaranteed that under the given constraints, there is always a solution.
-
-
A sequence a is lexicographically larger than a sequence b (of the same length) if in the first position where a and b differ, sequence a has a number greater than the corresponding number in b. For example, [0,1,9,0] is lexicographically larger than [0,1,5,6] because the first position they differ is at the third number, and 9 is greater than 5.
-
-
-
Example 1:
-
-
-Input: n = 3
-Output: [3,1,2,3,2]
-Explanation: [2,3,2,1,3] is also a valid sequence, but [3,1,2,3,2] is the lexicographically largest valid sequence.
-
A web developer needs to know how to design a web page's size. So, given a specific rectangular web page’s area, your job by now is to design a rectangular web page, whose length L and width W satisfy the following requirements:
-
-
-
The area of the rectangular web page you designed must equal to the given target area.
-
The width W should not be larger than the length L, which means L >= W.
-
The difference between length L and width W should be as small as possible.
-
-
-
Return an array [L, W] where L and W are the length and width of the web page you designed in sequence.
-
-
-
Example 1:
-
-
-Input: area = 4
-Output: [2,2]
-Explanation: The target area is 4, and all the possible ways to construct it are [1,4], [2,2], [4,1].
-But according to requirement 2, [1,4] is illegal; according to requirement 3, [4,1] is not optimal compared to [2,2]. So the length L is 2, and the width W is 2.
-
-
-
Example 2:
-
-
-Input: area = 37
-Output: [37,1]
-
-
-
Example 3:
-
-
-Input: area = 122122
-Output: [427,286]
-
-
-
-
Constraints:
-
-
-
1 <= area <= 107
-
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
-
-### Hints
-
-Hint 1
-The W is always less than or equal to the square root of the area, so we start searching at sqrt(area) till we find the result.
-
diff --git a/problems/construct-the-rectangle/construct_the_rectangle.go b/problems/construct-the-rectangle/construct_the_rectangle.go
deleted file mode 100644
index 85281dc4e..000000000
--- a/problems/construct-the-rectangle/construct_the_rectangle.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem492
diff --git a/problems/construct-the-rectangle/construct_the_rectangle_test.go b/problems/construct-the-rectangle/construct_the_rectangle_test.go
deleted file mode 100644
index 85281dc4e..000000000
--- a/problems/construct-the-rectangle/construct_the_rectangle_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem492
diff --git a/problems/contain-virus/README.md b/problems/contain-virus/README.md
deleted file mode 100644
index 4771a9807..000000000
--- a/problems/contain-virus/README.md
+++ /dev/null
@@ -1,80 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../shortest-completing-word "Shortest Completing Word")
-
-[Next >](../number-of-corner-rectangles "Number Of Corner Rectangles")
-
-## [749. Contain Virus (Hard)](https://leetcode.com/problems/contain-virus "隔离病毒")
-
-
A virus is spreading rapidly, and your task is to quarantine the infected area by installing walls.
-
-
The world is modeled as an m x n binary grid isInfected, where isInfected[i][j] == 0 represents uninfected cells, and isInfected[i][j] == 1 represents cells contaminated with the virus. A wall (and only one wall) can be installed between any two 4-directionally adjacent cells, on the shared boundary.
-
-
Every night, the virus spreads to all neighboring cells in all four directions unless blocked by a wall. Resources are limited. Each day, you can install walls around only one region (i.e., the affected area (continuous block of infected cells) that threatens the most uninfected cells the following night). There will never be a tie.
-
-
Return the number of walls used to quarantine all the infected regions. If the world will become fully infected, return the number of walls used.
-
-
-
Example 1:
-
-
-Input: isInfected = [[0,1,0,0,0,0,0,1],[0,1,0,0,0,0,0,1],[0,0,0,0,0,0,0,1],[0,0,0,0,0,0,0,0]]
-Output: 10
-Explanation: There are 2 contaminated regions.
-On the first day, add 5 walls to quarantine the viral region on the left. The board after the virus spreads is:
-
-On the second day, add 5 walls to quarantine the viral region on the right. The virus is fully contained.
-
-
-
-
Example 2:
-
-
-Input: isInfected = [[1,1,1],[1,0,1],[1,1,1]]
-Output: 4
-Explanation: Even though there is only one cell saved, there are 4 walls built.
-Notice that walls are only built on the shared boundary of two different cells.
-
-
-
Example 3:
-
-
-Input: isInfected = [[1,1,1,0,0,0,0,0,0],[1,0,1,0,1,1,1,1,1],[1,1,1,0,0,0,0,0,0]]
-Output: 13
-Explanation: The region on the left only builds two new walls.
-
-
-
-
Constraints:
-
-
-
m == isInfected.length
-
n == isInfected[i].length
-
1 <= m, n <= 50
-
isInfected[i][j] is either 0 or 1.
-
There is always a contiguous viral region throughout the described process that will infect strictly more uncontaminated squares in the next round.
-
-
-### Related Topics
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
- [[Simulation](../../tag/simulation/README.md)]
-
-### Hints
-
-Hint 1
-The implementation is long - we want to perfrom the following steps:
-
-* Find all viral regions (connected components), additionally for each region keeping track of the frontier (neighboring uncontaminated cells), and the perimeter of the region.
-
-* Disinfect the most viral region, adding it's perimeter to the answer.
-
-* Spread the virus in the remaining regions outward by 1 square.
-
diff --git a/problems/contain-virus/contain_virus.go b/problems/contain-virus/contain_virus.go
deleted file mode 100644
index 928684e83..000000000
--- a/problems/contain-virus/contain_virus.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem749
diff --git a/problems/contain-virus/contain_virus_test.go b/problems/contain-virus/contain_virus_test.go
deleted file mode 100644
index 928684e83..000000000
--- a/problems/contain-virus/contain_virus_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem749
diff --git a/problems/container-with-most-water/README.md b/problems/container-with-most-water/README.md
deleted file mode 100644
index b3b25e052..000000000
--- a/problems/container-with-most-water/README.md
+++ /dev/null
@@ -1,76 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../regular-expression-matching "Regular Expression Matching")
-
-[Next >](../integer-to-roman "Integer to Roman")
-
-## [11. Container With Most Water (Medium)](https://leetcode.com/problems/container-with-most-water "盛最多水的容器")
-
-
You are given an integer array height of length n. There are n vertical lines drawn such that the two endpoints of the ith line are (i, 0) and (i, height[i]).
-
-
Find two lines that together with the x-axis form a container, such that the container contains the most water.
-
-
Return the maximum amount of water a container can store.
-
-
Notice that you may not slant the container.
-
-
-
Example 1:
-
-
-Input: height = [1,8,6,2,5,4,8,3,7]
-Output: 49
-Explanation: The above vertical lines are represented by array [1,8,6,2,5,4,8,3,7]. In this case, the max area of water (blue section) the container can contain is 49.
-
-
-
Example 2:
-
-
-Input: height = [1,1]
-Output: 1
-
-
-
-
Constraints:
-
-
-
n == height.length
-
2 <= n <= 105
-
0 <= height[i] <= 104
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Two Pointers](../../tag/two-pointers/README.md)]
- [[Greedy](../../tag/greedy/README.md)]
-
-### Similar Questions
- 1. [Trapping Rain Water](../trapping-rain-water) (Hard)
-
-### Hints
-
-Hint 1
-The aim is to maximize the area formed between the vertical lines. The area of any container is calculated using the shorter line as length and the distance between the lines as the width of the rectangle.
-
-
-Area = length of shorter vertical line * distance between lines
-
-
-We can definitely get the maximum width container as the outermost lines have the maximum distance between them. However, this container might not be the maximum in size as one of the vertical lines of this container could be really short.
-
-
-
-
-
-
-
-
-
-Hint 2
-Start with the maximum width container and go to a shorter width container if there is a vertical line longer than the current containers shorter line. This way we are compromising on the width but we are looking forward to a longer length container.
-
diff --git a/problems/container-with-most-water/container_with_most_water.go b/problems/container-with-most-water/container_with_most_water.go
deleted file mode 100644
index 4cbac5812..000000000
--- a/problems/container-with-most-water/container_with_most_water.go
+++ /dev/null
@@ -1,17 +0,0 @@
-package problem11
-
-func maxArea(height []int) int {
- ans, l, r := 0, 0, len(height)-1
- for l < r {
- w, h := r-l, height[l]
- if h < height[r] {
- l++
- } else {
- h, r = height[r], r-1
- }
- if area := w * h; area > ans {
- ans = area
- }
- }
- return ans
-}
diff --git a/problems/container-with-most-water/container_with_most_water_test.go b/problems/container-with-most-water/container_with_most_water_test.go
deleted file mode 100644
index 643acc4cf..000000000
--- a/problems/container-with-most-water/container_with_most_water_test.go
+++ /dev/null
@@ -1,27 +0,0 @@
-package problem11
-
-import "testing"
-
-type testType struct {
- in []int
- want int
-}
-
-func TestMaxArea(t *testing.T) {
- tests := [...]testType{
- {
- in: []int{1, 8, 6, 2, 5, 4, 8, 3, 7},
- want: 49,
- },
- {
- in: []int{1, 8, 6, 30, 20, 6, 9, 10, 1},
- want: 48,
- },
- }
- for _, tt := range tests {
- got := maxArea(tt.in)
- if got != tt.want {
- t.Fatalf("in: %v, got: %v, want: %v", tt.in, got, tt.want)
- }
- }
-}
diff --git a/problems/contains-duplicate-ii/README.md b/problems/contains-duplicate-ii/README.md
deleted file mode 100644
index 540b57fcb..000000000
--- a/problems/contains-duplicate-ii/README.md
+++ /dev/null
@@ -1,54 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../the-skyline-problem "The Skyline Problem")
-
-[Next >](../contains-duplicate-iii "Contains Duplicate III")
-
-## [219. Contains Duplicate II (Easy)](https://leetcode.com/problems/contains-duplicate-ii "存在重复元素 II")
-
-
Given an integer array nums and an integer k, return true if there are two distinct indicesi and j in the array such that nums[i] == nums[j] and abs(i - j) <= k.
-
-
-
Example 1:
-
-
-Input: nums = [1,2,3,1], k = 3
-Output: true
-
-
-
Example 2:
-
-
-Input: nums = [1,0,1,1], k = 1
-Output: true
-
-
-
Example 3:
-
-
-Input: nums = [1,2,3,1,2,3], k = 2
-Output: false
-
Given an integer array nums and two integers k and t, return true if there are two distinct indicesi and j in the array such that abs(nums[i] - nums[j]) <= t and abs(i - j) <= k.
-
-
-
Example 1:
-
Input: nums = [1,2,3,1], k = 3, t = 0
-Output: true
-
Example 2:
-
Input: nums = [1,0,1,1], k = 1, t = 2
-Output: true
-
Example 3:
-
Input: nums = [1,5,9,1,5,9], k = 2, t = 3
-Output: false
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 2 * 104
-
-231 <= nums[i] <= 231 - 1
-
0 <= k <= 104
-
0 <= t <= 231 - 1
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Bucket Sort](../../tag/bucket-sort/README.md)]
- [[Ordered Set](../../tag/ordered-set/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
- [[Sliding Window](../../tag/sliding-window/README.md)]
-
-### Similar Questions
- 1. [Contains Duplicate](../contains-duplicate) (Easy)
- 1. [Contains Duplicate II](../contains-duplicate-ii) (Easy)
-
-### Hints
-
-Hint 1
-Time complexity O(n logk) - This will give an indication that sorting is involved for k elements.
-
-
-
-Hint 2
-Use already existing state to evaluate next state - Like, a set of k sorted numbers are only needed to be tracked. When we are processing the next number in array, then we can utilize the existing sorted state and it is not necessary to sort next overlapping set of k numbers again.
-
diff --git a/problems/contains-duplicate-iii/contains_duplicate_iii.go b/problems/contains-duplicate-iii/contains_duplicate_iii.go
deleted file mode 100644
index e869ba255..000000000
--- a/problems/contains-duplicate-iii/contains_duplicate_iii.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem220
diff --git a/problems/contains-duplicate-iii/contains_duplicate_iii_test.go b/problems/contains-duplicate-iii/contains_duplicate_iii_test.go
deleted file mode 100644
index e869ba255..000000000
--- a/problems/contains-duplicate-iii/contains_duplicate_iii_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem220
diff --git a/problems/contains-duplicate/README.md b/problems/contains-duplicate/README.md
deleted file mode 100644
index ef9f2a2d2..000000000
--- a/problems/contains-duplicate/README.md
+++ /dev/null
@@ -1,42 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../combination-sum-iii "Combination Sum III")
-
-[Next >](../the-skyline-problem "The Skyline Problem")
-
-## [217. Contains Duplicate (Easy)](https://leetcode.com/problems/contains-duplicate "存在重复元素")
-
-
Given an integer array nums, return true if any value appears at least twice in the array, and return false if every element is distinct.
Given an integer array nums and an integer k, return trueif nums has a continuous subarray of size at least two whose elements sum up to a multiple ofk, or false otherwise.
-
-
An integer x is a multiple of k if there exists an integer n such that x = n * k. 0 is always a multiple of k.
-
-
-
Example 1:
-
-
-Input: nums = [23,2,4,6,7], k = 6
-Output: true
-Explanation: [2, 4] is a continuous subarray of size 2 whose elements sum up to 6.
-
-
-
Example 2:
-
-
-Input: nums = [23,2,6,4,7], k = 6
-Output: true
-Explanation: [23, 2, 6, 4, 7] is an continuous subarray of size 5 whose elements sum up to 42.
-42 is a multiple of 6 because 42 = 7 * 6 and 7 is an integer.
-
-
-
Example 3:
-
-
-Input: nums = [23,2,6,4,7], k = 13
-Output: false
-
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 105
-
0 <= nums[i] <= 109
-
0 <= sum(nums[i]) <= 231 - 1
-
1 <= k <= 231 - 1
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Math](../../tag/math/README.md)]
- [[Prefix Sum](../../tag/prefix-sum/README.md)]
-
-### Similar Questions
- 1. [Subarray Sum Equals K](../subarray-sum-equals-k) (Medium)
diff --git a/problems/continuous-subarray-sum/continuous_subarray_sum.go b/problems/continuous-subarray-sum/continuous_subarray_sum.go
deleted file mode 100644
index aca7a6a24..000000000
--- a/problems/continuous-subarray-sum/continuous_subarray_sum.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem523
diff --git a/problems/continuous-subarray-sum/continuous_subarray_sum_test.go b/problems/continuous-subarray-sum/continuous_subarray_sum_test.go
deleted file mode 100644
index aca7a6a24..000000000
--- a/problems/continuous-subarray-sum/continuous_subarray_sum_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem523
diff --git a/problems/convert-1d-array-into-2d-array/README.md b/problems/convert-1d-array-into-2d-array/README.md
deleted file mode 100644
index 1a2c6e69f..000000000
--- a/problems/convert-1d-array-into-2d-array/README.md
+++ /dev/null
@@ -1,77 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../brightest-position-on-street "Brightest Position on Street")
-
-[Next >](../number-of-pairs-of-strings-with-concatenation-equal-to-target "Number of Pairs of Strings With Concatenation Equal to Target")
-
-## [2022. Convert 1D Array Into 2D Array (Easy)](https://leetcode.com/problems/convert-1d-array-into-2d-array "将一维数组转变成二维数组")
-
-
You are given a 0-indexed 1-dimensional (1D) integer array original, and two integers, m and n. You are tasked with creating a 2-dimensional (2D) array with m rows and n columns using all the elements from original.
-
-
The elements from indices 0 to n - 1 (inclusive) of original should form the first row of the constructed 2D array, the elements from indices n to 2 * n - 1 (inclusive) should form the second row of the constructed 2D array, and so on.
-
-
Return an m x n 2D array constructed according to the above procedure, or an empty 2D array if it is impossible.
-
-
-
Example 1:
-
-
-Input: original = [1,2,3,4], m = 2, n = 2
-Output: [[1,2],[3,4]]
-Explanation: The constructed 2D array should contain 2 rows and 2 columns.
-The first group of n=2 elements in original, [1,2], becomes the first row in the constructed 2D array.
-The second group of n=2 elements in original, [3,4], becomes the second row in the constructed 2D array.
-
-
-
Example 2:
-
-
-Input: original = [1,2,3], m = 1, n = 3
-Output: [[1,2,3]]
-Explanation: The constructed 2D array should contain 1 row and 3 columns.
-Put all three elements in original into the first row of the constructed 2D array.
-
-
-
Example 3:
-
-
-Input: original = [1,2], m = 1, n = 1
-Output: []
-Explanation: There are 2 elements in original.
-It is impossible to fit 2 elements in a 1x1 2D array, so return an empty 2D array.
-
-
-
-
Constraints:
-
-
-
1 <= original.length <= 5 * 104
-
1 <= original[i] <= 105
-
1 <= m, n <= 4 * 104
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
- [[Simulation](../../tag/simulation/README.md)]
-
-### Hints
-
-Hint 1
-When is it possible to convert original into a 2D array and when is it impossible?
-
-
-
-Hint 2
-It is possible if and only if m * n == original.length
-
-
-
-Hint 3
-If it is possible to convert original to a 2D array, keep an index i such that original[i] is the next element to add to the 2D array.
-
diff --git a/problems/convert-a-number-to-hexadecimal/README.md b/problems/convert-a-number-to-hexadecimal/README.md
deleted file mode 100644
index 955b7b2d3..000000000
--- a/problems/convert-a-number-to-hexadecimal/README.md
+++ /dev/null
@@ -1,37 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../sum-of-left-leaves "Sum of Left Leaves")
-
-[Next >](../queue-reconstruction-by-height "Queue Reconstruction by Height")
-
-## [405. Convert a Number to Hexadecimal (Easy)](https://leetcode.com/problems/convert-a-number-to-hexadecimal "数字转换为十六进制数")
-
-
Given an integer num, return a string representing its hexadecimal representation. For negative integers, two’s complement method is used.
-
-
All the letters in the answer string should be lowercase characters, and there should not be any leading zeros in the answer except for the zero itself.
-
-
Note: You are not allowed to use any built-in library method to directly solve this problem.
Given head which is a reference node to a singly-linked list. The value of each node in the linked list is either 0 or 1. The linked list holds the binary representation of a number.
-
-
Return the decimal value of the number in the linked list.
-
-
-
Example 1:
-
-
-Input: head = [1,0,1]
-Output: 5
-Explanation: (101) in base 2 = (5) in base 10
-
-
-
Example 2:
-
-
-Input: head = [0]
-Output: 0
-
-
-
Example 3:
-
-
-Input: head = [1]
-Output: 1
-
-
-
Example 4:
-
-
-Input: head = [1,0,0,1,0,0,1,1,1,0,0,0,0,0,0]
-Output: 18880
-
-
-
Example 5:
-
-
-Input: head = [0,0]
-Output: 0
-
-
-
-
Constraints:
-
-
-
The Linked List is not empty.
-
Number of nodes will not exceed 30.
-
Each node's value is either 0 or 1.
-
-
-### Related Topics
- [[Linked List](../../tag/linked-list/README.md)]
- [[Math](../../tag/math/README.md)]
-
-### Hints
-
-Hint 1
-Traverse the linked list and store all values in a string or array. convert the values obtained to decimal value.
-
-
-
-Hint 2
-You can solve the problem in O(1) memory using bits operation. use shift left operation ( << ) and or operation ( | ) to get the decimal value in one operation.
-
diff --git a/problems/convert-binary-search-tree-to-sorted-doubly-linked-list/README.md b/problems/convert-binary-search-tree-to-sorted-doubly-linked-list/README.md
deleted file mode 100644
index 6380ffd0d..000000000
--- a/problems/convert-binary-search-tree-to-sorted-doubly-linked-list/README.md
+++ /dev/null
@@ -1,47 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../word-squares "Word Squares")
-
-[Next >](../construct-quad-tree "Construct Quad Tree")
-
-## [426. Convert Binary Search Tree to Sorted Doubly Linked List (Medium)](https://leetcode.com/problems/convert-binary-search-tree-to-sorted-doubly-linked-list "将二叉搜索树转化为排序的双向链表")
-
-
Convert a BST to a sorted circular doubly-linked list in-place. Think of the left and right pointers as synonymous to the previous and next pointers in a doubly-linked list.
-
-
Let's take the following BST as an example, it may help you understand the problem better:
-
-
-
-
-
-
We want to transform this BST into a circular doubly linked list. Each node in a doubly linked list has a predecessor and successor. For a circular doubly linked list, the predecessor of the first element is the last element, and the successor of the last element is the first element.
-
-
The figure below shows the circular doubly linked list for the BST above. The "head" symbol means the node it points to is the smallest element of the linked list.
-
-
-
-
-
-
Specifically, we want to do the transformation in place. After the transformation, the left pointer of the tree node should point to its predecessor, and the right pointer should point to its successor. We should return the pointer to the first element of the linked list.
-
-
The figure below shows the transformed BST. The solid line indicates the successor relationship, while the dashed line means the predecessor relationship.
Given the root of a Binary Search Tree (BST), convert it to a Greater Tree such that every key of the original BST is changed to the original key plus the sum of all keys greater than the original key in BST.
-
-
As a reminder, a binary search tree is a tree that satisfies these constraints:
-
-
-
The left subtree of a node contains only nodes with keys less than the node's key.
-
The right subtree of a node contains only nodes with keys greater than the node's key.
-
Both the left and right subtrees must also be binary search trees.
-
-### Related Topics
- [[Tree](../../tag/tree/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Binary Search Tree](../../tag/binary-search-tree/README.md)]
- [[Binary Tree](../../tag/binary-tree/README.md)]
diff --git a/problems/convert-bst-to-greater-tree/convert_bst_to_greater_tree.go b/problems/convert-bst-to-greater-tree/convert_bst_to_greater_tree.go
deleted file mode 100644
index 997891c23..000000000
--- a/problems/convert-bst-to-greater-tree/convert_bst_to_greater_tree.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem538
diff --git a/problems/convert-bst-to-greater-tree/convert_bst_to_greater_tree_test.go b/problems/convert-bst-to-greater-tree/convert_bst_to_greater_tree_test.go
deleted file mode 100644
index 997891c23..000000000
--- a/problems/convert-bst-to-greater-tree/convert_bst_to_greater_tree_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem538
diff --git a/problems/convert-date-format/README.md b/problems/convert-date-format/README.md
deleted file mode 100644
index 3723629a4..000000000
--- a/problems/convert-date-format/README.md
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../distinct-numbers-in-each-subarray "Distinct Numbers in Each Subarray")
-
-[Next >](../maximum-population-year "Maximum Population Year")
-
-## [1853. Convert Date Format (Easy)](https://leetcode.com/problems/convert-date-format "转换日期格式")
-
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/convert-date-format/mysql_schemas.sql b/problems/convert-date-format/mysql_schemas.sql
deleted file mode 100644
index 774d3d900..000000000
--- a/problems/convert-date-format/mysql_schemas.sql
+++ /dev/null
@@ -1,5 +0,0 @@
-Create table If Not Exists Days (day date);
-Truncate table Days;
-insert into Days (day) values ('2022-04-12');
-insert into Days (day) values ('2021-08-09');
-insert into Days (day) values ('2020-06-26');
diff --git a/problems/convert-integer-to-the-sum-of-two-no-zero-integers/README.md b/problems/convert-integer-to-the-sum-of-two-no-zero-integers/README.md
deleted file mode 100644
index c06050fea..000000000
--- a/problems/convert-integer-to-the-sum-of-two-no-zero-integers/README.md
+++ /dev/null
@@ -1,60 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../distinct-echo-substrings "Distinct Echo Substrings")
-
-[Next >](../minimum-flips-to-make-a-or-b-equal-to-c "Minimum Flips to Make a OR b Equal to c")
-
-## [1317. Convert Integer to the Sum of Two No-Zero Integers (Easy)](https://leetcode.com/problems/convert-integer-to-the-sum-of-two-no-zero-integers "将整数转换为两个无零整数的和")
-
-
No-Zero integer is a positive integer that does not contain any 0 in its decimal representation.
-
-
Given an integer n, return a list of two integers[A, B]where:
-
-
-
A and B are No-Zero integers.
-
A + B = n
-
-
-
The test cases are generated so that there is at least one valid solution. If there are many valid solutions you can return any of them.
-
-
-
Example 1:
-
-
-Input: n = 2
-Output: [1,1]
-Explanation: A = 1, B = 1. A + B = n and both A and B do not contain any 0 in their decimal representation.
-
-
-
Example 2:
-
-
-Input: n = 11
-Output: [2,9]
-
-
-
-
Constraints:
-
-
-
2 <= n <= 104
-
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
-
-### Hints
-
-Hint 1
-Loop through all elements from 1 to n.
-
-
-
-Hint 2
-Choose A = i and B = n - i then check if A and B are both No-Zero integers.
-
diff --git a/problems/convert-sorted-array-to-binary-search-tree/README.md b/problems/convert-sorted-array-to-binary-search-tree/README.md
deleted file mode 100644
index 83415f923..000000000
--- a/problems/convert-sorted-array-to-binary-search-tree/README.md
+++ /dev/null
@@ -1,53 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../binary-tree-level-order-traversal-ii "Binary Tree Level Order Traversal II")
-
-[Next >](../convert-sorted-list-to-binary-search-tree "Convert Sorted List to Binary Search Tree")
-
-## [108. Convert Sorted Array to Binary Search Tree (Easy)](https://leetcode.com/problems/convert-sorted-array-to-binary-search-tree "将有序数组转换为二叉搜索树")
-
-
Given an integer array nums where the elements are sorted in ascending order, convert it to a height-balanced binary search tree.
-
-
A height-balanced binary tree is a binary tree in which the depth of the two subtrees of every node never differs by more than one.
-
-
-
Example 1:
-
-
-Input: nums = [-10,-3,0,5,9]
-Output: [0,-3,9,-10,null,5]
-Explanation: [0,-10,5,null,-3,null,9] is also accepted:
-
-
-
-
Example 2:
-
-
-Input: nums = [1,3]
-Output: [3,1]
-Explanation: [1,3] and [3,1] are both a height-balanced BSTs.
-
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 104
-
-104 <= nums[i] <= 104
-
nums is sorted in a strictly increasing order.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Divide and Conquer](../../tag/divide-and-conquer/README.md)]
- [[Tree](../../tag/tree/README.md)]
- [[Binary Search Tree](../../tag/binary-search-tree/README.md)]
- [[Binary Tree](../../tag/binary-tree/README.md)]
-
-### Similar Questions
- 1. [Convert Sorted List to Binary Search Tree](../convert-sorted-list-to-binary-search-tree) (Medium)
diff --git a/problems/convert-sorted-array-to-binary-search-tree/convert_sorted_array_to_binary_search_tree.go b/problems/convert-sorted-array-to-binary-search-tree/convert_sorted_array_to_binary_search_tree.go
deleted file mode 100644
index 2db149324..000000000
--- a/problems/convert-sorted-array-to-binary-search-tree/convert_sorted_array_to_binary_search_tree.go
+++ /dev/null
@@ -1,24 +0,0 @@
-package problem108
-
-import "github.com/awesee/leetcode/internal/kit"
-
-// TreeNode - Definition for a binary tree node.
-type TreeNode = kit.TreeNode
-
-/**
- * Definition for a binary tree node.
- * type TreeNode struct {
- * Val int
- * Left *TreeNode
- * Right *TreeNode
- * }
- */
-func sortedArrayToBST(nums []int) *TreeNode {
- var node *TreeNode
- if l := len(nums); l > 0 {
- node = &TreeNode{Val: nums[l/2]}
- node.Left = sortedArrayToBST(nums[0 : l/2])
- node.Right = sortedArrayToBST(nums[l/2+1:])
- }
- return node
-}
diff --git a/problems/convert-sorted-array-to-binary-search-tree/convert_sorted_array_to_binary_search_tree_test.go b/problems/convert-sorted-array-to-binary-search-tree/convert_sorted_array_to_binary_search_tree_test.go
deleted file mode 100644
index b9b685b0f..000000000
--- a/problems/convert-sorted-array-to-binary-search-tree/convert_sorted_array_to_binary_search_tree_test.go
+++ /dev/null
@@ -1,28 +0,0 @@
-package problem108
-
-import (
- "reflect"
- "testing"
-
- "github.com/awesee/leetcode/internal/kit"
-)
-
-type testType struct {
- in []int
- want []int
-}
-
-func TestSortedArrayToBST(t *testing.T) {
- tests := [...]testType{
- {
- in: []int{-10, -3, 0, 5, 9},
- want: []int{0, -3, 9, -10, kit.NULL, 5},
- },
- }
- for _, tt := range tests {
- got := kit.TreeNode2SliceInt(sortedArrayToBST(tt.in))
- if !reflect.DeepEqual(got, tt.want) {
- t.Fatalf("in: %v, got: %v, want: %v", tt.in, got, tt.want)
- }
- }
-}
diff --git a/problems/convert-sorted-list-to-binary-search-tree/README.md b/problems/convert-sorted-list-to-binary-search-tree/README.md
deleted file mode 100644
index e91c9b31d..000000000
--- a/problems/convert-sorted-list-to-binary-search-tree/README.md
+++ /dev/null
@@ -1,50 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../convert-sorted-array-to-binary-search-tree "Convert Sorted Array to Binary Search Tree")
-
-[Next >](../balanced-binary-tree "Balanced Binary Tree")
-
-## [109. Convert Sorted List to Binary Search Tree (Medium)](https://leetcode.com/problems/convert-sorted-list-to-binary-search-tree "有序链表转换二叉搜索树")
-
-
Given the head of a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.
-
-
For this problem, a height-balanced binary tree is defined as a binary tree in which the depth of the two subtrees of every node never differ by more than 1.
-
-
-
Example 1:
-
-
-Input: head = [-10,-3,0,5,9]
-Output: [0,-3,9,-10,null,5]
-Explanation: One possible answer is [0,-3,9,-10,null,5], which represents the shown height balanced BST.
-
-
-
Example 2:
-
-
-Input: head = []
-Output: []
-
-
-
-
Constraints:
-
-
-
The number of nodes in head is in the range [0, 2 * 104].
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
-
-### Similar Questions
- 1. [Encode Number](../encode-number) (Medium)
-
-### Hints
-
-Hint 1
-Figure out whether you need the ones digit placed or not, then shift by two.
-
diff --git a/problems/convert-to-base-2/convert_to_base_2.go b/problems/convert-to-base-2/convert_to_base_2.go
deleted file mode 100644
index a23fb11d0..000000000
--- a/problems/convert-to-base-2/convert_to_base_2.go
+++ /dev/null
@@ -1,39 +0,0 @@
-package problem1017
-
-func baseNeg2(N int) string {
- if N == 0 {
- return "0"
- }
-
- B := make([]byte, 0, 30)
- for N > 0 {
- switch N & 3 {
- case 0, 1:
- B = append(B, byte(N&1)+'0', '0')
- default: // 2,3
- B = append(B, byte(N&1)+'0', '1')
- N += 4
- // 2^(2n)-2^(2n-1) == 2^(2n-1)
- // 所以,把 N 转换成二进制后,每在奇数位上看见 1 就在其左边的偶数位上加 1
- // 就可以转换成以 -2 为基的二进制了
- }
- N >>= 2
- }
-
- swap(B)
-
- if B[0] == '0' { // no lead 0 except for N is 0
- B = B[1:]
- }
-
- return string(B)
-}
-
-func swap(B []byte) {
- i, j := 0, len(B)-1
- for i < j {
- B[i], B[j] = B[j], B[i]
- i++
- j--
- }
-}
diff --git a/problems/convex-polygon/README.md b/problems/convex-polygon/README.md
deleted file mode 100644
index 866c02f6d..000000000
--- a/problems/convex-polygon/README.md
+++ /dev/null
@@ -1,50 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../validate-ip-address "Validate IP Address")
-
-[Next >](../implement-rand10-using-rand7 "Implement Rand10() Using Rand7()")
-
-## [469. Convex Polygon (Medium)](https://leetcode.com/problems/convex-polygon "凸多边形")
-
-
Given a list of points that form a polygon when joined sequentially, find if this polygon is convex (Convex polygon definition).
-
-
-
-
Note:
-
-
-
There are at least 3 and at most 10,000 points.
-
Coordinates are in the range -10,000 to 10,000.
-
You may assume the polygon formed by given points is always a simple polygon (Simple polygon definition). In other words, we ensure that exactly two edges intersect at each vertex, and that edges otherwise don't intersect each other.
-
-### Related Topics
- [[Geometry](../../tag/geometry/README.md)]
- [[Math](../../tag/math/README.md)]
diff --git a/problems/convex-polygon/convex_polygon.go b/problems/convex-polygon/convex_polygon.go
deleted file mode 100644
index e39705b1f..000000000
--- a/problems/convex-polygon/convex_polygon.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem469
diff --git a/problems/convex-polygon/convex_polygon_test.go b/problems/convex-polygon/convex_polygon_test.go
deleted file mode 100644
index e39705b1f..000000000
--- a/problems/convex-polygon/convex_polygon_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem469
diff --git a/problems/coordinate-with-maximum-network-quality/README.md b/problems/coordinate-with-maximum-network-quality/README.md
deleted file mode 100644
index 6ada4d259..000000000
--- a/problems/coordinate-with-maximum-network-quality/README.md
+++ /dev/null
@@ -1,80 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../mean-of-array-after-removing-some-elements "Mean of Array After Removing Some Elements")
-
-[Next >](../number-of-sets-of-k-non-overlapping-line-segments "Number of Sets of K Non-Overlapping Line Segments")
-
-## [1620. Coordinate With Maximum Network Quality (Medium)](https://leetcode.com/problems/coordinate-with-maximum-network-quality "网络信号最好的坐标")
-
-
You are given an array of network towers towers, where towers[i] = [xi, yi, qi] denotes the ith network tower with location (xi, yi) and quality factor qi. All the coordinates are integral coordinates on the X-Y plane, and the distance between the two coordinates is the Euclidean distance.
-
-
You are also given an integer radius where a tower is reachable if the distance is less than or equal toradius. Outside that distance, the signal becomes garbled, and the tower is not reachable.
-
-
The signal quality of the ith tower at a coordinate (x, y) is calculated with the formula ⌊qi / (1 + d)⌋, where d is the distance between the tower and the coordinate. The network quality at a coordinate is the sum of the signal qualities from all the reachable towers.
-
-
Return the array [cx, cy] representing the integral coordinate (cx, cy) where the network quality is maximum. If there are multiple coordinates with the same network quality, return the lexicographically minimum non-negative coordinate.
-
-
Note:
-
-
-
A coordinate (x1, y1) is lexicographically smaller than (x2, y2) if either:
-
-
x1 < x2, or
-
x1 == x2 and y1 < y2.
-
-
-
⌊val⌋ is the greatest integer less than or equal to val (the floor function).
-
-
-
-
Example 1:
-
-
-Input: towers = [[1,2,5],[2,1,7],[3,1,9]], radius = 2
-Output: [2,1]
-Explanation: At coordinate (2, 1) the total quality is 13.
-- Quality of 7 from (2, 1) results in ⌊7 / (1 + sqrt(0)⌋ = ⌊7⌋ = 7
-- Quality of 5 from (1, 2) results in ⌊5 / (1 + sqrt(2)⌋ = ⌊2.07⌋ = 2
-- Quality of 9 from (3, 1) results in ⌊9 / (1 + sqrt(1)⌋ = ⌊4.5⌋ = 4
-No other coordinate has a higher network quality.
-
-
Example 2:
-
-
-Input: towers = [[23,11,21]], radius = 9
-Output: [23,11]
-Explanation: Since there is only one tower, the network quality is highest right at the tower's location.
-
-
-
Example 3:
-
-
-Input: towers = [[1,2,13],[2,1,7],[0,1,9]], radius = 2
-Output: [1,2]
-Explanation: Coordinate (1, 2) has the highest network quality.
-
-
-
-
Constraints:
-
-
-
1 <= towers.length <= 50
-
towers[i].length == 3
-
0 <= xi, yi, qi <= 50
-
1 <= radius <= 50
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Enumeration](../../tag/enumeration/README.md)]
-
-### Hints
-
-Hint 1
-The constraints are small enough to consider every possible coordinate and calculate its quality.
-
diff --git a/problems/copy-list-with-random-pointer/README.md b/problems/copy-list-with-random-pointer/README.md
deleted file mode 100644
index d6f283200..000000000
--- a/problems/copy-list-with-random-pointer/README.md
+++ /dev/null
@@ -1,103 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../single-number-ii "Single Number II")
-
-[Next >](../word-break "Word Break")
-
-## [138. Copy List with Random Pointer (Medium)](https://leetcode.com/problems/copy-list-with-random-pointer "复制带随机指针的链表")
-
-
A linked list of length n is given such that each node contains an additional random pointer, which could point to any node in the list, or null.
-
-
Construct a deep copy of the list. The deep copy should consist of exactly nbrand new nodes, where each new node has its value set to the value of its corresponding original node. Both the next and random pointer of the new nodes should point to new nodes in the copied list such that the pointers in the original list and copied list represent the same list state. None of the pointers in the new list should point to nodes in the original list.
-
-
For example, if there are two nodes X and Y in the original list, where X.random --> Y, then for the corresponding two nodes x and y in the copied list, x.random --> y.
-
-
Return the head of the copied linked list.
-
-
The linked list is represented in the input/output as a list of n nodes. Each node is represented as a pair of [val, random_index] where:
-
-
-
val: an integer representing Node.val
-
random_index: the index of the node (range from 0 to n-1) that the random pointer points to, or null if it does not point to any node.
-
-
-
Your code will only be given the head of the original linked list.
-
-
-
Example 1:
-
-
-Input: head = [[7,null],[13,0],[11,4],[10,2],[1,0]]
-Output: [[7,null],[13,0],[11,4],[10,2],[1,0]]
-
-
-
Example 2:
-
-
-Input: head = [[1,1],[2,1]]
-Output: [[1,1],[2,1]]
-
-
-
Example 3:
-
-
-
-
-Input: head = [[3,null],[3,0],[3,null]]
-Output: [[3,null],[3,0],[3,null]]
-
-
-
Example 4:
-
-
-Input: head = []
-Output: []
-Explanation: The given linked list is empty (null pointer), so return null.
-
-
-
-
Constraints:
-
-
-
0 <= n <= 1000
-
-10000 <= Node.val <= 10000
-
Node.random is null or is pointing to some node in the linked list.
-
-
-### Related Topics
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Linked List](../../tag/linked-list/README.md)]
-
-### Similar Questions
- 1. [Clone Graph](../clone-graph) (Medium)
-
-### Hints
-
-Hint 1
-Just iterate the linked list and create copies of the nodes on the go. Since a node can be referenced from multiple nodes due to the random pointers, make sure you are not making multiple copies of the same node.
-
-
-
-Hint 2
-You may want to use extra space to keep old node ---> new node mapping to prevent creating multiples copies of same node.
-
-
-
-Hint 3
-We can avoid using extra space for old node ---> new node mapping, by tweaking the original linked list. Simply interweave the nodes of the old and copied list.
-For e.g.
-
-Old List: A --> B --> C --> D
-InterWeaved List: A --> A' --> B --> B' --> C --> C' --> D --> D'
-
-
-
-
-Hint 4
-The interweaving is done using next pointers and we can make use of interweaved structure to get the correct reference nodes for random pointers.
-
diff --git a/problems/copy-list-with-random-pointer/copy_list_with_random_pointer.go b/problems/copy-list-with-random-pointer/copy_list_with_random_pointer.go
deleted file mode 100644
index 37ad5883b..000000000
--- a/problems/copy-list-with-random-pointer/copy_list_with_random_pointer.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem138
diff --git a/problems/copy-list-with-random-pointer/copy_list_with_random_pointer.py b/problems/copy-list-with-random-pointer/copy_list_with_random_pointer.py
deleted file mode 100755
index bf723165f..000000000
--- a/problems/copy-list-with-random-pointer/copy_list_with_random_pointer.py
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/usr/bin/env python
-
-"""
-# Definition for a Node.
-class Node:
- def __init__(self, val, next, random):
- self.val = val
- self.next = next
- self.random = random
-"""
-class Solution:
- def copyRandomList(self, head: 'Node') -> 'Node':
-
\ No newline at end of file
diff --git a/problems/copy-list-with-random-pointer/copy_list_with_random_pointer_test.go b/problems/copy-list-with-random-pointer/copy_list_with_random_pointer_test.go
deleted file mode 100644
index 37ad5883b..000000000
--- a/problems/copy-list-with-random-pointer/copy_list_with_random_pointer_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem138
diff --git a/problems/corporate-flight-bookings/README.md b/problems/corporate-flight-bookings/README.md
deleted file mode 100644
index 63e874b4c..000000000
--- a/problems/corporate-flight-bookings/README.md
+++ /dev/null
@@ -1,62 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../defanging-an-ip-address "Defanging an IP Address")
-
-[Next >](../delete-nodes-and-return-forest "Delete Nodes And Return Forest")
-
-## [1109. Corporate Flight Bookings (Medium)](https://leetcode.com/problems/corporate-flight-bookings "航班预订统计")
-
-
There are n flights that are labeled from 1 to n.
-
-
You are given an array of flight bookings bookings, where bookings[i] = [firsti, lasti, seatsi] represents a booking for flights firsti through lasti (inclusive) with seatsi seats reserved for each flight in the range.
-
-
Return an array answer of length n, where answer[i] is the total number of seats reserved for flight i.
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Prefix Sum](../../tag/prefix-sum/README.md)]
diff --git a/problems/corporate-flight-bookings/corporate_flight_bookings.go b/problems/corporate-flight-bookings/corporate_flight_bookings.go
deleted file mode 100644
index 120b8a289..000000000
--- a/problems/corporate-flight-bookings/corporate_flight_bookings.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem1109
diff --git a/problems/correct-a-binary-tree/README.md b/problems/correct-a-binary-tree/README.md
deleted file mode 100644
index a98761723..000000000
--- a/problems/correct-a-binary-tree/README.md
+++ /dev/null
@@ -1,27 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximize-grid-happiness "Maximize Grid Happiness")
-
-[Next >](../average-time-of-process-per-machine "Average Time of Process per Machine")
-
-## [1660. Correct a Binary Tree (Medium)](https://leetcode.com/problems/correct-a-binary-tree "纠正二叉树")
-
-
-
-### Related Topics
- [[Tree](../../tag/tree/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Binary Tree](../../tag/binary-tree/README.md)]
-
-### Hints
-
-Hint 1
-If you traverse the tree from right to left, the invalid node will point to a node that has already been visited.
-
diff --git a/problems/count-all-possible-routes/README.md b/problems/count-all-possible-routes/README.md
deleted file mode 100644
index 5de9e8ec3..000000000
--- a/problems/count-all-possible-routes/README.md
+++ /dev/null
@@ -1,81 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../shortest-subarray-to-be-removed-to-make-array-sorted "Shortest Subarray to be Removed to Make Array Sorted")
-
-[Next >](../replace-all-s-to-avoid-consecutive-repeating-characters "Replace All ?'s to Avoid Consecutive Repeating Characters")
-
-## [1575. Count All Possible Routes (Hard)](https://leetcode.com/problems/count-all-possible-routes "统计所有可行路径")
-
-
You are given an array of distinct positive integers locations where locations[i] represents the position of city i. You are also given integers start, finish and fuel representing the starting city, ending city, and the initial amount of fuel you have, respectively.
-
-
At each step, if you are at city i, you can pick any city j such that j != i and 0 <= j < locations.length and move to city j. Moving from city i to city j reduces the amount of fuel you have by |locations[i] - locations[j]|. Please notice that |x| denotes the absolute value of x.
-
-
Notice that fuelcannot become negative at any point in time, and that you are allowed to visit any city more than once (including start and finish).
-
-
Return the count of all possible routes from starttofinish. Since the answer may be too large, return it modulo 109 + 7.
-
-
-
Example 1:
-
-
-Input: locations = [2,3,6,8,4], start = 1, finish = 3, fuel = 5
-Output: 4
-Explanation: The following are all possible routes, each uses 5 units of fuel:
-1 -> 3
-1 -> 2 -> 3
-1 -> 4 -> 3
-1 -> 4 -> 2 -> 3
-
-
-
Example 2:
-
-
-Input: locations = [4,3,1], start = 1, finish = 0, fuel = 6
-Output: 5
-Explanation: The following are all possible routes:
-1 -> 0, used fuel = 1
-1 -> 2 -> 0, used fuel = 5
-1 -> 2 -> 1 -> 0, used fuel = 5
-1 -> 0 -> 1 -> 0, used fuel = 3
-1 -> 0 -> 1 -> 0 -> 1 -> 0, used fuel = 5
-
-
-
Example 3:
-
-
-Input: locations = [5,2,1], start = 0, finish = 2, fuel = 3
-Output: 0
-Explanation: It is impossible to get from 0 to 2 using only 3 units of fuel since the shortest route needs 4 units of fuel.
-
-
-
-
Constraints:
-
-
-
2 <= locations.length <= 100
-
1 <= locations[i] <= 109
-
All integers in locations are distinct.
-
0 <= start, finish < locations.length
-
1 <= fuel <= 200
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Memoization](../../tag/memoization/README.md)]
-
-### Hints
-
-Hint 1
-Use dynamic programming to solve this problem with each state defined by the city index and fuel left.
-
-
-
-Hint 2
-Since the array contains distinct integers fuel will always be spent in each move and so there can be no cycles.
-
diff --git a/problems/count-all-valid-pickup-and-delivery-options/README.md b/problems/count-all-valid-pickup-and-delivery-options/README.md
deleted file mode 100644
index 32cda0c3e..000000000
--- a/problems/count-all-valid-pickup-and-delivery-options/README.md
+++ /dev/null
@@ -1,62 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../number-of-substrings-containing-all-three-characters "Number of Substrings Containing All Three Characters")
-
-[Next >](../number-of-days-between-two-dates "Number of Days Between Two Dates")
-
-## [1359. Count All Valid Pickup and Delivery Options (Hard)](https://leetcode.com/problems/count-all-valid-pickup-and-delivery-options "有效的快递序列数目")
-
-
Given n orders, each order consist in pickup and delivery services.
-
-
Count all valid pickup/delivery possible sequences such that delivery(i) is always after of pickup(i).
-
-
Since the answer may be too large, return it modulo 10^9 + 7.
-
-
-
Example 1:
-
-
-Input: n = 1
-Output: 1
-Explanation: Unique order (P1, D1), Delivery 1 always is after of Pickup 1.
-
-
-
Example 2:
-
-
-Input: n = 2
-Output: 6
-Explanation: All possible orders:
-(P1,P2,D1,D2), (P1,P2,D2,D1), (P1,D1,P2,D2), (P2,P1,D1,D2), (P2,P1,D2,D1) and (P2,D2,P1,D1).
-This is an invalid order (P1,D2,P2,D1) because Pickup 2 is after of Delivery 2.
-
-
-
Example 3:
-
-
-Input: n = 3
-Output: 90
-
-
-
-
Constraints:
-
-
-
1 <= n <= 500
-
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Combinatorics](../../tag/combinatorics/README.md)]
-
-### Hints
-
-Hint 1
-Use the permutation and combination theory to add one (P, D) pair each time until n pairs.
-
diff --git a/problems/count-and-say/README.md b/problems/count-and-say/README.md
deleted file mode 100644
index 4ed8226bb..000000000
--- a/problems/count-and-say/README.md
+++ /dev/null
@@ -1,83 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../sudoku-solver "Sudoku Solver")
-
-[Next >](../combination-sum "Combination Sum")
-
-## [38. Count and Say (Medium)](https://leetcode.com/problems/count-and-say "外观数列")
-
-
The count-and-say sequence is a sequence of digit strings defined by the recursive formula:
-
-
-
countAndSay(1) = "1"
-
countAndSay(n) is the way you would "say" the digit string from countAndSay(n-1), which is then converted into a different digit string.
-
-
-
To determine how you "say" a digit string, split it into the minimal number of groups so that each group is a contiguous section all of the same character. Then for each group, say the number of characters, then say the character. To convert the saying into a digit string, replace the counts with a number and concatenate every saying.
-
-
For example, the saying and conversion for digit string "3322251":
-
-
Given a positive integer n, return the nth term of the count-and-say sequence.
-
-
-
Example 1:
-
-
-Input: n = 1
-Output: "1"
-Explanation: This is the base case.
-
-
-
Example 2:
-
-
-Input: n = 4
-Output: "1211"
-Explanation:
-countAndSay(1) = "1"
-countAndSay(2) = say "1" = one 1 = "11"
-countAndSay(3) = say "11" = two 1's = "21"
-countAndSay(4) = say "21" = one 2 + one 1 = "12" + "11" = "1211"
-
-
-
-
Constraints:
-
-
-
1 <= n <= 30
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
-
-### Similar Questions
- 1. [Encode and Decode Strings](../encode-and-decode-strings) (Medium)
- 1. [String Compression](../string-compression) (Medium)
-
-### Hints
-
-Hint 1
-The following are the terms from n=1 to n=10 of the count-and-say sequence:
-
-
-
-
-Hint 2
-To generate the nth term, just count and say the n-1th term.
-
diff --git a/problems/count-and-say/count_and_say.go b/problems/count-and-say/count_and_say.go
deleted file mode 100644
index 55104effb..000000000
--- a/problems/count-and-say/count_and_say.go
+++ /dev/null
@@ -1,33 +0,0 @@
-package problem38
-
-func countAndSay(n int) string {
- r := "1"
- for i := 1; i < n; i++ {
- r = say(r)
- }
- return r
-}
-
-func say(s string) string {
- r := ""
- var sv rune
- var sc byte
- for i, v := range s {
- if i == 0 {
- sv = v
- sc = '1'
- } else {
- if v == rune(s[i-1]) {
- sc++
- } else {
- r += string(sc) + string(sv)
- sv = v
- sc = '1'
- }
- }
- }
- if sc > '0' {
- r += string(sc) + string(sv)
- }
- return r
-}
diff --git a/problems/count-and-say/count_and_say_test.go b/problems/count-and-say/count_and_say_test.go
deleted file mode 100644
index 95704ed75..000000000
--- a/problems/count-and-say/count_and_say_test.go
+++ /dev/null
@@ -1,20 +0,0 @@
-package problem38
-
-import "testing"
-
-func TestCountAndSay(t *testing.T) {
- tests := map[int]string{
- 1: "1",
- 3: "21",
- 5: "111221",
- 7: "13112221",
- 9: "31131211131221",
- }
-
- for in, want := range tests {
- got := countAndSay(in)
- if got != want {
- t.Fatalf("in: %v, got: %v, want: %v", in, got, want)
- }
- }
-}
diff --git a/problems/count-apples-and-oranges/README.md b/problems/count-apples-and-oranges/README.md
deleted file mode 100644
index beb6557bc..000000000
--- a/problems/count-apples-and-oranges/README.md
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../sum-of-special-evenly-spaced-elements-in-array "Sum Of Special Evenly-Spaced Elements In Array")
-
-[Next >](../calculate-money-in-leetcode-bank "Calculate Money in Leetcode Bank")
-
-## [1715. Count Apples and Oranges (Medium)](https://leetcode.com/problems/count-apples-and-oranges "苹果和橘子的个数")
-
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/count-apples-and-oranges/mysql_schemas.sql b/problems/count-apples-and-oranges/mysql_schemas.sql
deleted file mode 100644
index 89d31e15c..000000000
--- a/problems/count-apples-and-oranges/mysql_schemas.sql
+++ /dev/null
@@ -1,16 +0,0 @@
-Create table If Not Exists Boxes (box_id int, chest_id int, apple_count int, orange_count int);
-Create table If Not Exists Chests (chest_id int, apple_count int, orange_count int);
-Truncate table Boxes;
-insert into Boxes (box_id, chest_id, apple_count, orange_count) values ('2', 'None', '6', '15');
-insert into Boxes (box_id, chest_id, apple_count, orange_count) values ('18', '14', '4', '15');
-insert into Boxes (box_id, chest_id, apple_count, orange_count) values ('19', '3', '8', '4');
-insert into Boxes (box_id, chest_id, apple_count, orange_count) values ('12', '2', '19', '20');
-insert into Boxes (box_id, chest_id, apple_count, orange_count) values ('20', '6', '12', '9');
-insert into Boxes (box_id, chest_id, apple_count, orange_count) values ('8', '6', '9', '9');
-insert into Boxes (box_id, chest_id, apple_count, orange_count) values ('3', '14', '16', '7');
-Truncate table Chests;
-insert into Chests (chest_id, apple_count, orange_count) values ('6', '5', '6');
-insert into Chests (chest_id, apple_count, orange_count) values ('14', '20', '10');
-insert into Chests (chest_id, apple_count, orange_count) values ('2', '8', '8');
-insert into Chests (chest_id, apple_count, orange_count) values ('3', '19', '4');
-insert into Chests (chest_id, apple_count, orange_count) values ('16', '19', '19');
diff --git a/problems/count-binary-substrings/README.md b/problems/count-binary-substrings/README.md
deleted file mode 100644
index de93a8d21..000000000
--- a/problems/count-binary-substrings/README.md
+++ /dev/null
@@ -1,56 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../max-area-of-island "Max Area of Island")
-
-[Next >](../degree-of-an-array "Degree of an Array")
-
-## [696. Count Binary Substrings (Easy)](https://leetcode.com/problems/count-binary-substrings "计数二进制子串")
-
-
Give a binary string s, return the number of non-empty substrings that have the same number of 0's and 1's, and all the 0's and all the 1's in these substrings are grouped consecutively.
-
-
Substrings that occur multiple times are counted the number of times they occur.
-
-
-
Example 1:
-
-
-Input: s = "00110011"
-Output: 6
-Explanation: There are 6 substrings that have equal number of consecutive 1's and 0's: "0011", "01", "1100", "10", "0011", and "01".
-Notice that some of these substrings repeat and are counted the number of times they occur.
-Also, "00110011" is not a valid substring because all the 0's (and 1's) are not grouped together.
-
-
-
Example 2:
-
-
-Input: s = "10101"
-Output: 4
-Explanation: There are 4 substrings: "10", "01", "10", "01" that have equal number of consecutive 1's and 0's.
-
-
-
-
Constraints:
-
-
-
1 <= s.length <= 105
-
s[i] is either '0' or '1'.
-
-
-### Related Topics
- [[Two Pointers](../../tag/two-pointers/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Similar Questions
- 1. [Encode and Decode Strings](../encode-and-decode-strings) (Medium)
-
-### Hints
-
-Hint 1
-How many valid binary substrings exist in "000111", and how many in "11100"? What about "00011100"?
-
diff --git a/problems/count-binary-substrings/count_binary_substrings.go b/problems/count-binary-substrings/count_binary_substrings.go
deleted file mode 100644
index 33be90891..000000000
--- a/problems/count-binary-substrings/count_binary_substrings.go
+++ /dev/null
@@ -1,22 +0,0 @@
-package problem696
-
-func countBinarySubstrings(s string) int {
- ans, pre, cur, l := 0, 0, 1, len(s)
- for i := 1; i < l; i++ {
- if s[i] != s[i-1] {
- ans += min(pre, cur)
- pre = cur
- cur = 1
- } else {
- cur++
- }
- }
- return ans + min(pre, cur)
-}
-
-func min(x, y int) int {
- if x < y {
- return x
- }
- return y
-}
diff --git a/problems/count-binary-substrings/count_binary_substrings_test.go b/problems/count-binary-substrings/count_binary_substrings_test.go
deleted file mode 100644
index 606c5a873..000000000
--- a/problems/count-binary-substrings/count_binary_substrings_test.go
+++ /dev/null
@@ -1,27 +0,0 @@
-package problem696
-
-import "testing"
-
-type testType struct {
- in string
- want int
-}
-
-func TestCountBinarySubstrings(t *testing.T) {
- tests := [...]testType{
- {
- in: "00110011",
- want: 6,
- },
- {
- in: "10101",
- want: 4,
- },
- }
- for _, tt := range tests {
- got := countBinarySubstrings(tt.in)
- if got != tt.want {
- t.Fatalf("in: %v, got: %v, want: %v", tt.in, got, tt.want)
- }
- }
-}
diff --git a/problems/count-common-words-with-one-occurrence/README.md b/problems/count-common-words-with-one-occurrence/README.md
deleted file mode 100644
index 776b6f8bc..000000000
--- a/problems/count-common-words-with-one-occurrence/README.md
+++ /dev/null
@@ -1,70 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../drop-type-1-orders-for-customers-with-type-0-orders "Drop Type 1 Orders for Customers With Type 0 Orders")
-
-[Next >](../minimum-number-of-buckets-required-to-collect-rainwater-from-houses "Minimum Number of Buckets Required to Collect Rainwater from Houses")
-
-## [2085. Count Common Words With One Occurrence (Easy)](https://leetcode.com/problems/count-common-words-with-one-occurrence "统计出现过一次的公共字符串")
-
-
Given two string arrays words1 and words2, return the number of strings that appear exactly once in each of the two arrays.
-
-
-
Example 1:
-
-
-Input: words1 = ["leetcode","is","amazing","as","is"], words2 = ["amazing","leetcode","is"]
-Output: 2
-Explanation:
-- "leetcode" appears exactly once in each of the two arrays. We count this string.
-- "amazing" appears exactly once in each of the two arrays. We count this string.
-- "is" appears in each of the two arrays, but there are 2 occurrences of it in words1. We do not count this string.
-- "as" appears once in words1, but does not appear in words2. We do not count this string.
-Thus, there are 2 strings that appear exactly once in each of the two arrays.
-
-
-
Example 2:
-
-
-Input: words1 = ["b","bb","bbb"], words2 = ["a","aa","aaa"]
-Output: 0
-Explanation: There are no strings that appear in each of the two arrays.
-
-
-
Example 3:
-
-
-Input: words1 = ["a","ab"], words2 = ["a","a","a","ab"]
-Output: 1
-Explanation: The only string that appears exactly once in each of the two arrays is "ab".
-
-
-
-
Constraints:
-
-
-
1 <= words1.length, words2.length <= 1000
-
1 <= words1[i].length, words2[j].length <= 30
-
words1[i] and words2[j] consists only of lowercase English letters.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
- [[Counting](../../tag/counting/README.md)]
-
-### Hints
-
-Hint 1
-Could you try every word?
-
-
-
-Hint 2
-Could you use a hash map to achieve a good complexity?
-
diff --git a/problems/count-complete-tree-nodes/README.md b/problems/count-complete-tree-nodes/README.md
deleted file mode 100644
index 3770c14e4..000000000
--- a/problems/count-complete-tree-nodes/README.md
+++ /dev/null
@@ -1,58 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximal-square "Maximal Square")
-
-[Next >](../rectangle-area "Rectangle Area")
-
-## [222. Count Complete Tree Nodes (Medium)](https://leetcode.com/problems/count-complete-tree-nodes "完全二叉树的节点个数")
-
-
Given the root of a complete binary tree, return the number of the nodes in the tree.
-
-
According to Wikipedia, every level, except possibly the last, is completely filled in a complete binary tree, and all nodes in the last level are as far left as possible. It can have between 1 and 2h nodes inclusive at the last level h.
-
-
Design an algorithm that runs in less than O(n) time complexity.
-
-
-
Example 1:
-
-
-Input: root = [1,2,3,4,5,6]
-Output: 6
-
-
-
Example 2:
-
-
-Input: root = []
-Output: 0
-
-
-
Example 3:
-
-
-Input: root = [1]
-Output: 1
-
-
-
-
Constraints:
-
-
-
The number of nodes in the tree is in the range [0, 5 * 104].
Given a string s, return the number of different non-empty palindromic subsequences ins. Since the answer may be very large, return it modulo109 + 7.
-
-
A subsequence of a string is obtained by deleting zero or more characters from the string.
-
-
A sequence is palindromic if it is equal to the sequence reversed.
-
-
Two sequences a1, a2, ... and b1, b2, ... are different if there is some i for which ai != bi.
-
-
-
Example 1:
-
-
-Input: s = "bccb"
-Output: 6
-Explanation: The 6 different non-empty palindromic subsequences are 'b', 'c', 'bb', 'cc', 'bcb', 'bccb'.
-Note that 'bcb' is counted only once, even though it occurs twice.
-
-
-
Example 2:
-
-
-Input: s = "abcdabcdabcdabcdabcdabcdabcdabcddcbadcbadcbadcbadcbadcbadcbadcba"
-Output: 104860361
-Explanation: There are 3104860382 different non-empty palindromic subsequences, which is 104860361 modulo 109 + 7.
-
-
-
-
Constraints:
-
-
-
1 <= s.length <= 1000
-
s[i] is either 'a', 'b', 'c', or 'd'.
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Similar Questions
- 1. [Longest Palindromic Subsequence](../longest-palindromic-subsequence) (Medium)
-
-### Hints
-
-Hint 1
-Let dp(i, j) be the answer for the string T = S[i:j+1] including the empty sequence. The answer is the number of unique characters in T, plus palindromes of the form "a_a", "b_b", "c_c", and "d_d", where "_" represents zero or more characters.
-
diff --git a/problems/count-different-palindromic-subsequences/count_different_palindromic_subsequences.go b/problems/count-different-palindromic-subsequences/count_different_palindromic_subsequences.go
deleted file mode 100644
index 1ef294407..000000000
--- a/problems/count-different-palindromic-subsequences/count_different_palindromic_subsequences.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem730
diff --git a/problems/count-different-palindromic-subsequences/count_different_palindromic_subsequences_test.go b/problems/count-different-palindromic-subsequences/count_different_palindromic_subsequences_test.go
deleted file mode 100644
index 1ef294407..000000000
--- a/problems/count-different-palindromic-subsequences/count_different_palindromic_subsequences_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem730
diff --git a/problems/count-elements-with-strictly-smaller-and-greater-elements/README.md b/problems/count-elements-with-strictly-smaller-and-greater-elements/README.md
deleted file mode 100644
index 199267f0b..000000000
--- a/problems/count-elements-with-strictly-smaller-and-greater-elements/README.md
+++ /dev/null
@@ -1,62 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../number-of-ways-to-divide-a-long-corridor "Number of Ways to Divide a Long Corridor")
-
-[Next >](../rearrange-array-elements-by-sign "Rearrange Array Elements by Sign")
-
-## [2148. Count Elements With Strictly Smaller and Greater Elements (Easy)](https://leetcode.com/problems/count-elements-with-strictly-smaller-and-greater-elements "元素计数")
-
-
Given an integer array nums, return the number of elements that have both a strictly smaller and a strictly greater element appear in nums.
-
-
-
Example 1:
-
-
-Input: nums = [11,7,2,15]
-Output: 2
-Explanation: The element 7 has the element 2 strictly smaller than it and the element 11 strictly greater than it.
-Element 11 has element 7 strictly smaller than it and element 15 strictly greater than it.
-In total there are 2 elements having both a strictly smaller and a strictly greater element appear in nums.
-
-
-
Example 2:
-
-
-Input: nums = [-3,3,3,90]
-Output: 2
-Explanation: The element 3 has the element -3 strictly smaller than it and the element 90 strictly greater than it.
-Since there are two elements with the value 3, in total there are 2 elements having both a strictly smaller and a strictly greater element appear in nums.
-
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 100
-
-105 <= nums[i] <= 105
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Hints
-
-Hint 1
-All the elements in the array should be counted except for the minimum and maximum elements.
-
-
-
-Hint 2
-If the array has n elements, the answer will be n - count(min(nums)) - count(max(nums))
-
-
-
-Hint 3
-This formula will not work in case the array has all the elements equal, why?
-
diff --git a/problems/count-fertile-pyramids-in-a-land/README.md b/problems/count-fertile-pyramids-in-a-land/README.md
deleted file mode 100644
index 9e438e6a1..000000000
--- a/problems/count-fertile-pyramids-in-a-land/README.md
+++ /dev/null
@@ -1,99 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-cost-homecoming-of-a-robot-in-a-grid "Minimum Cost Homecoming of a Robot in a Grid")
-
-[Next >](../find-target-indices-after-sorting-array "Find Target Indices After Sorting Array")
-
-## [2088. Count Fertile Pyramids in a Land (Hard)](https://leetcode.com/problems/count-fertile-pyramids-in-a-land "统计农场中肥沃金字塔的数目")
-
-
A farmer has a rectangular grid of land with m rows and n columns that can be divided into unit cells. Each cell is either fertile (represented by a 1) or barren (represented by a 0). All cells outside the grid are considered barren.
-
-
A pyramidal plot of land can be defined as a set of cells with the following criteria:
-
-
-
The number of cells in the set has to be greater than 1 and all cells must be fertile.
-
The apex of a pyramid is the topmost cell of the pyramid. The height of a pyramid is the number of rows it covers. Let (r, c) be the apex of the pyramid, and its height be h. Then, the plot comprises of cells (i, j) where r <= i <= r + h - 1andc - (i - r) <= j <= c + (i - r).
-
-
-
An inverse pyramidal plot of land can be defined as a set of cells with similar criteria:
-
-
-
The number of cells in the set has to be greater than 1 and all cells must be fertile.
-
The apex of an inverse pyramid is the bottommost cell of the inverse pyramid. The height of an inverse pyramid is the number of rows it covers. Let (r, c) be the apex of the pyramid, and its height be h. Then, the plot comprises of cells (i, j) where r - h + 1 <= i <= randc - (r - i) <= j <= c + (r - i).
-
-
-
Some examples of valid and invalid pyramidal (and inverse pyramidal) plots are shown below. Black cells indicate fertile cells.
-
-
Given a 0-indexedm x n binary matrix grid representing the farmland, return the total number of pyramidal and inverse pyramidal plots that can be found ingrid.
-
-
-
Example 1:
-
-
-Input: grid = [[0,1,1,0],[1,1,1,1]]
-Output: 2
-Explanation: The 2 possible pyramidal plots are shown in blue and red respectively.
-There are no inverse pyramidal plots in this grid.
-Hence total number of pyramidal and inverse pyramidal plots is 2 + 0 = 2.
-
-
-
Example 2:
-
-
-Input: grid = [[1,1,1],[1,1,1]]
-Output: 2
-Explanation: The pyramidal plot is shown in blue, and the inverse pyramidal plot is shown in red.
-Hence the total number of plots is 1 + 1 = 2.
-
-
-
Example 3:
-
-
-Input: grid = [[1,1,1,1,0],[1,1,1,1,1],[1,1,1,1,1],[0,1,0,0,1]]
-Output: 13
-Explanation: There are 7 pyramidal plots, 3 of which are shown in the 2nd and 3rd figures.
-There are 6 inverse pyramidal plots, 2 of which are shown in the last figure.
-The total number of plots is 7 + 6 = 13.
-
-
-
-
Constraints:
-
-
-
m == grid.length
-
n == grid[i].length
-
1 <= m, n <= 1000
-
1 <= m * n <= 105
-
grid[i][j] is either 0 or 1.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
-
-### Hints
-
-Hint 1
-Think about how dynamic programming can help solve the problem.
-
-
-
-Hint 2
-For any fixed cell (r, c), can you calculate the maximum height of the pyramid for which it is the apex? Let us denote this value as dp[r][c].
-
-
-
-Hint 3
-How will the values at dp[r+1][c-1] and dp[r+1][c+1] help in determining the value at dp[r][c]?
-
-
-
-Hint 4
-For the cell (r, c), is there a relation between the number of pyramids for which it serves as the apex and dp[r][c]? How does it help in calculating the answer?
-
diff --git a/problems/count-good-meals/README.md b/problems/count-good-meals/README.md
deleted file mode 100644
index 472223138..000000000
--- a/problems/count-good-meals/README.md
+++ /dev/null
@@ -1,65 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-units-on-a-truck "Maximum Units on a Truck")
-
-[Next >](../ways-to-split-array-into-three-subarrays "Ways to Split Array Into Three Subarrays")
-
-## [1711. Count Good Meals (Medium)](https://leetcode.com/problems/count-good-meals "大餐计数")
-
-
A good meal is a meal that contains exactly two different food items with a sum of deliciousness equal to a power of two.
-
-
You can pick any two different foods to make a good meal.
-
-
Given an array of integers deliciousness where deliciousness[i] is the deliciousness of the ith item of food, return the number of different good meals you can make from this list modulo109 + 7.
-
-
Note that items with different indices are considered different even if they have the same deliciousness value.
-
-
-
Example 1:
-
-
-Input: deliciousness = [1,3,5,7,9]
-Output: 4
-Explanation: The good meals are (1,3), (1,7), (3,5) and, (7,9).
-Their respective sums are 4, 8, 8, and 16, all of which are powers of 2.
-
-
-
Example 2:
-
-
-Input: deliciousness = [1,1,1,3,3,3,7]
-Output: 15
-Explanation: The good meals are (1,1) with 3 ways, (1,3) with 9 ways, and (1,7) with 3 ways.
-
-
-
Constraints:
-
-
-
1 <= deliciousness.length <= 105
-
0 <= deliciousness[i] <= 220
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
-
-### Similar Questions
- 1. [Two Sum](../two-sum) (Easy)
- 1. [Max Number of K-Sum Pairs](../max-number-of-k-sum-pairs) (Medium)
- 1. [Find All Possible Recipes from Given Supplies](../find-all-possible-recipes-from-given-supplies) (Medium)
-
-### Hints
-
-Hint 1
-Note that the number of powers of 2 is at most 21 so this turns the problem to a classic find the number of pairs that sum to a certain value but for 21 values
-
-
-
-Hint 2
-You need to use something fasters than the NlogN approach since there is already the log of iterating over the powers so one idea is two pointers
-
diff --git a/problems/count-good-nodes-in-binary-tree/README.md b/problems/count-good-nodes-in-binary-tree/README.md
deleted file mode 100644
index 4a8baa459..000000000
--- a/problems/count-good-nodes-in-binary-tree/README.md
+++ /dev/null
@@ -1,66 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../simplified-fractions "Simplified Fractions")
-
-[Next >](../form-largest-integer-with-digits-that-add-up-to-target "Form Largest Integer With Digits That Add up to Target")
-
-## [1448. Count Good Nodes in Binary Tree (Medium)](https://leetcode.com/problems/count-good-nodes-in-binary-tree "统计二叉树中好节点的数目")
-
-
Given a binary tree root, a node X in the tree is named good if in the path from root to X there are no nodes with a value greater than X.
-
-
Return the number of good nodes in the binary tree.
-
-
-
Example 1:
-
-
-
-
-Input: root = [3,1,4,3,null,1,5]
-Output: 4
-Explanation: Nodes in blue are good.
-Root Node (3) is always a good node.
-Node 4 -> (3,4) is the maximum value in the path starting from the root.
-Node 5 -> (3,4,5) is the maximum value in the path
-Node 3 -> (3,1,3) is the maximum value in the path.
-
-
Example 2:
-
-
-
-
-Input: root = [3,3,null,4,2]
-Output: 3
-Explanation: Node 2 -> (3, 3, 2) is not good, because "3" is higher than it.
-
-
Example 3:
-
-
-Input: root = [1]
-Output: 1
-Explanation: Root is considered as good.
-
-
-
Constraints:
-
-
-
The number of nodes in the binary tree is in the range [1, 10^5].
-
Each node's value is between [-10^4, 10^4].
-
-
-### Related Topics
- [[Tree](../../tag/tree/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Binary Tree](../../tag/binary-tree/README.md)]
-
-### Hints
-
-Hint 1
-Use DFS (Depth First Search) to traverse the tree, and constantly keep track of the current path maximum.
-
diff --git a/problems/count-good-numbers/README.md b/problems/count-good-numbers/README.md
deleted file mode 100644
index ab7e822a8..000000000
--- a/problems/count-good-numbers/README.md
+++ /dev/null
@@ -1,67 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../eliminate-maximum-number-of-monsters "Eliminate Maximum Number of Monsters")
-
-[Next >](../longest-common-subpath "Longest Common Subpath")
-
-## [1922. Count Good Numbers (Medium)](https://leetcode.com/problems/count-good-numbers "统计好数字的数目")
-
-
A digit string is good if the digits (0-indexed) at even indices are even and the digits at odd indices are prime (2, 3, 5, or 7).
-
-
-
For example, "2582" is good because the digits (2 and 8) at even positions are even and the digits (5 and 2) at odd positions are prime. However, "3245" is not good because 3 is at an even index but is not even.
-
-
-
Given an integer n, return the total number of good digit strings of length n. Since the answer may be large, return it modulo 109 + 7.
-
-
A digit string is a string consisting of digits 0 through 9 that may contain leading zeros.
-
-
-
Example 1:
-
-
-Input: n = 1
-Output: 5
-Explanation: The good numbers of length 1 are "0", "2", "4", "6", "8".
-
-
-
Example 2:
-
-
-Input: n = 4
-Output: 400
-
-
-
Example 3:
-
-
-Input: n = 50
-Output: 564908303
-
-
-
-
Constraints:
-
-
-
1 <= n <= 1015
-
-
-### Related Topics
- [[Recursion](../../tag/recursion/README.md)]
- [[Math](../../tag/math/README.md)]
-
-### Hints
-
-Hint 1
-Is there a formula we can use to find the count of all the good numbers?
-
-
-
-Hint 2
-Exponentiation can be done very fast if we looked at the binary bits of n.
-
diff --git a/problems/count-good-triplets/README.md b/problems/count-good-triplets/README.md
deleted file mode 100644
index 10a302420..000000000
--- a/problems/count-good-triplets/README.md
+++ /dev/null
@@ -1,68 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../find-the-index-of-the-large-integer "Find the Index of the Large Integer")
-
-[Next >](../find-the-winner-of-an-array-game "Find the Winner of an Array Game")
-
-## [1534. Count Good Triplets (Easy)](https://leetcode.com/problems/count-good-triplets "统计好三元组")
-
-
Given an array of integers arr, and three integers a, b and c. You need to find the number of good triplets.
-
-
A triplet (arr[i], arr[j], arr[k]) is good if the following conditions are true:
-
-
-
0 <= i < j < k < arr.length
-
|arr[i] - arr[j]| <= a
-
|arr[j] - arr[k]| <= b
-
|arr[i] - arr[k]| <= c
-
-
-
Where |x| denotes the absolute value of x.
-
-
Return the number of good triplets.
-
-
-
Example 1:
-
-
-Input: arr = [3,0,1,1,9,7], a = 7, b = 2, c = 3
-Output: 4
-Explanation: There are 4 good triplets: [(3,0,1), (3,0,1), (3,1,1), (0,1,1)].
-
-
-
Example 2:
-
-
-Input: arr = [1,1,2,2,3], a = 0, b = 0, c = 1
-Output: 0
-Explanation: No triplet satisfies all conditions.
-
-
-
-
Constraints:
-
-
-
3 <= arr.length <= 100
-
0 <= arr[i] <= 1000
-
0 <= a, b, c <= 1000
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Enumeration](../../tag/enumeration/README.md)]
-
-### Hints
-
-Hint 1
-Notice that the constraints are small enough for a brute force solution to pass.
-
-
-
-Hint 2
-Loop through all triplets, and count the ones that are good.
-
diff --git a/problems/count-items-matching-a-rule/README.md b/problems/count-items-matching-a-rule/README.md
deleted file mode 100644
index 0da1a676a..000000000
--- a/problems/count-items-matching-a-rule/README.md
+++ /dev/null
@@ -1,60 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../sort-features-by-popularity "Sort Features by Popularity")
-
-[Next >](../closest-dessert-cost "Closest Dessert Cost")
-
-## [1773. Count Items Matching a Rule (Easy)](https://leetcode.com/problems/count-items-matching-a-rule "统计匹配检索规则的物品数量")
-
-
You are given an array items, where each items[i] = [typei, colori, namei] describes the type, color, and name of the ith item. You are also given a rule represented by two strings, ruleKey and ruleValue.
-
-
The ith item is said to match the rule if one of the following is true:
-
-
-
ruleKey == "type" and ruleValue == typei.
-
ruleKey == "color" and ruleValue == colori.
-
ruleKey == "name" and ruleValue == namei.
-
-
-
Return the number of items that match the given rule.
-
-
-
Example 1:
-
-
-Input: items = [["phone","blue","pixel"],["computer","silver","lenovo"],["phone","gold","iphone"]], ruleKey = "color", ruleValue = "silver"
-Output: 1
-Explanation: There is only one item matching the given rule, which is ["computer","silver","lenovo"].
-
-
-
Example 2:
-
-
-Input: items = [["phone","blue","pixel"],["computer","silver","phone"],["phone","gold","iphone"]], ruleKey = "type", ruleValue = "phone"
-Output: 2
-Explanation: There are only two items matching the given rule, which are ["phone","blue","pixel"] and ["phone","gold","iphone"]. Note that the item ["computer","silver","phone"] does not match.
ruleKey is equal to either "type", "color", or "name".
-
All strings consist only of lowercase letters.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Hints
-
-Hint 1
-Iterate on each item, and check if each one matches the rule according to the statement.
-
diff --git a/problems/count-largest-group/README.md b/problems/count-largest-group/README.md
deleted file mode 100644
index 38160b260..000000000
--- a/problems/count-largest-group/README.md
+++ /dev/null
@@ -1,54 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../customers-who-bought-products-a-and-b-but-not-c "Customers Who Bought Products A and B but Not C")
-
-[Next >](../construct-k-palindrome-strings "Construct K Palindrome Strings")
-
-## [1399. Count Largest Group (Easy)](https://leetcode.com/problems/count-largest-group "统计最大组的数目")
-
-
You are given an integer n.
-
-
Each number from 1 to n is grouped according to the sum of its digits.
-
-
Return the number of groups that have the largest size.
-
-
-
Example 1:
-
-
-Input: n = 13
-Output: 4
-Explanation: There are 9 groups in total, they are grouped according sum of its digits of numbers from 1 to 13:
-[1,10], [2,11], [3,12], [4,13], [5], [6], [7], [8], [9].
-There are 4 groups with largest size.
-
-
-
Example 2:
-
-
-Input: n = 2
-Output: 2
-Explanation: There are 2 groups [1], [2] of size 1.
-
-
-
-
Constraints:
-
-
-
1 <= n <= 104
-
-
-### Related Topics
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Math](../../tag/math/README.md)]
-
-### Hints
-
-Hint 1
-Count the digit sum for each integer in the range and find out the largest groups.
-
diff --git a/problems/count-largest-group/count_largest_group.go b/problems/count-largest-group/count_largest_group.go
deleted file mode 100644
index ae012a3f8..000000000
--- a/problems/count-largest-group/count_largest_group.go
+++ /dev/null
@@ -1,21 +0,0 @@
-package problem1399
-
-func countLargestGroup(n int) int {
- group := make(map[int]int)
- for i := 1; i <= n; i++ {
- s := 0
- for x := i; x > 0; x /= 10 {
- s += x % 10
- }
- group[s]++
- }
- ans, max := 0, 0
- for _, v := range group {
- if v == max {
- ans++
- } else if v > max {
- ans, max = 1, v
- }
- }
- return ans
-}
diff --git a/problems/count-largest-group/count_largest_group_test.go b/problems/count-largest-group/count_largest_group_test.go
deleted file mode 100644
index 56bb1705c..000000000
--- a/problems/count-largest-group/count_largest_group_test.go
+++ /dev/null
@@ -1,35 +0,0 @@
-package problem1399
-
-import "testing"
-
-type testType struct {
- in int
- want int
-}
-
-func TestCountLargestGroup(t *testing.T) {
- tests := [...]testType{
- {
- in: 13,
- want: 4,
- },
- {
- in: 2,
- want: 2,
- },
- {
- in: 15,
- want: 6,
- },
- {
- in: 24,
- want: 5,
- },
- }
- for _, tt := range tests {
- got := countLargestGroup(tt.in)
- if got != tt.want {
- t.Fatalf("in: %v, got: %v, want: %v", tt.in, got, tt.want)
- }
- }
-}
diff --git a/problems/count-negative-numbers-in-a-sorted-matrix/README.md b/problems/count-negative-numbers-in-a-sorted-matrix/README.md
deleted file mode 100644
index 7bfda52f4..000000000
--- a/problems/count-negative-numbers-in-a-sorted-matrix/README.md
+++ /dev/null
@@ -1,54 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../students-with-invalid-departments "Students With Invalid Departments")
-
-[Next >](../product-of-the-last-k-numbers "Product of the Last K Numbers")
-
-## [1351. Count Negative Numbers in a Sorted Matrix (Easy)](https://leetcode.com/problems/count-negative-numbers-in-a-sorted-matrix "统计有序矩阵中的负数")
-
-
Given a m x n matrix grid which is sorted in non-increasing order both row-wise and column-wise, return the number of negative numbers ingrid.
-
-
-
Example 1:
-
-
-Input: grid = [[4,3,2,-1],[3,2,1,-1],[1,1,-1,-2],[-1,-1,-2,-3]]
-Output: 8
-Explanation: There are 8 negatives number in the matrix.
-
-
-
Example 2:
-
-
-Input: grid = [[3,2],[1,0]]
-Output: 0
-
-
-
-
Constraints:
-
-
-
m == grid.length
-
n == grid[i].length
-
1 <= m, n <= 100
-
-100 <= grid[i][j] <= 100
-
-
-
-Follow up: Could you find an O(n + m) solution?
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
-
-### Hints
-
-Hint 1
-Use binary search for optimization or simply brute force.
-
diff --git a/problems/count-nice-pairs-in-an-array/README.md b/problems/count-nice-pairs-in-an-array/README.md
deleted file mode 100644
index 5cc54e815..000000000
--- a/problems/count-nice-pairs-in-an-array/README.md
+++ /dev/null
@@ -1,72 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../sentence-similarity-iii "Sentence Similarity III")
-
-[Next >](../maximum-number-of-groups-getting-fresh-donuts "Maximum Number of Groups Getting Fresh Donuts")
-
-## [1814. Count Nice Pairs in an Array (Medium)](https://leetcode.com/problems/count-nice-pairs-in-an-array "统计一个数组中好对子的数目")
-
-
You are given an array nums that consists of non-negative integers. Let us define rev(x) as the reverse of the non-negative integer x. For example, rev(123) = 321, and rev(120) = 21. A pair of indices (i, j) is nice if it satisfies all of the following conditions:
-
-
-
0 <= i < j < nums.length
-
nums[i] + rev(nums[j]) == nums[j] + rev(nums[i])
-
-
-
Return the number of nice pairs of indices. Since that number can be too large, return it modulo109 + 7.
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Math](../../tag/math/README.md)]
- [[Counting](../../tag/counting/README.md)]
-
-### Similar Questions
- 1. [Number of Pairs of Interchangeable Rectangles](../number-of-pairs-of-interchangeable-rectangles) (Medium)
-
-### Hints
-
-Hint 1
-The condition can be rearranged to (nums[i] - rev(nums[i])) == (nums[j] - rev(nums[j])).
-
-
-
-Hint 2
-Transform each nums[i] into (nums[i] - rev(nums[i])). Then, count the number of (i, j) pairs that have equal values.
-
-
-
-Hint 3
-Keep a map storing the frequencies of values that you have seen so far. For each i, check if nums[i] is in the map. If it is, then add that count to the overall count. Then, increment the frequency of nums[i].
-
diff --git a/problems/count-nodes-equal-to-sum-of-descendants/README.md b/problems/count-nodes-equal-to-sum-of-descendants/README.md
deleted file mode 100644
index 3008e7d1d..000000000
--- a/problems/count-nodes-equal-to-sum-of-descendants/README.md
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../first-and-last-call-on-the-same-day "First and Last Call On the Same Day")
-
-[Next >](../minimum-time-to-type-word-using-special-typewriter "Minimum Time to Type Word Using Special Typewriter")
-
-## [1973. Count Nodes Equal to Sum of Descendants (Medium)](https://leetcode.com/problems/count-nodes-equal-to-sum-of-descendants "值等于子节点值之和的节点数量")
-
-
-
-### Hints
-
-Hint 1
-Can we reuse previously calculated information?
-
-
-
-Hint 2
-How can we calculate the sum of the current subtree using the sum of the child's subtree?
-
diff --git a/problems/count-nodes-with-the-highest-score/README.md b/problems/count-nodes-with-the-highest-score/README.md
deleted file mode 100644
index 1bab0218c..000000000
--- a/problems/count-nodes-with-the-highest-score/README.md
+++ /dev/null
@@ -1,78 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../next-greater-numerically-balanced-number "Next Greater Numerically Balanced Number")
-
-[Next >](../parallel-courses-iii "Parallel Courses III")
-
-## [2049. Count Nodes With the Highest Score (Medium)](https://leetcode.com/problems/count-nodes-with-the-highest-score "统计最高分的节点数目")
-
-
There is a binary tree rooted at 0 consisting of n nodes. The nodes are labeled from 0 to n - 1. You are given a 0-indexed integer array parents representing the tree, where parents[i] is the parent of node i. Since node 0 is the root, parents[0] == -1.
-
-
Each node has a score. To find the score of a node, consider if the node and the edges connected to it were removed. The tree would become one or more non-empty subtrees. The size of a subtree is the number of the nodes in it. The score of the node is the product of the sizes of all those subtrees.
-
-
Return the number of nodes that have the highest score.
-
-
-
Example 1:
-
-
-Input: parents = [-1,2,0,2,0]
-Output: 3
-Explanation:
-- The score of node 0 is: 3 * 1 = 3
-- The score of node 1 is: 4 = 4
-- The score of node 2 is: 1 * 1 * 2 = 2
-- The score of node 3 is: 4 = 4
-- The score of node 4 is: 4 = 4
-The highest score is 4, and three nodes (node 1, node 3, and node 4) have the highest score.
-
-
-
Example 2:
-
-
-Input: parents = [-1,2,0]
-Output: 2
-Explanation:
-- The score of node 0 is: 2 = 2
-- The score of node 1 is: 2 = 2
-- The score of node 2 is: 1 * 1 = 1
-The highest score is 2, and two nodes (node 0 and node 1) have the highest score.
-
-
-
-
Constraints:
-
-
-
n == parents.length
-
2 <= n <= 105
-
parents[0] == -1
-
0 <= parents[i] <= n - 1 for i != 0
-
parents represents a valid binary tree.
-
-
-### Related Topics
- [[Tree](../../tag/tree/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Binary Tree](../../tag/binary-tree/README.md)]
-
-### Hints
-
-Hint 1
-For each node, you need to find the sizes of the subtrees rooted in each of its children. Maybe DFS?
-
-
-
-Hint 2
-How to determine the number of nodes in the rest of the tree? Can you subtract the size of the subtree rooted at the node from the total number of nodes of the tree?
-
-
-
-Hint 3
-Use these values to compute the score of the node. Track the maximum score, and how many nodes achieve such score.
-
diff --git a/problems/count-number-of-homogenous-substrings/README.md b/problems/count-number-of-homogenous-substrings/README.md
deleted file mode 100644
index efa87ce86..000000000
--- a/problems/count-number-of-homogenous-substrings/README.md
+++ /dev/null
@@ -1,71 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-changes-to-make-alternating-binary-string "Minimum Changes To Make Alternating Binary String")
-
-[Next >](../minimum-limit-of-balls-in-a-bag "Minimum Limit of Balls in a Bag")
-
-## [1759. Count Number of Homogenous Substrings (Medium)](https://leetcode.com/problems/count-number-of-homogenous-substrings "统计同构子字符串的数目")
-
-
Given a string s, return the number of homogenous substrings of s. Since the answer may be too large, return it modulo109 + 7.
-
-
A string is homogenous if all the characters of the string are the same.
-
-
A substring is a contiguous sequence of characters within a string.
-Input: s = "xy"
-Output: 2
-Explanation: The homogenous substrings are "x" and "y".
-
-
Example 3:
-
-
-Input: s = "zzzzz"
-Output: 15
-
-
-
-
Constraints:
-
-
-
1 <= s.length <= 105
-
s consists of lowercase letters.
-
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Hints
-
-Hint 1
-A string of only 'a's of length k contains k choose 2 homogenous substrings.
-
-
-
-Hint 2
-Split the string into substrings where each substring contains only one letter, and apply the formula on each substring's length.
-
diff --git a/problems/count-number-of-maximum-bitwise-or-subsets/README.md b/problems/count-number-of-maximum-bitwise-or-subsets/README.md
deleted file mode 100644
index 0a0609c00..000000000
--- a/problems/count-number-of-maximum-bitwise-or-subsets/README.md
+++ /dev/null
@@ -1,74 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../simple-bank-system "Simple Bank System")
-
-[Next >](../second-minimum-time-to-reach-destination "Second Minimum Time to Reach Destination")
-
-## [2044. Count Number of Maximum Bitwise-OR Subsets (Medium)](https://leetcode.com/problems/count-number-of-maximum-bitwise-or-subsets "统计按位或能得到最大值的子集数目")
-
-
Given an integer array nums, find the maximum possible bitwise OR of a subset of nums and return the number of different non-empty subsets with the maximum bitwise OR.
-
-
An array a is a subset of an array b if a can be obtained from b by deleting some (possibly zero) elements of b. Two subsets are considered different if the indices of the elements chosen are different.
-
-
The bitwise OR of an array a is equal to a[0] OR a[1] OR ... OR a[a.length - 1] (0-indexed).
-
-
-
Example 1:
-
-
-Input: nums = [3,1]
-Output: 2
-Explanation: The maximum possible bitwise OR of a subset is 3. There are 2 subsets with a bitwise OR of 3:
-- [3]
-- [3,1]
-
-
-
Example 2:
-
-
-Input: nums = [2,2,2]
-Output: 7
-Explanation: All non-empty subsets of [2,2,2] have a bitwise OR of 2. There are 23 - 1 = 7 total subsets.
-
-
-
Example 3:
-
-
-Input: nums = [3,2,1,5]
-Output: 6
-Explanation: The maximum possible bitwise OR of a subset is 7. There are 6 subsets with a bitwise OR of 7:
-- [3,5]
-- [3,1,5]
-- [3,2,5]
-- [3,2,1,5]
-- [2,5]
-- [2,1,5]
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 16
-
1 <= nums[i] <= 105
-
-
-### Related Topics
- [[Bit Manipulation](../../tag/bit-manipulation/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Backtracking](../../tag/backtracking/README.md)]
-
-### Hints
-
-Hint 1
-Can we enumerate all possible subsets?
-
-
-
-Hint 2
-The maximum bitwise-OR is the bitwise-OR of the whole array.
-
diff --git a/problems/count-number-of-nice-subarrays/README.md b/problems/count-number-of-nice-subarrays/README.md
deleted file mode 100644
index 5a88c6c6a..000000000
--- a/problems/count-number-of-nice-subarrays/README.md
+++ /dev/null
@@ -1,71 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-swaps-to-make-strings-equal "Minimum Swaps to Make Strings Equal")
-
-[Next >](../minimum-remove-to-make-valid-parentheses "Minimum Remove to Make Valid Parentheses")
-
-## [1248. Count Number of Nice Subarrays (Medium)](https://leetcode.com/problems/count-number-of-nice-subarrays "统计「优美子数组」")
-
-
Given an array of integers nums and an integer k. A continuous subarray is called nice if there are k odd numbers on it.
-
-
Return the number of nice sub-arrays.
-
-
-
Example 1:
-
-
-Input: nums = [1,1,2,1,1], k = 3
-Output: 2
-Explanation: The only sub-arrays with 3 odd numbers are [1,1,2,1] and [1,2,1,1].
-
-
-
Example 2:
-
-
-Input: nums = [2,4,6], k = 1
-Output: 0
-Explanation: There is no odd numbers in the array.
-
-
-
Example 3:
-
-
-Input: nums = [2,2,2,1,2,2,1,2,2,2], k = 2
-Output: 16
-
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 50000
-
1 <= nums[i] <= 10^5
-
1 <= k <= nums.length
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Math](../../tag/math/README.md)]
- [[Sliding Window](../../tag/sliding-window/README.md)]
-
-### Hints
-
-Hint 1
-After replacing each even by zero and every odd by one can we use prefix sum to find answer ?
-
-
-
-Hint 2
-Can we use two pointers to count number of sub-arrays ?
-
-
-
-Hint 3
-Can we store indices of odd numbers and for each k indices count number of sub-arrays contains them ?
-
diff --git a/problems/count-number-of-pairs-with-absolute-difference-k/README.md b/problems/count-number-of-pairs-with-absolute-difference-k/README.md
deleted file mode 100644
index 588fa71df..000000000
--- a/problems/count-number-of-pairs-with-absolute-difference-k/README.md
+++ /dev/null
@@ -1,78 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../subtree-removal-game-with-fibonacci-tree "Subtree Removal Game with Fibonacci Tree")
-
-[Next >](../find-original-array-from-doubled-array "Find Original Array From Doubled Array")
-
-## [2006. Count Number of Pairs With Absolute Difference K (Easy)](https://leetcode.com/problems/count-number-of-pairs-with-absolute-difference-k "差的绝对值为 K 的数对数目")
-
-
Given an integer array nums and an integer k, return the number of pairs(i, j)wherei < jsuch that|nums[i] - nums[j]| == k.
-
-
The value of |x| is defined as:
-
-
-
x if x >= 0.
-
-x if x < 0.
-
-
-
-
Example 1:
-
-
-Input: nums = [1,2,2,1], k = 1
-Output: 4
-Explanation: The pairs with an absolute difference of 1 are:
-- [1,2,2,1]
-- [1,2,2,1]
-- [1,2,2,1]
-- [1,2,2,1]
-
-
-
Example 2:
-
-
-Input: nums = [1,3], k = 3
-Output: 0
-Explanation: There are no pairs with an absolute difference of 3.
-
-
-
Example 3:
-
-
-Input: nums = [3,2,1,5,4], k = 2
-Output: 3
-Explanation: The pairs with an absolute difference of 2 are:
-- [3,2,1,5,4]
-- [3,2,1,5,4]
-- [3,2,1,5,4]
-
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 200
-
1 <= nums[i] <= 100
-
1 <= k <= 99
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Counting](../../tag/counting/README.md)]
-
-### Hints
-
-Hint 1
-Can we check every possible pair?
-
-
-
-Hint 2
-Can we use a nested for loop to solve this problem?
-
diff --git a/problems/count-number-of-special-subsequences/README.md b/problems/count-number-of-special-subsequences/README.md
deleted file mode 100644
index 3871d7327..000000000
--- a/problems/count-number-of-special-subsequences/README.md
+++ /dev/null
@@ -1,78 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-garden-perimeter-to-collect-enough-apples "Minimum Garden Perimeter to Collect Enough Apples")
-
-[Next >](../minimum-time-for-k-virus-variants-to-spread "Minimum Time For K Virus Variants to Spread")
-
-## [1955. Count Number of Special Subsequences (Hard)](https://leetcode.com/problems/count-number-of-special-subsequences "统计特殊子序列的数目")
-
-
A sequence is special if it consists of a positive number of 0s, followed by a positive number of 1s, then a positive number of 2s.
-
-
-
For example, [0,1,2] and [0,0,1,1,1,2] are special.
-
In contrast, [2,1,0], [1], and [0,1,2,0] are not special.
-
-
-
Given an array nums (consisting of only integers 0, 1, and 2), return the number of different subsequences that are special. Since the answer may be very large, return it modulo 109 + 7.
-
-
A subsequence of an array is a sequence that can be derived from the array by deleting some or no elements without changing the order of the remaining elements. Two subsequences are different if the set of indices chosen are different.
-
-
-
Example 1:
-
-
-Input: nums = [0,1,2,2]
-Output: 3
-Explanation: The special subsequences are bolded [0,1,2,2], [0,1,2,2], and [0,1,2,2].
-
-
-
Example 2:
-
-
-Input: nums = [2,2,0,0]
-Output: 0
-Explanation: There are no special subsequences in [2,2,0,0].
-
-
-
Example 3:
-
-
-Input: nums = [0,1,2,0,1,2]
-Output: 7
-Explanation: The special subsequences are bolded:
-- [0,1,2,0,1,2]
-- [0,1,2,0,1,2]
-- [0,1,2,0,1,2]
-- [0,1,2,0,1,2]
-- [0,1,2,0,1,2]
-- [0,1,2,0,1,2]
-- [0,1,2,0,1,2]
-
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 105
-
0 <= nums[i] <= 2
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Hints
-
-Hint 1
-Can we first solve a simpler problem? Counting the number of subsequences with 1s followed by 0s.
-
-
-
-Hint 2
-How can we keep track of the partially matched subsequences to help us find the answer?
-
diff --git a/problems/count-number-of-teams/README.md b/problems/count-number-of-teams/README.md
deleted file mode 100644
index 2fb55323d..000000000
--- a/problems/count-number-of-teams/README.md
+++ /dev/null
@@ -1,68 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../find-lucky-integer-in-an-array "Find Lucky Integer in an Array")
-
-[Next >](../design-underground-system "Design Underground System")
-
-## [1395. Count Number of Teams (Medium)](https://leetcode.com/problems/count-number-of-teams "统计作战单位数")
-
-
There are n soldiers standing in a line. Each soldier is assigned a uniquerating value.
-
-
You have to form a team of 3 soldiers amongst them under the following rules:
-
-
-
Choose 3 soldiers with index (i, j, k) with rating (rating[i], rating[j], rating[k]).
-
A team is valid if: (rating[i] < rating[j] < rating[k]) or (rating[i] > rating[j] > rating[k]) where (0 <= i < j < k < n).
-
-
-
Return the number of teams you can form given the conditions. (soldiers can be part of multiple teams).
-
-
-
Example 1:
-
-
-Input: rating = [2,5,3,4,1]
-Output: 3
-Explanation: We can form three teams given the conditions. (2,3,4), (5,4,1), (5,3,1).
-
-
-
Example 2:
-
-
-Input: rating = [2,1,3]
-Output: 0
-Explanation: We can't form any team given the conditions.
-
Given an integer n, return the count of all numbers with unique digits, x, where 0 <= x < 10n.
-
-
-
Example 1:
-
-
-Input: n = 2
-Output: 91
-Explanation: The answer should be the total numbers in the range of 0 ≤ x < 100, excluding 11,22,33,44,55,66,77,88,99
-
-
-
Example 2:
-
-
-Input: n = 0
-Output: 1
-
-
-
-
Constraints:
-
-
-
0 <= n <= 8
-
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Backtracking](../../tag/backtracking/README.md)]
-
-### Hints
-
-Hint 1
-A direct way is to use the backtracking approach.
-
-
-
-Hint 2
-Backtracking should contains three states which are (the current number, number of steps to get that number and a bitmask which represent which number is marked as visited so far in the current number). Start with state (0,0,0) and count all valid number till we reach number of steps equals to 10n.
-
-
-
-Hint 3
-This problem can also be solved using a dynamic programming approach and some knowledge of combinatorics.
-
-
-
-Hint 4
-Let f(k) = count of numbers with unique digits with length equals k.
-
-
-
-Hint 5
-f(1) = 10, ..., f(k) = 9 * 9 * 8 * ... (9 - k + 2) [The first factor is 9 because a number cannot start with 0].
-
diff --git a/problems/count-numbers-with-unique-digits/count_numbers_with_unique_digits.go b/problems/count-numbers-with-unique-digits/count_numbers_with_unique_digits.go
deleted file mode 100644
index 39ce37305..000000000
--- a/problems/count-numbers-with-unique-digits/count_numbers_with_unique_digits.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem357
diff --git a/problems/count-numbers-with-unique-digits/count_numbers_with_unique_digits_test.go b/problems/count-numbers-with-unique-digits/count_numbers_with_unique_digits_test.go
deleted file mode 100644
index 39ce37305..000000000
--- a/problems/count-numbers-with-unique-digits/count_numbers_with_unique_digits_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem357
diff --git a/problems/count-odd-numbers-in-an-interval-range/README.md b/problems/count-odd-numbers-in-an-interval-range/README.md
deleted file mode 100644
index ded9c497f..000000000
--- a/problems/count-odd-numbers-in-an-interval-range/README.md
+++ /dev/null
@@ -1,50 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../diameter-of-n-ary-tree "Diameter of N-Ary Tree")
-
-[Next >](../number-of-sub-arrays-with-odd-sum "Number of Sub-arrays With Odd Sum")
-
-## [1523. Count Odd Numbers in an Interval Range (Easy)](https://leetcode.com/problems/count-odd-numbers-in-an-interval-range "在区间范围内统计奇数数目")
-
-
Given two non-negative integers low and high. Return the count of odd numbers between low and high (inclusive).
-
-
-
Example 1:
-
-
-Input: low = 3, high = 7
-Output: 3
-Explanation: The odd numbers between 3 and 7 are [3,5,7].
-
-
Example 2:
-
-
-Input: low = 8, high = 10
-Output: 1
-Explanation: The odd numbers between 8 and 10 are [9].
-
-
-
Constraints:
-
-
-
0 <= low <= high <= 10^9
-
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
-
-### Hints
-
-Hint 1
-If the range (high - low + 1) is even, the number of even and odd numbers in this range will be the same.
-
-
-
-Hint 2
-If the range (high - low + 1) is odd, the solution will depend on the parity of high and low.
-
diff --git a/problems/count-of-matches-in-tournament/README.md b/problems/count-of-matches-in-tournament/README.md
deleted file mode 100644
index 71e5c1cba..000000000
--- a/problems/count-of-matches-in-tournament/README.md
+++ /dev/null
@@ -1,69 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../delivering-boxes-from-storage-to-ports "Delivering Boxes from Storage to Ports")
-
-[Next >](../partitioning-into-minimum-number-of-deci-binary-numbers "Partitioning Into Minimum Number Of Deci-Binary Numbers")
-
-## [1688. Count of Matches in Tournament (Easy)](https://leetcode.com/problems/count-of-matches-in-tournament "比赛中的配对次数")
-
-
You are given an integer n, the number of teams in a tournament that has strange rules:
-
-
-
If the current number of teams is even, each team gets paired with another team. A total of n / 2 matches are played, and n / 2 teams advance to the next round.
-
If the current number of teams is odd, one team randomly advances in the tournament, and the rest gets paired. A total of (n - 1) / 2 matches are played, and (n - 1) / 2 + 1 teams advance to the next round.
-
-
-
Return the number of matches played in the tournament until a winner is decided.
-
-
-
Example 1:
-
-
-Input: n = 7
-Output: 6
-Explanation: Details of the tournament:
-- 1st Round: Teams = 7, Matches = 3, and 4 teams advance.
-- 2nd Round: Teams = 4, Matches = 2, and 2 teams advance.
-- 3rd Round: Teams = 2, Matches = 1, and 1 team is declared the winner.
-Total number of matches = 3 + 2 + 1 = 6.
-
-
-
Example 2:
-
-
-Input: n = 14
-Output: 13
-Explanation: Details of the tournament:
-- 1st Round: Teams = 14, Matches = 7, and 7 teams advance.
-- 2nd Round: Teams = 7, Matches = 3, and 4 teams advance.
-- 3rd Round: Teams = 4, Matches = 2, and 2 teams advance.
-- 4th Round: Teams = 2, Matches = 1, and 1 team is declared the winner.
-Total number of matches = 7 + 3 + 2 + 1 = 13.
-
-
-
-
Constraints:
-
-
-
1 <= n <= 200
-
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
- [[Simulation](../../tag/simulation/README.md)]
-
-### Hints
-
-Hint 1
-Simulate the tournament as given in the statement.
-
-
-
-Hint 2
-Be careful when handling odd integers.
-
diff --git a/problems/count-of-range-sum/README.md b/problems/count-of-range-sum/README.md
deleted file mode 100644
index 5e070bfde..000000000
--- a/problems/count-of-range-sum/README.md
+++ /dev/null
@@ -1,55 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../power-of-three "Power of Three")
-
-[Next >](../odd-even-linked-list "Odd Even Linked List")
-
-## [327. Count of Range Sum (Hard)](https://leetcode.com/problems/count-of-range-sum "区间和的个数")
-
-
Given an integer array nums and two integers lower and upper, return the number of range sums that lie in[lower, upper]inclusive.
-
-
Range sum S(i, j) is defined as the sum of the elements in nums between indices i and j inclusive, where i <= j.
-
-
-
Example 1:
-
-
-Input: nums = [-2,5,-1], lower = -2, upper = 2
-Output: 3
-Explanation: The three ranges are: [0,0], [2,2], and [0,2] and their respective sums are: -2, -1, 2.
-
You are given an integer array nums and you have to return a new counts array. The counts array has the property where counts[i] is the number of smaller elements to the right of nums[i].
-
-
-
Example 1:
-
-
-Input: nums = [5,2,6,1]
-Output: [2,1,1,0]
-Explanation:
-To the right of 5 there are 2 smaller elements (2 and 1).
-To the right of 2 there is only 1 smaller element (1).
-To the right of 6 there is 1 smaller element (1).
-To the right of 1 there is 0 smaller element.
-
-
-
Example 2:
-
-
-Input: nums = [-1]
-Output: [0]
-
-
-
Example 3:
-
-
-Input: nums = [-1,-1]
-Output: [0,0]
-
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 105
-
-104 <= nums[i] <= 104
-
-
-### Related Topics
- [[Binary Indexed Tree](../../tag/binary-indexed-tree/README.md)]
- [[Segment Tree](../../tag/segment-tree/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
- [[Divide and Conquer](../../tag/divide-and-conquer/README.md)]
- [[Ordered Set](../../tag/ordered-set/README.md)]
- [[Merge Sort](../../tag/merge-sort/README.md)]
-
-### Similar Questions
- 1. [Count of Range Sum](../count-of-range-sum) (Hard)
- 1. [Queue Reconstruction by Height](../queue-reconstruction-by-height) (Medium)
- 1. [Reverse Pairs](../reverse-pairs) (Hard)
diff --git a/problems/count-of-smaller-numbers-after-self/count_of_smaller_numbers_after_self.go b/problems/count-of-smaller-numbers-after-self/count_of_smaller_numbers_after_self.go
deleted file mode 100644
index 4feb2cd86..000000000
--- a/problems/count-of-smaller-numbers-after-self/count_of_smaller_numbers_after_self.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem315
diff --git a/problems/count-of-smaller-numbers-after-self/count_of_smaller_numbers_after_self_test.go b/problems/count-of-smaller-numbers-after-self/count_of_smaller_numbers_after_self_test.go
deleted file mode 100644
index 4feb2cd86..000000000
--- a/problems/count-of-smaller-numbers-after-self/count_of_smaller_numbers_after_self_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem315
diff --git a/problems/count-operations-to-obtain-zero/README.md b/problems/count-operations-to-obtain-zero/README.md
deleted file mode 100644
index 019bc3626..000000000
--- a/problems/count-operations-to-obtain-zero/README.md
+++ /dev/null
@@ -1,69 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../unique-substrings-with-equal-digit-frequency "Unique Substrings With Equal Digit Frequency")
-
-[Next >](../minimum-operations-to-make-the-array-alternating "Minimum Operations to Make the Array Alternating")
-
-## [2169. Count Operations to Obtain Zero (Easy)](https://leetcode.com/problems/count-operations-to-obtain-zero "得到 0 的操作数")
-
-
You are given two non-negative integers num1 and num2.
-
-
In one operation, if num1 >= num2, you must subtract num2 from num1, otherwise subtract num1 from num2.
-
-
-
For example, if num1 = 5 and num2 = 4, subtract num2 from num1, thus obtaining num1 = 1 and num2 = 4. However, if num1 = 4 and num2 = 5, after one operation, num1 = 4 and num2 = 1.
-
-
-
Return the number of operations required to make eithernum1 = 0ornum2 = 0.
-
-
-
Example 1:
-
-
-Input: num1 = 2, num2 = 3
-Output: 3
-Explanation:
-- Operation 1: num1 = 2, num2 = 3. Since num1 < num2, we subtract num1 from num2 and get num1 = 2, num2 = 3 - 2 = 1.
-- Operation 2: num1 = 2, num2 = 1. Since num1 > num2, we subtract num2 from num1.
-- Operation 3: num1 = 1, num2 = 1. Since num1 == num2, we subtract num2 from num1.
-Now num1 = 0 and num2 = 1. Since num1 == 0, we do not need to perform any further operations.
-So the total number of operations required is 3.
-
-
-
Example 2:
-
-
-Input: num1 = 10, num2 = 10
-Output: 1
-Explanation:
-- Operation 1: num1 = 10, num2 = 10. Since num1 == num2, we subtract num2 from num1 and get num1 = 10 - 10 = 0.
-Now num1 = 0 and num2 = 10. Since num1 == 0, we are done.
-So the total number of operations required is 1.
-
-
-
-
Constraints:
-
-
-
0 <= num1, num2 <= 105
-
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
- [[Simulation](../../tag/simulation/README.md)]
-
-### Hints
-
-Hint 1
-Try simulating the process until either of the two integers is zero.
-
-
-
-Hint 2
-Count the number of operations done.
-
diff --git a/problems/count-pairs-in-two-arrays/README.md b/problems/count-pairs-in-two-arrays/README.md
deleted file mode 100644
index 82a198799..000000000
--- a/problems/count-pairs-in-two-arrays/README.md
+++ /dev/null
@@ -1,40 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../egg-drop-with-2-eggs-and-n-floors "Egg Drop With 2 Eggs and N Floors")
-
-[Next >](../determine-whether-matrix-can-be-obtained-by-rotation "Determine Whether Matrix Can Be Obtained By Rotation")
-
-## [1885. Count Pairs in Two Arrays (Medium)](https://leetcode.com/problems/count-pairs-in-two-arrays "统计数对")
-
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Hints
-
-Hint 1
-We can write it as nums1[i] - nums2[i] > nums2[j] - nums1[j] instead of nums1[i] + nums1[j] > nums2[i] + nums2[j].
-
-
-
-Hint 2
-Store nums1[idx] - nums2[idx] in a data structure.
-
-
-
-Hint 3
-Store nums2[idx] - nums1[idx] in a different data structure.
-
-
-
-Hint 4
-For each integer in the first data structure, count the number of the strictly smaller integers in the second data structure with a larger index in the original array.
-
diff --git a/problems/count-pairs-of-equal-substrings-with-minimum-difference/README.md b/problems/count-pairs-of-equal-substrings-with-minimum-difference/README.md
deleted file mode 100644
index cd3d037fd..000000000
--- a/problems/count-pairs-of-equal-substrings-with-minimum-difference/README.md
+++ /dev/null
@@ -1,30 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-score-of-a-good-subarray "Maximum Score of a Good Subarray")
-
-[Next >](../rearrange-products-table "Rearrange Products Table")
-
-## [1794. Count Pairs of Equal Substrings With Minimum Difference (Medium)](https://leetcode.com/problems/count-pairs-of-equal-substrings-with-minimum-difference "统计距离最小的子串对个数")
-
-
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Hints
-
-Hint 1
-If the chosen substrings are of size larger than 1, then you can remove all but the first character from both substrings, and you'll get equal substrings of size 1, with the same a but less j. Hence, it's always optimal to choose substrings of size 1.
-
-
-
-Hint 2
-If you choose a specific letter, then it's optimal to choose its first occurrence in firstString, and its last occurrence in secondString, to minimize j-a.
-
diff --git a/problems/count-pairs-of-nodes/README.md b/problems/count-pairs-of-nodes/README.md
deleted file mode 100644
index 9678daee2..000000000
--- a/problems/count-pairs-of-nodes/README.md
+++ /dev/null
@@ -1,89 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../sum-of-beauty-of-all-substrings "Sum of Beauty of All Substrings")
-
-[Next >](../grand-slam-titles "Grand Slam Titles")
-
-## [1782. Count Pairs Of Nodes (Hard)](https://leetcode.com/problems/count-pairs-of-nodes "统计点对的数目")
-
-
You are given an undirected graph defined by an integer n, the number of nodes, and a 2D integer array edges, the edges in the graph, where edges[i] = [ui, vi] indicates that there is an undirected edge between ui and vi. You are also given an integer array queries.
-
-
Let incident(a, b) be defined as the number of edges that are connected to either node a or b.
-
-
The answer to the jth query is the number of pairs of nodes (a, b) that satisfy both of the following conditions:
-
-
-
a < b
-
incident(a, b) > queries[j]
-
-
-
Return an array answers such that answers.length == queries.length and answers[j] is the answer of the jth query.
-
-
Note that there can be multiple edges between the same two nodes.
-
-
-
Example 1:
-
-
-Input: n = 4, edges = [[1,2],[2,4],[1,3],[2,3],[2,1]], queries = [2,3]
-Output: [6,5]
-Explanation: The calculations for incident(a, b) are shown in the table above.
-The answers for each of the queries are as follows:
-- answers[0] = 6. All the pairs have an incident(a, b) value greater than 2.
-- answers[1] = 5. All the pairs except (3, 4) have an incident(a, b) value greater than 3.
-
-
-### Related Topics
- [[Graph](../../tag/graph/README.md)]
- [[Two Pointers](../../tag/two-pointers/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
-
-### Hints
-
-Hint 1
-We want to count pairs (x,y) such that degree[x] + degree[y] - occurrences(x,y) > k
-
-
-
-Hint 2
-Think about iterating on x, and counting the number of valid y to pair with x.
-
-
-
-Hint 3
-You can consider at first that the (- occurrences(x,y)) isn't there, or it is 0 at first for all y. Count the valid y this way.
-
-
-
-Hint 4
-Then you can iterate on the neighbors of x, let that neighbor be y, and update occurrences(x,y).
-
-
-
-Hint 5
-When you update occurrences(x,y), the left-hand side decreases. Once it reaches k, then y is not valid for x anymore, so you should decrease the answer by 1.
-
diff --git a/problems/count-pairs-with-xor-in-a-range/README.md b/problems/count-pairs-with-xor-in-a-range/README.md
deleted file mode 100644
index 1f7764e98..000000000
--- a/problems/count-pairs-with-xor-in-a-range/README.md
+++ /dev/null
@@ -1,71 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-value-at-a-given-index-in-a-bounded-array "Maximum Value at a Given Index in a Bounded Array")
-
-[Next >](../implement-trie-ii-prefix-tree "Implement Trie II (Prefix Tree)")
-
-## [1803. Count Pairs With XOR in a Range (Hard)](https://leetcode.com/problems/count-pairs-with-xor-in-a-range "统计异或值在范围内的数对有多少")
-
-
Given a (0-indexed) integer array nums and two integers low and high, return the number of nice pairs.
-
-
A nice pair is a pair (i, j) where 0 <= i < j < nums.length and low <= (nums[i] XOR nums[j]) <= high.
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Bit Manipulation](../../tag/bit-manipulation/README.md)]
- [[Trie](../../tag/trie/README.md)]
-
-### Hints
-
-Hint 1
-Let's note that we can count all pairs with XOR ≤ K, so the answer would be to subtract the number of pairs withs XOR < low from the number of pairs with XOR ≤ high.
-
-
-
-Hint 2
-For each value, find out the number of values when you XOR it with the result is ≤ K using a trie.
-
diff --git a/problems/count-primes/README.md b/problems/count-primes/README.md
deleted file mode 100644
index efef39034..000000000
--- a/problems/count-primes/README.md
+++ /dev/null
@@ -1,157 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../remove-linked-list-elements "Remove Linked List Elements")
-
-[Next >](../isomorphic-strings "Isomorphic Strings")
-
-## [204. Count Primes (Medium)](https://leetcode.com/problems/count-primes "计数质数")
-
-
Given an integer n, return the number of prime numbers that are strictly less thann.
-
-
-
Example 1:
-
-
-Input: n = 10
-Output: 4
-Explanation: There are 4 prime numbers less than 10, they are 2, 3, 5, 7.
-
Let's start with a isPrime function. To determine if a number is prime, we need to check if it is not divisible by any number less than n. The runtime complexity of isPrime function would be O(n) and hence counting the total prime numbers up to n would be O(n2). Could we do better?
-
-
-
-Hint 2
-
As we know the number must not be divisible by any number > n / 2, we can immediately cut the total iterations half by dividing only up to n / 2. Could we still do better?
-
-
-
-Hint 3
-
Let's write down all of 12's factors:
-
-2 × 6 = 12
-3 × 4 = 12
-4 × 3 = 12
-6 × 2 = 12
-
-
-
As you can see, calculations of 4 × 3 and 6 × 2 are not necessary. Therefore, we only need to consider factors up to √n because, if n is divisible by some number p, then n = p × q and since p ≤ q, we could derive that p ≤ √n.
-
-
Our total runtime has now improved to O(n1.5), which is slightly better. Is there a faster approach?
-
-
-public int countPrimes(int n) {
- int count = 0;
- for (int i = 1; i < n; i++) {
- if (isPrime(i)) count++;
- }
- return count;
-}
-
-private boolean isPrime(int num) {
- if (num <= 1) return false;
- // Loop's ending condition is i * i <= num instead of i <= sqrt(num)
- // to avoid repeatedly calling an expensive function sqrt().
- for (int i = 2; i * i <= num; i++) {
- if (num % i == 0) return false;
- }
- return true;
-}
-
-
-
-
-Hint 4
-
The Sieve of Eratosthenes is one of the most efficient ways to find all prime numbers up to n. But don't let that name scare you, I promise that the concept is surprisingly simple.
We start off with a table of n numbers. Let's look at the first number, 2. We know all multiples of 2 must not be primes, so we mark them off as non-primes. Then we look at the next number, 3. Similarly, all multiples of 3 such as 3 × 2 = 6, 3 × 3 = 9, ... must not be primes, so we mark them off as well. Now we look at the next number, 4, which was already marked off. What does this tell you? Should you mark off all multiples of 4 as well?
-
-
-
-Hint 5
-
4 is not a prime because it is divisible by 2, which means all multiples of 4 must also be divisible by 2 and were already marked off. So we can skip 4 immediately and go to the next number, 5. Now, all multiples of 5 such as 5 × 2 = 10, 5 × 3 = 15, 5 × 4 = 20, 5 × 5 = 25, ... can be marked off. There is a slight optimization here, we do not need to start from 5 × 2 = 10. Where should we start marking off?
-
-
-
-Hint 6
-
In fact, we can mark off multiples of 5 starting at 5 × 5 = 25, because 5 × 2 = 10 was already marked off by multiple of 2, similarly 5 × 3 = 15 was already marked off by multiple of 3. Therefore, if the current number is p, we can always mark off multiples of p starting at p2, then in increments of p: p2 + p, p2 + 2p, ... Now what should be the terminating loop condition?
-
-
-
-Hint 7
-
It is easy to say that the terminating loop condition is p < n, which is certainly correct but not efficient. Do you still remember Hint #3?
-
-
-
-Hint 8
-
Yes, the terminating loop condition can be p < √n, as all non-primes ≥ √n must have already been marked off. When the loop terminates, all the numbers in the table that are non-marked are prime.
-
-
The Sieve of Eratosthenes uses an extra O(n) memory and its runtime complexity is O(n log log n). For the more mathematically inclined readers, you can read more about its algorithm complexity on Wikipedia.
-
-
-public int countPrimes(int n) {
- boolean[] isPrime = new boolean[n];
- for (int i = 2; i < n; i++) {
- isPrime[i] = true;
- }
- // Loop's ending condition is i * i < n instead of i < sqrt(n)
- // to avoid repeatedly calling an expensive function sqrt().
- for (int i = 2; i * i < n; i++) {
- if (!isPrime[i]) continue;
- for (int j = i * i; j < n; j += i) {
- isPrime[j] = false;
- }
- }
- int count = 0;
- for (int i = 2; i < n; i++) {
- if (isPrime[i]) count++;
- }
- return count;
-}
-
You are given a map of a server center, represented as a m * n integer matrix grid, where 1 means that on that cell there is a server and 0 means that it is no server. Two servers are said to communicate if they are on the same row or on the same column.
-
-Return the number of servers that communicate with any other server.
-
-
-
Example 1:
-
-
-
-
-Input: grid = [[1,0],[0,1]]
-Output: 0
-Explanation: No servers can communicate with others.
-
-
Example 2:
-
-
-
-
-Input: grid = [[1,0],[1,1]]
-Output: 3
-Explanation: All three servers can communicate with at least one other server.
-
-
-
Example 3:
-
-
-
-
-Input: grid = [[1,1,0,0],[0,0,1,0],[0,0,1,0],[0,0,0,1]]
-Output: 4
-Explanation: The two servers in the first row can communicate with each other. The two servers in the third column can communicate with each other. The server at right bottom corner can't communicate with any other server.
-
-
-
-
Constraints:
-
-
-
m == grid.length
-
n == grid[i].length
-
1 <= m <= 250
-
1 <= n <= 250
-
grid[i][j] == 0 or 1
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Union Find](../../tag/union-find/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
- [[Counting](../../tag/counting/README.md)]
-
-### Hints
-
-Hint 1
-Store number of computer in each row and column.
-
-
-
-Hint 2
-Count all servers that are not isolated.
-
diff --git a/problems/count-sorted-vowel-strings/README.md b/problems/count-sorted-vowel-strings/README.md
deleted file mode 100644
index 9f86adbcb..000000000
--- a/problems/count-sorted-vowel-strings/README.md
+++ /dev/null
@@ -1,68 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../check-array-formation-through-concatenation "Check Array Formation Through Concatenation")
-
-[Next >](../furthest-building-you-can-reach "Furthest Building You Can Reach")
-
-## [1641. Count Sorted Vowel Strings (Medium)](https://leetcode.com/problems/count-sorted-vowel-strings "统计字典序元音字符串的数目")
-
-
Given an integer n, return the number of strings of length n that consist only of vowels (a, e, i, o, u) and are lexicographically sorted.
-
-
A string s is lexicographically sorted if for all valid i, s[i] is the same as or comes before s[i+1] in the alphabet.
-
-
-
Example 1:
-
-
-Input: n = 1
-Output: 5
-Explanation: The 5 sorted strings that consist of vowels only are ["a","e","i","o","u"].
-
-
-
Example 2:
-
-
-Input: n = 2
-Output: 15
-Explanation: The 15 sorted strings that consist of vowels only are
-["aa","ae","ai","ao","au","ee","ei","eo","eu","ii","io","iu","oo","ou","uu"].
-Note that "ea" is not a valid string since 'e' comes after 'a' in the alphabet.
-
-
-
Example 3:
-
-
-Input: n = 33
-Output: 66045
-
-
-
-
Constraints:
-
-
-
1 <= n <= 50
-
-
-### Related Topics
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Hints
-
-Hint 1
-For each character, its possible values will depend on the value of its previous character, because it needs to be not smaller than it.
-
-
-
-Hint 2
-Think backtracking. Build a recursive function count(n, last_character) that counts the number of valid strings of length n and whose first characters are not less than last_character.
-
-
-
-Hint 3
-In this recursive function, iterate on the possible characters for the first character, which will be all the vowels not less than last_character, and for each possible value c, increase the answer by count(n-1, c).
-
diff --git a/problems/count-special-quadruplets/README.md b/problems/count-special-quadruplets/README.md
deleted file mode 100644
index d9938c15d..000000000
--- a/problems/count-special-quadruplets/README.md
+++ /dev/null
@@ -1,71 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../the-number-of-good-subsets "The Number of Good Subsets")
-
-[Next >](../the-number-of-weak-characters-in-the-game "The Number of Weak Characters in the Game")
-
-## [1995. Count Special Quadruplets (Easy)](https://leetcode.com/problems/count-special-quadruplets "统计特殊四元组")
-
-
Given a 0-indexed integer array nums, return the number of distinct quadruplets(a, b, c, d)such that:
-
-
-
nums[a] + nums[b] + nums[c] == nums[d], and
-
a < b < c < d
-
-
-
-
Example 1:
-
-
-Input: nums = [1,2,3,6]
-Output: 1
-Explanation: The only quadruplet that satisfies the requirement is (0, 1, 2, 3) because 1 + 2 + 3 == 6.
-
-
-
Example 2:
-
-
-Input: nums = [3,3,6,4,5]
-Output: 0
-Explanation: There are no such quadruplets in [3,3,6,4,5].
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Enumeration](../../tag/enumeration/README.md)]
-
-### Hints
-
-Hint 1
-N is very small, how can we use that?
-
-
-
-Hint 2
-Can we check every possible quadruplet?
-
diff --git a/problems/count-square-submatrices-with-all-ones/README.md b/problems/count-square-submatrices-with-all-ones/README.md
deleted file mode 100644
index cf2e3ec9e..000000000
--- a/problems/count-square-submatrices-with-all-ones/README.md
+++ /dev/null
@@ -1,73 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../number-of-burgers-with-no-waste-of-ingredients "Number of Burgers with No Waste of Ingredients")
-
-[Next >](../palindrome-partitioning-iii "Palindrome Partitioning III")
-
-## [1277. Count Square Submatrices with All Ones (Medium)](https://leetcode.com/problems/count-square-submatrices-with-all-ones "统计全为 1 的正方形子矩阵")
-
-
Given a m * n matrix of ones and zeros, return how many square submatrices have all ones.
-
-
-
Example 1:
-
-
-Input: matrix =
-[
- [0,1,1,1],
- [1,1,1,1],
- [0,1,1,1]
-]
-Output: 15
-Explanation:
-There are 10 squares of side 1.
-There are 4 squares of side 2.
-There is 1 square of side 3.
-Total number of squares = 10 + 4 + 1 = 15.
-
-
-
Example 2:
-
-
-Input: matrix =
-[
- [1,0,1],
- [1,1,0],
- [1,1,0]
-]
-Output: 7
-Explanation:
-There are 6 squares of side 1.
-There is 1 square of side 2.
-Total number of squares = 6 + 1 = 7.
-
-
-
-
Constraints:
-
-
-
1 <= arr.length <= 300
-
1 <= arr[0].length <= 300
-
0 <= arr[i][j] <= 1
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
-
-### Hints
-
-Hint 1
-Create an additive table that counts the sum of elements of submatrix with the superior corner at (0,0).
-
-
-
-Hint 2
-Loop over all subsquares in O(n^3) and check if the sum make the whole array to be ones, if it checks then add 1 to the answer.
-
diff --git a/problems/count-square-sum-triples/README.md b/problems/count-square-sum-triples/README.md
deleted file mode 100644
index d9d046279..000000000
--- a/problems/count-square-sum-triples/README.md
+++ /dev/null
@@ -1,55 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../erect-the-fence-ii "Erect the Fence II")
-
-[Next >](../nearest-exit-from-entrance-in-maze "Nearest Exit from Entrance in Maze")
-
-## [1925. Count Square Sum Triples (Easy)](https://leetcode.com/problems/count-square-sum-triples "统计平方和三元组的数目")
-
-
A square triple(a,b,c) is a triple where a, b, and c are integers and a2 + b2 = c2.
-
-
Given an integer n, return the number of square triples such that 1 <= a, b, c <= n.
-
-
-
Example 1:
-
-
-Input: n = 5
-Output: 2
-Explanation: The square triples are (3,4,5) and (4,3,5).
-
-
-
Example 2:
-
-
-Input: n = 10
-Output: 4
-Explanation: The square triples are (3,4,5), (4,3,5), (6,8,10), and (8,6,10).
-
-
-
-
Constraints:
-
-
-
1 <= n <= 250
-
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
- [[Enumeration](../../tag/enumeration/README.md)]
-
-### Hints
-
-Hint 1
-Iterate over all possible pairs (a,b) and check that the square root of a * a + b * b is an integers less than or equal n
-
-
-
-Hint 2
-You can check that the square root of an integer is an integer using binary seach or a builtin function like sqrt
-
diff --git a/problems/count-student-number-in-departments/README.md b/problems/count-student-number-in-departments/README.md
deleted file mode 100644
index 089034b63..000000000
--- a/problems/count-student-number-in-departments/README.md
+++ /dev/null
@@ -1,87 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../find-cumulative-salary-of-an-employee "Find Cumulative Salary of an Employee")
-
-[Next >](../shortest-unsorted-continuous-subarray "Shortest Unsorted Continuous Subarray")
-
-## [580. Count Student Number in Departments (Medium)](https://leetcode.com/problems/count-student-number-in-departments "统计各专业学生人数")
-
-
A university uses 2 data tables, student and department, to store data about its students and the departments associated with each major.
-
-
Write a query to print the respective department name and number of students majoring in each department for all departments in the department table (even ones with no current students).
-
-
Sort your results by descending number of students; if two or more departments have the same number of students, then sort those departments alphabetically by department name.
-
-
The student is described as follow:
-
-
-| Column Name | Type |
-|--------------|-----------|
-| student_id | Integer |
-| student_name | String |
-| gender | Character |
-| dept_id | Integer |
-
-
-
where student_id is the student's ID number, student_name is the student's name, gender is their gender, and dept_id is the department ID associated with their declared major.
-
-
And the department table is described as below:
-
-
-| Column Name | Type |
-|-------------|---------|
-| dept_id | Integer |
-| dept_name | String |
-
-
-
where dept_id is the department's ID number and dept_name is the department name.
-
-
Here is an example input:
-student table:
-
-
-| student_id | student_name | gender | dept_id |
-|------------|--------------|--------|---------|
-| 1 | Jack | M | 1 |
-| 2 | Jane | F | 1 |
-| 3 | Mark | M | 2 |
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
-
-### Hints
-
-Hint 1
-Still remember the difference between 'INNER JOIN' and 'OUTTER JOIN' in SQL?
-
-
-
-Hint 2
-Do you know other expressions using the 'COUNT' function besides 'COUNT(*)'?
-
diff --git a/problems/count-student-number-in-departments/count_student_number_in_departments.sql b/problems/count-student-number-in-departments/count_student_number_in_departments.sql
deleted file mode 100644
index bae62cf19..000000000
--- a/problems/count-student-number-in-departments/count_student_number_in_departments.sql
+++ /dev/null
@@ -1 +0,0 @@
-# Write your MySQL query statement below
diff --git a/problems/count-student-number-in-departments/mysql_schemas.sql b/problems/count-student-number-in-departments/mysql_schemas.sql
deleted file mode 100644
index 618e4666d..000000000
--- a/problems/count-student-number-in-departments/mysql_schemas.sql
+++ /dev/null
@@ -1,10 +0,0 @@
-Create table If Not Exists Student (student_id int,student_name varchar(45), gender varchar(6), dept_id int);
-Create table If Not Exists Department (dept_id int, dept_name varchar(255));
-Truncate table Student;
-insert into Student (student_id, student_name, gender, dept_id) values ('1', 'Jack', 'M', '1');
-insert into Student (student_id, student_name, gender, dept_id) values ('2', 'Jane', 'F', '1');
-insert into Student (student_id, student_name, gender, dept_id) values ('3', 'Mark', 'M', '2');
-Truncate table Department;
-insert into Department (dept_id, dept_name) values ('1', 'Engineering');
-insert into Department (dept_id, dept_name) values ('2', 'Science');
-insert into Department (dept_id, dept_name) values ('3', 'Law');
diff --git a/problems/count-sub-islands/README.md b/problems/count-sub-islands/README.md
deleted file mode 100644
index 03d87c466..000000000
--- a/problems/count-sub-islands/README.md
+++ /dev/null
@@ -1,70 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../the-number-of-full-rounds-you-have-played "The Number of Full Rounds You Have Played")
-
-[Next >](../minimum-absolute-difference-queries "Minimum Absolute Difference Queries")
-
-## [1905. Count Sub Islands (Medium)](https://leetcode.com/problems/count-sub-islands "统计子岛屿")
-
-
You are given two m x n binary matrices grid1 and grid2 containing only 0's (representing water) and 1's (representing land). An island is a group of 1's connected 4-directionally (horizontal or vertical). Any cells outside of the grid are considered water cells.
-
-
An island in grid2 is considered a sub-island if there is an island in grid1 that contains all the cells that make up this island in grid2.
-
-
Return the number of islands in grid2that are considered sub-islands.
-
-
-
Example 1:
-
-
-Input: grid1 = [[1,1,1,0,0],[0,1,1,1,1],[0,0,0,0,0],[1,0,0,0,0],[1,1,0,1,1]], grid2 = [[1,1,1,0,0],[0,0,1,1,1],[0,1,0,0,0],[1,0,1,1,0],[0,1,0,1,0]]
-Output: 3
-Explanation: In the picture above, the grid on the left is grid1 and the grid on the right is grid2.
-The 1s colored red in grid2 are those considered to be part of a sub-island. There are three sub-islands.
-
-
-
Example 2:
-
-
-Input: grid1 = [[1,0,1,0,1],[1,1,1,1,1],[0,0,0,0,0],[1,1,1,1,1],[1,0,1,0,1]], grid2 = [[0,0,0,0,0],[1,1,1,1,1],[0,1,0,1,0],[0,1,0,1,0],[1,0,0,0,1]]
-Output: 2
-Explanation: In the picture above, the grid on the left is grid1 and the grid on the right is grid2.
-The 1s colored red in grid2 are those considered to be part of a sub-island. There are two sub-islands.
-
-
-
-
Constraints:
-
-
-
m == grid1.length == grid2.length
-
n == grid1[i].length == grid2[i].length
-
1 <= m, n <= 500
-
grid1[i][j] and grid2[i][j] are either 0 or 1.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Union Find](../../tag/union-find/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
-
-### Similar Questions
- 1. [Number of Islands](../number-of-islands) (Medium)
- 1. [Number of Distinct Islands](../number-of-distinct-islands) (Medium)
- 1. [Find All Groups of Farmland](../find-all-groups-of-farmland) (Medium)
-
-### Hints
-
-Hint 1
-Let's use floodfill to iterate over the islands of the second grid
-
-
-
-Hint 2
-Let's note that if all the cells in an island in the second grid if they are represented by land in the first grid then they are connected hence making that island a sub-island
-
diff --git a/problems/count-subarrays-with-more-ones-than-zeros/README.md b/problems/count-subarrays-with-more-ones-than-zeros/README.md
deleted file mode 100644
index e91e1a9cf..000000000
--- a/problems/count-subarrays-with-more-ones-than-zeros/README.md
+++ /dev/null
@@ -1,39 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../smallest-k-length-subsequence-with-occurrences-of-a-letter "Smallest K-Length Subsequence With Occurrences of a Letter")
-
-[Next >](../two-out-of-three "Two Out of Three")
-
-## [2031. Count Subarrays With More Ones Than Zeros (Medium)](https://leetcode.com/problems/count-subarrays-with-more-ones-than-zeros "1 比 0 多的子数组个数")
-
-
-
-### Related Topics
- [[Binary Indexed Tree](../../tag/binary-indexed-tree/README.md)]
- [[Segment Tree](../../tag/segment-tree/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
- [[Divide and Conquer](../../tag/divide-and-conquer/README.md)]
- [[Ordered Set](../../tag/ordered-set/README.md)]
- [[Merge Sort](../../tag/merge-sort/README.md)]
-
-### Hints
-
-Hint 1
-Change the zeros in nums to -1 and create a prefix sum array prefixSum using the new nums.
-
-
-
-Hint 2
-If prefixSum[i] for any index i in the range 0 <= i < prefixSum.length is positive, that means that there are more ones than zeros in the prefix ending at index i.
-
-
-
-Hint 3
-If prefixSum[j] > prefixSum[i] for two indexes i and j such that 0 <= i < j < prefixSum.length, that means that there are more ones than zeros in nums in the range [i + 1 : j] (inclusive)
-
diff --git a/problems/count-submatrices-with-all-ones/README.md b/problems/count-submatrices-with-all-ones/README.md
deleted file mode 100644
index a142458a3..000000000
--- a/problems/count-submatrices-with-all-ones/README.md
+++ /dev/null
@@ -1,71 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../last-moment-before-all-ants-fall-out-of-a-plank "Last Moment Before All Ants Fall Out of a Plank")
-
-[Next >](../minimum-possible-integer-after-at-most-k-adjacent-swaps-on-digits "Minimum Possible Integer After at Most K Adjacent Swaps On Digits")
-
-## [1504. Count Submatrices With All Ones (Medium)](https://leetcode.com/problems/count-submatrices-with-all-ones "统计全 1 子矩形")
-
-
Given an m x n binary matrix mat, return the number of submatrices that have all ones.
-
-
-
Example 1:
-
-
-Input: mat = [[1,0,1],[1,1,0],[1,1,0]]
-Output: 13
-Explanation:
-There are 6 rectangles of side 1x1.
-There are 2 rectangles of side 1x2.
-There are 3 rectangles of side 2x1.
-There is 1 rectangle of side 2x2.
-There is 1 rectangle of side 3x1.
-Total number of rectangles = 6 + 2 + 3 + 1 + 1 = 13.
-
-
-
Example 2:
-
-
-Input: mat = [[0,1,1,0],[0,1,1,1],[1,1,1,0]]
-Output: 24
-Explanation:
-There are 8 rectangles of side 1x1.
-There are 5 rectangles of side 1x2.
-There are 2 rectangles of side 1x3.
-There are 4 rectangles of side 2x1.
-There are 2 rectangles of side 2x2.
-There are 2 rectangles of side 3x1.
-There is 1 rectangle of side 3x2.
-Total number of rectangles = 8 + 5 + 2 + 4 + 2 + 2 + 1 = 24.
-
-
-
-
Constraints:
-
-
-
1 <= m, n <= 150
-
mat[i][j] is either 0 or 1.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Stack](../../tag/stack/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
- [[Monotonic Stack](../../tag/monotonic-stack/README.md)]
-
-### Hints
-
-Hint 1
-For each row i, create an array nums where: if mat[i][j] == 0 then nums[j] = 0 else nums[j] = nums[j-1] +1.
-
-
-
-Hint 2
-In the row i, number of rectangles between column j and k(inclusive) and ends in row i, is equal to SUM(min(nums[j, .. idx])) where idx go from j to k. Expected solution is O(n^3).
-
diff --git a/problems/count-substrings-that-differ-by-one-character/README.md b/problems/count-substrings-that-differ-by-one-character/README.md
deleted file mode 100644
index 4250e2fc0..000000000
--- a/problems/count-substrings-that-differ-by-one-character/README.md
+++ /dev/null
@@ -1,74 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../widest-vertical-area-between-two-points-containing-no-points "Widest Vertical Area Between Two Points Containing No Points")
-
-[Next >](../number-of-ways-to-form-a-target-string-given-a-dictionary "Number of Ways to Form a Target String Given a Dictionary")
-
-## [1638. Count Substrings That Differ by One Character (Medium)](https://leetcode.com/problems/count-substrings-that-differ-by-one-character "统计只差一个字符的子串数目")
-
-
Given two strings s and t, find the number of ways you can choose a non-empty substring of s and replace a single character by a different character such that the resulting substring is a substring of t. In other words, find the number of substrings in s that differ from some substring in t by exactly one character.
-
-
For example, the underlined substrings in "computer" and "computation" only differ by the 'e'/'a', so this is a valid way.
-
-
Return the number of substrings that satisfy the condition above.
-
-
A substring is a contiguous sequence of characters within a string.
-
-
-
Example 1:
-
-
-Input: s = "aba", t = "baba"
-Output: 6
-Explanation: The following are the pairs of substrings from s and t that differ by exactly 1 character:
-("aba", "baba")
-("aba", "baba")
-("aba", "baba")
-("aba", "baba")
-("aba", "baba")
-("aba", "baba")
-The underlined portions are the substrings that are chosen from s and t.
-
-Example 2:
-
-
-Input: s = "ab", t = "bb"
-Output: 3
-Explanation: The following are the pairs of substrings from s and t that differ by 1 character:
-("ab", "bb")
-("ab", "bb")
-("ab", "bb")
-The underlined portions are the substrings that are chosen from s and t.
-
-
-
-
Constraints:
-
-
-
1 <= s.length, t.length <= 100
-
s and t consist of lowercase English letters only.
-
-
-### Related Topics
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Similar Questions
- 1. [Count Words Obtained After Adding a Letter](../count-words-obtained-after-adding-a-letter) (Medium)
-
-### Hints
-
-Hint 1
-Take every substring of s, change a character, and see how many substrings of t match that substring.
-
-
-
-Hint 2
-Use a Trie to store all substrings of t as a dictionary.
-
diff --git a/problems/count-substrings-with-only-one-distinct-letter/README.md b/problems/count-substrings-with-only-one-distinct-letter/README.md
deleted file mode 100644
index bb512697a..000000000
--- a/problems/count-substrings-with-only-one-distinct-letter/README.md
+++ /dev/null
@@ -1,63 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../reformat-department-table "Reformat Department Table")
-
-[Next >](../before-and-after-puzzle "Before and After Puzzle")
-
-## [1180. Count Substrings with Only One Distinct Letter (Easy)](https://leetcode.com/problems/count-substrings-with-only-one-distinct-letter "统计只含单一字母的子串")
-
-
Given a string S, return the number of substrings that have only one distinct letter.
-
-
-
Example 1:
-
-
-Input: S = "aaaba"
-Output: 8
-Explanation: The substrings with one distinct letter are "aaa", "aa", "a", "b".
-"aaa" occurs 1 time.
-"aa" occurs 2 times.
-"a" occurs 4 times.
-"b" occurs 1 time.
-So the answer is 1 + 2 + 4 + 1 = 8.
-
-
-
Example 2:
-
-
-Input: S = "aaaaaaaaaa"
-Output: 55
-
-
-
-
Constraints:
-
-
-
1 <= S.length <= 1000
-
S[i] consists of only lowercase English letters.
-
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Hints
-
-Hint 1
-What if we divide the string into substrings containing only one distinct character with maximal lengths?
-
-
-
-Hint 2
-Now that you have sub-strings with only one distinct character, Try to come up with a formula that counts the number of its sub-strings.
-
-
-
-Hint 3
-Alternatively, Observe that the constraints are small so you can use brute force.
-
diff --git a/problems/count-subtrees-with-max-distance-between-cities/README.md b/problems/count-subtrees-with-max-distance-between-cities/README.md
deleted file mode 100644
index 4b8a8e661..000000000
--- a/problems/count-subtrees-with-max-distance-between-cities/README.md
+++ /dev/null
@@ -1,84 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../split-two-strings-to-make-palindrome "Split Two Strings to Make Palindrome")
-
-[Next >](../maximum-font-to-fit-a-sentence-in-a-screen "Maximum Font to Fit a Sentence in a Screen")
-
-## [1617. Count Subtrees With Max Distance Between Cities (Hard)](https://leetcode.com/problems/count-subtrees-with-max-distance-between-cities "统计子树中城市之间最大距离")
-
-
There are n cities numbered from 1 to n. You are given an array edges of size n-1, where edges[i] = [ui, vi] represents a bidirectional edge between cities ui and vi. There exists a unique path between each pair of cities. In other words, the cities form a tree.
-
-
A subtree is a subset of cities where every city is reachable from every other city in the subset, where the path between each pair passes through only the cities from the subset. Two subtrees are different if there is a city in one subtree that is not present in the other.
-
-
For each d from 1 to n-1, find the number of subtrees in which the maximum distance between any two cities in the subtree is equal to d.
-
-
Return an array of sizen-1where the dthelement (1-indexed) is the number of subtrees in which the maximum distance between any two cities is equal to d.
-
-
Notice that the distance between the two cities is the number of edges in the path between them.
-
-
-
Example 1:
-
-
-
-
-Input: n = 4, edges = [[1,2],[2,3],[2,4]]
-Output: [3,4,0]
-Explanation:
-The subtrees with subsets {1,2}, {2,3} and {2,4} have a max distance of 1.
-The subtrees with subsets {1,2,3}, {1,2,4}, {2,3,4} and {1,2,3,4} have a max distance of 2.
-No subtree has two nodes where the max distance between them is 3.
-
-
-
Example 2:
-
-
-Input: n = 2, edges = [[1,2]]
-Output: [1]
-
-
-
Example 3:
-
-
-Input: n = 3, edges = [[1,2],[2,3]]
-Output: [2,1]
-
-
-
-
Constraints:
-
-
-
2 <= n <= 15
-
edges.length == n-1
-
edges[i].length == 2
-
1 <= ui, vi <= n
-
All pairs (ui, vi) are distinct.
-
-
-### Related Topics
- [[Bit Manipulation](../../tag/bit-manipulation/README.md)]
- [[Tree](../../tag/tree/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Bitmask](../../tag/bitmask/README.md)]
- [[Enumeration](../../tag/enumeration/README.md)]
-
-### Hints
-
-Hint 1
-Iterate through every possible subtree by doing a bitmask on which vertices to include. How can you determine if a subtree is valid (all vertices are connected)?
-
-
-
-Hint 2
-To determine connectivity, count the number of reachable vertices starting from any included vertex and only traveling on edges connecting 2 vertices in the subtree. The count should be the same as the number of 1s in the bitmask.
-
-
-
-Hint 3
-The diameter is basically the maximum distance between any two nodes. Root the tree at a vertex. The answer is the max of the heights of the two largest subtrees or the longest diameter in any of the subtrees.
-
diff --git a/problems/count-the-hidden-sequences/README.md b/problems/count-the-hidden-sequences/README.md
deleted file mode 100644
index 7b6dd0bc0..000000000
--- a/problems/count-the-hidden-sequences/README.md
+++ /dev/null
@@ -1,96 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-cost-of-buying-candies-with-discount "Minimum Cost of Buying Candies With Discount")
-
-[Next >](../k-highest-ranked-items-within-a-price-range "K Highest Ranked Items Within a Price Range")
-
-## [2145. Count the Hidden Sequences (Medium)](https://leetcode.com/problems/count-the-hidden-sequences "统计隐藏数组数目")
-
-
You are given a 0-indexed array of n integers differences, which describes the differences between each pair of consecutive integers of a hidden sequence of length (n + 1). More formally, call the hidden sequence hidden, then we have that differences[i] = hidden[i + 1] - hidden[i].
-
-
You are further given two integers lower and upper that describe the inclusive range of values [lower, upper] that the hidden sequence can contain.
-
-
-
For example, given differences = [1, -3, 4], lower = 1, upper = 6, the hidden sequence is a sequence of length 4 whose elements are in between 1 and 6 (inclusive).
-
-
[3, 4, 1, 5] and [4, 5, 2, 6] are possible hidden sequences.
-
[5, 6, 3, 7] is not possible since it contains an element greater than 6.
-
[1, 2, 3, 4] is not possible since the differences are not correct.
-
-
-
-
-
Return the number of possible hidden sequences there are. If there are no possible sequences, return 0.
-Input: differences = [4,-7,2], lower = 3, upper = 6
-Output: 0
-Explanation: There are no possible hidden sequences. Thus, we return 0.
-
-
-
-
Constraints:
-
-
-
n == differences.length
-
1 <= n <= 105
-
-105 <= differences[i] <= 105
-
-105 <= lower <= upper <= 105
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Prefix Sum](../../tag/prefix-sum/README.md)]
-
-### Hints
-
-Hint 1
-Fix the first element of the hidden sequence to any value x and ignore the given bounds. Notice that we can then determine all the other elements of the sequence by using the differences array.
-
-
-
-Hint 2
-We will also be able to determine the difference between the minimum and maximum elements of the sequence. Notice that the value of x does not affect this.
-
-
-
-Hint 3
-We now have the ‘range’ of the sequence (difference between min and max element), we can then calculate how many ways there are to fit this range into the given range of lower to upper.
-
-
-
-Hint 4
-Answer is (upper - lower + 1) - (range of sequence)
-
diff --git a/problems/count-the-number-of-consistent-strings/README.md b/problems/count-the-number-of-consistent-strings/README.md
deleted file mode 100644
index 0149ed188..000000000
--- a/problems/count-the-number-of-consistent-strings/README.md
+++ /dev/null
@@ -1,69 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../invalid-tweets "Invalid Tweets")
-
-[Next >](../sum-of-absolute-differences-in-a-sorted-array "Sum of Absolute Differences in a Sorted Array")
-
-## [1684. Count the Number of Consistent Strings (Easy)](https://leetcode.com/problems/count-the-number-of-consistent-strings "统计一致字符串的数目")
-
-
You are given a string allowed consisting of distinct characters and an array of strings words. A string is consistent if all characters in the string appear in the string allowed.
-
-
Return the number of consistent strings in the array words.
-
-
-
Example 1:
-
-
-Input: allowed = "ab", words = ["ad","bd","aaab","baa","badab"]
-Output: 2
-Explanation: Strings "aaab" and "baa" are consistent since they only contain characters 'a' and 'b'.
-
-
-
Example 2:
-
-
-Input: allowed = "abc", words = ["a","b","c","ab","ac","bc","abc"]
-Output: 7
-Explanation: All strings are consistent.
-
-
-
Example 3:
-
-
-Input: allowed = "cad", words = ["cc","acd","b","ba","bac","bad","ac","d"]
-Output: 4
-Explanation: Strings "cc", "acd", "ac", and "d" are consistent.
-
-
-
-
Constraints:
-
-
-
1 <= words.length <= 104
-
1 <= allowed.length <=26
-
1 <= words[i].length <= 10
-
The characters in allowed are distinct.
-
words[i] and allowed contain only lowercase English letters.
-
-
-### Related Topics
- [[Bit Manipulation](../../tag/bit-manipulation/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Hints
-
-Hint 1
-A string is incorrect if it contains a character that is not allowed
-
-
-
-Hint 2
-Constraints are small enough for brute force
-
diff --git a/problems/count-the-number-of-experiments/README.md b/problems/count-the-number-of-experiments/README.md
deleted file mode 100644
index 32f1a9733..000000000
--- a/problems/count-the-number-of-experiments/README.md
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-number-of-people-that-can-be-caught-in-tag "Maximum Number of People That Can Be Caught in Tag")
-
-[Next >](../find-the-middle-index-in-array "Find the Middle Index in Array")
-
-## [1990. Count the Number of Experiments (Easy)](https://leetcode.com/problems/count-the-number-of-experiments "统计实验的数量")
-
-
diff --git a/problems/count-the-number-of-experiments/mysql_schemas.sql b/problems/count-the-number-of-experiments/mysql_schemas.sql
deleted file mode 100644
index 751d5694e..000000000
--- a/problems/count-the-number-of-experiments/mysql_schemas.sql
+++ /dev/null
@@ -1,8 +0,0 @@
-Create table If Not Exists Experiments (experiment_id int, platform ENUM('Android', 'IOS', 'Web'), experiment_name ENUM('Reading', 'Sports', 'Programming'));
-Truncate table Experiments;
-insert into Experiments (experiment_id, platform, experiment_name) values ('4', 'IOS', 'Programming');
-insert into Experiments (experiment_id, platform, experiment_name) values ('13', 'IOS', 'Sports');
-insert into Experiments (experiment_id, platform, experiment_name) values ('14', 'Android', 'Reading');
-insert into Experiments (experiment_id, platform, experiment_name) values ('8', 'Web', 'Reading');
-insert into Experiments (experiment_id, platform, experiment_name) values ('12', 'Web', 'Reading');
-insert into Experiments (experiment_id, platform, experiment_name) values ('18', 'Web', 'Programming');
diff --git a/problems/count-the-repetitions/README.md b/problems/count-the-repetitions/README.md
deleted file mode 100644
index 7c6d44a5e..000000000
--- a/problems/count-the-repetitions/README.md
+++ /dev/null
@@ -1,49 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../optimal-account-balancing "Optimal Account Balancing")
-
-[Next >](../unique-substrings-in-wraparound-string "Unique Substrings in Wraparound String")
-
-## [466. Count The Repetitions (Hard)](https://leetcode.com/problems/count-the-repetitions "统计重复个数")
-
-
We define str = [s, n] as the string str which consists of the string s concatenated n times.
-
-
-
For example, str == ["abc", 3] =="abcabcabc".
-
-
-
We define that string s1 can be obtained from string s2 if we can remove some characters from s2 such that it becomes s1.
-
-
-
For example, s1 = "abc" can be obtained from s2 = "abdbec" based on our definition by removing the bolded underlined characters.
-
-
-
You are given two strings s1 and s2 and two integers n1 and n2. You have the two strings str1 = [s1, n1] and str2 = [s2, n2].
-
-
Return the maximum integer m such that str = [str2, m] can be obtained from str1.
-
-### Related Topics
- [[String](../../tag/string/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
diff --git a/problems/count-the-repetitions/count_the_repetitions.go b/problems/count-the-repetitions/count_the_repetitions.go
deleted file mode 100644
index e50018ee1..000000000
--- a/problems/count-the-repetitions/count_the_repetitions.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem466
diff --git a/problems/count-the-repetitions/count_the_repetitions_test.go b/problems/count-the-repetitions/count_the_repetitions_test.go
deleted file mode 100644
index e50018ee1..000000000
--- a/problems/count-the-repetitions/count_the_repetitions_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem466
diff --git a/problems/count-triplets-that-can-form-two-arrays-of-equal-xor/README.md b/problems/count-triplets-that-can-form-two-arrays-of-equal-xor/README.md
deleted file mode 100644
index 54729a4f0..000000000
--- a/problems/count-triplets-that-can-form-two-arrays-of-equal-xor/README.md
+++ /dev/null
@@ -1,69 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../build-an-array-with-stack-operations "Build an Array With Stack Operations")
-
-[Next >](../minimum-time-to-collect-all-apples-in-a-tree "Minimum Time to Collect All Apples in a Tree")
-
-## [1442. Count Triplets That Can Form Two Arrays of Equal XOR (Medium)](https://leetcode.com/problems/count-triplets-that-can-form-two-arrays-of-equal-xor "形成两个异或相等数组的三元组数目")
-
-
Given an array of integers arr.
-
-
We want to select three indices i, j and k where (0 <= i < j <= k < arr.length).
-
-
Let's define a and b as follows:
-
-
-
a = arr[i] ^ arr[i + 1] ^ ... ^ arr[j - 1]
-
b = arr[j] ^ arr[j + 1] ^ ... ^ arr[k]
-
-
-
Note that ^ denotes the bitwise-xor operation.
-
-
Return the number of triplets (i, j and k) Where a == b.
-
-
-
Example 1:
-
-
-Input: arr = [2,3,1,6,7]
-Output: 4
-Explanation: The triplets are (0,1,2), (0,2,2), (2,3,4) and (2,4,4)
-
-
-
Example 2:
-
-
-Input: arr = [1,1,1,1,1]
-Output: 10
-
-
-
-
Constraints:
-
-
-
1 <= arr.length <= 300
-
1 <= arr[i] <= 108
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Math](../../tag/math/README.md)]
- [[Bit Manipulation](../../tag/bit-manipulation/README.md)]
- [[Prefix Sum](../../tag/prefix-sum/README.md)]
-
-### Hints
-
-Hint 1
-We are searching for sub-array of length ≥ 2 and we need to split it to 2 non-empty arrays so that the xor of the first array is equal to the xor of the second array. This is equivalent to searching for sub-array with xor = 0.
-
-
-
-Hint 2
-Keep the prefix xor of arr in another array, check the xor of all sub-arrays in O(n^2), if the xor of sub-array of length x is 0 add x-1 to the answer.
-
diff --git a/problems/count-unhappy-friends/README.md b/problems/count-unhappy-friends/README.md
deleted file mode 100644
index 10eb99863..000000000
--- a/problems/count-unhappy-friends/README.md
+++ /dev/null
@@ -1,86 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../special-positions-in-a-binary-matrix "Special Positions in a Binary Matrix")
-
-[Next >](../min-cost-to-connect-all-points "Min Cost to Connect All Points")
-
-## [1583. Count Unhappy Friends (Medium)](https://leetcode.com/problems/count-unhappy-friends "统计不开心的朋友")
-
-
You are given a list of preferences for n friends, where n is always even.
-
-
For each person i, preferences[i] contains a list of friends sorted in the order of preference. In other words, a friend earlier in the list is more preferred than a friend later in the list. Friends in each list are denoted by integers from 0 to n-1.
-
-
All the friends are divided into pairs. The pairings are given in a list pairs, where pairs[i] = [xi, yi] denotes xi is paired with yi and yi is paired with xi.
-
-
However, this pairing may cause some of the friends to be unhappy. A friend x is unhappy if x is paired with y and there exists a friend u who is paired with v but:
-
-
-
x prefers u over y, and
-
u prefers x over v.
-
-
-
Return the number of unhappy friends.
-
-
-
Example 1:
-
-
-Input: n = 4, preferences = [[1, 2, 3], [3, 2, 0], [3, 1, 0], [1, 2, 0]], pairs = [[0, 1], [2, 3]]
-Output: 2
-Explanation:
-Friend 1 is unhappy because:
-- 1 is paired with 0 but prefers 3 over 0, and
-- 3 prefers 1 over 2.
-Friend 3 is unhappy because:
-- 3 is paired with 2 but prefers 1 over 2, and
-- 1 prefers 3 over 0.
-Friends 0 and 2 are happy.
-
-
-
Example 2:
-
-
-Input: n = 2, preferences = [[1], [0]], pairs = [[1, 0]]
-Output: 0
-Explanation: Both friends 0 and 1 are happy.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Simulation](../../tag/simulation/README.md)]
-
-### Hints
-
-Hint 1
-Create a matrix “rank” where rank[i][j] holds how highly friend ‘i' views ‘j’. This allows for O(1) comparisons between people
-
diff --git a/problems/count-unique-characters-of-all-substrings-of-a-given-string/README.md b/problems/count-unique-characters-of-all-substrings-of-a-given-string/README.md
deleted file mode 100644
index cd6f99d95..000000000
--- a/problems/count-unique-characters-of-all-substrings-of-a-given-string/README.md
+++ /dev/null
@@ -1,60 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../making-a-large-island "Making A Large Island")
-
-[Next >](../consecutive-numbers-sum "Consecutive Numbers Sum")
-
-## [828. Count Unique Characters of All Substrings of a Given String (Hard)](https://leetcode.com/problems/count-unique-characters-of-all-substrings-of-a-given-string "统计子串中的唯一字符")
-
-
Let's define a function countUniqueChars(s) that returns the number of unique characters on s.
-
-
-
For example if s = "LEETCODE" then "L", "T", "C", "O", "D" are the unique characters since they appear only once in s, therefore countUniqueChars(s) = 5.
-
-
-
Given a string s, return the sum of countUniqueChars(t) where t is a substring of s.
-
-
Notice that some substrings can be repeated so in this case you have to count the repeated ones too.
-
-
-
Example 1:
-
-
-Input: s = "ABC"
-Output: 10
-Explanation: All possible substrings are: "A","B","C","AB","BC" and "ABC".
-Evey substring is composed with only unique letters.
-Sum of lengths of all substring is 1 + 1 + 1 + 2 + 2 + 3 = 10
-
-
-
Example 2:
-
-
-Input: s = "ABA"
-Output: 8
-Explanation: The same as example 1, except countUniqueChars("ABA") = 1.
-
A substring is a contiguous (non-empty) sequence of characters within a string.
-
-
A vowel substring is a substring that only consists of vowels ('a', 'e', 'i', 'o', and 'u') and has all five vowels present in it.
-
-
Given a string word, return the number of vowel substrings inword.
-
-
-
Example 1:
-
-
-Input: word = "aeiouu"
-Output: 2
-Explanation: The vowel substrings of word are as follows (underlined):
-- "aeiouu"
-- "aeiouu"
-
-
-
Example 2:
-
-
-Input: word = "unicornarihan"
-Output: 0
-Explanation: Not all 5 vowels are present, so there are no vowel substrings.
-
-
-
Example 3:
-
-
-Input: word = "cuaieuouac"
-Output: 7
-Explanation: The vowel substrings of word are as follows (underlined):
-- "cuaieuouac"
-- "cuaieuouac"
-- "cuaieuouac"
-- "cuaieuouac"
-- "cuaieuouac"
-- "cuaieuouac"
-- "cuaieuouac"
-
-
-
-
Constraints:
-
-
-
1 <= word.length <= 100
-
word consists of lowercase English letters only.
-
-
-### Related Topics
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Hints
-
-Hint 1
-While generating substrings starting at any index, do you need to continue generating larger substrings if you encounter a consonant?
-
-
-
-Hint 2
-Can you store the count of characters to avoid generating substrings altogether?
-
diff --git a/problems/count-vowels-permutation/README.md b/problems/count-vowels-permutation/README.md
deleted file mode 100644
index ea4985e9b..000000000
--- a/problems/count-vowels-permutation/README.md
+++ /dev/null
@@ -1,74 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../path-with-maximum-gold "Path with Maximum Gold")
-
-[Next >](../split-a-string-in-balanced-strings "Split a String in Balanced Strings")
-
-## [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:
-
-
-
Each character is a lower case vowel ('a', 'e', 'i', 'o', 'u')
-
Each vowel 'a' may only be followed by an 'e'.
-
Each vowel 'e' may only be followed by an 'a' or an 'i'.
-
Each vowel 'i'may not be followed by another 'i'.
-
Each vowel 'o' may only be followed by an 'i' or a 'u'.
-
Each vowel 'u' may only be followed by an 'a'.
-
-
-
Since the answer may be too large, return it modulo 10^9 + 7.
-
-
-
Example 1:
-
-
-Input: n = 1
-Output: 5
-Explanation: All possible strings are: "a", "e", "i" , "o" and "u".
-
-
-
Example 2:
-
-
-Input: n = 2
-Output: 10
-Explanation: All possible strings are: "ae", "ea", "ei", "ia", "ie", "io", "iu", "oi", "ou" and "ua".
-
-
-
Example 3:
-
-
-Input: n = 5
-Output: 68
-
-
-
Constraints:
-
-
-
1 <= n <= 2 * 10^4
-
-
-### Related Topics
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Hints
-
-Hint 1
-Use dynamic programming.
-
-
-
-Hint 2
-Let dp[i][j] be the number of strings of length i that ends with the j-th vowel.
-
-
-
-Hint 3
-Deduce the recurrence from the given relations between vowels.
-
diff --git a/problems/count-ways-to-build-rooms-in-an-ant-colony/README.md b/problems/count-ways-to-build-rooms-in-an-ant-colony/README.md
deleted file mode 100644
index 60c14efc3..000000000
--- a/problems/count-ways-to-build-rooms-in-an-ant-colony/README.md
+++ /dev/null
@@ -1,78 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../number-of-wonderful-substrings "Number of Wonderful Substrings")
-
-[Next >](../leetcodify-friends-recommendations "Leetcodify Friends Recommendations")
-
-## [1916. Count Ways to Build Rooms in an Ant Colony (Hard)](https://leetcode.com/problems/count-ways-to-build-rooms-in-an-ant-colony "统计为蚁群构筑房间的不同顺序")
-
-
You are an ant tasked with adding n new rooms numbered 0 to n-1 to your colony. You are given the expansion plan as a 0-indexed integer array of length n, prevRoom, where prevRoom[i] indicates that you must build room prevRoom[i] before building room i, and these two rooms must be connected directly. Room 0 is already built, so prevRoom[0] = -1. The expansion plan is given such that once all the rooms are built, every room will be reachable from room 0.
-
-
You can only build one room at a time, and you can travel freely between rooms you have already built only if they are connected. You can choose to build any room as long as its previous room is already built.
-
-
Return the number of different orders you can build all the rooms in. Since the answer may be large, return it modulo109 + 7.
-
-
-
Example 1:
-
-
-Input: prevRoom = [-1,0,1]
-Output: 1
-Explanation: There is only one way to build the additional rooms: 0 → 1 → 2
-
Every room is reachable from room 0 once all the rooms are built.
-
-
-### Related Topics
- [[Tree](../../tag/tree/README.md)]
- [[Graph](../../tag/graph/README.md)]
- [[Topological Sort](../../tag/topological-sort/README.md)]
- [[Math](../../tag/math/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Combinatorics](../../tag/combinatorics/README.md)]
-
-### Hints
-
-Hint 1
-Use dynamic programming.
-
-
-
-Hint 2
-Let dp[i] be the number of ways to solve the problem for the subtree of node i.
-
-
-
-Hint 3
-Imagine you are trying to fill an array with the order of traversal, dp[i] equals the multiplications of the number of ways to distribute the subtrees of the children of i on the array using combinatorics, multiplied bu their dp values.
-
diff --git a/problems/count-ways-to-distribute-candies/README.md b/problems/count-ways-to-distribute-candies/README.md
deleted file mode 100644
index e84290d1c..000000000
--- a/problems/count-ways-to-distribute-candies/README.md
+++ /dev/null
@@ -1,38 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-height-by-stacking-cuboids "Maximum Height by Stacking Cuboids ")
-
-[Next >](../daily-leads-and-partners "Daily Leads and Partners")
-
-## [1692. Count Ways to Distribute Candies (Hard)](https://leetcode.com/problems/count-ways-to-distribute-candies "计算分配糖果的不同方式")
-
-
-
-### Related Topics
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Hints
-
-Hint 1
-Try to define a recursive approach. For the ith candies, there will be one of the two following cases:
-
-
-
-Hint 2
-If the i - 1 previous candies are already distributed into k bags for the ith candy, you can have k * dp[n - 1][k] ways to distribute the ith candy. We need then to solve the state of (n - 1, k).
-
-
-
-Hint 3
-If the i - 1 previous candies are already distributed into k - 1 bags for the ith candy, you can have dp[n - 1][k - 1] ways to distribute the ith candy. We need then to solve the state of (n - 1, k - 1).
-
-
-
-Hint 4
-This approach will be too slow and will traverse some states more than once. We should use memoization to make the algorithm efficient.
-
diff --git a/problems/count-ways-to-make-array-with-product/README.md b/problems/count-ways-to-make-array-with-product/README.md
deleted file mode 100644
index e96f4859a..000000000
--- a/problems/count-ways-to-make-array-with-product/README.md
+++ /dev/null
@@ -1,59 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../decode-xored-permutation "Decode XORed Permutation")
-
-[Next >](../latest-time-by-replacing-hidden-digits "Latest Time by Replacing Hidden Digits")
-
-## [1735. Count Ways to Make Array With Product (Hard)](https://leetcode.com/problems/count-ways-to-make-array-with-product "生成乘积数组的方案数")
-
-
You are given a 2D integer array, queries. For each queries[i], where queries[i] = [ni, ki], find the number of different ways you can place positive integers into an array of size ni such that the product of the integers is ki. As the number of ways may be too large, the answer to the ith query is the number of ways modulo109 + 7.
-
-
Return an integer array answer where answer.length == queries.length, and answer[i] is the answer to the ith query.
-
-
-
Example 1:
-
-
-Input: queries = [[2,6],[5,1],[73,660]]
-Output: [4,1,50734910]
-Explanation: Each query is independent.
-[2,6]: There are 4 ways to fill an array of size 2 that multiply to 6: [1,6], [2,3], [3,2], [6,1].
-[5,1]: There is 1 way to fill an array of size 5 that multiply to 1: [1,1,1,1,1].
-[73,660]: There are 1050734917 ways to fill an array of size 73 that multiply to 660. 1050734917 modulo 109 + 7 = 50734910.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Math](../../tag/math/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Hints
-
-Hint 1
-Prime-factorize ki and count how many ways you can distribute the primes among the ni positions.
-
-
-
-Hint 2
-After prime factorizing ki, suppose there are x amount of prime factor. There are (x + n - 1) choose (n - 1) ways to distribute the x prime factors into k positions, allowing repetitions.
-
diff --git a/problems/count-words-obtained-after-adding-a-letter/README.md b/problems/count-words-obtained-after-adding-a-letter/README.md
deleted file mode 100644
index b182d8fbc..000000000
--- a/problems/count-words-obtained-after-adding-a-letter/README.md
+++ /dev/null
@@ -1,86 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-swaps-to-group-all-1s-together-ii "Minimum Swaps to Group All 1's Together II")
-
-[Next >](../earliest-possible-day-of-full-bloom "Earliest Possible Day of Full Bloom")
-
-## [2135. Count Words Obtained After Adding a Letter (Medium)](https://leetcode.com/problems/count-words-obtained-after-adding-a-letter "统计追加字母可以获得的单词数")
-
-
You are given two 0-indexed arrays of strings startWords and targetWords. Each string consists of lowercase English letters only.
-
-
For each string in targetWords, check if it is possible to choose a string from startWords and perform a conversion operation on it to be equal to that from targetWords.
-
-
The conversion operation is described in the following two steps:
-
-
-
Append any lowercase letter that is not present in the string to its end.
-
-
For example, if the string is "abc", the letters 'd', 'e', or 'y' can be added to it, but not 'a'. If 'd' is added, the resulting string will be "abcd".
-
-
-
Rearrange the letters of the new string in any arbitrary order.
-
-
For example, "abcd" can be rearranged to "acbd", "bacd", "cbda", and so on. Note that it can also be rearranged to "abcd" itself.
-
-
-
-
-
Return the number of strings in targetWords that can be obtained by performing the operations on any string of startWords.
-
-
Note that you will only be verifying if the string in targetWords can be obtained from a string in startWords by performing the operations. The strings in startWordsdo not actually change during this process.
-
-
-
Example 1:
-
-
-Input: startWords = ["ant","act","tack"], targetWords = ["tack","act","acti"]
-Output: 2
-Explanation:
-- In order to form targetWords[0] = "tack", we use startWords[1] = "act", append 'k' to it, and rearrange "actk" to "tack".
-- There is no string in startWords that can be used to obtain targetWords[1] = "act".
- Note that "act" does exist in startWords, but we must append one letter to the string before rearranging it.
-- In order to form targetWords[2] = "acti", we use startWords[1] = "act", append 'i' to it, and rearrange "acti" to "acti" itself.
-
-
-
Example 2:
-
-
-Input: startWords = ["ab","a"], targetWords = ["abc","abcd"]
-Output: 1
-Explanation:
-- In order to form targetWords[0] = "abc", we use startWords[0] = "ab", add 'c' to it, and rearrange it to "abc".
-- There is no string in startWords that can be used to obtain targetWords[1] = "abcd".
-
Each string of startWords and targetWords consists of lowercase English letters only.
-
No letter occurs more than once in any string of startWords or targetWords.
-
-
-### Related Topics
- [[Bit Manipulation](../../tag/bit-manipulation/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Hints
-
-Hint 1
-Which data structure can be used to efficiently check if a string exists in startWords?
-
-
-
-Hint 2
-After appending a letter, all letters of a string can be rearranged in any possible way. How can we use this to reduce our search space while checking if a string in targetWords can be obtained from a string in startWords?
-
diff --git a/problems/counting-bits/README.md b/problems/counting-bits/README.md
deleted file mode 100644
index edcd0c085..000000000
--- a/problems/counting-bits/README.md
+++ /dev/null
@@ -1,78 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../house-robber-iii "House Robber III")
-
-[Next >](../nested-list-weight-sum "Nested List Weight Sum")
-
-## [338. Counting Bits (Easy)](https://leetcode.com/problems/counting-bits "比特位计数")
-
-
Given an integer n, return an array ans of length n + 1 such that for each i(0 <= i <= n), ans[i] is the number of 1's in the binary representation of i.
It is very easy to come up with a solution with a runtime of O(n log n). Can you do it in linear time O(n) and possibly in a single pass?
-
Can you do it without using any built-in function (i.e., like __builtin_popcount in C++)?
-
-
-### Related Topics
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Bit Manipulation](../../tag/bit-manipulation/README.md)]
-
-### Similar Questions
- 1. [Number of 1 Bits](../number-of-1-bits) (Easy)
-
-### Hints
-
-Hint 1
-You should make use of what you have produced already.
-
-
-
-Hint 2
-Divide the numbers in ranges like [2-3], [4-7], [8-15] and so on. And try to generate new range from previous.
-
-
-
-Hint 3
-Or does the odd/even status of the number help you in calculating the number of 1s?
-
diff --git a/problems/counting-bits/counting_bits.go b/problems/counting-bits/counting_bits.go
deleted file mode 100644
index cf3a610dc..000000000
--- a/problems/counting-bits/counting_bits.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem338
diff --git a/problems/counting-bits/counting_bits_test.go b/problems/counting-bits/counting_bits_test.go
deleted file mode 100644
index cf3a610dc..000000000
--- a/problems/counting-bits/counting_bits_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem338
diff --git a/problems/counting-elements/README.md b/problems/counting-elements/README.md
deleted file mode 100644
index 5b85f3d94..000000000
--- a/problems/counting-elements/README.md
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../constrained-subsequence-sum "Constrained Subsequence Sum")
-
-[Next >](../perform-string-shifts "Perform String Shifts")
-
-## [1426. Counting Elements (Easy)](https://leetcode.com/problems/counting-elements "数元素")
-
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
-
-### Hints
-
-Hint 1
-Use hashset to store all elements.
-
-
-
-Hint 2
-Loop again to count all valid elements.
-
diff --git a/problems/countries-you-can-safely-invest-in/README.md b/problems/countries-you-can-safely-invest-in/README.md
deleted file mode 100644
index 75a1ea51b..000000000
--- a/problems/countries-you-can-safely-invest-in/README.md
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../design-a-file-sharing-system "Design a File Sharing System")
-
-[Next >](../can-make-arithmetic-progression-from-sequence "Can Make Arithmetic Progression From Sequence")
-
-## [1501. Countries You Can Safely Invest In (Medium)](https://leetcode.com/problems/countries-you-can-safely-invest-in "可以放心投资的国家")
-
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
-
-### Similar Questions
- 1. [Average Salary: Departments VS Company](../average-salary-departments-vs-company) (Hard)
diff --git a/problems/countries-you-can-safely-invest-in/mysql_schemas.sql b/problems/countries-you-can-safely-invest-in/mysql_schemas.sql
deleted file mode 100644
index ca07cd0eb..000000000
--- a/problems/countries-you-can-safely-invest-in/mysql_schemas.sql
+++ /dev/null
@@ -1,27 +0,0 @@
-Create table If Not Exists Person (id int, name varchar(15), phone_number varchar(11));
-Create table If Not Exists Country (name varchar(15), country_code varchar(3));
-Create table If Not Exists Calls (caller_id int, callee_id int, duration int);
-Truncate table Person;
-insert into Person (id, name, phone_number) values ('3', 'Jonathan', '051-1234567');
-insert into Person (id, name, phone_number) values ('12', 'Elvis', '051-7654321');
-insert into Person (id, name, phone_number) values ('1', 'Moncef', '212-1234567');
-insert into Person (id, name, phone_number) values ('2', 'Maroua', '212-6523651');
-insert into Person (id, name, phone_number) values ('7', 'Meir', '972-1234567');
-insert into Person (id, name, phone_number) values ('9', 'Rachel', '972-0011100');
-Truncate table Country;
-insert into Country (name, country_code) values ('Peru', '051');
-insert into Country (name, country_code) values ('Israel', '972');
-insert into Country (name, country_code) values ('Morocco', '212');
-insert into Country (name, country_code) values ('Germany', '049');
-insert into Country (name, country_code) values ('Ethiopia', '251');
-Truncate table Calls;
-insert into Calls (caller_id, callee_id, duration) values ('1', '9', '33');
-insert into Calls (caller_id, callee_id, duration) values ('2', '9', '4');
-insert into Calls (caller_id, callee_id, duration) values ('1', '2', '59');
-insert into Calls (caller_id, callee_id, duration) values ('3', '12', '102');
-insert into Calls (caller_id, callee_id, duration) values ('3', '12', '330');
-insert into Calls (caller_id, callee_id, duration) values ('12', '3', '5');
-insert into Calls (caller_id, callee_id, duration) values ('7', '9', '13');
-insert into Calls (caller_id, callee_id, duration) values ('7', '1', '3');
-insert into Calls (caller_id, callee_id, duration) values ('9', '7', '1');
-insert into Calls (caller_id, callee_id, duration) values ('1', '7', '7');
diff --git a/problems/couples-holding-hands/README.md b/problems/couples-holding-hands/README.md
deleted file mode 100644
index 517465e5d..000000000
--- a/problems/couples-holding-hands/README.md
+++ /dev/null
@@ -1,64 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../largest-plus-sign "Largest Plus Sign")
-
-[Next >](../toeplitz-matrix "Toeplitz Matrix")
-
-## [765. Couples Holding Hands (Hard)](https://leetcode.com/problems/couples-holding-hands "情侣牵手")
-
-
There are n couples sitting in 2n seats arranged in a row and want to hold hands.
-
-
The people and seats are represented by an integer array row where row[i] is the ID of the person sitting in the ith seat. The couples are numbered in order, the first couple being (0, 1), the second couple being (2, 3), and so on with the last couple being (2n - 2, 2n - 1).
-
-
Return the minimum number of swaps so that every couple is sitting side by side. A swap consists of choosing any two people, then they stand up and switch seats.
-
-
-
Example 1:
-
-
-Input: row = [0,2,1,3]
-Output: 1
-Explanation: We only need to swap the second (row[1]) and third (row[2]) person.
-
-
-
Example 2:
-
-
-Input: row = [3,2,0,1]
-Output: 0
-Explanation: All couples are already seated side by side.
-
-
-
-
Constraints:
-
-
-
2n == row.length
-
2 <= n <= 30
-
n is even.
-
0 <= row[i] < 2n
-
All the elements of row are unique.
-
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Union Find](../../tag/union-find/README.md)]
- [[Graph](../../tag/graph/README.md)]
-
-### Similar Questions
- 1. [First Missing Positive](../first-missing-positive) (Hard)
- 1. [Missing Number](../missing-number) (Easy)
- 1. [K-Similar Strings](../k-similar-strings) (Hard)
-
-### Hints
-
-Hint 1
-Say there are N two-seat couches. For each couple, draw an edge from the couch of one partner to the couch of the other partner.
-
diff --git a/problems/couples-holding-hands/couples_holding_hands.go b/problems/couples-holding-hands/couples_holding_hands.go
deleted file mode 100644
index 4a3016bc7..000000000
--- a/problems/couples-holding-hands/couples_holding_hands.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem765
diff --git a/problems/couples-holding-hands/couples_holding_hands_test.go b/problems/couples-holding-hands/couples_holding_hands_test.go
deleted file mode 100644
index 4a3016bc7..000000000
--- a/problems/couples-holding-hands/couples_holding_hands_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem765
diff --git a/problems/course-schedule-ii/README.md b/problems/course-schedule-ii/README.md
deleted file mode 100644
index e84e3bcf3..000000000
--- a/problems/course-schedule-ii/README.md
+++ /dev/null
@@ -1,87 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-size-subarray-sum "Minimum Size Subarray Sum")
-
-[Next >](../design-add-and-search-words-data-structure "Design Add and Search Words Data Structure")
-
-## [210. Course Schedule II (Medium)](https://leetcode.com/problems/course-schedule-ii "课程表 II")
-
-
There are a total of numCourses courses you have to take, labeled from 0 to numCourses - 1. You are given an array prerequisites where prerequisites[i] = [ai, bi] indicates that you must take course bi first if you want to take course ai.
-
-
-
For example, the pair [0, 1], indicates that to take course 0 you have to first take course 1.
-
-
-
Return the ordering of courses you should take to finish all courses. If there are many valid answers, return any of them. If it is impossible to finish all courses, return an empty array.
-
-
-
Example 1:
-
-
-Input: numCourses = 2, prerequisites = [[1,0]]
-Output: [0,1]
-Explanation: There are a total of 2 courses to take. To take course 1 you should have finished course 0. So the correct course order is [0,1].
-
-
-
Example 2:
-
-
-Input: numCourses = 4, prerequisites = [[1,0],[2,0],[3,1],[3,2]]
-Output: [0,2,1,3]
-Explanation: There are a total of 4 courses to take. To take course 3 you should have finished both courses 1 and 2. Both courses 1 and 2 should be taken after you finished course 0.
-So one correct course order is [0,1,2,3]. Another correct ordering is [0,2,1,3].
-
-
-### Related Topics
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Graph](../../tag/graph/README.md)]
- [[Topological Sort](../../tag/topological-sort/README.md)]
-
-### Similar Questions
- 1. [Course Schedule](../course-schedule) (Medium)
- 1. [Alien Dictionary](../alien-dictionary) (Hard)
- 1. [Minimum Height Trees](../minimum-height-trees) (Medium)
- 1. [Sequence Reconstruction](../sequence-reconstruction) (Medium)
- 1. [Course Schedule III](../course-schedule-iii) (Hard)
- 1. [Parallel Courses](../parallel-courses) (Medium)
-
-### Hints
-
-Hint 1
-This problem is equivalent to finding the topological order in a directed graph. If a cycle exists, no topological ordering exists and therefore it will be impossible to take all courses.
-
-
-
-Hint 2
-Topological Sort via DFS - A great video tutorial (21 minutes) on Coursera explaining the basic concepts of Topological Sort.
-
-
-
-Hint 3
-Topological sort could also be done via BFS.
-
diff --git a/problems/course-schedule-ii/course_schedule_ii.go b/problems/course-schedule-ii/course_schedule_ii.go
deleted file mode 100644
index bb91c4a93..000000000
--- a/problems/course-schedule-ii/course_schedule_ii.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem210
diff --git a/problems/course-schedule-ii/course_schedule_ii_test.go b/problems/course-schedule-ii/course_schedule_ii_test.go
deleted file mode 100644
index bb91c4a93..000000000
--- a/problems/course-schedule-ii/course_schedule_ii_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem210
diff --git a/problems/course-schedule-iii/README.md b/problems/course-schedule-iii/README.md
deleted file mode 100644
index bdfa941a0..000000000
--- a/problems/course-schedule-iii/README.md
+++ /dev/null
@@ -1,78 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../k-inverse-pairs-array "K Inverse Pairs Array")
-
-[Next >](../design-excel-sum-formula "Design Excel Sum Formula")
-
-## [630. Course Schedule III (Hard)](https://leetcode.com/problems/course-schedule-iii "课程表 III")
-
-
There are n different online courses numbered from 1 to n. You are given an array courses where courses[i] = [durationi, lastDayi] indicate that the ith course should be taken continuously for durationi days and must be finished before or on lastDayi.
-
-
You will start on the 1st day and you cannot take two or more courses simultaneously.
-
-
Return the maximum number of courses that you can take.
-
-
-
Example 1:
-
-
-Input: courses = [[100,200],[200,1300],[1000,1250],[2000,3200]]
-Output: 3
-Explanation:
-There are totally 4 courses, but you can take 3 courses at most:
-First, take the 1st course, it costs 100 days so you will finish it on the 100th day, and ready to take the next course on the 101st day.
-Second, take the 3rd course, it costs 1000 days so you will finish it on the 1100th day, and ready to take the next course on the 1101st day.
-Third, take the 2nd course, it costs 200 days so you will finish it on the 1300th day.
-The 4th course cannot be taken now, since you will finish it on the 3300th day, which exceeds the closed date.
-
-
-
Example 2:
-
-
-Input: courses = [[1,2]]
-Output: 1
-
-
-
Example 3:
-
-
-Input: courses = [[3,2],[4,3]]
-Output: 0
-
-
-
-
Constraints:
-
-
-
1 <= courses.length <= 104
-
1 <= durationi, lastDayi <= 104
-
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Heap (Priority Queue)](../../tag/heap-priority-queue/README.md)]
-
-### Similar Questions
- 1. [Course Schedule](../course-schedule) (Medium)
- 1. [Course Schedule II](../course-schedule-ii) (Medium)
-
-### Hints
-
-Hint 1
-During iteration, say I want to add the current course, currentTotalTime being total time of all courses taken till now, but adding the current course might exceed my deadline or it doesn’t.
-
-1. If it doesn’t, then I have added one new course. Increment the currentTotalTime with duration of current course.
-
-
-
-Hint 2
-2. If it exceeds deadline, I can swap current course with current courses that has biggest duration.
-* No harm done and I might have just reduced the currentTotalTime, right?
-* What preprocessing do I need to do on my course processing order so that this swap is always legal?
-
diff --git a/problems/course-schedule-iii/course_schedule_iii.go b/problems/course-schedule-iii/course_schedule_iii.go
deleted file mode 100644
index b4237004c..000000000
--- a/problems/course-schedule-iii/course_schedule_iii.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem630
diff --git a/problems/course-schedule-iii/course_schedule_iii_test.go b/problems/course-schedule-iii/course_schedule_iii_test.go
deleted file mode 100644
index b4237004c..000000000
--- a/problems/course-schedule-iii/course_schedule_iii_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem630
diff --git a/problems/course-schedule-iv/README.md b/problems/course-schedule-iv/README.md
deleted file mode 100644
index 261ed9931..000000000
--- a/problems/course-schedule-iv/README.md
+++ /dev/null
@@ -1,87 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../check-if-a-string-contains-all-binary-codes-of-size-k "Check If a String Contains All Binary Codes of Size K")
-
-[Next >](../cherry-pickup-ii "Cherry Pickup II")
-
-## [1462. Course Schedule IV (Medium)](https://leetcode.com/problems/course-schedule-iv "课程表 IV")
-
-
There are a total of numCourses courses you have to take, labeled from 0 to numCourses - 1. You are given an array prerequisites where prerequisites[i] = [ai, bi] indicates that you must take course ai first if you want to take course bi.
-
-
-
For example, the pair [0, 1] indicates that you have to take course 0 before you can take course 1.
-
-
-
Prerequisites can also be indirect. If course a is a prerequisite of course b, and course b is a prerequisite of course c, then course a is a prerequisite of course c.
-
-
You are also given an array queries where queries[j] = [uj, vj]. For the jth query, you should answer whether course uj is a prerequisite of course vj or not.
-
-
Return a boolean array answer, where answer[j] is the answer to the jth query.
-
-
-
Example 1:
-
-
-Input: numCourses = 2, prerequisites = [[1,0]], queries = [[0,1],[1,0]]
-Output: [false,true]
-Explanation: The pair [1, 0] indicates that you have to take course 1 before you can take course 0.
-Course 0 is not a prerequisite of course 1, but the opposite is true.
-
-
-
Example 2:
-
-
-Input: numCourses = 2, prerequisites = [], queries = [[1,0],[0,1]]
-Output: [false,false]
-Explanation: There are no prerequisites, and each course is independent.
-
-
-### Related Topics
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Graph](../../tag/graph/README.md)]
- [[Topological Sort](../../tag/topological-sort/README.md)]
-
-### Hints
-
-Hint 1
-Imagine if the courses are nodes of a graph. We need to build an array isReachable[i][j].
-
-
-
-Hint 2
-Start a bfs from each course i and assign for each course j you visit isReachable[i][j] = True.
-
-
-
-Hint 3
-Answer the queries from the isReachable array.
-
diff --git a/problems/course-schedule/README.md b/problems/course-schedule/README.md
deleted file mode 100644
index 974381397..000000000
--- a/problems/course-schedule/README.md
+++ /dev/null
@@ -1,78 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../reverse-linked-list "Reverse Linked List")
-
-[Next >](../implement-trie-prefix-tree "Implement Trie (Prefix Tree)")
-
-## [207. Course Schedule (Medium)](https://leetcode.com/problems/course-schedule "课程表")
-
-
There are a total of numCourses courses you have to take, labeled from 0 to numCourses - 1. You are given an array prerequisites where prerequisites[i] = [ai, bi] indicates that you must take course bi first if you want to take course ai.
-
-
-
For example, the pair [0, 1], indicates that to take course 0 you have to first take course 1.
-
-
-
Return true if you can finish all courses. Otherwise, return false.
-
-
-
Example 1:
-
-
-Input: numCourses = 2, prerequisites = [[1,0]]
-Output: true
-Explanation: There are a total of 2 courses to take.
-To take course 1 you should have finished course 0. So it is possible.
-
-
-
Example 2:
-
-
-Input: numCourses = 2, prerequisites = [[1,0],[0,1]]
-Output: false
-Explanation: There are a total of 2 courses to take.
-To take course 1 you should have finished course 0, and to take course 0 you should also have finished course 1. So it is impossible.
-
-
-
-
Constraints:
-
-
-
1 <= numCourses <= 105
-
0 <= prerequisites.length <= 5000
-
prerequisites[i].length == 2
-
0 <= ai, bi < numCourses
-
All the pairs prerequisites[i] are unique.
-
-
-### Related Topics
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Graph](../../tag/graph/README.md)]
- [[Topological Sort](../../tag/topological-sort/README.md)]
-
-### Similar Questions
- 1. [Course Schedule II](../course-schedule-ii) (Medium)
- 1. [Graph Valid Tree](../graph-valid-tree) (Medium)
- 1. [Minimum Height Trees](../minimum-height-trees) (Medium)
- 1. [Course Schedule III](../course-schedule-iii) (Hard)
-
-### Hints
-
-Hint 1
-This problem is equivalent to finding if a cycle exists in a directed graph. If a cycle exists, no topological ordering exists and therefore it will be impossible to take all courses.
-
-
-
-Hint 2
-Topological Sort via DFS - A great video tutorial (21 minutes) on Coursera explaining the basic concepts of Topological Sort.
-
-
-
-Hint 3
-Topological sort could also be done via BFS.
-
diff --git a/problems/course-schedule/course_schedule.go b/problems/course-schedule/course_schedule.go
deleted file mode 100644
index f7f62e168..000000000
--- a/problems/course-schedule/course_schedule.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem207
diff --git a/problems/course-schedule/course_schedule_test.go b/problems/course-schedule/course_schedule_test.go
deleted file mode 100644
index f7f62e168..000000000
--- a/problems/course-schedule/course_schedule_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem207
diff --git a/problems/cousins-in-binary-tree/README.md b/problems/cousins-in-binary-tree/README.md
deleted file mode 100644
index 1acce6499..000000000
--- a/problems/cousins-in-binary-tree/README.md
+++ /dev/null
@@ -1,60 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../subarrays-with-k-different-integers "Subarrays with K Different Integers")
-
-[Next >](../rotting-oranges "Rotting Oranges")
-
-## [993. Cousins in Binary Tree (Easy)](https://leetcode.com/problems/cousins-in-binary-tree "二叉树的堂兄弟节点")
-
-
Given the root of a binary tree with unique values and the values of two different nodes of the tree x and y, return trueif the nodes corresponding to the values x and y in the tree are cousins, or false otherwise.
-
-
Two nodes of a binary tree are cousins if they have the same depth with different parents.
-
-
Note that in a binary tree, the root node is at the depth 0, and children of each depth k node are at the depth k + 1.
-
-
-
Example 1:
-
-
-Input: root = [1,2,3,4], x = 4, y = 3
-Output: false
-
-
-
Example 2:
-
-
-Input: root = [1,2,3,null,4,null,5], x = 5, y = 4
-Output: true
-
-
-
Example 3:
-
-
-Input: root = [1,2,3,null,4], x = 2, y = 3
-Output: false
-
-
-
-
Constraints:
-
-
-
The number of nodes in the tree is in the range [2, 100].
There is a safe protected by a password. The password is a sequence of n digits where each digit can be in the range [0, k - 1].
-
-
The safe has a peculiar way of checking the password. When you enter in a sequence, it checks the most recent n digits that were entered each time you type a digit.
-
-
-
For example, the correct password is "345" and you enter in "012345":
-
-
After typing 0, the most recent 3 digits is "0", which is incorrect.
-
After typing 1, the most recent 3 digits is "01", which is incorrect.
-
After typing 2, the most recent 3 digits is "012", which is incorrect.
-
After typing 3, the most recent 3 digits is "123", which is incorrect.
-
After typing 4, the most recent 3 digits is "234", which is incorrect.
-
After typing 5, the most recent 3 digits is "345", which is correct and the safe unlocks.
-
-
-
-
-
Return any string of minimum length that will unlock the safe at some point of entering it.
-
-
-
Example 1:
-
-
-Input: n = 1, k = 2
-Output: "10"
-Explanation: The password is a single digit, so enter each digit. "01" would also unlock the safe.
-
-
-
Example 2:
-
-
-Input: n = 2, k = 2
-Output: "01100"
-Explanation: For each possible password:
-- "00" is typed in starting from the 4th digit.
-- "01" is typed in starting from the 1st digit.
-- "10" is typed in starting from the 3rd digit.
-- "11" is typed in starting from the 2nd digit.
-Thus "01100" will unlock the safe. "01100", "10011", and "11001" would also unlock the safe.
-
-
-
-
Constraints:
-
-
-
1 <= n <= 4
-
1 <= k <= 10
-
1 <= kn <= 4096
-
-
-### Related Topics
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Graph](../../tag/graph/README.md)]
- [[Eulerian Circuit](../../tag/eulerian-circuit/README.md)]
-
-### Hints
-
-Hint 1
-We can think of this problem as the problem of finding an Euler path (a path visiting every edge exactly once) on the following graph: there are $$k^{n-1}$$ nodes with each node having $$k$$ edges. It turns out this graph always has an Eulerian circuit (path starting where it ends.)
-
-We should visit each node in "post-order" so as to not get stuck in the graph prematurely.
-
diff --git a/problems/cracking-the-safe/cracking_the_safe.go b/problems/cracking-the-safe/cracking_the_safe.go
deleted file mode 100644
index 494f1fd57..000000000
--- a/problems/cracking-the-safe/cracking_the_safe.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem753
diff --git a/problems/cracking-the-safe/cracking_the_safe_test.go b/problems/cracking-the-safe/cracking_the_safe_test.go
deleted file mode 100644
index 494f1fd57..000000000
--- a/problems/cracking-the-safe/cracking_the_safe_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem753
diff --git a/problems/crawler-log-folder/README.md b/problems/crawler-log-folder/README.md
deleted file mode 100644
index dc6240635..000000000
--- a/problems/crawler-log-folder/README.md
+++ /dev/null
@@ -1,86 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../build-binary-expression-tree-from-infix-expression "Build Binary Expression Tree From Infix Expression")
-
-[Next >](../maximum-profit-of-operating-a-centennial-wheel "Maximum Profit of Operating a Centennial Wheel")
-
-## [1598. Crawler Log Folder (Easy)](https://leetcode.com/problems/crawler-log-folder "文件夹操作日志搜集器")
-
-
The Leetcode file system keeps a log each time some user performs a change folder operation.
-
-
The operations are described below:
-
-
-
"../" : Move to the parent folder of the current folder. (If you are already in the main folder, remain in the same folder).
-
"./" : Remain in the same folder.
-
"x/" : Move to the child folder named x (This folder is guaranteed to always exist).
-
-
-
You are given a list of strings logs where logs[i] is the operation performed by the user at the ith step.
-
-
The file system starts in the main folder, then the operations in logs are performed.
-
-
Return the minimum number of operations needed to go back to the main folder after the change folder operations.
-
-
-
Example 1:
-
-
-
-
-Input: logs = ["d1/","d2/","../","d21/","./"]
-Output: 2
-Explanation: Use this change folder operation "../" 2 times and go back to the main folder.
-
logs[i] contains lowercase English letters, digits, '.', and '/'.
-
logs[i] follows the format described in the statement.
-
Folder names consist of lowercase English letters and digits.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[String](../../tag/string/README.md)]
- [[Stack](../../tag/stack/README.md)]
-
-### Similar Questions
- 1. [Baseball Game](../baseball-game) (Easy)
- 1. [Backspace String Compare](../backspace-string-compare) (Easy)
-
-### Hints
-
-Hint 1
-Simulate the process but don’t move the pointer beyond the main folder.
-
-
-
-Hint 2
-Simulate the process but don’t move the pointer beyond the main folder.
-
diff --git a/problems/create-a-session-bar-chart/README.md b/problems/create-a-session-bar-chart/README.md
deleted file mode 100644
index 2d98529f9..000000000
--- a/problems/create-a-session-bar-chart/README.md
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../number-of-ways-to-wear-different-hats-to-each-other "Number of Ways to Wear Different Hats to Each Other")
-
-[Next >](../destination-city "Destination City")
-
-## [1435. Create a Session Bar Chart (Easy)](https://leetcode.com/problems/create-a-session-bar-chart "制作会话柱状图")
-
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
-
-### Similar Questions
- 1. [Count Salary Categories](../count-salary-categories) (Medium)
diff --git a/problems/create-a-session-bar-chart/mysql_schemas.sql b/problems/create-a-session-bar-chart/mysql_schemas.sql
deleted file mode 100644
index 6041cffa5..000000000
--- a/problems/create-a-session-bar-chart/mysql_schemas.sql
+++ /dev/null
@@ -1,7 +0,0 @@
-Create table If Not Exists Sessions (session_id int, duration int);
-Truncate table Sessions;
-insert into Sessions (session_id, duration) values ('1', '30');
-insert into Sessions (session_id, duration) values ('2', '199');
-insert into Sessions (session_id, duration) values ('3', '299');
-insert into Sessions (session_id, duration) values ('4', '580');
-insert into Sessions (session_id, duration) values ('5', '1000');
diff --git a/problems/create-maximum-number/README.md b/problems/create-maximum-number/README.md
deleted file mode 100644
index a556c1b4b..000000000
--- a/problems/create-maximum-number/README.md
+++ /dev/null
@@ -1,60 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../generalized-abbreviation "Generalized Abbreviation")
-
-[Next >](../coin-change "Coin Change")
-
-## [321. Create Maximum Number (Hard)](https://leetcode.com/problems/create-maximum-number "拼接最大数")
-
-
You are given two integer arrays nums1 and nums2 of lengths m and n respectively. nums1 and nums2 represent the digits of two numbers. You are also given an integer k.
-
-
Create the maximum number of length k <= m + n from digits of the two numbers. The relative order of the digits from the same array must be preserved.
-
-
Return an array of the k digits representing the answer.
Given an integer array instructions, you are asked to create a sorted array from the elements in instructions. You start with an empty container nums. For each element from left to right in instructions, insert it into nums. The cost of each insertion is the minimum of the following:
-
-
-
The number of elements currently in nums that are strictly less thaninstructions[i].
-
The number of elements currently in nums that are strictly greater thaninstructions[i].
-
-
-
For example, if inserting element 3 into nums = [1,2,3,5], the cost of insertion is min(2, 1) (elements 1 and 2 are less than 3, element 5 is greater than 3) and nums will become [1,2,3,3,5].
-
-
Return the total cost to insert all elements from instructions into nums. Since the answer may be large, return it modulo109 + 7
-
-
-
Example 1:
-
-
-Input: instructions = [1,5,6,2]
-Output: 1
-Explanation: Begin with nums = [].
-Insert 1 with cost min(0, 0) = 0, now nums = [1].
-Insert 5 with cost min(1, 0) = 0, now nums = [1,5].
-Insert 6 with cost min(2, 0) = 0, now nums = [1,5,6].
-Insert 2 with cost min(1, 2) = 1, now nums = [1,2,5,6].
-The total cost is 0 + 0 + 0 + 1 = 1.
-
-
Example 2:
-
-
-Input: instructions = [1,2,3,6,5,4]
-Output: 3
-Explanation: Begin with nums = [].
-Insert 1 with cost min(0, 0) = 0, now nums = [1].
-Insert 2 with cost min(1, 0) = 0, now nums = [1,2].
-Insert 3 with cost min(2, 0) = 0, now nums = [1,2,3].
-Insert 6 with cost min(3, 0) = 0, now nums = [1,2,3,6].
-Insert 5 with cost min(3, 1) = 1, now nums = [1,2,3,5,6].
-Insert 4 with cost min(3, 2) = 2, now nums = [1,2,3,4,5,6].
-The total cost is 0 + 0 + 0 + 0 + 1 + 2 = 3.
-
-
-
Example 3:
-
-
-Input: instructions = [1,3,3,3,2,4,2,1,2]
-Output: 4
-Explanation: Begin with nums = [].
-Insert 1 with cost min(0, 0) = 0, now nums = [1].
-Insert 3 with cost min(1, 0) = 0, now nums = [1,3].
-Insert 3 with cost min(1, 0) = 0, now nums = [1,3,3].
-Insert 3 with cost min(1, 0) = 0, now nums = [1,3,3,3].
-Insert 2 with cost min(1, 3) = 1, now nums = [1,2,3,3,3].
-Insert 4 with cost min(5, 0) = 0, now nums = [1,2,3,3,3,4].
-Insert 2 with cost min(1, 4) = 1, now nums = [1,2,2,3,3,3,4].
-Insert 1 with cost min(0, 6) = 0, now nums = [1,1,2,2,3,3,3,4].
-Insert 2 with cost min(2, 4) = 2, now nums = [1,1,2,2,2,3,3,3,4].
-The total cost is 0 + 0 + 0 + 0 + 1 + 0 + 1 + 0 + 2 = 4.
-
-
-
-
Constraints:
-
-
-
1 <= instructions.length <= 105
-
1 <= instructions[i] <= 105
-
-
-### Related Topics
- [[Binary Indexed Tree](../../tag/binary-indexed-tree/README.md)]
- [[Segment Tree](../../tag/segment-tree/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
- [[Divide and Conquer](../../tag/divide-and-conquer/README.md)]
- [[Ordered Set](../../tag/ordered-set/README.md)]
- [[Merge Sort](../../tag/merge-sort/README.md)]
-
-### Hints
-
-Hint 1
-This problem is closely related to finding the number of inversions in an array
-
-
-
-Hint 2
-if i know the position in which i will insert the i-th element in I can find the minimum cost to insert it
-
diff --git a/problems/create-target-array-in-the-given-order/README.md b/problems/create-target-array-in-the-given-order/README.md
deleted file mode 100644
index ed80d4212..000000000
--- a/problems/create-target-array-in-the-given-order/README.md
+++ /dev/null
@@ -1,80 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../pizza-with-3n-slices "Pizza With 3n Slices")
-
-[Next >](../four-divisors "Four Divisors")
-
-## [1389. Create Target Array in the Given Order (Easy)](https://leetcode.com/problems/create-target-array-in-the-given-order "按既定顺序创建目标数组")
-
-
Given two arrays of integers nums and index. Your task is to create target array under the following rules:
-
-
-
Initially target array is empty.
-
From left to right read nums[i] and index[i], insert at index index[i] the value nums[i] in target array.
-
Repeat the previous step until there are no elements to read in nums and index.
-
-
-
Return the target array.
-
-
It is guaranteed that the insertion operations will be valid.
There are n servers numbered from 0 to n - 1 connected by undirected server-to-server connections forming a network where connections[i] = [ai, bi] represents a connection between servers ai and bi. Any server can reach other servers directly or indirectly through the network.
-
-
A critical connection is a connection that, if removed, will make some servers unable to reach some other server.
-
-
Return all critical connections in the network in any order.
-
-
-
Example 1:
-
-
-Input: n = 4, connections = [[0,1],[1,2],[2,0],[1,3]]
-Output: [[1,3]]
-Explanation: [[3,1]] is also accepted.
-
-
-
Example 2:
-
-
-Input: n = 2, connections = [[0,1]]
-Output: [[0,1]]
-
You are given two strings order and s. All the words of order are unique and were sorted in some custom order previously.
-
-
Permute the characters of s so that they match the order that order was sorted. More specifically, if a character x occurs before a character y in order, then x should occur before y in the permuted string.
-
-
Return any permutation of s that satisfies this property.
-
-
-
Example 1:
-
-
-Input: order = "cba", s = "abcd"
-Output: "cbad"
-Explanation:
-"a", "b", "c" appear in order, so the order of "a", "b", "c" should be "c", "b", and "a".
-Since "d" does not appear in order, it can be at any position in the returned string. "dcba", "cdba", "cbda" are also valid outputs.
-
-
-
Example 2:
-
-
-Input: order = "cbafg", s = "abcd"
-Output: "cbad"
-
-
-
-
Constraints:
-
-
-
1 <= order.length <= 26
-
1 <= s.length <= 200
-
order and s consist of lowercase English letters.
-
All the characters of order are unique.
-
-
-### Related Topics
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
diff --git a/problems/custom-sort-string/custom_sort_string.go b/problems/custom-sort-string/custom_sort_string.go
deleted file mode 100644
index c266bb28b..000000000
--- a/problems/custom-sort-string/custom_sort_string.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem791
diff --git a/problems/custom-sort-string/custom_sort_string_test.go b/problems/custom-sort-string/custom_sort_string_test.go
deleted file mode 100644
index c266bb28b..000000000
--- a/problems/custom-sort-string/custom_sort_string_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem791
diff --git a/problems/customer-order-frequency/README.md b/problems/customer-order-frequency/README.md
deleted file mode 100644
index c683e39f5..000000000
--- a/problems/customer-order-frequency/README.md
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../stone-game-iv "Stone Game IV")
-
-[Next >](../number-of-good-pairs "Number of Good Pairs")
-
-## [1511. Customer Order Frequency (Easy)](https://leetcode.com/problems/customer-order-frequency "消费者下单频率")
-
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/customer-order-frequency/mysql_schemas.sql b/problems/customer-order-frequency/mysql_schemas.sql
deleted file mode 100644
index 307de3f82..000000000
--- a/problems/customer-order-frequency/mysql_schemas.sql
+++ /dev/null
@@ -1,23 +0,0 @@
-Create table If Not Exists Customers (customer_id int, name varchar(30), country varchar(30));
-Create table If Not Exists Product (product_id int, description varchar(30), price int)
-;
-Create table If Not Exists Orders (order_id int, customer_id int, product_id int, order_date date, quantity int)
-;
-Truncate table Customers;
-insert into Customers (customer_id, name, country) values ('1', 'Winston', 'USA');
-insert into Customers (customer_id, name, country) values ('2', 'Jonathan', 'Peru');
-insert into Customers (customer_id, name, country) values ('3', 'Moustafa', 'Egypt');
-Truncate table Product;
-insert into Product (product_id, description, price) values ('10', 'LC Phone', '300');
-insert into Product (product_id, description, price) values ('20', 'LC T-Shirt', '10');
-insert into Product (product_id, description, price) values ('30', 'LC Book', '45');
-insert into Product (product_id, description, price) values ('40', 'LC Keychain', '2');
-Truncate table Orders;
-insert into Orders (order_id, customer_id, product_id, order_date, quantity) values ('1', '1', '10', '2020-06-10', '1');
-insert into Orders (order_id, customer_id, product_id, order_date, quantity) values ('2', '1', '20', '2020-07-01', '1');
-insert into Orders (order_id, customer_id, product_id, order_date, quantity) values ('3', '1', '30', '2020-07-08', '2');
-insert into Orders (order_id, customer_id, product_id, order_date, quantity) values ('4', '2', '10', '2020-06-15', '2');
-insert into Orders (order_id, customer_id, product_id, order_date, quantity) values ('5', '2', '40', '2020-07-01', '10');
-insert into Orders (order_id, customer_id, product_id, order_date, quantity) values ('6', '3', '20', '2020-06-24', '2');
-insert into Orders (order_id, customer_id, product_id, order_date, quantity) values ('7', '3', '30', '2020-06-25', '2');
-insert into Orders (order_id, customer_id, product_id, order_date, quantity) values ('9', '3', '30', '2020-05-08', '3');
diff --git a/problems/customer-placing-the-largest-number-of-orders/README.md b/problems/customer-placing-the-largest-number-of-orders/README.md
deleted file mode 100644
index e00893cb3..000000000
--- a/problems/customer-placing-the-largest-number-of-orders/README.md
+++ /dev/null
@@ -1,67 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../investments-in-2016 "Investments in 2016")
-
-[Next >](../erect-the-fence "Erect the Fence")
-
-## [586. Customer Placing the Largest Number of Orders (Easy)](https://leetcode.com/problems/customer-placing-the-largest-number-of-orders "订单最多的客户")
-
-
Query the customer_number from the orders table for the customer who has placed the largest number of orders.
-
-
It is guaranteed that exactly one customer will have placed more orders than any other customer.
-
-
The orders table is defined as follows:
-
-
-| Column | Type |
-|-------------------|-----------|
-| order_number (PK) | int |
-| customer_number | int |
-| order_date | date |
-| required_date | date |
-| shipped_date | date |
-| status | char(15) |
-| comment | char(200) |
-
-The customer with number '3' has two orders, which is greater than either customer '1' or '2' because each of them only has one order.
-So the result is customer_number '3'.
-
-
-
Follow up: What if more than one customer have the largest number of orders, can you find all the customer_number in this case?
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
-
-### Hints
-
-Hint 1
-MySQL uses a different expression to get the first records other than MSSQL's TOP expression.
-
diff --git a/problems/customer-placing-the-largest-number-of-orders/customer_placing_the_largest_number_of_orders.sql b/problems/customer-placing-the-largest-number-of-orders/customer_placing_the_largest_number_of_orders.sql
deleted file mode 100644
index bae62cf19..000000000
--- a/problems/customer-placing-the-largest-number-of-orders/customer_placing_the_largest_number_of_orders.sql
+++ /dev/null
@@ -1 +0,0 @@
-# Write your MySQL query statement below
diff --git a/problems/customer-placing-the-largest-number-of-orders/mysql_schemas.sql b/problems/customer-placing-the-largest-number-of-orders/mysql_schemas.sql
deleted file mode 100644
index 989cb5c24..000000000
--- a/problems/customer-placing-the-largest-number-of-orders/mysql_schemas.sql
+++ /dev/null
@@ -1,6 +0,0 @@
-Create table If Not Exists orders (order_number int, customer_number int);
-Truncate table orders;
-insert into orders (order_number, customer_number) values ('1', '1');
-insert into orders (order_number, customer_number) values ('2', '2');
-insert into orders (order_number, customer_number) values ('3', '3');
-insert into orders (order_number, customer_number) values ('4', '3');
diff --git a/problems/customer-who-visited-but-did-not-make-any-transactions/README.md b/problems/customer-who-visited-but-did-not-make-any-transactions/README.md
deleted file mode 100644
index c37bf735d..000000000
--- a/problems/customer-who-visited-but-did-not-make-any-transactions/README.md
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../put-boxes-into-the-warehouse-ii "Put Boxes Into the Warehouse II")
-
-[Next >](../special-positions-in-a-binary-matrix "Special Positions in a Binary Matrix")
-
-## [1581. Customer Who Visited but Did Not Make Any Transactions (Easy)](https://leetcode.com/problems/customer-who-visited-but-did-not-make-any-transactions "进店却未进行过交易的顾客")
-
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
-
-### Similar Questions
- 1. [Sellers With No Sales](../sellers-with-no-sales) (Easy)
diff --git a/problems/customer-who-visited-but-did-not-make-any-transactions/mysql_schemas.sql b/problems/customer-who-visited-but-did-not-make-any-transactions/mysql_schemas.sql
deleted file mode 100644
index 9f6c0ba5c..000000000
--- a/problems/customer-who-visited-but-did-not-make-any-transactions/mysql_schemas.sql
+++ /dev/null
@@ -1,16 +0,0 @@
-Create table If Not Exists Visits(visit_id int, customer_id int);
-Create table If Not Exists Transactions(transaction_id int, visit_id int, amount int);
-Truncate table Visits;
-insert into Visits (visit_id, customer_id) values ('1', '23');
-insert into Visits (visit_id, customer_id) values ('2', '9');
-insert into Visits (visit_id, customer_id) values ('4', '30');
-insert into Visits (visit_id, customer_id) values ('5', '54');
-insert into Visits (visit_id, customer_id) values ('6', '96');
-insert into Visits (visit_id, customer_id) values ('7', '54');
-insert into Visits (visit_id, customer_id) values ('8', '54');
-Truncate table Transactions;
-insert into Transactions (transaction_id, visit_id, amount) values ('2', '5', '310');
-insert into Transactions (transaction_id, visit_id, amount) values ('3', '5', '300');
-insert into Transactions (transaction_id, visit_id, amount) values ('9', '5', '200');
-insert into Transactions (transaction_id, visit_id, amount) values ('12', '1', '910');
-insert into Transactions (transaction_id, visit_id, amount) values ('13', '2', '970');
diff --git a/problems/customers-who-bought-all-products/README.md b/problems/customers-who-bought-all-products/README.md
deleted file mode 100644
index 1f081037c..000000000
--- a/problems/customers-who-bought-all-products/README.md
+++ /dev/null
@@ -1,74 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../longest-duplicate-substring "Longest Duplicate Substring")
-
-[Next >](../last-stone-weight "Last Stone Weight")
-
-## [1045. Customers Who Bought All Products (Medium)](https://leetcode.com/problems/customers-who-bought-all-products "买下所有产品的客户")
-
-
Table: Customer
-
-
-+-------------+---------+
-| Column Name | Type |
-+-------------+---------+
-| customer_id | int |
-| product_key | int |
-+-------------+---------+
-product_key is a foreign key to Product table.
-
-
-
Table: Product
-
-
-+-------------+---------+
-| Column Name | Type |
-+-------------+---------+
-| product_key | int |
-+-------------+---------+
-product_key is the primary key column for this table.
-
-
-
-
-
Write an SQL query for a report that provides the customer ids from the Customer table that bought all the products in the Product table.
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/customers-who-bought-all-products/customers_who_bought_all_products.sql b/problems/customers-who-bought-all-products/customers_who_bought_all_products.sql
deleted file mode 100644
index bae62cf19..000000000
--- a/problems/customers-who-bought-all-products/customers_who_bought_all_products.sql
+++ /dev/null
@@ -1 +0,0 @@
-# Write your MySQL query statement below
diff --git a/problems/customers-who-bought-all-products/mysql_schemas.sql b/problems/customers-who-bought-all-products/mysql_schemas.sql
deleted file mode 100644
index ef68a04c1..000000000
--- a/problems/customers-who-bought-all-products/mysql_schemas.sql
+++ /dev/null
@@ -1,11 +0,0 @@
-Create table If Not Exists Customer (customer_id int, product_key int);
-Create table Product (product_key int);
-Truncate table Customer;
-insert into Customer (customer_id, product_key) values ('1', '5');
-insert into Customer (customer_id, product_key) values ('2', '6');
-insert into Customer (customer_id, product_key) values ('3', '5');
-insert into Customer (customer_id, product_key) values ('3', '6');
-insert into Customer (customer_id, product_key) values ('1', '6');
-Truncate table Product;
-insert into Product (product_key) values ('5');
-insert into Product (product_key) values ('6');
diff --git a/problems/customers-who-bought-products-a-and-b-but-not-c/README.md b/problems/customers-who-bought-products-a-and-b-but-not-c/README.md
deleted file mode 100644
index 443bb7664..000000000
--- a/problems/customers-who-bought-products-a-and-b-but-not-c/README.md
+++ /dev/null
@@ -1,81 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../find-all-good-strings "Find All Good Strings")
-
-[Next >](../count-largest-group "Count Largest Group")
-
-## [1398. Customers Who Bought Products A and B but Not C (Medium)](https://leetcode.com/problems/customers-who-bought-products-a-and-b-but-not-c "购买了产品 A 和产品 B 却没有购买产品 C 的顾客")
-
-
Table: Customers
-
-+---------------------+---------+
-| Column Name | Type |
-+---------------------+---------+
-| customer_id | int |
-| customer_name | varchar |
-+---------------------+---------+
-customer_id is the primary key for this table.
-customer_name is the name of the customer.
-
-
-
Table: Orders
-
-+---------------+---------+
-| Column Name | Type |
-+---------------+---------+
-| order_id | int |
-| customer_id | int |
-| product_name | varchar |
-+---------------+---------+
-order_id is the primary key for this table.
-customer_id is the id of the customer who bought the product "product_name".
-
-
-Write an SQL query to report the customer_id and customer_name of customers who bought products "A", "B" but did not buy the product "C" since we want to recommend them buy this product.
-
-Return the result table ordered by customer_id.
-
-The query result format is in the following example.
-
-
-Customers table:
-+-------------+---------------+
-| customer_id | customer_name |
-+-------------+---------------+
-| 1 | Daniel |
-| 2 | Diana |
-| 3 | Elizabeth |
-| 4 | Jhon |
-+-------------+---------------+
-
-Orders table:
-+------------+--------------+---------------+
-| order_id | customer_id | product_name |
-+------------+--------------+---------------+
-| 10 | 1 | A |
-| 20 | 1 | B |
-| 30 | 1 | D |
-| 40 | 1 | C |
-| 50 | 2 | A |
-| 60 | 3 | A |
-| 70 | 3 | B |
-| 80 | 3 | D |
-| 90 | 4 | C |
-+------------+--------------+---------------+
-
-Result table:
-+-------------+---------------+
-| customer_id | customer_name |
-+-------------+---------------+
-| 3 | Elizabeth |
-+-------------+---------------+
-Only the customer_id with id 3 bought the product A and B but not the product C.
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/customers-who-bought-products-a-and-b-but-not-c/mysql_schemas.sql b/problems/customers-who-bought-products-a-and-b-but-not-c/mysql_schemas.sql
deleted file mode 100644
index a69fad8cb..000000000
--- a/problems/customers-who-bought-products-a-and-b-but-not-c/mysql_schemas.sql
+++ /dev/null
@@ -1,17 +0,0 @@
-Create table If Not Exists Customers (customer_id int, customer_name varchar(30));
-Create table If Not Exists Orders (order_id int, customer_id int, product_name varchar(30));
-Truncate table Customers;
-insert into Customers (customer_id, customer_name) values ('1', 'Daniel');
-insert into Customers (customer_id, customer_name) values ('2', 'Diana');
-insert into Customers (customer_id, customer_name) values ('3', 'Elizabeth');
-insert into Customers (customer_id, customer_name) values ('4', 'Jhon');
-Truncate table Orders;
-insert into Orders (order_id, customer_id, product_name) values ('10', '1', 'A');
-insert into Orders (order_id, customer_id, product_name) values ('20', '1', 'B');
-insert into Orders (order_id, customer_id, product_name) values ('30', '1', 'D');
-insert into Orders (order_id, customer_id, product_name) values ('40', '1', 'C');
-insert into Orders (order_id, customer_id, product_name) values ('50', '2', 'A');
-insert into Orders (order_id, customer_id, product_name) values ('60', '3', 'A');
-insert into Orders (order_id, customer_id, product_name) values ('70', '3', 'B');
-insert into Orders (order_id, customer_id, product_name) values ('80', '3', 'D');
-insert into Orders (order_id, customer_id, product_name) values ('90', '4', 'C');
diff --git a/problems/customers-who-never-order/README.md b/problems/customers-who-never-order/README.md
deleted file mode 100644
index 470908e17..000000000
--- a/problems/customers-who-never-order/README.md
+++ /dev/null
@@ -1,82 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../duplicate-emails "Duplicate Emails")
-
-[Next >](../department-highest-salary "Department Highest Salary")
-
-## [183. Customers Who Never Order (Easy)](https://leetcode.com/problems/customers-who-never-order "从不订购的客户")
-
-
Table: Customers
-
-
-+-------------+---------+
-| Column Name | Type |
-+-------------+---------+
-| id | int |
-| name | varchar |
-+-------------+---------+
-id is the primary key column for this table.
-Each row of this table indicates the ID and name of a customer.
-
-
-
-
-
Table: Orders
-
-
-+-------------+------+
-| Column Name | Type |
-+-------------+------+
-| id | int |
-| customerId | int |
-+-------------+------+
-id is the primary key column for this table.
-customerId is a foreign key of the ID from the Customers table.
-Each row of this table indicates the ID of an order and the ID of the customer who ordered it.
-
-
-
-
-
Write an SQL query to report all customers who never order anything.
-
-
Return the result table in any order.
-
-
The query result format is in the following example.
-
-
-
Example 1:
-
-
-Input:
-Customers table:
-+----+-------+
-| id | name |
-+----+-------+
-| 1 | Joe |
-| 2 | Henry |
-| 3 | Sam |
-| 4 | Max |
-+----+-------+
-Orders table:
-+----+------------+
-| id | customerId |
-+----+------------+
-| 1 | 3 |
-| 2 | 1 |
-+----+------------+
-Output:
-+-----------+
-| Customers |
-+-----------+
-| Henry |
-| Max |
-+-----------+
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/customers-who-never-order/customers_who_never_order.sql b/problems/customers-who-never-order/customers_who_never_order.sql
deleted file mode 100644
index bae62cf19..000000000
--- a/problems/customers-who-never-order/customers_who_never_order.sql
+++ /dev/null
@@ -1 +0,0 @@
-# Write your MySQL query statement below
diff --git a/problems/customers-who-never-order/mysql_schemas.sql b/problems/customers-who-never-order/mysql_schemas.sql
deleted file mode 100644
index 9a38db656..000000000
--- a/problems/customers-who-never-order/mysql_schemas.sql
+++ /dev/null
@@ -1,10 +0,0 @@
-Create table If Not Exists Customers (id int, name varchar(255));
-Create table If Not Exists Orders (id int, customerId int);
-Truncate table Customers;
-insert into Customers (id, name) values ('1', 'Joe');
-insert into Customers (id, name) values ('2', 'Henry');
-insert into Customers (id, name) values ('3', 'Sam');
-insert into Customers (id, name) values ('4', 'Max');
-Truncate table Orders;
-insert into Orders (id, customerId) values ('1', '3');
-insert into Orders (id, customerId) values ('2', '1');
diff --git a/problems/cut-off-trees-for-golf-event/README.md b/problems/cut-off-trees-for-golf-event/README.md
deleted file mode 100644
index 355e1a9d3..000000000
--- a/problems/cut-off-trees-for-golf-event/README.md
+++ /dev/null
@@ -1,70 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../longest-continuous-increasing-subsequence "Longest Continuous Increasing Subsequence")
-
-[Next >](../implement-magic-dictionary "Implement Magic Dictionary")
-
-## [675. Cut Off Trees for Golf Event (Hard)](https://leetcode.com/problems/cut-off-trees-for-golf-event "为高尔夫比赛砍树")
-
-
You are asked to cut off all the trees in a forest for a golf event. The forest is represented as an m x n matrix. In this matrix:
-
-
-
0 means the cell cannot be walked through.
-
1 represents an empty cell that can be walked through.
-
A number greater than 1 represents a tree in a cell that can be walked through, and this number is the tree's height.
-
-
-
In one step, you can walk in any of the four directions: north, east, south, and west. If you are standing in a cell with a tree, you can choose whether to cut it off.
-
-
You must cut off the trees in order from shortest to tallest. When you cut off a tree, the value at its cell becomes 1 (an empty cell).
-
-
Starting from the point (0, 0), return the minimum steps you need to walk to cut off all the trees. If you cannot cut off all the trees, return -1.
-
-
You are guaranteed that no two trees have the same height, and there is at least one tree needs to be cut off.
-
-
-
Example 1:
-
-
-Input: forest = [[1,2,3],[0,0,4],[7,6,5]]
-Output: 6
-Explanation: Following the path above allows you to cut off the trees from shortest to tallest in 6 steps.
-
-
-
Example 2:
-
-
-Input: forest = [[1,2,3],[0,0,0],[7,6,5]]
-Output: -1
-Explanation: The trees in the bottom row cannot be accessed as the middle row is blocked.
-
-
-
Example 3:
-
-
-Input: forest = [[2,3,4],[0,0,5],[8,7,6]]
-Output: 6
-Explanation: You can follow the same path as Example 1 to cut off all the trees.
-Note that you can cut off the first tree at (0, 0) before making any steps.
-
-
-
-
Constraints:
-
-
-
m == forest.length
-
n == forest[i].length
-
1 <= m, n <= 50
-
0 <= forest[i][j] <= 109
-
-
-### Related Topics
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
- [[Heap (Priority Queue)](../../tag/heap-priority-queue/README.md)]
diff --git a/problems/cut-off-trees-for-golf-event/cut_off_trees_for_golf_event.go b/problems/cut-off-trees-for-golf-event/cut_off_trees_for_golf_event.go
deleted file mode 100644
index 0578a7546..000000000
--- a/problems/cut-off-trees-for-golf-event/cut_off_trees_for_golf_event.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem675
diff --git a/problems/cut-off-trees-for-golf-event/cut_off_trees_for_golf_event_test.go b/problems/cut-off-trees-for-golf-event/cut_off_trees_for_golf_event_test.go
deleted file mode 100644
index 0578a7546..000000000
--- a/problems/cut-off-trees-for-golf-event/cut_off_trees_for_golf_event_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem675
diff --git a/problems/cutting-ribbons/README.md b/problems/cutting-ribbons/README.md
deleted file mode 100644
index 6d7c7f13c..000000000
--- a/problems/cutting-ribbons/README.md
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../the-latest-login-in-2020 "The Latest Login in 2020")
-
-[Next >](../page-recommendations-ii "Page Recommendations II")
-
-## [1891. Cutting Ribbons (Medium)](https://leetcode.com/problems/cutting-ribbons "割绳子")
-
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
-
-### Similar Questions
- 1. [Capacity To Ship Packages Within D Days](../capacity-to-ship-packages-within-d-days) (Medium)
- 1. [Add Minimum Number of Rungs](../add-minimum-number-of-rungs) (Medium)
-
-### Hints
-
-Hint 1
-Use binary search on the answer.
-
-
-
-Hint 2
-You can get l/m branches of length m from a branch with length l.
-
diff --git a/problems/cyclically-rotating-a-grid/README.md b/problems/cyclically-rotating-a-grid/README.md
deleted file mode 100644
index bd3a7fc9f..000000000
--- a/problems/cyclically-rotating-a-grid/README.md
+++ /dev/null
@@ -1,68 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-product-difference-between-two-pairs "Maximum Product Difference Between Two Pairs")
-
-[Next >](../number-of-wonderful-substrings "Number of Wonderful Substrings")
-
-## [1914. Cyclically Rotating a Grid (Medium)](https://leetcode.com/problems/cyclically-rotating-a-grid "循环轮转矩阵")
-
-
You are given an m x n integer matrix grid, where m and n are both even integers, and an integer k.
-
-
The matrix is composed of several layers, which is shown in the below image, where each color is its own layer:
-
-
-
-
A cyclic rotation of the matrix is done by cyclically rotating each layer in the matrix. To cyclically rotate a layer once, each element in the layer will take the place of the adjacent element in the counter-clockwise direction. An example rotation is shown below:
-
-
Return the matrix after applying kcyclic rotations to it.
-
-
-
Example 1:
-
-
-Input: grid = [[40,10],[30,20]], k = 1
-Output: [[10,20],[40,30]]
-Explanation: The figures above represent the grid at every state.
-
-
-
Example 2:
-
-
-
-Input: grid = [[1,2,3,4],[5,6,7,8],[9,10,11,12],[13,14,15,16]], k = 2
-Output: [[3,4,8,12],[2,11,10,16],[1,7,6,15],[5,9,13,14]]
-Explanation: The figures above represent the grid at every state.
-
-
-
-
Constraints:
-
-
-
m == grid.length
-
n == grid[i].length
-
2 <= m, n <= 50
-
Both m and n are even integers.
-
1 <= grid[i][j] <=5000
-
1 <= k <= 109
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
- [[Simulation](../../tag/simulation/README.md)]
-
-### Hints
-
-Hint 1
-First, you need to consider each layer separately as an array.
-
-
-
-Hint 2
-Just cycle this array and then re-assign it.
-
diff --git a/problems/daily-leads-and-partners/README.md b/problems/daily-leads-and-partners/README.md
deleted file mode 100644
index 299b0bd44..000000000
--- a/problems/daily-leads-and-partners/README.md
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../count-ways-to-distribute-candies "Count Ways to Distribute Candies")
-
-[Next >](../reformat-phone-number "Reformat Phone Number")
-
-## [1693. Daily Leads and Partners (Easy)](https://leetcode.com/problems/daily-leads-and-partners "每天的领导和合伙人")
-
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/daily-leads-and-partners/mysql_schemas.sql b/problems/daily-leads-and-partners/mysql_schemas.sql
deleted file mode 100644
index 53e2eb911..000000000
--- a/problems/daily-leads-and-partners/mysql_schemas.sql
+++ /dev/null
@@ -1,12 +0,0 @@
-Create table If Not Exists DailySales(date_id date, make_name varchar(20), lead_id int, partner_id int);
-Truncate table DailySales;
-insert into DailySales (date_id, make_name, lead_id, partner_id) values ('2020-12-8', 'toyota', '0', '1');
-insert into DailySales (date_id, make_name, lead_id, partner_id) values ('2020-12-8', 'toyota', '1', '0');
-insert into DailySales (date_id, make_name, lead_id, partner_id) values ('2020-12-8', 'toyota', '1', '2');
-insert into DailySales (date_id, make_name, lead_id, partner_id) values ('2020-12-7', 'toyota', '0', '2');
-insert into DailySales (date_id, make_name, lead_id, partner_id) values ('2020-12-7', 'toyota', '0', '1');
-insert into DailySales (date_id, make_name, lead_id, partner_id) values ('2020-12-8', 'honda', '1', '2');
-insert into DailySales (date_id, make_name, lead_id, partner_id) values ('2020-12-8', 'honda', '2', '1');
-insert into DailySales (date_id, make_name, lead_id, partner_id) values ('2020-12-7', 'honda', '0', '1');
-insert into DailySales (date_id, make_name, lead_id, partner_id) values ('2020-12-7', 'honda', '1', '2');
-insert into DailySales (date_id, make_name, lead_id, partner_id) values ('2020-12-7', 'honda', '2', '1');
diff --git a/problems/daily-temperatures/README.md b/problems/daily-temperatures/README.md
deleted file mode 100644
index ff6a70607..000000000
--- a/problems/daily-temperatures/README.md
+++ /dev/null
@@ -1,47 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../monotone-increasing-digits "Monotone Increasing Digits")
-
-[Next >](../delete-and-earn "Delete and Earn")
-
-## [739. Daily Temperatures (Medium)](https://leetcode.com/problems/daily-temperatures "每日温度")
-
-
Given an array of integers temperatures represents the daily temperatures, return an arrayanswersuch thatanswer[i]is the number of days you have to wait after theithday to get a warmer temperature. If there is no future day for which this is possible, keep answer[i] == 0 instead.
At most 3 * 104 calls will be made to addNum and getIntervals.
-
-
-
-
Follow up: What if there are lots of merges and the number of disjoint intervals is small compared to the size of the data stream?
-
-### Related Topics
- [[Binary Search](../../tag/binary-search/README.md)]
- [[Design](../../tag/design/README.md)]
- [[Ordered Set](../../tag/ordered-set/README.md)]
-
-### Similar Questions
- 1. [Summary Ranges](../summary-ranges) (Easy)
- 1. [Find Right Interval](../find-right-interval) (Medium)
- 1. [Range Module](../range-module) (Hard)
diff --git a/problems/data-stream-as-disjoint-intervals/data_stream_as_disjoint_intervals.go b/problems/data-stream-as-disjoint-intervals/data_stream_as_disjoint_intervals.go
deleted file mode 100644
index 087d6216b..000000000
--- a/problems/data-stream-as-disjoint-intervals/data_stream_as_disjoint_intervals.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem352
diff --git a/problems/data-stream-as-disjoint-intervals/data_stream_as_disjoint_intervals_test.go b/problems/data-stream-as-disjoint-intervals/data_stream_as_disjoint_intervals_test.go
deleted file mode 100644
index 087d6216b..000000000
--- a/problems/data-stream-as-disjoint-intervals/data_stream_as_disjoint_intervals_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem352
diff --git a/problems/day-of-the-week/README.md b/problems/day-of-the-week/README.md
deleted file mode 100644
index 9ffca921a..000000000
--- a/problems/day-of-the-week/README.md
+++ /dev/null
@@ -1,66 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../distance-between-bus-stops "Distance Between Bus Stops")
-
-[Next >](../maximum-subarray-sum-with-one-deletion "Maximum Subarray Sum with One Deletion")
-
-## [1185. Day of the Week (Easy)](https://leetcode.com/problems/day-of-the-week "一周中的第几天")
-
-
Given a date, return the corresponding day of the week for that date.
-
-
The input is given as three integers representing the day, month and year respectively.
-
-
Return the answer as one of the following values {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"}.
-
-
-
Example 1:
-
-
-Input: day = 31, month = 8, year = 2019
-Output: "Saturday"
-
-
-
Example 2:
-
-
-Input: day = 18, month = 7, year = 1999
-Output: "Sunday"
-
-
-
Example 3:
-
-
-Input: day = 15, month = 8, year = 1993
-Output: "Sunday"
-
-
-
-
Constraints:
-
-
-
The given dates are valid dates between the years 1971 and 2100.
-
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
-
-### Hints
-
-Hint 1
-Sum up the number of days for the years before the given year.
-
-
-
-Hint 2
-Handle the case of a leap year.
-
-
-
-Hint 3
-Find the number of days for each month of the given year.
-
diff --git a/problems/day-of-the-week/day_of_the_week.go b/problems/day-of-the-week/day_of_the_week.go
deleted file mode 100644
index 10218509e..000000000
--- a/problems/day-of-the-week/day_of_the_week.go
+++ /dev/null
@@ -1,9 +0,0 @@
-package problem1185
-
-import "time"
-
-func dayOfTheWeek(day int, month int, year int) string {
- return time.Date(year, time.Month(month), day, 0, 0, 0, 0, time.Local).
- Weekday().
- String()
-}
diff --git a/problems/day-of-the-week/day_of_the_week_test.go b/problems/day-of-the-week/day_of_the_week_test.go
deleted file mode 100644
index 1533f28e0..000000000
--- a/problems/day-of-the-week/day_of_the_week_test.go
+++ /dev/null
@@ -1,51 +0,0 @@
-package problem1185
-
-import "testing"
-
-type testType struct {
- day int
- month int
- year int
- want string
-}
-
-func TestDayOfTheWeek(t *testing.T) {
- tests := [...]testType{
- {
- day: 31,
- month: 8,
- year: 2019,
- want: "Saturday",
- },
- {
- day: 15,
- month: 8,
- year: 1993,
- want: "Sunday",
- },
- {
- day: 1,
- month: 1,
- year: 1970,
- want: "Thursday",
- },
- {
- day: 25,
- month: 3,
- year: 1993,
- want: "Thursday",
- },
- {
- day: 30,
- month: 6,
- year: 2000,
- want: "Friday",
- },
- }
- for _, tt := range tests {
- got := dayOfTheWeek(tt.day, tt.month, tt.year)
- if got != tt.want {
- t.Fatalf("in: %v, got: %v, want: %v", tt, got, tt.want)
- }
- }
-}
diff --git a/problems/day-of-the-year/README.md b/problems/day-of-the-year/README.md
deleted file mode 100644
index 3f08074a0..000000000
--- a/problems/day-of-the-year/README.md
+++ /dev/null
@@ -1,63 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../string-transforms-into-another-string "String Transforms Into Another String")
-
-[Next >](../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 "一年中的第几天")
-
-
Given a string date representing a Gregorian calendar date formatted as YYYY-MM-DD, return the day number of the year.
-
-
-
Example 1:
-
-
-Input: date = "2019-01-09"
-Output: 9
-Explanation: Given date is the 9th day of the year in 2019.
-
-
-
Example 2:
-
-
-Input: date = "2019-02-10"
-Output: 41
-
-
-
Example 3:
-
-
-Input: date = "2003-03-01"
-Output: 60
-
-
-
Example 4:
-
-
-Input: date = "2004-03-01"
-Output: 61
-
-
-
-
Constraints:
-
-
-
date.length == 10
-
date[4] == date[7] == '-', and all other date[i]'s are digits
-
date represents a calendar date between Jan 1st, 1900 and Dec 31, 2019.
-
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Hints
-
-Hint 1
-Have a integer array of how many days there are per month. February gets one extra day if its a leap year. Then, we can manually count the ordinal as day + (number of days in months before this one).
-
diff --git a/problems/day-of-the-year/day_of_the_year.go b/problems/day-of-the-year/day_of_the_year.go
deleted file mode 100644
index 18df7e443..000000000
--- a/problems/day-of-the-year/day_of_the_year.go
+++ /dev/null
@@ -1,8 +0,0 @@
-package problem1154
-
-import "time"
-
-func dayOfYear(date string) int {
- t, _ := time.Parse("2006-01-02", date)
- return t.YearDay()
-}
diff --git a/problems/day-of-the-year/day_of_the_year_test.go b/problems/day-of-the-year/day_of_the_year_test.go
deleted file mode 100644
index 607af2434..000000000
--- a/problems/day-of-the-year/day_of_the_year_test.go
+++ /dev/null
@@ -1,43 +0,0 @@
-package problem1154
-
-import "testing"
-
-type testType struct {
- in string
- want int
-}
-
-func TestDayOfYear(t *testing.T) {
- tests := [...]testType{
- {
- in: "2019-01-09",
- want: 9,
- },
- {
- in: "2019-02-10",
- want: 41,
- },
- {
- in: "2003-03-01",
- want: 60,
- },
- {
- in: "2004-03-01",
- want: 61,
- },
- {
- in: "2000-08-01",
- want: 214,
- },
- {
- in: "1993-12-11",
- want: 345,
- },
- }
- for _, tt := range tests {
- got := dayOfYear(tt.in)
- if got != tt.want {
- t.Fatalf("in: %v, got: %v, want: %v", tt.in, got, tt.want)
- }
- }
-}
diff --git a/problems/decode-string/README.md b/problems/decode-string/README.md
deleted file mode 100644
index 340d924ee..000000000
--- a/problems/decode-string/README.md
+++ /dev/null
@@ -1,54 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../utf-8-validation "UTF-8 Validation")
-
-[Next >](../longest-substring-with-at-least-k-repeating-characters "Longest Substring with At Least K Repeating Characters")
-
-## [394. Decode String (Medium)](https://leetcode.com/problems/decode-string "字符串解码")
-
-
Given an encoded string, return its decoded string.
-
-
The encoding rule is: k[encoded_string], where the encoded_string inside the square brackets is being repeated exactly k times. Note that k is guaranteed to be a positive integer.
-
-
You may assume that the input string is always valid; No extra white spaces, square brackets are well-formed, etc.
-
-
Furthermore, you may assume that the original data does not contain any digits and that digits are only for those repeat numbers, k. For example, there won't be input like 3a or 2[4].
-
-
-
Example 1:
-
Input: s = "3[a]2[bc]"
-Output: "aaabcbc"
-
Example 2:
-
Input: s = "3[a2[c]]"
-Output: "accaccacc"
-
Example 3:
-
Input: s = "2[abc]3[cd]ef"
-Output: "abcabccdcdcdef"
-
Example 4:
-
Input: s = "abc3[cd]xyz"
-Output: "abccdcdcdxyz"
-
-
-
Constraints:
-
-
-
1 <= s.length <= 30
-
s consists of lowercase English letters, digits, and square brackets '[]'.
A string originalText is encoded using a slanted transposition cipher to a string encodedText with the help of a matrix having a fixed number of rowsrows.
-
-
originalText is placed first in a top-left to bottom-right manner.
-
-
The blue cells are filled first, followed by the red cells, then the yellow cells, and so on, until we reach the end of originalText. The arrow indicates the order in which the cells are filled. All empty cells are filled with ' '. The number of columns is chosen such that the rightmost column will not be empty after filling in originalText.
-
-
encodedText is then formed by appending all characters of the matrix in a row-wise fashion.
-
-
The characters in the blue cells are appended first to encodedText, then the red cells, and so on, and finally the yellow cells. The arrow indicates the order in which the cells are accessed.
-
-
For example, if originalText = "cipher" and rows = 3, then we encode it in the following manner:
-
-
The blue arrows depict how originalText is placed in the matrix, and the red arrows denote the order in which encodedText is formed. In the above example, encodedText = "ch ie pr".
-
-
Given the encoded string encodedText and number of rows rows, return the original stringoriginalText.
-
-
Note:originalTextdoes not have any trailing spaces ' '. The test cases are generated such that there is only one possible originalText.
-
-
-
Example 1:
-
-
-Input: encodedText = "ch ie pr", rows = 3
-Output: "cipher"
-Explanation: This is the same example described in the problem description.
-
-
-
Example 2:
-
-
-Input: encodedText = "iveo eed l te olc", rows = 4
-Output: "i love leetcode"
-Explanation: The figure above denotes the matrix that was used to encode originalText.
-The blue arrows show how we can find originalText from encodedText.
-
-
-
Example 3:
-
-
-Input: encodedText = "coding", rows = 1
-Output: "coding"
-Explanation: Since there is only 1 row, both originalText and encodedText are the same.
-
-
-
-
Constraints:
-
-
-
0 <= encodedText.length <= 106
-
encodedText consists of lowercase English letters and ' ' only.
-
encodedText is a valid encoding of some originalText that does not have trailing spaces.
-
1 <= rows <= 1000
-
The testcases are generated such that there is only one possible originalText.
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
- [[Simulation](../../tag/simulation/README.md)]
-
-### Hints
-
-Hint 1
-How can you use rows and encodedText to find the number of columns of the matrix?
-
-
-
-Hint 2
-Once you have the number of rows and columns, you can create the matrix and place encodedText in it. How should you place it in the matrix?
-
-
-
-Hint 3
-How should you traverse the matrix to "decode" originalText?
-
diff --git a/problems/decode-ways-ii/README.md b/problems/decode-ways-ii/README.md
deleted file mode 100644
index 7e825db0d..000000000
--- a/problems/decode-ways-ii/README.md
+++ /dev/null
@@ -1,84 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../shopping-offers "Shopping Offers")
-
-[Next >](../solve-the-equation "Solve the Equation")
-
-## [639. Decode Ways II (Hard)](https://leetcode.com/problems/decode-ways-ii "解码方法 II")
-
-
A message containing letters from A-Z can be encoded into numbers using the following mapping:
-
-
-'A' -> "1"
-'B' -> "2"
-...
-'Z' -> "26"
-
-
-
To decode an encoded message, all the digits must be grouped then mapped back into letters using the reverse of the mapping above (there may be multiple ways). For example, "11106" can be mapped into:
-
-
-
"AAJF" with the grouping (1 1 10 6)
-
"KJF" with the grouping (11 10 6)
-
-
-
Note that the grouping (1 11 06) is invalid because "06" cannot be mapped into 'F' since "6" is different from "06".
-
-
In addition to the mapping above, an encoded message may contain the '*' character, which can represent any digit from '1' to '9' ('0' is excluded). For example, the encoded message "1*" may represent any of the encoded messages "11", "12", "13", "14", "15", "16", "17", "18", or "19". Decoding "1*" is equivalent to decoding any of the encoded messages it can represent.
-
-
Given a string s consisting of digits and '*' characters, return the number of ways to decode it.
-
-
Since the answer may be very large, return it modulo109 + 7.
-
-
-
Example 1:
-
-
-Input: s = "*"
-Output: 9
-Explanation: The encoded message can represent any of the encoded messages "1", "2", "3", "4", "5", "6", "7", "8", or "9".
-Each of these can be decoded to the strings "A", "B", "C", "D", "E", "F", "G", "H", and "I" respectively.
-Hence, there are a total of 9 ways to decode "*".
-
-
-
Example 2:
-
-
-Input: s = "1*"
-Output: 18
-Explanation: The encoded message can represent any of the encoded messages "11", "12", "13", "14", "15", "16", "17", "18", or "19".
-Each of these encoded messages have 2 ways to be decoded (e.g. "11" can be decoded to "AA" or "K").
-Hence, there are a total of 9 * 2 = 18 ways to decode "1*".
-
-
-
Example 3:
-
-
-Input: s = "2*"
-Output: 15
-Explanation: The encoded message can represent any of the encoded messages "21", "22", "23", "24", "25", "26", "27", "28", or "29".
-"21", "22", "23", "24", "25", and "26" have 2 ways of being decoded, but "27", "28", and "29" only have 1 way.
-Hence, there are a total of (6 * 2) + (3 * 1) = 12 + 3 = 15 ways to decode "2*".
-
-
-
-
Constraints:
-
-
-
1 <= s.length <= 105
-
s[i] is a digit or '*'.
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Similar Questions
- 1. [Decode Ways](../decode-ways) (Medium)
- 1. [Number of Ways to Separate Numbers](../number-of-ways-to-separate-numbers) (Hard)
- 1. [Number of Ways to Divide a Long Corridor](../number-of-ways-to-divide-a-long-corridor) (Hard)
diff --git a/problems/decode-ways-ii/decode_ways_ii.go b/problems/decode-ways-ii/decode_ways_ii.go
deleted file mode 100644
index 543880e17..000000000
--- a/problems/decode-ways-ii/decode_ways_ii.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem639
diff --git a/problems/decode-ways-ii/decode_ways_ii_test.go b/problems/decode-ways-ii/decode_ways_ii_test.go
deleted file mode 100644
index 543880e17..000000000
--- a/problems/decode-ways-ii/decode_ways_ii_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem639
diff --git a/problems/decode-ways/README.md b/problems/decode-ways/README.md
deleted file mode 100644
index 4f55bba1d..000000000
--- a/problems/decode-ways/README.md
+++ /dev/null
@@ -1,85 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../subsets-ii "Subsets II")
-
-[Next >](../reverse-linked-list-ii "Reverse Linked List II")
-
-## [91. Decode Ways (Medium)](https://leetcode.com/problems/decode-ways "解码方法")
-
-
A message containing letters from A-Z can be encoded into numbers using the following mapping:
-
-
-'A' -> "1"
-'B' -> "2"
-...
-'Z' -> "26"
-
-
-
To decode an encoded message, all the digits must be grouped then mapped back into letters using the reverse of the mapping above (there may be multiple ways). For example, "11106" can be mapped into:
-
-
-
"AAJF" with the grouping (1 1 10 6)
-
"KJF" with the grouping (11 10 6)
-
-
-
Note that the grouping (1 11 06) is invalid because "06" cannot be mapped into 'F' since "6" is different from "06".
-
-
Given a string s containing only digits, return the number of ways to decode it.
-
-
The answer is guaranteed to fit in a 32-bit integer.
-
-
-
Example 1:
-
-
-Input: s = "12"
-Output: 2
-Explanation: "12" could be decoded as "AB" (1 2) or "L" (12).
-
-
-
Example 2:
-
-
-Input: s = "226"
-Output: 3
-Explanation: "226" could be decoded as "BZ" (2 26), "VF" (22 6), or "BBF" (2 2 6).
-
-
-
Example 3:
-
-
-Input: s = "0"
-Output: 0
-Explanation: There is no character that is mapped to a number starting with 0.
-The only valid mappings with 0 are 'J' -> "10" and 'T' -> "20", neither of which start with 0.
-Hence, there are no valid ways to decode this since all digits need to be mapped.
-
-
-
Example 4:
-
-
-Input: s = "06"
-Output: 0
-Explanation: "06" cannot be mapped to "F" because of the leading zero ("6" is different from "06").
-
-
-
-
Constraints:
-
-
-
1 <= s.length <= 100
-
s contains only digits and may contain leading zero(s).
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Similar Questions
- 1. [Decode Ways II](../decode-ways-ii) (Hard)
- 1. [Number of Ways to Separate Numbers](../number-of-ways-to-separate-numbers) (Hard)
diff --git a/problems/decode-ways/decode_ways.go b/problems/decode-ways/decode_ways.go
deleted file mode 100644
index ec5cdea5d..000000000
--- a/problems/decode-ways/decode_ways.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem91
diff --git a/problems/decode-ways/decode_ways_test.go b/problems/decode-ways/decode_ways_test.go
deleted file mode 100644
index ec5cdea5d..000000000
--- a/problems/decode-ways/decode_ways_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem91
diff --git a/problems/decode-xored-array/README.md b/problems/decode-xored-array/README.md
deleted file mode 100644
index a1431e45a..000000000
--- a/problems/decode-xored-array/README.md
+++ /dev/null
@@ -1,61 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../number-of-ways-to-reconstruct-a-tree "Number Of Ways To Reconstruct A Tree")
-
-[Next >](../swapping-nodes-in-a-linked-list "Swapping Nodes in a Linked List")
-
-## [1720. Decode XORed Array (Easy)](https://leetcode.com/problems/decode-xored-array "解码异或后的数组")
-
-
There is a hidden integer array arr that consists of n non-negative integers.
-
-
It was encoded into another integer array encoded of length n - 1, such that encoded[i] = arr[i] XOR arr[i + 1]. For example, if arr = [1,0,2,1], then encoded = [1,2,3].
-
-
You are given the encoded array. You are also given an integer first, that is the first element of arr, i.e. arr[0].
-
-
Return the original arrayarr. It can be proved that the answer exists and is unique.
-
-
-
Example 1:
-
-
-Input: encoded = [1,2,3], first = 1
-Output: [1,0,2,1]
-Explanation: If arr = [1,0,2,1], then first = 1 and encoded = [1 XOR 0, 0 XOR 2, 2 XOR 1] = [1,2,3]
-
-
-
Example 2:
-
-
-Input: encoded = [6,2,7,3], first = 4
-Output: [4,2,0,7,4]
-
-
-
-
Constraints:
-
-
-
2 <= n <= 104
-
encoded.length == n - 1
-
0 <= encoded[i] <= 105
-
0 <= first <= 105
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Bit Manipulation](../../tag/bit-manipulation/README.md)]
-
-### Hints
-
-Hint 1
-Since that encoded[i] = arr[i] XOR arr[i+1], then arr[i+1] = encoded[i] XOR arr[i].
-
-
-
-Hint 2
-Iterate on i from beginning to end, and set arr[i+1] = encoded[i] XOR arr[i].
-
diff --git a/problems/decode-xored-permutation/README.md b/problems/decode-xored-permutation/README.md
deleted file mode 100644
index f1782835e..000000000
--- a/problems/decode-xored-permutation/README.md
+++ /dev/null
@@ -1,68 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-number-of-people-to-teach "Minimum Number of People to Teach")
-
-[Next >](../count-ways-to-make-array-with-product "Count Ways to Make Array With Product")
-
-## [1734. Decode XORed Permutation (Medium)](https://leetcode.com/problems/decode-xored-permutation "解码异或后的排列")
-
-
There is an integer array perm that is a permutation of the first n positive integers, where n is always odd.
-
-
It was encoded into another integer array encoded of length n - 1, such that encoded[i] = perm[i] XOR perm[i + 1]. For example, if perm = [1,3,2], then encoded = [2,1].
-
-
Given the encoded array, return the original arrayperm. It is guaranteed that the answer exists and is unique.
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Bit Manipulation](../../tag/bit-manipulation/README.md)]
-
-### Hints
-
-Hint 1
-Compute the XOR of the numbers between 1 and n, and think about how it can be used. Let it be x.
-
-
-
-Hint 2
-Think why n is odd.
-
-
-
-Hint 3
-perm[0] = x XOR encoded[1] XOR encoded[3] XOR encoded[5] ...
-
-
-
-Hint 4
-perm[i] = perm[i-1] XOR encoded[i-1]
-
diff --git a/problems/decoded-string-at-index/README.md b/problems/decoded-string-at-index/README.md
deleted file mode 100644
index db82b21f2..000000000
--- a/problems/decoded-string-at-index/README.md
+++ /dev/null
@@ -1,65 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../profitable-schemes "Profitable Schemes")
-
-[Next >](../boats-to-save-people "Boats to Save People")
-
-## [880. Decoded String at Index (Medium)](https://leetcode.com/problems/decoded-string-at-index "索引处的解码字符串")
-
-
You are given an encoded string s. To decode the string to a tape, the encoded string is read one character at a time and the following steps are taken:
-
-
-
If the character read is a letter, that letter is written onto the tape.
-
If the character read is a digit d, the entire current tape is repeatedly written d - 1 more times in total.
-
-
-
Given an integer k, return the kth letter (1-indexed) in the decoded string.
-
-
-
Example 1:
-
-
-Input: s = "leet2code3", k = 10
-Output: "o"
-Explanation: The decoded string is "leetleetcodeleetleetcodeleetleetcode".
-The 10th letter in the string is "o".
-
-
-
Example 2:
-
-
-Input: s = "ha22", k = 5
-Output: "h"
-Explanation: The decoded string is "hahahaha".
-The 5th letter is "h".
-
-
-
Example 3:
-
-
-Input: s = "a2345678999999999999999", k = 1
-Output: "a"
-Explanation: The decoded string is "a" repeated 8301530446056247680 times.
-The 1st letter is "a".
-
-
-
-
Constraints:
-
-
-
2 <= s.length <= 100
-
s consists of lowercase English letters and digits 2 through 9.
-
s starts with a letter.
-
1 <= k <= 109
-
It is guaranteed that k is less than or equal to the length of the decoded string.
-
The decoded string is guaranteed to have less than 263 letters.
We are given a list nums of integers representing a list compressed with run-length encoding.
-
-
Consider each adjacent pair of elements [freq, val] = [nums[2*i], nums[2*i+1]] (with i >= 0). For each such pair, there are freq elements with value val concatenated in a sublist. Concatenate all the sublists from left to right to generate the decompressed list.
-
-
Return the decompressed list.
-
-
-
Example 1:
-
-
-Input: nums = [1,2,3,4]
-Output: [2,4,4,4]
-Explanation: The first pair [1,2] means we have freq = 1 and val = 2 so we generate the array [2].
-The second pair [3,4] means we have freq = 3 and val = 4 so we generate [4,4,4].
-At the end the concatenation [2] + [4,4,4] is [2,4,4,4].
-
-
-
Example 2:
-
-
-Input: nums = [1,1,2,3]
-Output: [1,3,3]
-
-
-
-
Constraints:
-
-
-
2 <= nums.length <= 100
-
nums.length % 2 == 0
-
1 <= nums[i] <= 100
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
-
-### Similar Questions
- 1. [String Compression](../string-compression) (Medium)
-
-### Hints
-
-Hint 1
-Decompress the given array by repeating nums[2*i+1] a number of times equal to nums[2*i].
-
diff --git a/problems/decrease-elements-to-make-array-zigzag/README.md b/problems/decrease-elements-to-make-array-zigzag/README.md
deleted file mode 100644
index 1abcb21e0..000000000
--- a/problems/decrease-elements-to-make-array-zigzag/README.md
+++ /dev/null
@@ -1,57 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../longest-common-subsequence "Longest Common Subsequence")
-
-[Next >](../binary-tree-coloring-game "Binary Tree Coloring Game")
-
-## [1144. Decrease Elements To Make Array Zigzag (Medium)](https://leetcode.com/problems/decrease-elements-to-make-array-zigzag "递减元素使数组呈锯齿状")
-
-
Given an array nums of integers, a move consists of choosing any element and decreasing it by 1.
-
-
An array A is a zigzag array if either:
-
-
-
Every even-indexed element is greater than adjacent elements, ie. A[0] > A[1] < A[2] > A[3] < A[4] > ...
-
OR, every odd-indexed element is greater than adjacent elements, ie. A[0] < A[1] > A[2] < A[3] > A[4] < ...
-
-
-
Return the minimum number of moves to transform the given array nums into a zigzag array.
-
-
-
Example 1:
-
-
-Input: nums = [1,2,3]
-Output: 2
-Explanation: We can decrease 2 to 0 or 3 to 1.
-
-
-
Example 2:
-
-
-Input: nums = [9,6,1,6,2]
-Output: 4
-
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 1000
-
1 <= nums[i] <= 1000
-
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[Array](../../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/decrypt-string-from-alphabet-to-integer-mapping/README.md b/problems/decrypt-string-from-alphabet-to-integer-mapping/README.md
deleted file mode 100644
index 51121f55c..000000000
--- a/problems/decrypt-string-from-alphabet-to-integer-mapping/README.md
+++ /dev/null
@@ -1,57 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../running-total-for-different-genders "Running Total for Different Genders")
-
-[Next >](../xor-queries-of-a-subarray "XOR Queries of a Subarray")
-
-## [1309. Decrypt String from Alphabet to Integer Mapping (Easy)](https://leetcode.com/problems/decrypt-string-from-alphabet-to-integer-mapping "解码字母到整数映射")
-
-
You are given a string s formed by digits and '#'. We want to map s to English lowercase characters as follows:
-
-
-
Characters ('a' to 'i') are represented by ('1' to '9') respectively.
-
Characters ('j' to 'z') are represented by ('10#' to '26#') respectively.
-
-
-
Return the string formed after mapping.
-
-
The test cases are generated so that a unique mapping will always exist.
You have a bomb to defuse, and your time is running out! Your informer will provide you with a circular array code of length of n and a key k.
-
-
To decrypt the code, you must replace every number. All the numbers are replaced simultaneously.
-
-
-
If k > 0, replace the ith number with the sum of the nextk numbers.
-
If k < 0, replace the ith number with the sum of the previousk numbers.
-
If k == 0, replace the ith number with 0.
-
-
-
As code is circular, the next element of code[n-1] is code[0], and the previous element of code[0] is code[n-1].
-
-
Given the circular array code and an integer key k, return the decrypted code to defuse the bomb!
-
-
-
Example 1:
-
-
-Input: code = [5,7,1,4], k = 3
-Output: [12,10,16,13]
-Explanation: Each number is replaced by the sum of the next 3 numbers. The decrypted code is [7+1+4, 1+4+5, 4+5+7, 5+7+1]. Notice that the numbers wrap around.
-
-
-
Example 2:
-
-
-Input: code = [1,2,3,4], k = 0
-Output: [0,0,0,0]
-Explanation: When k is zero, the numbers are replaced by 0.
-
-
-
Example 3:
-
-
-Input: code = [2,4,9,3], k = -2
-Output: [12,5,6,13]
-Explanation: The decrypted code is [3+9, 2+3, 4+2, 9+4]. Notice that the numbers wrap around again. If k is negative, the sum is of the previous numbers.
-
-
-
-
Constraints:
-
-
-
n == code.length
-
1 <= n <= 100
-
1 <= code[i] <= 100
-
-(n - 1) <= k <= n - 1
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
-
-### Hints
-
-Hint 1
-As the array is circular, use modulo to find the correct index.
-
-
-
-Hint 2
-The constraints are low enough for a brute-force solution.
-
diff --git a/problems/degree-of-an-array/README.md b/problems/degree-of-an-array/README.md
deleted file mode 100644
index 46abd362f..000000000
--- a/problems/degree-of-an-array/README.md
+++ /dev/null
@@ -1,60 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../count-binary-substrings "Count Binary Substrings")
-
-[Next >](../partition-to-k-equal-sum-subsets "Partition to K Equal Sum Subsets")
-
-## [697. Degree of an Array (Easy)](https://leetcode.com/problems/degree-of-an-array "数组的度")
-
-
Given a non-empty array of non-negative integers nums, the degree of this array is defined as the maximum frequency of any one of its elements.
-
-
Your task is to find the smallest possible length of a (contiguous) subarray of nums, that has the same degree as nums.
-
-
-
Example 1:
-
-
-Input: nums = [1,2,2,3,1]
-Output: 2
-Explanation:
-The input array has a degree of 2 because both elements 1 and 2 appear twice.
-Of the subarrays that have the same degree:
-[1, 2, 2, 3, 1], [1, 2, 2, 3], [2, 2, 3, 1], [1, 2, 2], [2, 2, 3], [2, 2]
-The shortest length is 2. So return 2.
-
-
-
Example 2:
-
-
-Input: nums = [1,2,2,3,1,4,2]
-Output: 6
-Explanation:
-The degree is 3 because the element 2 is repeated 3 times.
-So [2,2,3,1,4,2] is the shortest subarray, therefore returning 6.
-
-
-
-
Constraints:
-
-
-
nums.length will be between 1 and 50,000.
-
nums[i] will be an integer between 0 and 49,999.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
-
-### Similar Questions
- 1. [Maximum Subarray](../maximum-subarray) (Easy)
-
-### Hints
-
-Hint 1
-Say 5 is the only element that occurs the most number of times - for example, nums = [1, 5, 2, 3, 5, 4, 5, 6]. What is the answer?
-
diff --git a/problems/degree-of-an-array/degree_of_an_array.go b/problems/degree-of-an-array/degree_of_an_array.go
deleted file mode 100644
index 1901e8292..000000000
--- a/problems/degree-of-an-array/degree_of_an_array.go
+++ /dev/null
@@ -1,20 +0,0 @@
-package problem697
-
-func findShortestSubArray(nums []int) int {
- m, ans := make(map[int]int), 0
- first, max := make(map[int]int), 0
- for i, v := range nums {
- m[v]++
- if first[v] == 0 {
- first[v] = i + 1
- }
- if m[v] >= max {
- t := i - first[v] + 2
- if m[v] > max || (m[v] == max && t < ans) {
- ans = t
- }
- max = m[v]
- }
- }
- return ans
-}
diff --git a/problems/degree-of-an-array/degree_of_an_array_test.go b/problems/degree-of-an-array/degree_of_an_array_test.go
deleted file mode 100644
index e9a9e7d4e..000000000
--- a/problems/degree-of-an-array/degree_of_an_array_test.go
+++ /dev/null
@@ -1,39 +0,0 @@
-package problem697
-
-import "testing"
-
-type testType struct {
- in []int
- want int
-}
-
-func TestFindShortestSubArray(t *testing.T) {
- tests := [...]testType{
- {
- in: []int{1, 2, 2, 3, 1},
- want: 2,
- },
- {
- in: []int{1, 2, 2, 3, 1, 4, 2},
- want: 6,
- },
- {
- in: []int{1},
- want: 1,
- },
- {
- in: []int{2, 1, 1, 2, 1, 3, 3, 3, 1, 3, 1, 3, 2},
- want: 7,
- },
- {
- in: []int{1, 2, 2, 3, 1},
- want: 2,
- },
- }
- for _, tt := range tests {
- got := findShortestSubArray(tt.in)
- if got != tt.want {
- t.Fatalf("in: %v, got: %v, want: %v", tt.in, got, tt.want)
- }
- }
-}
diff --git a/problems/delete-and-earn/README.md b/problems/delete-and-earn/README.md
deleted file mode 100644
index a76cd1977..000000000
--- a/problems/delete-and-earn/README.md
+++ /dev/null
@@ -1,65 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../daily-temperatures "Daily Temperatures")
-
-[Next >](../cherry-pickup "Cherry Pickup")
-
-## [740. Delete and Earn (Medium)](https://leetcode.com/problems/delete-and-earn "删除并获得点数")
-
-
You are given an integer array nums. You want to maximize the number of points you get by performing the following operation any number of times:
-
-
-
Pick any nums[i] and delete it to earn nums[i] points. Afterwards, you must delete every element equal to nums[i] - 1 and every element equal to nums[i] + 1.
-
-
-
Return the maximum number of points you can earn by applying the above operation some number of times.
-
-
-
Example 1:
-
-
-Input: nums = [3,4,2]
-Output: 6
-Explanation: You can perform the following operations:
-- Delete 4 to earn 4 points. Consequently, 3 is also deleted. nums = [2].
-- Delete 2 to earn 2 points. nums = [].
-You earn a total of 6 points.
-
-
-
Example 2:
-
-
-Input: nums = [2,2,3,3,3,4]
-Output: 9
-Explanation: You can perform the following operations:
-- Delete a 3 to earn 3 points. All 2's and 4's are also deleted. nums = [3,3].
-- Delete a 3 again to earn 3 points. nums = [3].
-- Delete a 3 once more to earn 3 points. nums = [].
-You earn a total of 9 points.
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 2 * 104
-
1 <= nums[i] <= 104
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Similar Questions
- 1. [House Robber](../house-robber) (Medium)
-
-### Hints
-
-Hint 1
-If you take a number, you might as well take them all. Keep track of what the value is of the subset of the input with maximum M when you either take or don't take M.
-
diff --git a/problems/delete-and-earn/delete_and_earn.go b/problems/delete-and-earn/delete_and_earn.go
deleted file mode 100644
index 8de02ee07..000000000
--- a/problems/delete-and-earn/delete_and_earn.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem740
diff --git a/problems/delete-and-earn/delete_and_earn_test.go b/problems/delete-and-earn/delete_and_earn_test.go
deleted file mode 100644
index 8de02ee07..000000000
--- a/problems/delete-and-earn/delete_and_earn_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem740
diff --git a/problems/delete-characters-to-make-fancy-string/README.md b/problems/delete-characters-to-make-fancy-string/README.md
deleted file mode 100644
index 786cb11c1..000000000
--- a/problems/delete-characters-to-make-fancy-string/README.md
+++ /dev/null
@@ -1,70 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-time-for-k-virus-variants-to-spread "Minimum Time For K Virus Variants to Spread")
-
-[Next >](../check-if-move-is-legal "Check if Move is Legal")
-
-## [1957. Delete Characters to Make Fancy String (Easy)](https://leetcode.com/problems/delete-characters-to-make-fancy-string "删除字符使字符串变好")
-
-
A fancy string is a string where no threeconsecutive characters are equal.
-
-
Given a string s, delete the minimum possible number of characters from s to make it fancy.
-
-
Return the final string after the deletion. It can be shown that the answer will always be unique.
-
-
-
Example 1:
-
-
-Input: s = "leeetcode"
-Output: "leetcode"
-Explanation:
-Remove an 'e' from the first group of 'e's to create "leetcode".
-No three consecutive characters are equal, so return "leetcode".
-
-
-
Example 2:
-
-
-Input: s = "aaabaaaa"
-Output: "aabaa"
-Explanation:
-Remove an 'a' from the first group of 'a's to create "aabaaaa".
-Remove two 'a's from the second group of 'a's to create "aabaa".
-No three consecutive characters are equal, so return "aabaa".
-
-
-
Example 3:
-
-
-Input: s = "aab"
-Output: "aab"
-Explanation: No three consecutive characters are equal, so return "aab".
-
-
-
-
Constraints:
-
-
-
1 <= s.length <= 105
-
s consists only of lowercase English letters.
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
-
-### Hints
-
-Hint 1
-What's the optimal way to delete characters if three or more consecutive characters are equal?
-
-
-
-Hint 2
-If three or more consecutive characters are equal, keep two of them and delete the rest.
-
diff --git a/problems/delete-columns-to-make-sorted-ii/README.md b/problems/delete-columns-to-make-sorted-ii/README.md
deleted file mode 100644
index 6ead9d1b4..000000000
--- a/problems/delete-columns-to-make-sorted-ii/README.md
+++ /dev/null
@@ -1,66 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../array-of-doubled-pairs "Array of Doubled Pairs")
-
-[Next >](../tallest-billboard "Tallest Billboard")
-
-## [955. Delete Columns to Make Sorted II (Medium)](https://leetcode.com/problems/delete-columns-to-make-sorted-ii "删列造序 II")
-
-
You are given an array of n strings strs, all of the same length.
-
-
We may choose any deletion indices, and we delete all the characters in those indices for each string.
-
-
For example, if we have strs = ["abcdef","uvwxyz"] and deletion indices {0, 2, 3}, then the final array after deletions is ["bef", "vyz"].
-
-
Suppose we chose a set of deletion indices answer such that after deletions, the final array has its elements in lexicographic order (i.e., strs[0] <= strs[1] <= strs[2] <= ... <= strs[n - 1]). Return the minimum possible value ofanswer.length.
-
-
-
Example 1:
-
-
-Input: strs = ["ca","bb","ac"]
-Output: 1
-Explanation:
-After deleting the first column, strs = ["a", "b", "c"].
-Now strs is in lexicographic order (ie. strs[0] <= strs[1] <= strs[2]).
-We require at least 1 deletion since initially strs was not in lexicographic order, so the answer is 1.
-
-
-
Example 2:
-
-
-Input: strs = ["xc","yb","za"]
-Output: 0
-Explanation:
-strs is already in lexicographic order, so we do not need to delete anything.
-Note that the rows of strs are not necessarily in lexicographic order:
-i.e., it is NOT necessarily true that (strs[0][0] <= strs[0][1] <= ...)
-
-
-
Example 3:
-
-
-Input: strs = ["zyx","wvu","tsr"]
-Output: 3
-Explanation: We have to delete every column.
-
You are given an array of n strings strs, all of the same length.
-
-
We may choose any deletion indices, and we delete all the characters in those indices for each string.
-
-
For example, if we have strs = ["abcdef","uvwxyz"] and deletion indices {0, 2, 3}, then the final array after deletions is ["bef", "vyz"].
-
-
Suppose we chose a set of deletion indices answer such that after deletions, the final array has every string (row) in lexicographic order. (i.e., (strs[0][0] <= strs[0][1] <= ... <= strs[0][strs[0].length - 1]), and (strs[1][0] <= strs[1][1] <= ... <= strs[1][strs[1].length - 1]), and so on). Return the minimum possible value ofanswer.length.
-
-
-
Example 1:
-
-
-Input: strs = ["babca","bbazb"]
-Output: 3
-Explanation: After deleting columns 0, 1, and 4, the final array is strs = ["bc", "az"].
-Both these rows are individually in lexicographic order (ie. strs[0][0] <= strs[0][1] and strs[1][0] <= strs[1][1]).
-Note that strs[0] > strs[1] - the array strs is not necessarily in lexicographic order.
-
-
Example 2:
-
-
-Input: strs = ["edcba"]
-Output: 4
-Explanation: If we delete less than 4 columns, the only row will not be lexicographically sorted.
-
-
-
Example 3:
-
-
-Input: strs = ["ghi","def","abc"]
-Output: 0
-Explanation: All rows are already lexicographically sorted.
-
You are given an array of n strings strs, all of the same length.
-
-
The strings can be arranged such that there is one on each line, making a grid. For example, strs = ["abc", "bce", "cae"] can be arranged as:
-
-
-abc
-bce
-cae
-
-
-
You want to delete the columns that are not sorted lexicographically. In the above example (0-indexed), columns 0 ('a', 'b', 'c') and 2 ('c', 'e', 'e') are sorted while column 1 ('b', 'c', 'a') is not, so you would delete column 1.
-
-
Return the number of columns that you will delete.
-
-
-
Example 1:
-
-
-Input: strs = ["cba","daf","ghi"]
-Output: 1
-Explanation: The grid looks as follows:
- cba
- daf
- ghi
-Columns 0 and 2 are sorted, but column 1 is not, so you only need to delete 1 column.
-
-
-
Example 2:
-
-
-Input: strs = ["a","b"]
-Output: 0
-Explanation: The grid looks as follows:
- a
- b
-Column 0 is the only column and is sorted, so you will not delete any columns.
-
-
-
Example 3:
-
-
-Input: strs = ["zyx","wvu","tsr"]
-Output: 3
-Explanation: The grid looks as follows:
- zyx
- wvu
- tsr
-All 3 columns are not sorted, so you will delete all 3.
-
-+-------------+---------+
-| Column Name | Type |
-+-------------+---------+
-| id | int |
-| email | varchar |
-+-------------+---------+
-id is the primary key column for this table.
-Each row of this table contains an email. The emails will not contain uppercase letters.
-
-
-
-
-
Write an SQL query to delete all the duplicate emails, keeping only one unique email with the smallest id. Note that you are supposed to write a DELETE statement and not a SELECT one.
-
-
Return the result table in any order.
-
-
The query result format is in the following example.
-
-
-
Example 1:
-
-
-Input:
-Person table:
-+----+------------------+
-| id | email |
-+----+------------------+
-| 1 | john@example.com |
-| 2 | bob@example.com |
-| 3 | john@example.com |
-+----+------------------+
-Output:
-+----+------------------+
-| id | email |
-+----+------------------+
-| 1 | john@example.com |
-| 2 | bob@example.com |
-+----+------------------+
-Explanation: john@example.com is repeated two times. We keep the row with the smallest Id = 1.
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/delete-duplicate-emails/delete_duplicate_emails.sql b/problems/delete-duplicate-emails/delete_duplicate_emails.sql
deleted file mode 100644
index bae62cf19..000000000
--- a/problems/delete-duplicate-emails/delete_duplicate_emails.sql
+++ /dev/null
@@ -1 +0,0 @@
-# Write your MySQL query statement below
diff --git a/problems/delete-duplicate-emails/mysql_schemas.sql b/problems/delete-duplicate-emails/mysql_schemas.sql
deleted file mode 100644
index 6ee53bdfa..000000000
--- a/problems/delete-duplicate-emails/mysql_schemas.sql
+++ /dev/null
@@ -1,5 +0,0 @@
-Create table If Not Exists Person (Id int, Email varchar(255));
-Truncate table Person;
-insert into Person (id, email) values ('1', 'john@example.com');
-insert into Person (id, email) values ('2', 'bob@example.com');
-insert into Person (id, email) values ('3', 'john@example.com');
diff --git a/problems/delete-duplicate-folders-in-system/README.md b/problems/delete-duplicate-folders-in-system/README.md
deleted file mode 100644
index 7e5d89477..000000000
--- a/problems/delete-duplicate-folders-in-system/README.md
+++ /dev/null
@@ -1,101 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-compatibility-score-sum "Maximum Compatibility Score Sum")
-
-[Next >](../strong-friendship "Strong Friendship")
-
-## [1948. Delete Duplicate Folders in System (Hard)](https://leetcode.com/problems/delete-duplicate-folders-in-system "删除系统中的重复文件夹")
-
-
Due to a bug, there are many duplicate folders in a file system. You are given a 2D array paths, where paths[i] is an array representing an absolute path to the ith folder in the file system.
-
-
-
For example, ["one", "two", "three"] represents the path "/one/two/three".
-
-
-
Two folders (not necessarily on the same level) are identical if they contain the same non-empty set of identical subfolders and underlying subfolder structure. The folders do not need to be at the root level to be identical. If two or more folders are identical, then mark the folders as well as all their subfolders.
-
-
-
For example, folders "/a" and "/b" in the file structure below are identical. They (as well as their subfolders) should all be marked:
-
-
/a
-
/a/x
-
/a/x/y
-
/a/z
-
/b
-
/b/x
-
/b/x/y
-
/b/z
-
-
-
However, if the file structure also included the path "/b/w", then the folders "/a" and "/b" would not be identical. Note that "/a/x" and "/b/x" would still be considered identical even with the added folder.
-
-
-
Once all the identical folders and their subfolders have been marked, the file system will delete all of them. The file system only runs the deletion once, so any folders that become identical after the initial deletion are not deleted.
-
-
Return the 2D array anscontaining the paths of the remaining folders after deleting all the marked folders. The paths may be returned in any order.
-
-
-
Example 1:
-
-
-Input: paths = [["a"],["c"],["d"],["a","b"],["c","b"],["d","a"]]
-Output: [["d"],["d","a"]]
-Explanation: The file structure is as shown.
-Folders "/a" and "/c" (and their subfolders) are marked for deletion because they both contain an empty
-folder named "b".
-
-
-
Example 2:
-
-
-Input: paths = [["a"],["c"],["a","b"],["c","b"],["a","b","x"],["a","b","x","y"],["w"],["w","y"]]
-Output: [["c"],["c","b"],["a"],["a","b"]]
-Explanation: The file structure is as shown.
-Folders "/a/b/x" and "/w" (and their subfolders) are marked for deletion because they both contain an empty folder named "y".
-Note that folders "/a" and "/c" are identical after the deletion, but they are not deleted because they were not marked beforehand.
-
-
-
Example 3:
-
-
-Input: paths = [["a","b"],["c","d"],["c"],["a"]]
-Output: [["c"],["c","d"],["a"],["a","b"]]
-Explanation: All folders are unique in the file system.
-Note that the returned array can be in a different order as the order does not matter.
-
-
-
-
Constraints:
-
-
-
1 <= paths.length <= 2 * 104
-
1 <= paths[i].length <= 500
-
1 <= paths[i][j].length <= 10
-
1 <= sum(paths[i][j].length) <= 2 * 105
-
path[i][j] consists of lowercase English letters.
-
No two paths lead to the same folder.
-
For any folder not at the root level, its parent folder will also be in the input.
-
-
-### Related Topics
- [[Trie](../../tag/trie/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
- [[Hash Function](../../tag/hash-function/README.md)]
-
-### Hints
-
-Hint 1
-Can we use a trie to build the folder structure?
-
-
-
-Hint 2
-Can we utilize hashing to hash the folder structures?
-
diff --git a/problems/delete-leaves-with-a-given-value/README.md b/problems/delete-leaves-with-a-given-value/README.md
deleted file mode 100644
index 1b4d423df..000000000
--- a/problems/delete-leaves-with-a-given-value/README.md
+++ /dev/null
@@ -1,68 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../print-words-vertically "Print Words Vertically")
-
-[Next >](../minimum-number-of-taps-to-open-to-water-a-garden "Minimum Number of Taps to Open to Water a Garden")
-
-## [1325. Delete Leaves With a Given Value (Medium)](https://leetcode.com/problems/delete-leaves-with-a-given-value "删除给定值的叶子节点")
-
-
Given a binary tree root and an integer target, delete all the leaf nodes with value target.
-
-
Note that once you delete a leaf node with value target, if its parent node becomes a leaf node and has the value target, it should also be deleted (you need to continue doing that until you cannot).
-
-
-
Example 1:
-
-
-
-
-Input: root = [1,2,3,2,null,2,4], target = 2
-Output: [1,null,3,null,4]
-Explanation: Leaf nodes in green with value (target = 2) are removed (Picture in left).
-After removing, new nodes become leaf nodes with value (target = 2) (Picture in center).
-
-Input: root = [1,2,null,2,null,2], target = 2
-Output: [1]
-Explanation: Leaf nodes in green with value (target = 2) are removed at each step.
-
-
-
-
Constraints:
-
-
-
The number of nodes in the tree is in the range [1, 3000].
-
1 <= Node.val, target <= 1000
-
-
-### Related Topics
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Tree](../../tag/tree/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Binary Tree](../../tag/binary-tree/README.md)]
-
-### Hints
-
-Hint 1
-Use the DFS to reconstruct the tree such that no leaf node is equal to the target. If the leaf node is equal to the target, return an empty object instead.
-
diff --git a/problems/delete-n-nodes-after-m-nodes-of-a-linked-list/README.md b/problems/delete-n-nodes-after-m-nodes-of-a-linked-list/README.md
deleted file mode 100644
index 9c97fa0c3..000000000
--- a/problems/delete-n-nodes-after-m-nodes-of-a-linked-list/README.md
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../paint-house-iii "Paint House III")
-
-[Next >](../final-prices-with-a-special-discount-in-a-shop "Final Prices With a Special Discount in a Shop")
-
-## [1474. Delete N Nodes After M Nodes of a Linked List (Easy)](https://leetcode.com/problems/delete-n-nodes-after-m-nodes-of-a-linked-list "删除链表 M 个节点之后的 N 个节点")
-
-
-
-### Related Topics
- [[Linked List](../../tag/linked-list/README.md)]
-
-### Hints
-
-Hint 1
-Traverse the Linked List, each time you need to delete the next n nodes connect the nodes previous deleting with the next node after deleting.
-
diff --git a/problems/delete-node-in-a-bst/README.md b/problems/delete-node-in-a-bst/README.md
deleted file mode 100644
index c9ad5f2fd..000000000
--- a/problems/delete-node-in-a-bst/README.md
+++ /dev/null
@@ -1,70 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../serialize-and-deserialize-bst "Serialize and Deserialize BST")
-
-[Next >](../sort-characters-by-frequency "Sort Characters By Frequency")
-
-## [450. Delete Node in a BST (Medium)](https://leetcode.com/problems/delete-node-in-a-bst "删除二叉搜索树中的节点")
-
-
Given a root node reference of a BST and a key, delete the node with the given key in the BST. Return the root node reference (possibly updated) of the BST.
-
-
Basically, the deletion can be divided into two stages:
-
-
-
Search for a node to remove.
-
If the node is found, delete the node.
-
-
-
-
Example 1:
-
-
-Input: root = [5,3,6,2,4,null,7], key = 3
-Output: [5,4,6,2,null,null,7]
-Explanation: Given key to delete is 3. So we find the node with value 3 and delete it.
-One valid answer is [5,4,6,2,null,null,7], shown in the above BST.
-Please notice that another valid answer is [5,2,6,null,4,null,7] and it's also accepted.
-
-
-
-
Example 2:
-
-
-Input: root = [5,3,6,2,4,null,7], key = 0
-Output: [5,3,6,2,4,null,7]
-Explanation: The tree does not contain a node with value = 0.
-
-
-
Example 3:
-
-
-Input: root = [], key = 0
-Output: []
-
-
-
-
Constraints:
-
-
-
The number of nodes in the tree is in the range [0, 104].
-
-105 <= Node.val <= 105
-
Each node has a unique value.
-
root is a valid binary search tree.
-
-105 <= key <= 105
-
-
-
-
Follow up: Could you solve it with time complexity O(height of tree)?
-
-### Related Topics
- [[Tree](../../tag/tree/README.md)]
- [[Binary Search Tree](../../tag/binary-search-tree/README.md)]
- [[Binary Tree](../../tag/binary-tree/README.md)]
-
-### Similar Questions
- 1. [Split BST](../split-bst) (Medium)
diff --git a/problems/delete-node-in-a-bst/delete_node_in_a_bst.go b/problems/delete-node-in-a-bst/delete_node_in_a_bst.go
deleted file mode 100644
index ad24d0e02..000000000
--- a/problems/delete-node-in-a-bst/delete_node_in_a_bst.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem450
diff --git a/problems/delete-node-in-a-bst/delete_node_in_a_bst_test.go b/problems/delete-node-in-a-bst/delete_node_in_a_bst_test.go
deleted file mode 100644
index ad24d0e02..000000000
--- a/problems/delete-node-in-a-bst/delete_node_in_a_bst_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem450
diff --git a/problems/delete-node-in-a-linked-list/README.md b/problems/delete-node-in-a-linked-list/README.md
deleted file mode 100644
index 232dc471f..000000000
--- a/problems/delete-node-in-a-linked-list/README.md
+++ /dev/null
@@ -1,70 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../lowest-common-ancestor-of-a-binary-tree "Lowest Common Ancestor of a Binary Tree")
-
-[Next >](../product-of-array-except-self "Product of Array Except Self")
-
-## [237. Delete Node in a Linked List (Easy)](https://leetcode.com/problems/delete-node-in-a-linked-list "删除链表中的节点")
-
-
Write a function to delete a node in a singly-linked list. You will not be given access to the head of the list, instead you will be given access to the node to be deleted directly.
-
-
It is guaranteed that the node to be deleted is not a tail node in the list.
-
-
-
Example 1:
-
-
-Input: head = [4,5,1,9], node = 5
-Output: [4,1,9]
-Explanation: You are given the second node with value 5, the linked list should become 4 -> 1 -> 9 after calling your function.
-
-
-
Example 2:
-
-
-Input: head = [4,5,1,9], node = 1
-Output: [4,5,9]
-Explanation: You are given the third node with value 1, the linked list should become 4 -> 5 -> 9 after calling your function.
-
-
-
Example 3:
-
-
-Input: head = [1,2,3,4], node = 3
-Output: [1,2,4]
-
-
-
Example 4:
-
-
-Input: head = [0,1], node = 0
-Output: [1]
-
-
-
Example 5:
-
-
-Input: head = [-3,5,-99], node = -3
-Output: [5,-99]
-
-
-
-
Constraints:
-
-
-
The number of the nodes in the given list is in the range [2, 1000].
-
-1000 <= Node.val <= 1000
-
The value of each node in the list is unique.
-
The node to be deleted is in the list and is not a tail node
word1 and word2 consist of only lowercase English letters.
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Similar Questions
- 1. [Edit Distance](../edit-distance) (Hard)
- 1. [Minimum ASCII Delete Sum for Two Strings](../minimum-ascii-delete-sum-for-two-strings) (Medium)
- 1. [Longest Common Subsequence](../longest-common-subsequence) (Medium)
diff --git a/problems/delete-operation-for-two-strings/delete_operation_for_two_strings.go b/problems/delete-operation-for-two-strings/delete_operation_for_two_strings.go
deleted file mode 100644
index ba746c9e5..000000000
--- a/problems/delete-operation-for-two-strings/delete_operation_for_two_strings.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem583
diff --git a/problems/delete-operation-for-two-strings/delete_operation_for_two_strings_test.go b/problems/delete-operation-for-two-strings/delete_operation_for_two_strings_test.go
deleted file mode 100644
index ba746c9e5..000000000
--- a/problems/delete-operation-for-two-strings/delete_operation_for_two_strings_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem583
diff --git a/problems/delete-the-middle-node-of-a-linked-list/README.md b/problems/delete-the-middle-node-of-a-linked-list/README.md
deleted file mode 100644
index e88e98744..000000000
--- a/problems/delete-the-middle-node-of-a-linked-list/README.md
+++ /dev/null
@@ -1,75 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../finding-3-digit-even-numbers "Finding 3-Digit Even Numbers")
-
-[Next >](../step-by-step-directions-from-a-binary-tree-node-to-another "Step-By-Step Directions From a Binary Tree Node to Another")
-
-## [2095. Delete the Middle Node of a Linked List (Medium)](https://leetcode.com/problems/delete-the-middle-node-of-a-linked-list "删除链表的中间节点")
-
-
You are given the head of a linked list. Delete the middle node, and return theheadof the modified linked list.
-
-
The middle node of a linked list of size n is the ⌊n / 2⌋th node from the start using 0-based indexing, where ⌊x⌋ denotes the largest integer less than or equal to x.
-
-
-
For n = 1, 2, 3, 4, and 5, the middle nodes are 0, 1, 1, 2, and 2, respectively.
-
-
-
-
Example 1:
-
-
-Input: head = [1,3,4,7,1,2,6]
-Output: [1,3,4,1,2,6]
-Explanation:
-The above figure represents the given linked list. The indices of the nodes are written below.
-Since n = 7, node 3 with value 7 is the middle node, which is marked in red.
-We return the new list after removing this node.
-
-
-
Example 2:
-
-
-Input: head = [1,2,3,4]
-Output: [1,2,4]
-Explanation:
-The above figure represents the given linked list.
-For n = 4, node 2 with value 3 is the middle node, which is marked in red.
-
-
-
Example 3:
-
-
-Input: head = [2,1]
-Output: [2]
-Explanation:
-The above figure represents the given linked list.
-For n = 2, node 1 with value 1 is the middle node, which is marked in red.
-Node 0 with value 2 is the only node remaining after removing node 1.
-
-
-
Constraints:
-
-
-
The number of nodes in the list is in the range [1, 105].
-
1 <= Node.val <= 105
-
-
-### Related Topics
- [[Linked List](../../tag/linked-list/README.md)]
- [[Two Pointers](../../tag/two-pointers/README.md)]
-
-### Hints
-
-Hint 1
-If a point with a speed s moves n units in a given time, a point with speed 2 * s will move 2 * n units at the same time. Can you use this to find the middle node of a linked list?
-
-
-
-Hint 2
-If you are given the middle node, the node before it, and the node after it, how can you modify the linked list?
-
diff --git a/problems/delete-tree-nodes/README.md b/problems/delete-tree-nodes/README.md
deleted file mode 100644
index c355e3823..000000000
--- a/problems/delete-tree-nodes/README.md
+++ /dev/null
@@ -1,65 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../remove-interval "Remove Interval")
-
-[Next >](../number-of-ships-in-a-rectangle "Number of Ships in a Rectangle")
-
-## [1273. Delete Tree Nodes (Medium)](https://leetcode.com/problems/delete-tree-nodes "删除树节点")
-
-
A tree rooted at node 0 is given as follows:
-
-
-
The number of nodes is nodes;
-
The value of the i-th node is value[i];
-
The parent of the i-th node is parent[i].
-
-
-
Remove every subtree whose sum of values of nodes is zero.
-
-
After doing so, return the number of nodes remaining in the tree.
parent[0] == -1 which indicates that 0 is the root.
-
-
-### Related Topics
- [[Tree](../../tag/tree/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
-
-### Hints
-
-Hint 1
-Traverse the tree using depth first search.
-
-
-
-Hint 2
-Find for every node the sum of values of its sub-tree.
-
-
-
-Hint 3
-Traverse the tree again from the root and return once you reach a node with zero sum of values in its sub-tree.
-
diff --git a/problems/delivering-boxes-from-storage-to-ports/README.md b/problems/delivering-boxes-from-storage-to-ports/README.md
deleted file mode 100644
index a72e47f52..000000000
--- a/problems/delivering-boxes-from-storage-to-ports/README.md
+++ /dev/null
@@ -1,99 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../stone-game-vi "Stone Game VI")
-
-[Next >](../count-of-matches-in-tournament "Count of Matches in Tournament")
-
-## [1687. Delivering Boxes from Storage to Ports (Hard)](https://leetcode.com/problems/delivering-boxes-from-storage-to-ports "从仓库到码头运输箱子")
-
-
You have the task of delivering some boxes from storage to their ports using only one ship. However, this ship has a limit on the number of boxes and the total weight that it can carry.
-
-
You are given an array boxes, where boxes[i] = [portsi, weighti], and three integers portsCount, maxBoxes, and maxWeight.
-
-
-
portsi is the port where you need to deliver the ith box and weightsi is the weight of the ith box.
-
portsCount is the number of ports.
-
maxBoxes and maxWeight are the respective box and weight limits of the ship.
-
-
-
The boxes need to be delivered in the order they are given. The ship will follow these steps:
-
-
-
The ship will take some number of boxes from the boxes queue, not violating the maxBoxes and maxWeight constraints.
-
For each loaded box in order, the ship will make a trip to the port the box needs to be delivered to and deliver it. If the ship is already at the correct port, no trip is needed, and the box can immediately be delivered.
-
The ship then makes a return trip to storage to take more boxes from the queue.
-
-
-
The ship must end at storage after all the boxes have been delivered.
-
-
Return the minimum number of trips the ship needs to make to deliver all boxes to their respective ports.
-
-
-
Example 1:
-
-
-Input: boxes = [[1,1],[2,1],[1,1]], portsCount = 2, maxBoxes = 3, maxWeight = 3
-Output: 4
-Explanation: The optimal strategy is as follows:
-- The ship takes all the boxes in the queue, goes to port 1, then port 2, then port 1 again, then returns to storage. 4 trips.
-So the total number of trips is 4.
-Note that the first and third boxes cannot be delivered together because the boxes need to be delivered in order (i.e. the second box needs to be delivered at port 2 before the third box).
-
-
-
Example 2:
-
-
-Input: boxes = [[1,2],[3,3],[3,1],[3,1],[2,4]], portsCount = 3, maxBoxes = 3, maxWeight = 6
-Output: 6
-Explanation: The optimal strategy is as follows:
-- The ship takes the first box, goes to port 1, then returns to storage. 2 trips.
-- The ship takes the second, third and fourth boxes, goes to port 3, then returns to storage. 2 trips.
-- The ship takes the fifth box, goes to port 3, then returns to storage. 2 trips.
-So the total number of trips is 2 + 2 + 2 = 6.
-
-
-
Example 3:
-
-
-Input: boxes = [[1,4],[1,2],[2,1],[2,1],[3,2],[3,4]], portsCount = 3, maxBoxes = 6, maxWeight = 7
-Output: 6
-Explanation: The optimal strategy is as follows:
-- The ship takes the first and second boxes, goes to port 1, then returns to storage. 2 trips.
-- The ship takes the third and fourth boxes, goes to port 2, then returns to storage. 2 trips.
-- The ship takes the fifth and sixth boxes, goes to port 3, then returns to storage. 2 trips.
-So the total number of trips is 2 + 2 + 2 = 6.
-
-
-
-
Constraints:
-
-
-
1 <= boxes.length <= 105
-
1 <= portsCount, maxBoxes, maxWeight <= 105
-
1 <= portsi <= portsCount
-
1 <= weightsi <= maxWeight
-
-
-### Related Topics
- [[Segment Tree](../../tag/segment-tree/README.md)]
- [[Queue](../../tag/queue/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Monotonic Queue](../../tag/monotonic-queue/README.md)]
- [[Heap (Priority Queue)](../../tag/heap-priority-queue/README.md)]
-
-### Hints
-
-Hint 1
-Try to think of the most basic dp which is n^2 now optimize it
-
-
-
-Hint 2
-Think of any range query data structure to optimize
-
diff --git a/problems/department-highest-salary/README.md b/problems/department-highest-salary/README.md
deleted file mode 100644
index c9072c79e..000000000
--- a/problems/department-highest-salary/README.md
+++ /dev/null
@@ -1,87 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../customers-who-never-order "Customers Who Never Order")
-
-[Next >](../department-top-three-salaries "Department Top Three Salaries")
-
-## [184. Department Highest Salary (Medium)](https://leetcode.com/problems/department-highest-salary "部门工资最高的员工")
-
-
Table: Employee
-
-
-+--------------+---------+
-| Column Name | Type |
-+--------------+---------+
-| Id | int |
-| Name | varchar |
-| Salary | int |
-| DepartmentId | int |
-+--------------+---------+
-Id is the primary key column for this table.
-DepartmentId is a foreign key of the ID from the Department table.
-Each row of this table indicates the ID, name, and salary of an employee. It also contains the ID of their department.
-
-
-
-
-
Table: Department
-
-
-+-------------+---------+
-| Column Name | Type |
-+-------------+---------+
-| Id | int |
-| Name | varchar |
-+-------------+---------+
-Id is the primary key column for this table.
-Each row of this table indicates the ID of a department and its name.
-
-
-
-
-
Write an SQL query to find employees who have the highest salary in each of the departments.
-
-
Return the result table in any order.
-
-
The query result format is in the following example.
-
-
-
Example 1:
-
-
-Input:
-Employee table:
-+----+-------+--------+--------------+
-| Id | Name | Salary | DepartmentId |
-+----+-------+--------+--------------+
-| 1 | Joe | 70000 | 1 |
-| 2 | Jim | 90000 | 1 |
-| 3 | Henry | 80000 | 2 |
-| 4 | Sam | 60000 | 2 |
-| 5 | Max | 90000 | 1 |
-+----+-------+--------+--------------+
-Department table:
-+----+-------+
-| Id | Name |
-+----+-------+
-| 1 | IT |
-| 2 | Sales |
-+----+-------+
-Output:
-+------------+----------+--------+
-| Department | Employee | Salary |
-+------------+----------+--------+
-| IT | Jim | 90000 |
-| Sales | Henry | 80000 |
-| IT | Max | 90000 |
-+------------+----------+--------+
-Explanation: Max and Jim both have the highest salary in the IT department and Henry has the highest salary in the Sales department.
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/department-highest-salary/department_highest_salary.sql b/problems/department-highest-salary/department_highest_salary.sql
deleted file mode 100644
index bae62cf19..000000000
--- a/problems/department-highest-salary/department_highest_salary.sql
+++ /dev/null
@@ -1 +0,0 @@
-# Write your MySQL query statement below
diff --git a/problems/department-highest-salary/mysql_schemas.sql b/problems/department-highest-salary/mysql_schemas.sql
deleted file mode 100644
index 2fb3b6485..000000000
--- a/problems/department-highest-salary/mysql_schemas.sql
+++ /dev/null
@@ -1,11 +0,0 @@
-Create table If Not Exists Employee (Id int, Name varchar(255), Salary int, DepartmentId int);
-Create table If Not Exists Department (Id int, Name varchar(255));
-Truncate table Employee;
-insert into Employee (Id, Name, Salary, DepartmentId) values ('1', 'Joe', '70000', '1');
-insert into Employee (Id, Name, Salary, DepartmentId) values ('2', 'Jim', '90000', '1');
-insert into Employee (Id, Name, Salary, DepartmentId) values ('3', 'Henry', '80000', '2');
-insert into Employee (Id, Name, Salary, DepartmentId) values ('4', 'Sam', '60000', '2');
-insert into Employee (Id, Name, Salary, DepartmentId) values ('5', 'Max', '90000', '1');
-Truncate table Department;
-insert into Department (Id, Name) values ('1', 'IT');
-insert into Department (Id, Name) values ('2', 'Sales');
diff --git a/problems/department-top-three-salaries/README.md b/problems/department-top-three-salaries/README.md
deleted file mode 100644
index 3badb634b..000000000
--- a/problems/department-top-three-salaries/README.md
+++ /dev/null
@@ -1,103 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../department-highest-salary "Department Highest Salary")
-
-[Next >](../reverse-words-in-a-string-ii "Reverse Words in a String II")
-
-## [185. Department Top Three Salaries (Hard)](https://leetcode.com/problems/department-top-three-salaries "部门工资前三高的所有员工")
-
-
Table: Employee
-
-
-+--------------+---------+
-| Column Name | Type |
-+--------------+---------+
-| Id | int |
-| Name | varchar |
-| Salary | int |
-| DepartmentId | int |
-+--------------+---------+
-Id is the primary key column for this table.
-DepartmentId is a foreign key of the ID from the Department table.
-Each row of this table indicates the ID, name, and salary of an employee. It also contains the ID of their department.
-
-
-
-
-
Table: Department
-
-
-+-------------+---------+
-| Column Name | Type |
-+-------------+---------+
-| Id | int |
-| Name | varchar |
-+-------------+---------+
-Id is the primary key column for this table.
-Each row of this table indicates the ID of a department and its name.
-
-
-
-
-
A company's executives are interested in seeing who earns the most money in each of the company's departments. A high earner in a department is an employee who has a salary in the top three unique salaries for that department.
-
-
Write an SQL query to find the employees who are high earners in each of the departments.
-
-
Return the result table in any order.
-
-
The query result format is in the following example.
-
-
-
Example 1:
-
-
-Input:
-Employee table:
-+----+-------+--------+--------------+
-| Id | Name | Salary | DepartmentId |
-+----+-------+--------+--------------+
-| 1 | Joe | 85000 | 1 |
-| 2 | Henry | 80000 | 2 |
-| 3 | Sam | 60000 | 2 |
-| 4 | Max | 90000 | 1 |
-| 5 | Janet | 69000 | 1 |
-| 6 | Randy | 85000 | 1 |
-| 7 | Will | 70000 | 1 |
-+----+-------+--------+--------------+
-Department table:
-+----+-------+
-| Id | Name |
-+----+-------+
-| 1 | IT |
-| 2 | Sales |
-+----+-------+
-Output:
-+------------+----------+--------+
-| Department | Employee | Salary |
-+------------+----------+--------+
-| IT | Max | 90000 |
-| IT | Joe | 85000 |
-| IT | Randy | 85000 |
-| IT | Will | 70000 |
-| Sales | Henry | 80000 |
-| Sales | Sam | 60000 |
-+------------+----------+--------+
-Explanation:
-In the IT department:
-- Max earns the highest unique salary
-- Both Randy and Joe earn the second-highest unique salary
-- Will earns the third-highest unique salary
-
-In the Sales department:
-- Henry earns the highest salary
-- Sam earns the second-highest salary
-- There is no third-highest salary as there are only two employees
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/department-top-three-salaries/department_top_three_salaries.sql b/problems/department-top-three-salaries/department_top_three_salaries.sql
deleted file mode 100644
index bae62cf19..000000000
--- a/problems/department-top-three-salaries/department_top_three_salaries.sql
+++ /dev/null
@@ -1 +0,0 @@
-# Write your MySQL query statement below
diff --git a/problems/department-top-three-salaries/mysql_schemas.sql b/problems/department-top-three-salaries/mysql_schemas.sql
deleted file mode 100644
index 24a47da59..000000000
--- a/problems/department-top-three-salaries/mysql_schemas.sql
+++ /dev/null
@@ -1,13 +0,0 @@
-Create table If Not Exists Employee (Id int, Name varchar(255), Salary int, DepartmentId int);
-Create table If Not Exists Department (Id int, Name varchar(255));
-Truncate table Employee;
-insert into Employee (Id, Name, Salary, DepartmentId) values ('1', 'Joe', '85000', '1');
-insert into Employee (Id, Name, Salary, DepartmentId) values ('2', 'Henry', '80000', '2');
-insert into Employee (Id, Name, Salary, DepartmentId) values ('3', 'Sam', '60000', '2');
-insert into Employee (Id, Name, Salary, DepartmentId) values ('4', 'Max', '90000', '1');
-insert into Employee (Id, Name, Salary, DepartmentId) values ('5', 'Janet', '69000', '1');
-insert into Employee (Id, Name, Salary, DepartmentId) values ('6', 'Randy', '85000', '1');
-insert into Employee (Id, Name, Salary, DepartmentId) values ('7', 'Will', '70000', '1');
-Truncate table Department;
-insert into Department (Id, Name) values ('1', 'IT');
-insert into Department (Id, Name) values ('2', 'Sales');
diff --git a/problems/depth-of-bst-given-insertion-order/README.md b/problems/depth-of-bst-given-insertion-order/README.md
deleted file mode 100644
index ecf971b20..000000000
--- a/problems/depth-of-bst-given-insertion-order/README.md
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../find-a-peak-element-ii "Find a Peak Element II")
-
-[Next >](../largest-odd-number-in-string "Largest Odd Number in String")
-
-## [1902. Depth of BST Given Insertion Order (Medium)](https://leetcode.com/problems/depth-of-bst-given-insertion-order "给定二叉搜索树的插入顺序求深度")
-
-
-
-### Related Topics
- [[Tree](../../tag/tree/README.md)]
- [[Binary Search Tree](../../tag/binary-search-tree/README.md)]
- [[Binary Tree](../../tag/binary-tree/README.md)]
- [[Ordered Set](../../tag/ordered-set/README.md)]
-
-### Hints
-
-Hint 1
-There are at most 2 possible places where a new node can be inserted?
-
-
-
-Hint 2
-How can we keep track of the depth of each node?
-
diff --git a/problems/describe-the-painting/README.md b/problems/describe-the-painting/README.md
deleted file mode 100644
index ac2cbbea4..000000000
--- a/problems/describe-the-painting/README.md
+++ /dev/null
@@ -1,101 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../the-number-of-the-smallest-unoccupied-chair "The Number of the Smallest Unoccupied Chair")
-
-[Next >](../number-of-visible-people-in-a-queue "Number of Visible People in a Queue")
-
-## [1943. Describe the Painting (Medium)](https://leetcode.com/problems/describe-the-painting "描述绘画结果")
-
-
There is a long and thin painting that can be represented by a number line. The painting was painted with multiple overlapping segments where each segment was painted with a unique color. You are given a 2D integer array segments, where segments[i] = [starti, endi, colori] represents the half-closed segment[starti, endi) with colori as the color.
-
-
The colors in the overlapping segments of the painting were mixed when it was painted. When two or more colors mix, they form a new color that can be represented as a set of mixed colors.
-
-
-
For example, if colors 2, 4, and 6 are mixed, then the resulting mixed color is {2,4,6}.
-
-
-
For the sake of simplicity, you should only output the sum of the elements in the set rather than the full set.
-
-
You want to describe the painting with the minimum number of non-overlapping half-closed segments of these mixed colors. These segments can be represented by the 2D array painting where painting[j] = [leftj, rightj, mixj] describes a half-closed segment[leftj, rightj) with the mixed color sum of mixj.
-
-
-
For example, the painting created with segments = [[1,4,5],[1,7,7]] can be described by painting = [[1,4,12],[4,7,7]] because:
-
-
[1,4) is colored {5,7} (with a sum of 12) from both the first and second segments.
-
[4,7) is colored {7} from only the second segment.
-
-
-
-
-
Return the 2D array painting describing the finished painting (excluding any parts that are not painted). You may return the segments in any order.
-
-
A half-closed segment[a, b) is the section of the number line between points a and bincluding point a and not including point b.
-
-
-
Example 1:
-
-
-Input: segments = [[1,4,5],[4,7,7],[1,7,9]]
-Output: [[1,4,14],[4,7,16]]
-Explanation: The painting can be described as follows:
-- [1,4) is colored {5,9} (with a sum of 14) from the first and third segments.
-- [4,7) is colored {7,9} (with a sum of 16) from the second and third segments.
-
-
-
Example 2:
-
-
-Input: segments = [[1,7,9],[6,8,15],[8,10,7]]
-Output: [[1,6,9],[6,7,24],[7,8,15],[8,10,7]]
-Explanation: The painting can be described as follows:
-- [1,6) is colored 9 from the first segment.
-- [6,7) is colored {9,15} (with a sum of 24) from the first and second segments.
-- [7,8) is colored 15 from the second segment.
-- [8,10) is colored 7 from the third segment.
-
-
-
Example 3:
-
-
-Input: segments = [[1,4,5],[1,4,7],[4,7,1],[4,7,11]]
-Output: [[1,4,12],[4,7,12]]
-Explanation: The painting can be described as follows:
-- [1,4) is colored {5,7} (with a sum of 12) from the first and second segments.
-- [4,7) is colored {1,11} (with a sum of 12) from the third and fourth segments.
-Note that returning a single segment [1,7) is incorrect because the mixed color sets are different.
-
-
-
-
Constraints:
-
-
-
1 <= segments.length <= 2 * 104
-
segments[i].length == 3
-
1 <= starti < endi <= 105
-
1 <= colori <= 109
-
Each colori is distinct.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Prefix Sum](../../tag/prefix-sum/README.md)]
-
-### Similar Questions
- 1. [Average Height of Buildings in Each Segment](../average-height-of-buildings-in-each-segment) (Medium)
- 1. [Amount of New Area Painted Each Day](../amount-of-new-area-painted-each-day) (Hard)
-
-### Hints
-
-Hint 1
-Can we sort the segments in a way to help solve the problem?
-
-
-
-Hint 2
-How can we dynamically keep track of the sum of the current segment(s)?
-
diff --git a/problems/design-a-file-sharing-system/README.md b/problems/design-a-file-sharing-system/README.md
deleted file mode 100644
index ff0ae03e8..000000000
--- a/problems/design-a-file-sharing-system/README.md
+++ /dev/null
@@ -1,34 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../max-value-of-equation "Max Value of Equation")
-
-[Next >](../countries-you-can-safely-invest-in "Countries You Can Safely Invest In")
-
-## [1500. Design a File Sharing System (Medium)](https://leetcode.com/problems/design-a-file-sharing-system "设计文件分享系统")
-
-
-
-### Related Topics
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Design](../../tag/design/README.md)]
- [[Heap (Priority Queue)](../../tag/heap-priority-queue/README.md)]
- [[Data Stream](../../tag/data-stream/README.md)]
-
-### Similar Questions
- 1. [Design Twitter](../design-twitter) (Medium)
-
-### Hints
-
-Hint 1
-Try to solve it by keeping for each file chunk, the users who have this chunk.
-
-
-
-Hint 2
-Try to solve it by keeping all the users in the system with their owned chunks, and when you request a chunk, check all users for it.
-
diff --git a/problems/design-a-leaderboard/README.md b/problems/design-a-leaderboard/README.md
deleted file mode 100644
index 8d0f86afa..000000000
--- a/problems/design-a-leaderboard/README.md
+++ /dev/null
@@ -1,77 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../array-transformation "Array Transformation")
-
-[Next >](../tree-diameter "Tree Diameter")
-
-## [1244. Design A Leaderboard (Medium)](https://leetcode.com/problems/design-a-leaderboard "力扣排行榜")
-
-
Design a Leaderboard class, which has 3 functions:
-
-
-
addScore(playerId, score): Update the leaderboard by adding score to the given player's score. If there is no player with such id in the leaderboard, add him to the leaderboard with the given score.
-
top(K): Return the score sum of the top K players.
-
reset(playerId): Reset the score of the player with the given id to 0. It is guaranteed that the player was added to the leaderboard before calling this function.
It's guaranteed that K is less than or equal to the current number of players.
-
1 <= score <= 100
-
There will be at most 1000 function calls.
-
-
-### Related Topics
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Design](../../tag/design/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Hints
-
-Hint 1
-What data structure can we use to keep the players' data?
-
-
-
-Hint 2
-Keep a map (dictionary) of player scores.
-
-
-
-Hint 3
-For each top(K) function call, find the maximum K scores and add them.
-
diff --git a/problems/design-a-stack-with-increment-operation/README.md b/problems/design-a-stack-with-increment-operation/README.md
deleted file mode 100644
index 136646831..000000000
--- a/problems/design-a-stack-with-increment-operation/README.md
+++ /dev/null
@@ -1,75 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../lucky-numbers-in-a-matrix "Lucky Numbers in a Matrix")
-
-[Next >](../balance-a-binary-search-tree "Balance a Binary Search Tree")
-
-## [1381. Design a Stack With Increment Operation (Medium)](https://leetcode.com/problems/design-a-stack-with-increment-operation "设计一个支持增量操作的栈")
-
-
Design a stack which supports the following operations.
-
-
Implement the CustomStack class:
-
-
-
CustomStack(int maxSize) Initializes the object with maxSize which is the maximum number of elements in the stack or do nothing if the stack reached the maxSize.
-
void push(int x) Adds x to the top of the stack if the stack hasn't reached the maxSize.
-
int pop() Pops and returns the top of stack or -1 if the stack is empty.
-
void inc(int k, int val) Increments the bottom k elements of the stack by val. If there are less than k elements in the stack, just increment all the elements in the stack.
-
-
-
-
Example 1:
-
-
-Input
-["CustomStack","push","push","pop","push","push","push","increment","increment","pop","pop","pop","pop"]
-[[3],[1],[2],[],[2],[3],[4],[5,100],[2,100],[],[],[],[]]
-Output
-[null,null,null,2,null,null,null,null,null,103,202,201,-1]
-Explanation
-CustomStack customStack = new CustomStack(3); // Stack is Empty []
-customStack.push(1); // stack becomes [1]
-customStack.push(2); // stack becomes [1, 2]
-customStack.pop(); // return 2 --> Return top of the stack 2, stack becomes [1]
-customStack.push(2); // stack becomes [1, 2]
-customStack.push(3); // stack becomes [1, 2, 3]
-customStack.push(4); // stack still [1, 2, 3], Don't add another elements as size is 4
-customStack.increment(5, 100); // stack becomes [101, 102, 103]
-customStack.increment(2, 100); // stack becomes [201, 202, 103]
-customStack.pop(); // return 103 --> Return top of the stack 103, stack becomes [201, 202]
-customStack.pop(); // return 202 --> Return top of the stack 102, stack becomes [201]
-customStack.pop(); // return 201 --> Return top of the stack 101, stack becomes []
-customStack.pop(); // return -1 --> Stack is empty return -1.
-
-
-
-
Constraints:
-
-
-
1 <= maxSize <= 1000
-
1 <= x <= 1000
-
1 <= k <= 1000
-
0 <= val <= 100
-
At most 1000 calls will be made to each method of increment, push and pop each separately.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Stack](../../tag/stack/README.md)]
- [[Design](../../tag/design/README.md)]
-
-### Hints
-
-Hint 1
-Use an array to represent the stack. Push will add new integer to the array. Pop removes the last element in the array and increment will add val to the first k elements of the array.
-
-
-
-Hint 2
-This solution run in O(1) per push and pop and O(k) per increment.
-
diff --git a/problems/design-add-and-search-words-data-structure/README.md b/problems/design-add-and-search-words-data-structure/README.md
deleted file mode 100644
index fae9b6c28..000000000
--- a/problems/design-add-and-search-words-data-structure/README.md
+++ /dev/null
@@ -1,69 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../course-schedule-ii "Course Schedule II")
-
-[Next >](../word-search-ii "Word Search II")
-
-## [211. Design Add and Search Words Data Structure (Medium)](https://leetcode.com/problems/design-add-and-search-words-data-structure "添加与搜索单词 - 数据结构设计")
-
-
Design a data structure that supports adding new words and finding if a string matches any previously added string.
-
-
Implement the WordDictionary class:
-
-
-
WordDictionary() Initializes the object.
-
void addWord(word) Adds word to the data structure, it can be matched later.
-
bool search(word) Returns true if there is any string in the data structure that matches word or false otherwise. word may contain dots '.' where dots can be matched with any letter.
word in addWord consists lower-case English letters.
-
word in search consist of '.' or lower-case English letters.
-
At most 50000 calls will be made to addWord and search.
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Design](../../tag/design/README.md)]
- [[Trie](../../tag/trie/README.md)]
-
-### Similar Questions
- 1. [Implement Trie (Prefix Tree)](../implement-trie-prefix-tree) (Medium)
- 1. [Prefix and Suffix Search](../prefix-and-suffix-search) (Hard)
-
-### Hints
-
-Hint 1
-You should be familiar with how a Trie works. If not, please work on this problem: Implement Trie (Prefix Tree) first.
-
diff --git a/problems/design-an-expression-tree-with-evaluate-function/README.md b/problems/design-an-expression-tree-with-evaluate-function/README.md
deleted file mode 100644
index 1a7b65ecc..000000000
--- a/problems/design-an-expression-tree-with-evaluate-function/README.md
+++ /dev/null
@@ -1,42 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../graph-connectivity-with-threshold "Graph Connectivity With Threshold")
-
-[Next >](../slowest-key "Slowest Key")
-
-## [1628. Design an Expression Tree With Evaluate Function (Medium)](https://leetcode.com/problems/design-an-expression-tree-with-evaluate-function "设计带解析函数的表达式树")
-
-
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
- [[Stack](../../tag/stack/README.md)]
- [[Tree](../../tag/tree/README.md)]
- [[Design](../../tag/design/README.md)]
- [[Binary Tree](../../tag/binary-tree/README.md)]
-
-### Hints
-
-Hint 1
-Apply the concept of Polymorphism to get a good design
-
-
-
-Hint 2
-Implement the Node class using NumericNode and OperatorNode classes.
-
-
-
-Hint 3
-NumericNode only maintains the value and evaluate returns this value.
-
-
-
-Hint 4
-OperatorNode Maintains the left and right nodes representing the left and right operands, and the evaluate function applies the operator to them.
-
diff --git a/problems/design-an-ordered-stream/README.md b/problems/design-an-ordered-stream/README.md
deleted file mode 100644
index 33f5fb0c2..000000000
--- a/problems/design-an-ordered-stream/README.md
+++ /dev/null
@@ -1,82 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../distribute-repeating-integers "Distribute Repeating Integers")
-
-[Next >](../determine-if-two-strings-are-close "Determine if Two Strings Are Close")
-
-## [1656. Design an Ordered Stream (Easy)](https://leetcode.com/problems/design-an-ordered-stream "设计有序流")
-
-
There is a stream of n(idKey, value) pairs arriving in an arbitrary order, where idKey is an integer between 1 and n and value is a string. No two pairs have the same id.
-
-
Design a stream that returns the values in increasing order of their IDs by returning a chunk (list) of values after each insertion. The concatenation of all the chunks should result in a list of the sorted values.
-
-
Implement the OrderedStream class:
-
-
-
OrderedStream(int n) Constructs the stream to take n values.
-
String[] insert(int idKey, String value) Inserts the pair (idKey, value) into the stream, then returns the largest possible chunk of currently inserted values that appear next in the order.
-
-
-
-
Example:
-
-
-
-
-Input
-["OrderedStream", "insert", "insert", "insert", "insert", "insert"]
-[[5], [3, "ccccc"], [1, "aaaaa"], [2, "bbbbb"], [5, "eeeee"], [4, "ddddd"]]
-Output
-[null, [], ["aaaaa"], ["bbbbb", "ccccc"], [], ["ddddd", "eeeee"]]
-
-Explanation
-// Note that the values ordered by ID is ["aaaaa", "bbbbb", "ccccc", "ddddd", "eeeee"].
-OrderedStream os = new OrderedStream(5);
-os.insert(3, "ccccc"); // Inserts (3, "ccccc"), returns [].
-os.insert(1, "aaaaa"); // Inserts (1, "aaaaa"), returns ["aaaaa"].
-os.insert(2, "bbbbb"); // Inserts (2, "bbbbb"), returns ["bbbbb", "ccccc"].
-os.insert(5, "eeeee"); // Inserts (5, "eeeee"), returns [].
-os.insert(4, "ddddd"); // Inserts (4, "ddddd"), returns ["ddddd", "eeeee"].
-// Concatentating all the chunks returned:
-// [] + ["aaaaa"] + ["bbbbb", "ccccc"] + [] + ["ddddd", "eeeee"] = ["aaaaa", "bbbbb", "ccccc", "ddddd", "eeeee"]
-// The resulting order is the same as the order above.
-
-
-
-
Constraints:
-
-
-
1 <= n <= 1000
-
1 <= id <= n
-
value.length == 5
-
value consists only of lowercase letters.
-
Each call to insert will have a unique id.
-
Exactly n calls will be made to insert.
-
-
-### Related Topics
- [[Design](../../tag/design/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Data Stream](../../tag/data-stream/README.md)]
-
-### Hints
-
-Hint 1
-Maintain the next id that should be outputted.
-
-
-
-Hint 2
-Maintain the ids that were inserted in the stream.
-
-
-
-Hint 3
-Per each insert, make a loop where you check if the id that has the turn has been inserted, and if so increment the id that has the turn and continue the loop, else break.
-
diff --git a/problems/design-authentication-manager/README.md b/problems/design-authentication-manager/README.md
deleted file mode 100644
index 9a190e5aa..000000000
--- a/problems/design-authentication-manager/README.md
+++ /dev/null
@@ -1,84 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../second-largest-digit-in-a-string "Second Largest Digit in a String")
-
-[Next >](../maximum-number-of-consecutive-values-you-can-make "Maximum Number of Consecutive Values You Can Make")
-
-## [1797. Design Authentication Manager (Medium)](https://leetcode.com/problems/design-authentication-manager "设计一个验证系统")
-
-
There is an authentication system that works with authentication tokens. For each session, the user will receive a new authentication token that will expire timeToLive seconds after the currentTime. If the token is renewed, the expiry time will be extended to expire timeToLive seconds after the (potentially different) currentTime.
-
-
Implement the AuthenticationManager class:
-
-
-
AuthenticationManager(int timeToLive) constructs the AuthenticationManager and sets the timeToLive.
-
generate(string tokenId, int currentTime) generates a new token with the given tokenId at the given currentTime in seconds.
-
renew(string tokenId, int currentTime) renews the unexpired token with the given tokenId at the given currentTime in seconds. If there are no unexpired tokens with the given tokenId, the request is ignored, and nothing happens.
-
countUnexpiredTokens(int currentTime) returns the number of unexpired tokens at the given currentTime.
-
-
-
Note that if a token expires at time t, and another action happens on time t (renew or countUnexpiredTokens), the expiration takes place before the other actions.
-
-
-
Example 1:
-
-
-Input
-["AuthenticationManager", "renew", "generate", "countUnexpiredTokens", "generate", "renew", "renew", "countUnexpiredTokens"]
-[[5], ["aaa", 1], ["aaa", 2], [6], ["bbb", 7], ["aaa", 8], ["bbb", 10], [15]]
-Output
-[null, null, null, 1, null, null, null, 0]
-
-Explanation
-AuthenticationManager authenticationManager = new AuthenticationManager(5); // Constructs the AuthenticationManager with timeToLive = 5 seconds.
-authenticationManager.renew("aaa", 1); // No token exists with tokenId "aaa" at time 1, so nothing happens.
-authenticationManager.generate("aaa", 2); // Generates a new token with tokenId "aaa" at time 2.
-authenticationManager.countUnexpiredTokens(6); // The token with tokenId "aaa" is the only unexpired one at time 6, so return 1.
-authenticationManager.generate("bbb", 7); // Generates a new token with tokenId "bbb" at time 7.
-authenticationManager.renew("aaa", 8); // The token with tokenId "aaa" expired at time 7, and 8 >= 7, so at time 8 the renew request is ignored, and nothing happens.
-authenticationManager.renew("bbb", 10); // The token with tokenId "bbb" is unexpired at time 10, so the renew request is fulfilled and now the token will expire at time 15.
-authenticationManager.countUnexpiredTokens(15); // The token with tokenId "bbb" expires at time 15, and the token with tokenId "aaa" expired at time 7, so currently no token is unexpired, so return 0.
-
-
-
-
Constraints:
-
-
-
1 <= timeToLive <= 108
-
1 <= currentTime <= 108
-
1 <= tokenId.length <= 5
-
tokenId consists only of lowercase letters.
-
All calls to generate will contain unique values of tokenId.
-
The values of currentTime across all the function calls will be strictly increasing.
-
At most 2000 calls will be made to all functions combined.
-
-
-### Related Topics
- [[Design](../../tag/design/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
-
-### Hints
-
-Hint 1
-Using a map, track the expiry times of the tokens.
-
-
-
-Hint 2
-When generating a new token, add it to the map with its expiry time.
-
-
-
-Hint 3
-When renewing a token, check if it's on the map and has not expired yet. If so, update its expiry time.
-
-
-
-Hint 4
-To count unexpired tokens, iterate on the map and check for each token if it's not expired yet.
-
diff --git a/problems/design-bitset/README.md b/problems/design-bitset/README.md
deleted file mode 100644
index 2cbd3a0ed..000000000
--- a/problems/design-bitset/README.md
+++ /dev/null
@@ -1,78 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../smallest-value-of-the-rearranged-number "Smallest Value of the Rearranged Number")
-
-[Next >](../minimum-time-to-remove-all-cars-containing-illegal-goods "Minimum Time to Remove All Cars Containing Illegal Goods")
-
-## [2166. Design Bitset (Medium)](https://leetcode.com/problems/design-bitset "设计位集")
-
-
A Bitset is a data structure that compactly stores bits.
-
-
Implement the Bitset class:
-
-
-
Bitset(int size) Initializes the Bitset with size bits, all of which are 0.
-
void fix(int idx) Updates the value of the bit at the index idx to 1. If the value was already 1, no change occurs.
-
void unfix(int idx) Updates the value of the bit at the index idx to 0. If the value was already 0, no change occurs.
-
void flip() Flips the values of each bit in the Bitset. In other words, all bits with value 0 will now have value 1 and vice versa.
-
boolean all() Checks if the value of each bit in the Bitset is 1. Returns true if it satisfies the condition, false otherwise.
-
boolean one() Checks if there is at least one bit in the Bitset with value 1. Returns true if it satisfies the condition, false otherwise.
-
int count() Returns the total number of bits in the Bitset which have value 1.
-
String toString() Returns the current composition of the Bitset. Note that in the resultant string, the character at the ith index should coincide with the value at the ith bit of the Bitset.
-
-
-
-
Example 1:
-
-
-Input
-["Bitset", "fix", "fix", "flip", "all", "unfix", "flip", "one", "unfix", "count", "toString"]
-[[5], [3], [1], [], [], [0], [], [], [0], [], []]
-Output
-[null, null, null, null, false, null, null, true, null, 2, "01010"]
-
-Explanation
-Bitset bs = new Bitset(5); // bitset = "00000".
-bs.fix(3); // the value at idx = 3 is updated to 1, so bitset = "00010".
-bs.fix(1); // the value at idx = 1 is updated to 1, so bitset = "01010".
-bs.flip(); // the value of each bit is flipped, so bitset = "10101".
-bs.all(); // return False, as not all values of the bitset are 1.
-bs.unfix(0); // the value at idx = 0 is updated to 0, so bitset = "00101".
-bs.flip(); // the value of each bit is flipped, so bitset = "11010".
-bs.one(); // return True, as there is at least 1 index with value 1.
-bs.unfix(0); // the value at idx = 0 is updated to 0, so bitset = "01010".
-bs.count(); // return 2, as there are 2 bits with value 1.
-bs.toString(); // return "01010", which is the composition of bitset.
-
-
-
-
Constraints:
-
-
-
1 <= size <= 105
-
0 <= idx <= size - 1
-
At most 105 calls will be made in total to fix, unfix, flip, all, one, count, and toString.
-
At least one call will be made to all, one, count, or toString.
-
At most 5 calls will be made to toString.
-
-
-### Related Topics
- [[Design](../../tag/design/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
-
-### Hints
-
-Hint 1
-Note that flipping a bit twice does nothing.
-
-
-
-Hint 2
-In order to determine the value of a bit, consider how you can efficiently count the number of flips made on the bit since its latest update.
-
diff --git a/problems/design-bounded-blocking-queue/README.md b/problems/design-bounded-blocking-queue/README.md
deleted file mode 100644
index 70fd07167..000000000
--- a/problems/design-bounded-blocking-queue/README.md
+++ /dev/null
@@ -1,90 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../make-array-strictly-increasing "Make Array Strictly Increasing")
-
-[Next >](../maximum-number-of-balloons "Maximum Number of Balloons")
-
-## [1188. Design Bounded Blocking Queue (Medium)](https://leetcode.com/problems/design-bounded-blocking-queue "设计有限阻塞队列")
-
-
Implement a thread safe bounded blocking queue that has the following methods:
-
-
-
BoundedBlockingQueue(int capacity) The constructor initializes the queue with a maximum capacity.
-
void enqueue(int element) Adds an element to the front of the queue. If the queue is full, the calling thread is blocked until the queue is no longer full.
-
int dequeue() Returns the element at the rear of the queue and removes it. If the queue is empty, the calling thread is blocked until the queue is no longer empty.
-
int size() Returns the number of elements currently in the queue.
-
-
-
Your implementation will be tested using multiple threads at the same time. Each thread will either be a producer thread that only makes calls to the enqueue method or a consumer thread that only makes calls to the dequeue method. The size method will be called after every test case.
-
-
Please do not use built-in implementations of bounded blocking queue as this will not be accepted in an interview.
-
-
-
-
Example 1:
-
-
-Input:
-1
-1
-["BoundedBlockingQueue","enqueue","dequeue","dequeue","enqueue","enqueue","enqueue","enqueue","dequeue"]
-[[2],[1],[],[],[0],[2],[3],[4],[]]
-
-Output:
-[1,0,2,2]
-
-Explanation:
-Number of producer threads = 1
-Number of consumer threads = 1
-
-BoundedBlockingQueue queue = new BoundedBlockingQueue(2); // initialize the queue with capacity = 2.
-
-queue.enqueue(1); // The producer thread enqueues 1 to the queue.
-queue.dequeue(); // The consumer thread calls dequeue and returns 1 from the queue.
-queue.dequeue(); // Since the queue is empty, the consumer thread is blocked.
-queue.enqueue(0); // The producer thread enqueues 0 to the queue. The consumer thread is unblocked and returns 0 from the queue.
-queue.enqueue(2); // The producer thread enqueues 2 to the queue.
-queue.enqueue(3); // The producer thread enqueues 3 to the queue.
-queue.enqueue(4); // The producer thread is blocked because the queue's capacity (2) is reached.
-queue.dequeue(); // The consumer thread returns 2 from the queue. The producer thread is unblocked and enqueues 4 to the queue.
-queue.size(); // 2 elements remaining in the queue. size() is always called at the end of each test case.
-
-
-
-
-
Example 2:
-
-
-Input:
-3
-4
-["BoundedBlockingQueue","enqueue","enqueue","enqueue","dequeue","dequeue","dequeue","enqueue"]
-[[3],[1],[0],[2],[],[],[],[3]]
-
-Output:
-[1,0,2,1]
-
-Explanation:
-Number of producer threads = 3
-Number of consumer threads = 4
-
-BoundedBlockingQueue queue = new BoundedBlockingQueue(3); // initialize the queue with capacity = 3.
-
-queue.enqueue(1); // Producer thread P1 enqueues 1 to the queue.
-queue.enqueue(0); // Producer thread P2 enqueues 0 to the queue.
-queue.enqueue(2); // Producer thread P3 enqueues 2 to the queue.
-queue.dequeue(); // Consumer thread C1 calls dequeue.
-queue.dequeue(); // Consumer thread C2 calls dequeue.
-queue.dequeue(); // Consumer thread C3 calls dequeue.
-queue.enqueue(3); // One of the producer threads enqueues 3 to the queue.
-queue.size(); // 1 element remaining in the queue.
-
-Since the number of threads for producer/consumer is greater than 1, we do not know how the threads will be scheduled in the operating system, even though the input seems to imply the ordering. Therefore, any of the output [1,0,2] or [1,2,0] or [0,1,2] or [0,2,1] or [2,0,1] or [2,1,0] will be accepted.
-
-### Related Topics
- [[Concurrency](../../tag/concurrency/README.md)]
diff --git a/problems/design-browser-history/README.md b/problems/design-browser-history/README.md
deleted file mode 100644
index 54bb7bfee..000000000
--- a/problems/design-browser-history/README.md
+++ /dev/null
@@ -1,77 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../the-k-strongest-values-in-an-array "The k Strongest Values in an Array")
-
-[Next >](../paint-house-iii "Paint House III")
-
-## [1472. Design Browser History (Medium)](https://leetcode.com/problems/design-browser-history "设计浏览器历史记录")
-
-
You have a browser of one tab where you start on the homepage and you can visit another url, get back in the history number of steps or move forward in the history number of steps.
-
-
Implement the BrowserHistory class:
-
-
-
BrowserHistory(string homepage) Initializes the object with the homepage of the browser.
-
void visit(string url) Visits url from the current page. It clears up all the forward history.
-
string back(int steps) Move steps back in history. If you can only return x steps in the history and steps > x, you will return only x steps. Return the current url after moving back in history at moststeps.
-
string forward(int steps) Move steps forward in history. If you can only forward x steps in the history and steps > x, you will forward only x steps. Return the current url after forwarding in history at moststeps.
-
-
-
-
Example:
-
-
-Input:
-["BrowserHistory","visit","visit","visit","back","back","forward","visit","forward","back","back"]
-[["leetcode.com"],["google.com"],["facebook.com"],["youtube.com"],[1],[1],[1],["linkedin.com"],[2],[2],[7]]
-Output:
-[null,null,null,null,"facebook.com","google.com","facebook.com",null,"linkedin.com","google.com","leetcode.com"]
-
-Explanation:
-BrowserHistory browserHistory = new BrowserHistory("leetcode.com");
-browserHistory.visit("google.com"); // You are in "leetcode.com". Visit "google.com"
-browserHistory.visit("facebook.com"); // You are in "google.com". Visit "facebook.com"
-browserHistory.visit("youtube.com"); // You are in "facebook.com". Visit "youtube.com"
-browserHistory.back(1); // You are in "youtube.com", move back to "facebook.com" return "facebook.com"
-browserHistory.back(1); // You are in "facebook.com", move back to "google.com" return "google.com"
-browserHistory.forward(1); // You are in "google.com", move forward to "facebook.com" return "facebook.com"
-browserHistory.visit("linkedin.com"); // You are in "facebook.com". Visit "linkedin.com"
-browserHistory.forward(2); // You are in "linkedin.com", you cannot move forward any steps.
-browserHistory.back(2); // You are in "linkedin.com", move back two steps to "facebook.com" then to "google.com". return "google.com"
-browserHistory.back(7); // You are in "google.com", you can move back only one step to "leetcode.com". return "leetcode.com"
-
-
-
-
Constraints:
-
-
-
1 <= homepage.length <= 20
-
1 <= url.length <= 20
-
1 <= steps <= 100
-
homepage and url consist of '.' or lower case English letters.
-
At most 5000 calls will be made to visit, back, and forward.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Linked List](../../tag/linked-list/README.md)]
- [[Stack](../../tag/stack/README.md)]
- [[Design](../../tag/design/README.md)]
- [[Doubly-Linked List](../../tag/doubly-linked-list/README.md)]
- [[Data Stream](../../tag/data-stream/README.md)]
-
-### Hints
-
-Hint 1
-Use two stack one for back history and one for forward history and simulate the functions.
-
-
-
-Hint 2
-Can you do faster by using different data structure ?
-
diff --git a/problems/design-circular-deque/README.md b/problems/design-circular-deque/README.md
deleted file mode 100644
index 06669c2c1..000000000
--- a/problems/design-circular-deque/README.md
+++ /dev/null
@@ -1,69 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../solve-the-equation "Solve the Equation")
-
-[Next >](../design-search-autocomplete-system "Design Search Autocomplete System")
-
-## [641. Design Circular Deque (Medium)](https://leetcode.com/problems/design-circular-deque "设计循环双端队列")
-
-
Design your implementation of the circular double-ended queue (deque).
-
-
Implement the MyCircularDeque class:
-
-
-
MyCircularDeque(int k) Initializes the deque with a maximum size of k.
-
boolean insertFront() Adds an item at the front of Deque. Returns true if the operation is successful, or false otherwise.
-
boolean insertLast() Adds an item at the rear of Deque. Returns true if the operation is successful, or false otherwise.
-
boolean deleteFront() Deletes an item from the front of Deque. Returns true if the operation is successful, or false otherwise.
-
boolean deleteLast() Deletes an item from the rear of Deque. Returns true if the operation is successful, or false otherwise.
-
int getFront() Returns the front item from the Deque. Returns -1 if the deque is empty.
-
int getRear() Returns the last item from Deque. Returns -1 if the deque is empty.
-
boolean isEmpty() Returns true if the deque is empty, or false otherwise.
-
boolean isFull() Returns true if the deque is full, or false otherwise.
Design your implementation of the circular queue. The circular queue is a linear data structure in which the operations are performed based on FIFO (First In First Out) principle and the last position is connected back to the first position to make a circle. It is also called "Ring Buffer".
-
-
One of the benefits of the circular queue is that we can make use of the spaces in front of the queue. In a normal queue, once the queue becomes full, we cannot insert the next element even if there is a space in front of the queue. But using the circular queue, we can use the space to store new values.
-
-
Implementation the MyCircularQueue class:
-
-
-
MyCircularQueue(k) Initializes the object with the size of the queue to be k.
-
int Front() Gets the front item from the queue. If the queue is empty, return -1.
-
int Rear() Gets the last item from the queue. If the queue is empty, return -1.
-
boolean enQueue(int value) Inserts an element into the circular queue. Return true if the operation is successful.
-
boolean deQueue() Deletes an element from the circular queue. Return true if the operation is successful.
-
boolean isEmpty() Checks whether the circular queue is empty or not.
-
boolean isFull() Checks whether the circular queue is full or not.
-
-
-
You must solve the problem without using the built-in queue data structure in your programming language.
-Design and implement a data structure for a compressed string iterator. It should support the following operations: next and hasNext.
-
-
-
-The given compressed string will be in the form of each letter followed by a positive integer representing the number of this letter existing in the original uncompressed string.
-
-
-
-next() - if the original string still has uncompressed characters, return the next letter; Otherwise return a white space.
-hasNext() - Judge whether there is any letter needs to be uncompressed.
-
-
-
-Note:
-Please remember to RESET your class variables declared in StringIterator, as static/class variables are persisted across multiple test cases. Please see here for more details.
-
Your task is to design the basic function of Excel and implement the function of sum formula. Specifically, you need to implement the following functions:
-
-
-
-
Excel(int H, char W): This is the constructor. The inputs represents the height and width of the Excel form. H is a positive integer, range from 1 to 26. It represents the height. W is a character range from 'A' to 'Z'. It represents that the width is the number of characters from 'A' to W. The Excel form content is represented by a height * width 2D integer array C, it should be initialized to zero. You should assume that the first row of C starts from 1, and the first column of C starts from 'A'.
-
-
-
-
void Set(int row, char column, int val): Change the value at C(row, column) to be val.
-
-
int Get(int row, char column): Return the value at C(row, column).
-
-
int Sum(int row, char column, List of Strings : numbers): This function calculate and set the value at C(row, column), where the value should be the sum of cells represented by numbers. This function return the sum result at C(row, column). This sum formula should exist until this cell is overlapped by another value or another sum formula.
-
-
numbers is a list of strings that each string represent a cell or a range of cells. If the string represent a single cell, then it has the following format : ColRow. For example, "F7" represents the cell at (7, F).
-
-
If the string represent a range of cells, then it has the following format : ColRow1:ColRow2. The range will always be a rectangle, and ColRow1 represent the position of the top-left cell, and ColRow2 represents the position of the bottom-right cell.
-
-
Example 1:
-
-Excel(3,"C");
-// construct a 3*3 2D array with all zero.
-// A B C
-// 1 0 0 0
-// 2 0 0 0
-// 3 0 0 0
-
-Set(1, "A", 2);
-// set C(1,"A") to be 2.
-// A B C
-// 1 2 0 0
-// 2 0 0 0
-// 3 0 0 0
-
-Sum(3, "C", ["A1", "A1:B2"]);
-// set C(3,"C") to be the sum of value at C(1,"A") and the values sum of the rectangle range whose top-left cell is C(1,"A") and bottom-right cell is C(2,"B"). Return 4.
-// A B C
-// 1 2 0 0
-// 2 0 0 0
-// 3 0 0 4
-
-Set(2, "B", 2);
-// set C(2,"B") to be 2. Note C(3, "C") should also be changed.
-// A B C
-// 1 2 0 0
-// 2 0 2 0
-// 3 0 0 6
-
-
-
-
Note:
-
-
You could assume that there won't be any circular sum reference. For example, A1 = sum(B1) and B1 = sum(A1).
-
The test cases are using double-quotes to represent a character.
-
Please remember to RESET your class variables declared in class Excel, as static/class variables are persisted across multiple test cases. Please see here for more details.
You are asked to design a file system which provides two functions:
-
-
-
createPath(path, value): Creates a new path and associates a value to it if possible and returns True. Returns False if the path already exists or its parent path doesn't exist.
-
get(path): Returns the value associated with a path or returns -1 if the path doesn't exist.
-
-
-
The format of a path is one or more concatenated strings of the form: / followed by one or more lowercase English letters. For example, /leetcode and /leetcode/problems are valid paths while an empty string and / are not.
-Input:
-["FileSystem","createPath","createPath","get","createPath","get"]
-[[],["/leet",1],["/leet/code",2],["/leet/code"],["/c/d",1],["/c"]]
-Output:
-[null,true,true,2,false,-1]
-Explanation:
-FileSystem fileSystem = new FileSystem();
-
-fileSystem.createPath("/leet", 1); // return true
-fileSystem.createPath("/leet/code", 2); // return true
-fileSystem.get("/leet/code"); // return 2
-fileSystem.createPath("/c/d", 1); // return false because the parent path "/c" doesn't exist.
-fileSystem.get("/c"); // return -1 because this path doesn't exist.
-
-
-
-
Constraints:
-
-
-
The number of calls to the two functions is less than or equal to 10^4 in total.
-
2 <= path.length <= 100
-
1 <= value <= 10^9
-
-
-
NOTE: create method has been changed on August 29, 2019 to createPath. Please reset to default code definition to get new method signature.
-
-### Related Topics
- [[Design](../../tag/design/README.md)]
- [[Trie](../../tag/trie/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Hints
-
-Hint 1
-What if you think of a tree hierarchy for the files?.
-
-
-
-Hint 2
-A path is a node in the tree.
-
-
-
-Hint 3
-Use a hash table to store the valid paths along with their values.
-
diff --git a/problems/design-front-middle-back-queue/README.md b/problems/design-front-middle-back-queue/README.md
deleted file mode 100644
index 2d57da3a1..000000000
--- a/problems/design-front-middle-back-queue/README.md
+++ /dev/null
@@ -1,82 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../merge-in-between-linked-lists "Merge In Between Linked Lists")
-
-[Next >](../minimum-number-of-removals-to-make-mountain-array "Minimum Number of Removals to Make Mountain Array")
-
-## [1670. Design Front Middle Back Queue (Medium)](https://leetcode.com/problems/design-front-middle-back-queue "设计前中后队列")
-
-
Design a queue that supports push and pop operations in the front, middle, and back.
-
-
Implement the FrontMiddleBack class:
-
-
-
FrontMiddleBack() Initializes the queue.
-
void pushFront(int val) Adds val to the front of the queue.
-
void pushMiddle(int val) Adds val to the middle of the queue.
-
void pushBack(int val) Adds val to the back of the queue.
-
int popFront() Removes the front element of the queue and returns it. If the queue is empty, return -1.
-
int popMiddle() Removes the middle element of the queue and returns it. If the queue is empty, return -1.
-
int popBack() Removes the back element of the queue and returns it. If the queue is empty, return -1.
-
-
-
Notice that when there are two middle position choices, the operation is performed on the frontmost middle position choice. For example:
-
-
-
Pushing 6 into the middle of [1, 2, 3, 4, 5] results in [1, 2, 6, 3, 4, 5].
-
Popping the middle from [1, 2, 3, 4, 5, 6] returns 3 and results in [1, 2, 4, 5, 6].
At most 1000 calls will be made to pushFront, pushMiddle, pushBack, popFront, popMiddle, and popBack.
-
-
-### Related Topics
- [[Design](../../tag/design/README.md)]
- [[Queue](../../tag/queue/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Linked List](../../tag/linked-list/README.md)]
- [[Data Stream](../../tag/data-stream/README.md)]
-
-### Hints
-
-Hint 1
-The constraints are low enough for a brute force, single array approach.
-
-
-
-Hint 2
-For an O(1) per method approach, use 2 double-ended queues: one for the first half and one for the second half.
-
diff --git a/problems/design-hashmap/README.md b/problems/design-hashmap/README.md
deleted file mode 100644
index ede07f6c4..000000000
--- a/problems/design-hashmap/README.md
+++ /dev/null
@@ -1,64 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../design-hashset "Design HashSet")
-
-[Next >](../design-linked-list "Design Linked List")
-
-## [706. Design HashMap (Easy)](https://leetcode.com/problems/design-hashmap "设计哈希映射")
-
-
Design a HashMap without using any built-in hash table libraries.
-
-
Implement the MyHashMap class:
-
-
-
MyHashMap() initializes the object with an empty map.
-
void put(int key, int value) inserts a (key, value) pair into the HashMap. If the key already exists in the map, update the corresponding value.
-
int get(int key) returns the value to which the specified key is mapped, or -1 if this map contains no mapping for the key.
-
void remove(key) removes the key and its corresponding value if the map contains the mapping for the key.
-
-
-
-
Example 1:
-
-
-Input
-["MyHashMap", "put", "put", "get", "get", "put", "get", "remove", "get"]
-[[], [1, 1], [2, 2], [1], [3], [2, 1], [2], [2], [2]]
-Output
-[null, null, null, 1, -1, null, 1, null, -1]
-
-Explanation
-MyHashMap myHashMap = new MyHashMap();
-myHashMap.put(1, 1); // The map is now [[1,1]]
-myHashMap.put(2, 2); // The map is now [[1,1], [2,2]]
-myHashMap.get(1); // return 1, The map is now [[1,1], [2,2]]
-myHashMap.get(3); // return -1 (i.e., not found), The map is now [[1,1], [2,2]]
-myHashMap.put(2, 1); // The map is now [[1,1], [2,1]] (i.e., update the existing value)
-myHashMap.get(2); // return 1, The map is now [[1,1], [2,1]]
-myHashMap.remove(2); // remove the mapping for 2, The map is now [[1,1]]
-myHashMap.get(2); // return -1 (i.e., not found), The map is now [[1,1]]
-
-
-
-
Constraints:
-
-
-
0 <= key, value <= 106
-
At most 104 calls will be made to put, get, and remove.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Linked List](../../tag/linked-list/README.md)]
- [[Design](../../tag/design/README.md)]
- [[Hash Function](../../tag/hash-function/README.md)]
-
-### Similar Questions
- 1. [Design HashSet](../design-hashset) (Easy)
- 1. [Design Skiplist](../design-skiplist) (Hard)
diff --git a/problems/design-hashmap/design_hashmap.go b/problems/design-hashmap/design_hashmap.go
deleted file mode 100644
index 1cdfb05aa..000000000
--- a/problems/design-hashmap/design_hashmap.go
+++ /dev/null
@@ -1,36 +0,0 @@
-package problem706
-
-type MyHashMap struct {
- data map[int]int
-}
-
-/** Initialize your data structure here. */
-func Constructor() MyHashMap {
- return MyHashMap{make(map[int]int, 0)}
-}
-
-/** value will always be non-negative. */
-func (this *MyHashMap) Put(key int, value int) {
- this.data[key] = value
-}
-
-/** Returns the value to which the specified key is mapped, or -1 if this map contains no mapping for the key */
-func (this *MyHashMap) Get(key int) int {
- if v, ok := this.data[key]; ok {
- return v
- }
- return -1
-}
-
-/** Removes the mapping of the specified value key if this map contains a mapping for the key */
-func (this *MyHashMap) Remove(key int) {
- delete(this.data, key)
-}
-
-/**
- * Your MyHashMap object will be instantiated and called as such:
- * obj := Constructor();
- * obj.Put(key,value);
- * param_2 := obj.Get(key);
- * obj.Remove(key);
- */
diff --git a/problems/design-hashmap/design_hashmap_test.go b/problems/design-hashmap/design_hashmap_test.go
deleted file mode 100644
index 5f4ed59d0..000000000
--- a/problems/design-hashmap/design_hashmap_test.go
+++ /dev/null
@@ -1,18 +0,0 @@
-package problem706
-
-import "testing"
-
-func TestDesignHashmap(t *testing.T) {
- obj := Constructor()
- obj.Put(1, 1)
- obj.Put(2, 2)
- got := obj.Get(1) == 1
- got = obj.Get(3) == -1 && got
- obj.Put(2, 1)
- got = obj.Get(2) == 1 && got
- obj.Remove(2)
- got = obj.Get(2) == -1 && got
- if !got {
- t.Fatalf("got: %v, want: %v", got, true)
- }
-}
diff --git a/problems/design-hashset/README.md b/problems/design-hashset/README.md
deleted file mode 100644
index bd2bd2926..000000000
--- a/problems/design-hashset/README.md
+++ /dev/null
@@ -1,61 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../binary-search "Binary Search")
-
-[Next >](../design-hashmap "Design HashMap")
-
-## [705. Design HashSet (Easy)](https://leetcode.com/problems/design-hashset "设计哈希集合")
-
-
Design a HashSet without using any built-in hash table libraries.
-
-
Implement MyHashSet class:
-
-
-
void add(key) Inserts the value key into the HashSet.
-
bool contains(key) Returns whether the value key exists in the HashSet or not.
-
void remove(key) Removes the value key in the HashSet. If key does not exist in the HashSet, do nothing.
Design a hit counter which counts the number of hits received in the past 5 minutes.
-
-
Each function accepts a timestamp parameter (in seconds granularity) and you may assume that calls are being made to the system in chronological order (ie, the timestamp is monotonically increasing). You may assume that the earliest timestamp starts at 1.
-
-
It is possible that several hits arrive roughly at the same time.
-
-
Example:
-
-
-HitCounter counter = new HitCounter();
-
-// hit at timestamp 1.
-counter.hit(1);
-
-// hit at timestamp 2.
-counter.hit(2);
-
-// hit at timestamp 3.
-counter.hit(3);
-
-// get hits at timestamp 4, should return 3.
-counter.getHits(4);
-
-// hit at timestamp 300.
-counter.hit(300);
-
-// get hits at timestamp 300, should return 4.
-counter.getHits(300);
-
-// get hits at timestamp 301, should return 3.
-counter.getHits(301);
-
-
-
Follow up:
-What if the number of hits per second could be very large? Does your design scale?
Design an in-memory file system to simulate the following functions:
-
-
ls: Given a path in string format. If it is a file path, return a list that only contains this file's name. If it is a directory path, return the list of file and directory names in this directory. Your output (file and directory names together) should in lexicographic order.
-
-
mkdir: Given a directory path that does not exist, you should make a new directory according to the path. If the middle directories in the path don't exist either, you should create them as well. This function has void return type.
-
-
addContentToFile: Given a file path and file content in string format. If the file doesn't exist, you need to create that file containing given content. If the file already exists, you need to append given content to original content. This function has void return type.
-
-
readContentFromFile: Given a file path, return its content in string format.
You can assume all file or directory paths are absolute paths which begin with / and do not end with / except that the path is just "/".
-
You can assume that all operations will be passed valid parameters and users will not attempt to retrieve file content or list a directory or file that does not exist.
-
You can assume that all directory names and file names only contain lower-case letters, and same names won't exist in the same directory.
Design your implementation of the linked list. You can choose to use a singly or doubly linked list.
-A node in a singly linked list should have two attributes: val and next. val is the value of the current node, and next is a pointer/reference to the next node.
-If you want to use the doubly linked list, you will need one more attribute prev to indicate the previous node in the linked list. Assume all nodes in the linked list are 0-indexed.
-
-
Implement the MyLinkedList class:
-
-
-
MyLinkedList() Initializes the MyLinkedList object.
-
int get(int index) Get the value of the indexth node in the linked list. If the index is invalid, return -1.
-
void addAtHead(int val) Add a node of value val before the first element of the linked list. After the insertion, the new node will be the first node of the linked list.
-
void addAtTail(int val) Append a node of value val as the last element of the linked list.
-
void addAtIndex(int index, int val) Add a node of value val before the indexth node in the linked list. If index equals the length of the linked list, the node will be appended to the end of the linked list. If index is greater than the length, the node will not be inserted.
-
void deleteAtIndex(int index) Delete the indexth node in the linked list, if the index is valid.
-
-
-
-
Example 1:
-
-
-Input
-["MyLinkedList", "addAtHead", "addAtTail", "addAtIndex", "get", "deleteAtIndex", "get"]
-[[], [1], [3], [1, 2], [1], [1], [1]]
-Output
-[null, null, null, null, 2, null, 3]
-
-Explanation
-MyLinkedList myLinkedList = new MyLinkedList();
-myLinkedList.addAtHead(1);
-myLinkedList.addAtTail(3);
-myLinkedList.addAtIndex(1, 2); // linked list becomes 1->2->3
-myLinkedList.get(1); // return 2
-myLinkedList.deleteAtIndex(1); // now the linked list is 1->3
-myLinkedList.get(1); // return 3
-
-
-
-
Constraints:
-
-
-
0 <= index, val <= 1000
-
Please do not use the built-in LinkedList library.
-
At most 2000 calls will be made to get, addAtHead, addAtTail, addAtIndex and deleteAtIndex.
-
-
-### Related Topics
- [[Design](../../tag/design/README.md)]
- [[Linked List](../../tag/linked-list/README.md)]
diff --git a/problems/design-linked-list/design_linked_list.go b/problems/design-linked-list/design_linked_list.go
deleted file mode 100644
index da4e41c76..000000000
--- a/problems/design-linked-list/design_linked_list.go
+++ /dev/null
@@ -1,68 +0,0 @@
-package problem707
-
-import "container/list"
-
-type MyLinkedList struct {
- data *list.List
-}
-
-/** Initialize your data structure here. */
-func Constructor() MyLinkedList {
- return MyLinkedList{list.New()}
-}
-
-/** Get the value of the index-th node in the linked list. If the index is invalid, return -1. */
-func (this *MyLinkedList) Get(index int) int {
- if index < 0 || index >= this.data.Len() {
- return -1
- }
- node := this.data.Front()
- for i := 0; i < index; i++ {
- node = node.Next()
- }
- return node.Value.(int)
-}
-
-/** Add a node of value val before the first element of the linked list. After the insertion, the new node will be the first node of the linked list. */
-func (this *MyLinkedList) AddAtHead(val int) {
- this.data.PushFront(val)
-}
-
-/** Append a node of value val to the last element of the linked list. */
-func (this *MyLinkedList) AddAtTail(val int) {
- this.data.PushBack(val)
-}
-
-/** Add a node of value val before the index-th node in the linked list. If index equals to the length of linked list, the node will be appended to the end of linked list. If index is greater than the length, the node will not be inserted. */
-func (this *MyLinkedList) AddAtIndex(index int, val int) {
- if index == this.data.Len() {
- this.AddAtTail(val)
- } else if index >= 0 && index < this.data.Len() {
- node := this.data.Front()
- for i := 0; i < index; i++ {
- node = node.Next()
- }
- this.data.InsertBefore(val, node)
- }
-}
-
-/** Delete the index-th node in the linked list, if the index is valid. */
-func (this *MyLinkedList) DeleteAtIndex(index int) {
- if index >= 0 && index < this.data.Len() {
- node := this.data.Front()
- for i := 0; i < index; i++ {
- node = node.Next()
- }
- this.data.Remove(node)
- }
-}
-
-/**
- * Your MyLinkedList object will be instantiated and called as such:
- * obj := Constructor();
- * param_1 := obj.Get(index);
- * obj.AddAtHead(val);
- * obj.AddAtTail(val);
- * obj.AddAtIndex(index,val);
- * obj.DeleteAtIndex(index);
- */
diff --git a/problems/design-linked-list/design_linked_list_test.go b/problems/design-linked-list/design_linked_list_test.go
deleted file mode 100644
index bfcad69fb..000000000
--- a/problems/design-linked-list/design_linked_list_test.go
+++ /dev/null
@@ -1,18 +0,0 @@
-package problem707
-
-import "testing"
-
-func TestConstructor(t *testing.T) {
- obj := Constructor()
- obj.AddAtHead(1)
- obj.AddAtTail(3)
- obj.AddAtIndex(1, 2) // linked list becomes 1->2->3
- got := obj.Get(1) == 2 // returns 2
- obj.DeleteAtIndex(1) // now the linked list is 1->3
- got = obj.Get(1) == 3 && got
- obj.AddAtIndex(2, 2) // linked list becomes 1->3->2
- got = obj.Get(5) == -1 && got
- if !got {
- t.Fatalf("got: %v, want: %v", got, true)
- }
-}
diff --git a/problems/design-log-storage-system/README.md b/problems/design-log-storage-system/README.md
deleted file mode 100644
index 9f35d631e..000000000
--- a/problems/design-log-storage-system/README.md
+++ /dev/null
@@ -1,47 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../find-the-derangement-of-an-array "Find the Derangement of An Array")
-
-[Next >](../exclusive-time-of-functions "Exclusive Time of Functions")
-
-## [635. Design Log Storage System (Medium)](https://leetcode.com/problems/design-log-storage-system "设计日志存储系统")
-
-
You are given several logs that each log contains a unique id and timestamp. Timestamp is a string that has the following format: Year:Month:Day:Hour:Minute:Second, for example, 2017:01:01:23:59:59. All domains are zero-padded decimal numbers.
-
-
Design a log storage system to implement the following functions:
-
-
void Put(int id, string timestamp): Given a log's unique id and timestamp, store the log in your storage system.
-
-
int[] Retrieve(String start, String end, String granularity): Return the id of logs whose timestamps are within the range from start to end. Start and end all have the same format as timestamp. However, granularity means the time level for consideration. For example, start = "2017:01:01:23:59:59", end = "2017:01:02:23:59:59", granularity = "Day", it means that we need to find the logs within the range from Jan. 1st 2017 to Jan. 2nd 2017.
-
-
Example 1:
-
-put(1, "2017:01:01:23:59:59");
-put(2, "2017:01:01:22:59:59");
-put(3, "2016:01:01:00:00:00");
-retrieve("2016:01:01:01:01:01","2017:01:01:23:00:00","Year"); // return [1,2,3], because you need to return all logs within 2016 and 2017.
-retrieve("2016:01:01:01:01:01","2017:01:01:23:00:00","Hour"); // return [1,2], because you need to return all logs start from 2016:01:01:01 to 2017:01:01:23, where log 3 is left outside the range.
-
-
-
-
Note:
-
-
There will be at most 300 operations of Put or Retrieve.
-
Year ranges from [2000,2017]. Hour ranges from [00,23].
-
Output for Retrieve has no order required.
-
-
-
-### Related Topics
- [[Design](../../tag/design/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
- [[Ordered Set](../../tag/ordered-set/README.md)]
-
-### Similar Questions
- 1. [Design In-Memory File System](../design-in-memory-file-system) (Hard)
diff --git a/problems/design-log-storage-system/design_log_storage_system.go b/problems/design-log-storage-system/design_log_storage_system.go
deleted file mode 100644
index f1d68a92c..000000000
--- a/problems/design-log-storage-system/design_log_storage_system.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem635
diff --git a/problems/design-log-storage-system/design_log_storage_system_test.go b/problems/design-log-storage-system/design_log_storage_system_test.go
deleted file mode 100644
index f1d68a92c..000000000
--- a/problems/design-log-storage-system/design_log_storage_system_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem635
diff --git a/problems/design-most-recently-used-queue/README.md b/problems/design-most-recently-used-queue/README.md
deleted file mode 100644
index b2b8f0d02..000000000
--- a/problems/design-most-recently-used-queue/README.md
+++ /dev/null
@@ -1,38 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../closest-subsequence-sum "Closest Subsequence Sum")
-
-[Next >](../recyclable-and-low-fat-products "Recyclable and Low Fat Products")
-
-## [1756. Design Most Recently Used Queue (Medium)](https://leetcode.com/problems/design-most-recently-used-queue "设计最近使用(MRU)队列")
-
-
-
-### Related Topics
- [[Stack](../../tag/stack/README.md)]
- [[Design](../../tag/design/README.md)]
- [[Binary Indexed Tree](../../tag/binary-indexed-tree/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Ordered Set](../../tag/ordered-set/README.md)]
-
-### Hints
-
-Hint 1
-You can store the data in an array and apply each fetch by moving the ith element to the end of the array (i.e, O(n) per operation).
-
-
-
-Hint 2
-A better way is to use the square root decomposition technique.
-
-
-
-Hint 3
-You can build chunks of size sqrt(n). For each fetch operation, You can search for the chunk which has the ith element and update it (i.e., O(sqrt(n)) per operation), and move this element to an empty chunk at the end.
-
diff --git a/problems/design-movie-rental-system/README.md b/problems/design-movie-rental-system/README.md
deleted file mode 100644
index 8f579b4f1..000000000
--- a/problems/design-movie-rental-system/README.md
+++ /dev/null
@@ -1,87 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-alternating-subsequence-sum "Maximum Alternating Subsequence Sum")
-
-[Next >](../maximum-product-difference-between-two-pairs "Maximum Product Difference Between Two Pairs")
-
-## [1912. Design Movie Rental System (Hard)](https://leetcode.com/problems/design-movie-rental-system "设计电影租借系统")
-
-
You have a movie renting company consisting of n shops. You want to implement a renting system that supports searching for, booking, and returning movies. The system should also support generating a report of the currently rented movies.
-
-
Each movie is given as a 2D integer array entries where entries[i] = [shopi, moviei, pricei] indicates that there is a copy of movie moviei at shop shopi with a rental price of pricei. Each shop carries at most one copy of a movie moviei.
-
-
The system should support the following functions:
-
-
-
Search: Finds the cheapest 5 shops that have an unrented copy of a given movie. The shops should be sorted by price in ascending order, and in case of a tie, the one with the smaller shopi should appear first. If there are less than 5 matching shops, then all of them should be returned. If no shop has an unrented copy, then an empty list should be returned.
-
Rent: Rents an unrented copy of a given movie from a given shop.
-
Drop: Drops off a previously rented copy of a given movie at a given shop.
-
Report: Returns the cheapest 5 rented movies (possibly of the same movie ID) as a 2D list res where res[j] = [shopj, moviej] describes that the jth cheapest rented movie moviej was rented from the shop shopj. The movies in res should be sorted by price in ascending order, and in case of a tie, the one with the smaller shopj should appear first, and if there is still tie, the one with the smaller moviej should appear first. If there are fewer than 5 rented movies, then all of them should be returned. If no movies are currently being rented, then an empty list should be returned.
-
-
-
Implement the MovieRentingSystem class:
-
-
-
MovieRentingSystem(int n, int[][] entries) Initializes the MovieRentingSystem object with n shops and the movies in entries.
-
List<Integer> search(int movie) Returns a list of shops that have an unrented copy of the given movie as described above.
-
void rent(int shop, int movie) Rents the given movie from the given shop.
-
void drop(int shop, int movie) Drops off a previously rented movie at the given shop.
-
List<List<Integer>> report() Returns a list of cheapest rented movies as described above.
-
-
-
Note: The test cases will be generated such that rent will only be called if the shop has an unrented copy of the movie, and drop will only be called if the shop had previously rented out the movie.
-
-
-
Example 1:
-
-
-Input
-["MovieRentingSystem", "search", "rent", "rent", "report", "drop", "search"]
-[[3, [[0, 1, 5], [0, 2, 6], [0, 3, 7], [1, 1, 4], [1, 2, 7], [2, 1, 5]]], [1], [0, 1], [1, 2], [], [1, 2], [2]]
-Output
-[null, [1, 0, 2], null, null, [[0, 1], [1, 2]], null, [0, 1]]
-
-Explanation
-MovieRentingSystem movieRentingSystem = new MovieRentingSystem(3, [[0, 1, 5], [0, 2, 6], [0, 3, 7], [1, 1, 4], [1, 2, 7], [2, 1, 5]]);
-movieRentingSystem.search(1); // return [1, 0, 2], Movies of ID 1 are unrented at shops 1, 0, and 2. Shop 1 is cheapest; shop 0 and 2 are the same price, so order by shop number.
-movieRentingSystem.rent(0, 1); // Rent movie 1 from shop 0. Unrented movies at shop 0 are now [2,3].
-movieRentingSystem.rent(1, 2); // Rent movie 2 from shop 1. Unrented movies at shop 1 are now [1].
-movieRentingSystem.report(); // return [[0, 1], [1, 2]]. Movie 1 from shop 0 is cheapest, followed by movie 2 from shop 1.
-movieRentingSystem.drop(1, 2); // Drop off movie 2 at shop 1. Unrented movies at shop 1 are now [1,2].
-movieRentingSystem.search(2); // return [0, 1]. Movies of ID 2 are unrented at shops 0 and 1. Shop 0 is cheapest, followed by shop 1.
-
-
-
-
Constraints:
-
-
-
1 <= n <= 3 * 105
-
1 <= entries.length <= 105
-
0 <= shopi < n
-
1 <= moviei, pricei <= 104
-
Each shop carries at most one copy of a movie moviei.
-
At most 105 calls in total will be made to search, rent, drop and report.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Design](../../tag/design/README.md)]
- [[Heap (Priority Queue)](../../tag/heap-priority-queue/README.md)]
- [[Ordered Set](../../tag/ordered-set/README.md)]
-
-### Hints
-
-Hint 1
-You need to maintain a sorted list for each movie and a sorted list for rented movies
-
-
-
-Hint 2
-When renting a movie remove it from its movies sorted list and added it to the rented list and vice versa in the case of dropping a movie
-
diff --git a/problems/design-parking-system/README.md b/problems/design-parking-system/README.md
deleted file mode 100644
index 3b78047ab..000000000
--- a/problems/design-parking-system/README.md
+++ /dev/null
@@ -1,59 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../find-nearest-right-node-in-binary-tree "Find Nearest Right Node in Binary Tree")
-
-[Next >](../alert-using-same-key-card-three-or-more-times-in-a-one-hour-period "Alert Using Same Key-Card Three or More Times in a One Hour Period")
-
-## [1603. Design Parking System (Easy)](https://leetcode.com/problems/design-parking-system "设计停车系统")
-
-
Design a parking system for a parking lot. The parking lot has three kinds of parking spaces: big, medium, and small, with a fixed number of slots for each size.
-
-
Implement the ParkingSystem class:
-
-
-
ParkingSystem(int big, int medium, int small) Initializes object of the ParkingSystem class. The number of slots for each parking space are given as part of the constructor.
-
bool addCar(int carType) Checks whether there is a parking space of carType for the car that wants to get into the parking lot. carType can be of three kinds: big, medium, or small, which are represented by 1, 2, and 3 respectively. A car can only park in a parking space of its carType. If there is no space available, return false, else park the car in that size space and return true.
-
-
-
-
Example 1:
-
-
-Input
-["ParkingSystem", "addCar", "addCar", "addCar", "addCar"]
-[[1, 1, 0], [1], [2], [3], [1]]
-Output
-[null, true, true, false, false]
-
-Explanation
-ParkingSystem parkingSystem = new ParkingSystem(1, 1, 0);
-parkingSystem.addCar(1); // return true because there is 1 available slot for a big car
-parkingSystem.addCar(2); // return true because there is 1 available slot for a medium car
-parkingSystem.addCar(3); // return false because there is no available slot for a small car
-parkingSystem.addCar(1); // return false because there is no available slot for a big car. It is already occupied.
-
-
-
-
Constraints:
-
-
-
0 <= big, medium, small <= 1000
-
carType is 1, 2, or 3
-
At most 1000 calls will be made to addCar
-
-
-### Related Topics
- [[Design](../../tag/design/README.md)]
- [[Simulation](../../tag/simulation/README.md)]
- [[Counting](../../tag/counting/README.md)]
-
-### Hints
-
-Hint 1
-Record number of parking slots still available for each car type.
-
diff --git a/problems/design-phone-directory/README.md b/problems/design-phone-directory/README.md
deleted file mode 100644
index b25857881..000000000
--- a/problems/design-phone-directory/README.md
+++ /dev/null
@@ -1,60 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../kth-smallest-element-in-a-sorted-matrix "Kth Smallest Element in a Sorted Matrix")
-
-[Next >](../insert-delete-getrandom-o1 "Insert Delete GetRandom O(1)")
-
-## [379. Design Phone Directory (Medium)](https://leetcode.com/problems/design-phone-directory "电话目录管理系统")
-
-
Design a Phone Directory which supports the following operations:
-
-
-
-
get: Provide a number which is not assigned to anyone.
-
check: Check if a number is available or not.
-
release: Recycle or release a number.
-
-
-
-
Example:
-
-// Init a phone directory containing a total of 3 numbers: 0, 1, and 2.
-PhoneDirectory directory = new PhoneDirectory(3);
-
-// It can return any available phone number. Here we assume it returns 0.
-directory.get();
-
-// Assume it returns 1.
-directory.get();
-
-// The number 2 is available, so return true.
-directory.check(2);
-
-// It returns 2, the only number that is left.
-directory.get();
-
-// The number 2 is no longer available, so return false.
-directory.check(2);
-
-// Release number 2 back to the pool.
-directory.release(2);
-
-// Number 2 is available again, return true.
-directory.check(2);
-
Design a search autocomplete system for a search engine. Users may input a sentence (at least one word and end with a special character '#'). For each character they type except '#', you need to return the top 3 historical hot sentences that have prefix the same as the part of sentence already typed. Here are the specific rules:
-
-
-
The hot degree for a sentence is defined as the number of times a user typed the exactly same sentence before.
-
The returned top 3 hot sentences should be sorted by hot degree (The first is the hottest one). If several sentences have the same degree of hot, you need to use ASCII-code order (smaller one appears first).
-
If less than 3 hot sentences exist, then just return as many as you can.
-
When the input is a special character, it means the sentence ends, and in this case, you need to return an empty list.
-
-
-
Your job is to implement the following functions:
-
-
The constructor function:
-
-
AutocompleteSystem(String[] sentences, int[] times): This is the constructor. The input is historical data. Sentences is a string array consists of previously typed sentences. Times is the corresponding times a sentence has been typed. Your system should record these historical data.
-
-
Now, the user wants to input a new sentence. The following function will provide the next character the user types:
-
-
List<String> input(char c): The input c is the next character typed by the user. The character will only be lower-case letters ('a' to 'z'), blank space (' ') or a special character ('#'). Also, the previously typed sentence should be recorded in your system. The output will be the top 3 historical hot sentences that have prefix the same as the part of sentence already typed.
-
-
-
Example:
-Operation: AutocompleteSystem(["i love you", "island","ironman", "i love leetcode"], [5,3,2,2])
-The system have already tracked down the following sentences and their corresponding times:
-"i love you" : 5 times
-"island" : 3 times
-"ironman" : 2 times
-"i love leetcode" : 2 times
-Now, the user begins another search:
-
-Operation: input('i')
-Output: ["i love you", "island","i love leetcode"]
-Explanation:
-There are four sentences that have prefix "i". Among them, "ironman" and "i love leetcode" have same hot degree. Since ' ' has ASCII code 32 and 'r' has ASCII code 114, "i love leetcode" should be in front of "ironman". Also we only need to output top 3 hot sentences, so "ironman" will be ignored.
-
-Operation: input(' ')
-Output: ["i love you","i love leetcode"]
-Explanation:
-There are only two sentences that have prefix "i ".
-
-Operation: input('a')
-Output: []
-Explanation:
-There are no sentences that have prefix "i a".
-
-Operation: input('#')
-Output: []
-Explanation:
-The user finished the input, the sentence "i a" should be saved as a historical sentence in system. And the following input will be counted as a new search.
-
-
-
Note:
-
-
-
The input sentence will always start with a letter and end with '#', and only one blank space will exist between two words.
-
The number of complete sentences that to be searched won't exceed 100. The length of each sentence including those in the historical data won't exceed 100.
-
Please use double-quote instead of single-quote when you write test cases even for a character input.
-
Please remember to RESET your class variables declared in class AutocompleteSystem, as static/class variables are persisted across multiple test cases. Please see here for more details.
Design a Skiplist without using any built-in libraries.
-
-
A skiplist is a data structure that takes O(log(n)) time to add, erase and search. Comparing with treap and red-black tree which has the same function and performance, the code length of Skiplist can be comparatively short and the idea behind Skiplists is just simple linked lists.
-
-
For example, we have a Skiplist containing [30,40,50,60,70,90] and we want to add 80 and 45 into it. The Skiplist works this way:
You can see there are many layers in the Skiplist. Each layer is a sorted linked list. With the help of the top layers, add, erase and search can be faster than O(n). It can be proven that the average time complexity for each operation is O(log(n)) and space complexity is O(n).
Skiplist() Initializes the object of the skiplist.
-
bool search(int target) Returns true if the integer target exists in the Skiplist or false otherwise.
-
void add(int num) Inserts the value num into the SkipList.
-
bool erase(int num) Removes the value num from the Skiplist and returns true. If num does not exist in the Skiplist, do nothing and return false. If there exist multiple num values, removing any one of them is fine.
-
-
-
Note that duplicates may exist in the Skiplist, your code needs to handle this situation.
Design a Tic-tac-toe game that is played between two players on a n x n grid.
-
-
-
You may assume the following rules:
-
-
A move is guaranteed to be valid and is placed on an empty block.
-
Once a winning condition is reached, no more moves is allowed.
-
A player who succeeds in placing n of their marks in a horizontal, vertical, or diagonal row wins the game.
-
-
-
-
Example:
-
-Given n = 3, assume that player 1 is "X" and player 2 is "O" in the board.
-
-TicTacToe toe = new TicTacToe(3);
-
-toe.move(0, 0, 1); -> Returns 0 (no one wins)
-|X| | |
-| | | | // Player 1 makes a move at (0, 0).
-| | | |
-
-toe.move(0, 2, 2); -> Returns 0 (no one wins)
-|X| |O|
-| | | | // Player 2 makes a move at (0, 2).
-| | | |
-
-toe.move(2, 2, 1); -> Returns 0 (no one wins)
-|X| |O|
-| | | | // Player 1 makes a move at (2, 2).
-| | |X|
-
-toe.move(1, 1, 2); -> Returns 0 (no one wins)
-|X| |O|
-| |O| | // Player 2 makes a move at (1, 1).
-| | |X|
-
-toe.move(2, 0, 1); -> Returns 0 (no one wins)
-|X| |O|
-| |O| | // Player 1 makes a move at (2, 0).
-|X| |X|
-
-toe.move(1, 0, 2); -> Returns 0 (no one wins)
-|X| |O|
-|O|O| | // Player 2 makes a move at (1, 0).
-|X| |X|
-
-toe.move(2, 1, 1); -> Returns 1 (player 1 wins)
-|X| |O|
-|O|O| | // Player 1 makes a move at (2, 1).
-|X|X|X|
-
-
-
-
Follow up:
-Could you do better than O(n2) per move() operation?
-
-
-### Related Topics
- [[Design](../../tag/design/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
-
-### Similar Questions
- 1. [Valid Tic-Tac-Toe State](../valid-tic-tac-toe-state) (Medium)
-
-### Hints
-
-Hint 1
-Could you trade extra space such that move() operation can be done in O(1)?
-
-
-
-Hint 2
-You need two arrays: int rows[n], int cols[n], plus two variables: diagonal, anti_diagonal.
-
diff --git a/problems/design-tic-tac-toe/design_tic_tac_toe.go b/problems/design-tic-tac-toe/design_tic_tac_toe.go
deleted file mode 100644
index fe3652311..000000000
--- a/problems/design-tic-tac-toe/design_tic_tac_toe.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem348
diff --git a/problems/design-tic-tac-toe/design_tic_tac_toe_test.go b/problems/design-tic-tac-toe/design_tic_tac_toe_test.go
deleted file mode 100644
index fe3652311..000000000
--- a/problems/design-tic-tac-toe/design_tic_tac_toe_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem348
diff --git a/problems/design-twitter/README.md b/problems/design-twitter/README.md
deleted file mode 100644
index 3a8f47caf..000000000
--- a/problems/design-twitter/README.md
+++ /dev/null
@@ -1,61 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../russian-doll-envelopes "Russian Doll Envelopes")
-
-[Next >](../line-reflection "Line Reflection")
-
-## [355. Design Twitter (Medium)](https://leetcode.com/problems/design-twitter "设计推特")
-
-
Design a simplified version of Twitter where users can post tweets, follow/unfollow another user, and is able to see the 10 most recent tweets in the user's news feed.
-
-
Implement the Twitter class:
-
-
-
Twitter() Initializes your twitter object.
-
void postTweet(int userId, int tweetId) Composes a new tweet with ID tweetId by the user userId. Each call to this function will be made with a unique tweetId.
-
List<Integer> getNewsFeed(int userId) Retrieves the 10 most recent tweet IDs in the user's news feed. Each item in the news feed must be posted by users who the user followed or by the user themself. Tweets must be ordered from most recent to least recent.
-
void follow(int followerId, int followeeId) The user with ID followerId started following the user with ID followeeId.
-
void unfollow(int followerId, int followeeId) The user with ID followerId started unfollowing the user with ID followeeId.
-
-
-
-
Example 1:
-
-
-Input
-["Twitter", "postTweet", "getNewsFeed", "follow", "postTweet", "getNewsFeed", "unfollow", "getNewsFeed"]
-[[], [1, 5], [1], [1, 2], [2, 6], [1], [1, 2], [1]]
-Output
-[null, null, [5], null, null, [6, 5], null, [5]]
-
-Explanation
-Twitter twitter = new Twitter();
-twitter.postTweet(1, 5); // User 1 posts a new tweet (id = 5).
-twitter.getNewsFeed(1); // User 1's news feed should return a list with 1 tweet id -> [5]. return [5]
-twitter.follow(1, 2); // User 1 follows user 2.
-twitter.postTweet(2, 6); // User 2 posts a new tweet (id = 6).
-twitter.getNewsFeed(1); // User 1's news feed should return a list with 2 tweet ids -> [6, 5]. Tweet id 6 should precede tweet id 5 because it is posted after tweet id 5.
-twitter.unfollow(1, 2); // User 1 unfollows user 2.
-twitter.getNewsFeed(1); // User 1's news feed should return a list with 1 tweet id -> [5], since user 1 is no longer following user 2.
-
-
-
-
Constraints:
-
-
-
1 <= userId, followerId, followeeId <= 500
-
0 <= tweetId <= 104
-
All the tweets have unique IDs.
-
At most 3 * 104 calls will be made to postTweet, getNewsFeed, follow, and unfollow.
An underground railway system is keeping track of customer travel times between different stations. They are using this data to calculate the average time it takes to travel from one station to another.
-
-
Implement the UndergroundSystem class:
-
-
-
void checkIn(int id, string stationName, int t)
-
-
A customer with a card ID equal to id, checks in at the station stationName at time t.
-
A customer can only be checked into one place at a time.
-
-
-
void checkOut(int id, string stationName, int t)
-
-
A customer with a card ID equal to id, checks out from the station stationName at time t.
Returns the average time it takes to travel from startStation to endStation.
-
The average time is computed from all the previous traveling times from startStation to endStation that happened directly, meaning a check in at startStation followed by a check out from endStation.
-
The time it takes to travel from startStation to endStationmay be different from the time it takes to travel from endStation to startStation.
-
There will be at least one customer that has traveled from startStation to endStation before getAverageTime is called.
-
-
-
-
-
You may assume all calls to the checkIn and checkOut methods are consistent. If a customer checks in at time t1 then checks out at time t2, then t1 < t2. All events happen in chronological order.
All strings consist of uppercase and lowercase English letters and digits.
-
There will be at most 2 * 104 calls in total to checkIn, checkOut, and getAverageTime.
-
Answers within 10-5 of the actual value will be accepted.
-
-
-### Related Topics
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
- [[Design](../../tag/design/README.md)]
-
-### Similar Questions
- 1. [Design Bitset](../design-bitset) (Medium)
-
-### Hints
-
-Hint 1
-Use two hash tables. The first to save the check-in time for a customer and the second to update the total time between two stations.
-
diff --git a/problems/destination-city/README.md b/problems/destination-city/README.md
deleted file mode 100644
index 37239c418..000000000
--- a/problems/destination-city/README.md
+++ /dev/null
@@ -1,71 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../create-a-session-bar-chart "Create a Session Bar Chart")
-
-[Next >](../check-if-all-1s-are-at-least-length-k-places-away "Check If All 1's Are at Least Length K Places Away")
-
-## [1436. Destination City (Easy)](https://leetcode.com/problems/destination-city "旅行终点站")
-
-
You are given the array paths, where paths[i] = [cityAi, cityBi] means there exists a direct path going from cityAi to cityBi. Return the destination city, that is, the city without any path outgoing to another city.
-
-
It is guaranteed that the graph of paths forms a line without any loop, therefore, there will be exactly one destination city.
-
-
-
Example 1:
-
-
-Input: paths = [["London","New York"],["New York","Lima"],["Lima","Sao Paulo"]]
-Output: "Sao Paulo"
-Explanation: Starting at "London" city you will reach "Sao Paulo" city which is the destination city. Your trip consist of: "London" -> "New York" -> "Lima" -> "Sao Paulo".
-
-
-
Example 2:
-
-
-Input: paths = [["B","C"],["D","B"],["C","A"]]
-Output: "A"
-Explanation: All possible trips are:
-"D" -> "B" -> "C" -> "A".
-"B" -> "C" -> "A".
-"C" -> "A".
-"A".
-Clearly the destination city is "A".
-
-
-
Example 3:
-
-
-Input: paths = [["A","Z"]]
-Output: "Z"
-
-
-
-
Constraints:
-
-
-
1 <= paths.length <= 100
-
paths[i].length == 2
-
1 <= cityAi.length, cityBi.length <= 10
-
cityAi != cityBi
-
All strings consist of lowercase and uppercase English letters and the space character.
-
-
-### Related Topics
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Hints
-
-Hint 1
-Start in any city and use the path to move to the next city.
-
-
-
-Hint 2
-Eventually, you will reach a city with no path outgoing, this is the destination city.
-
diff --git a/problems/destination-city/destination_city.go b/problems/destination-city/destination_city.go
deleted file mode 100644
index cfac2933c..000000000
--- a/problems/destination-city/destination_city.go
+++ /dev/null
@@ -1,14 +0,0 @@
-package problem1436
-
-func destCity(paths [][]string) string {
- m := make(map[string]bool)
- for _, path := range paths {
- m[path[0]] = true
- }
- for _, path := range paths {
- if !m[path[1]] {
- return path[1]
- }
- }
- return ""
-}
diff --git a/problems/destination-city/destination_city_test.go b/problems/destination-city/destination_city_test.go
deleted file mode 100644
index c305e679d..000000000
--- a/problems/destination-city/destination_city_test.go
+++ /dev/null
@@ -1,48 +0,0 @@
-package problem1436
-
-import "testing"
-
-type testType struct {
- in [][]string
- want string
-}
-
-func TestDestCity(t *testing.T) {
- tests := [...]testType{
- {
- in: [][]string{
- {"London", "New York"},
- {"New York", "Lima"},
- {"Lima", "Sao Paulo"},
- },
- want: "Sao Paulo",
- },
- {
- in: [][]string{
- {"B", "C"},
- {"D", "B"},
- {"C", "A"},
- },
- want: "A",
- },
- {
- in: [][]string{
- {"A", "Z"},
- },
- want: "Z",
- },
- {
- in: [][]string{
- {"A", "B"},
- {"B", "A"},
- },
- want: "",
- },
- }
- for _, tt := range tests {
- got := destCity(tt.in)
- if got != tt.want {
- t.Fatalf("in: %v, got: %v, want: %v", tt.in, got, tt.want)
- }
- }
-}
diff --git a/problems/destroying-asteroids/README.md b/problems/destroying-asteroids/README.md
deleted file mode 100644
index f1ff813bf..000000000
--- a/problems/destroying-asteroids/README.md
+++ /dev/null
@@ -1,78 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../number-of-laser-beams-in-a-bank "Number of Laser Beams in a Bank")
-
-[Next >](../maximum-employees-to-be-invited-to-a-meeting "Maximum Employees to Be Invited to a Meeting")
-
-## [2126. Destroying Asteroids (Medium)](https://leetcode.com/problems/destroying-asteroids "摧毁小行星")
-
-
You are given an integer mass, which represents the original mass of a planet. You are further given an integer array asteroids, where asteroids[i] is the mass of the ith asteroid.
-
-
You can arrange for the planet to collide with the asteroids in any arbitrary order. If the mass of the planet is greater than or equal to the mass of the asteroid, the asteroid is destroyed and the planet gains the mass of the asteroid. Otherwise, the planet is destroyed.
-
-
Return true if all asteroids can be destroyed. Otherwise, return false.
-
-
-
Example 1:
-
-
-Input: mass = 10, asteroids = [3,9,19,5,21]
-Output: true
-Explanation: One way to order the asteroids is [9,19,5,3,21]:
-- The planet collides with the asteroid with a mass of 9. New planet mass: 10 + 9 = 19
-- The planet collides with the asteroid with a mass of 19. New planet mass: 19 + 19 = 38
-- The planet collides with the asteroid with a mass of 5. New planet mass: 38 + 5 = 43
-- The planet collides with the asteroid with a mass of 3. New planet mass: 43 + 3 = 46
-- The planet collides with the asteroid with a mass of 21. New planet mass: 46 + 21 = 67
-All asteroids are destroyed.
-
-
-
Example 2:
-
-
-Input: mass = 5, asteroids = [4,9,23,4]
-Output: false
-Explanation:
-The planet cannot ever gain enough mass to destroy the asteroid with a mass of 23.
-After the planet destroys the other asteroids, it will have a mass of 5 + 4 + 9 + 4 = 22.
-This is less than 23, so a collision would not destroy the last asteroid.
-
-
-
Constraints:
-
-
-
1 <= mass <= 105
-
1 <= asteroids.length <= 105
-
1 <= asteroids[i] <= 105
-
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Hints
-
-Hint 1
-Choosing the asteroid to collide with can be done greedily.
-
-
-
-Hint 2
-If an asteroid will destroy the planet, then every bigger asteroid will also destroy the planet.
-
-
-
-Hint 3
-You only need to check the smallest asteroid at each collision. If it will destroy the planet, then every other asteroid will also destroy the planet.
-
-
-
-Hint 4
-Sort the asteroids in non-decreasing order by mass, then greedily try to collide with the asteroids in that order.
-
diff --git a/problems/detect-capital/README.md b/problems/detect-capital/README.md
deleted file mode 100644
index c37869020..000000000
--- a/problems/detect-capital/README.md
+++ /dev/null
@@ -1,41 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../random-flip-matrix "Random Flip Matrix")
-
-[Next >](../longest-uncommon-subsequence-i "Longest Uncommon Subsequence I")
-
-## [520. Detect Capital (Easy)](https://leetcode.com/problems/detect-capital "检测大写字母")
-
-
We define the usage of capitals in a word to be right when one of the following cases holds:
-
-
-
All letters in this word are capitals, like "USA".
-
All letters in this word are not capitals, like "leetcode".
-
Only the first letter in this word is capital, like "Google".
-
-
-
Given a string word, return true if the usage of capitals in it is right.
-
-
-
Example 1:
-
Input: word = "USA"
-Output: true
-
Example 2:
-
Input: word = "FlaG"
-Output: false
-
-
-
Constraints:
-
-
-
1 <= word.length <= 100
-
word consists of lowercase and uppercase English letters.
Given a 2D array of characters grid of size m x n, you need to find if there exists any cycle consisting of the same value in grid.
-
-
A cycle is a path of length 4 or more in the grid that starts and ends at the same cell. From a given cell, you can move to one of the cells adjacent to it - in one of the four directions (up, down, left, or right), if it has the same value of the current cell.
-
-
Also, you cannot move to the cell that you visited in your last move. For example, the cycle (1, 1) -> (1, 2) -> (1, 1) is invalid because from (1, 2) we visited (1, 1) which was the last visited cell.
-
-
Return true if any cycle of the same value exists in grid, otherwise, return false.
-
-
-
Example 1:
-
-
-
-
-Input: grid = [["a","a","a","a"],["a","b","b","a"],["a","b","b","a"],["a","a","a","a"]]
-Output: true
-Explanation: There are two valid cycles shown in different colors in the image below:
-
-
-
-
Example 2:
-
-
-
-
-Input: grid = [["c","c","c","a"],["c","d","c","c"],["c","c","e","c"],["f","c","c","c"]]
-Output: true
-Explanation: There is only one valid cycle highlighted in the image below:
-
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Union Find](../../tag/union-find/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
-
-### Hints
-
-Hint 1
-Keep track of the parent (previous position) to avoid considering an invalid path.
-
-
-
-Hint 2
-Use DFS or BFS and keep track of visited cells to see if there is a cycle.
-
diff --git a/problems/detect-pattern-of-length-m-repeated-k-or-more-times/README.md b/problems/detect-pattern-of-length-m-repeated-k-or-more-times/README.md
deleted file mode 100644
index 6f2fcdace..000000000
--- a/problems/detect-pattern-of-length-m-repeated-k-or-more-times/README.md
+++ /dev/null
@@ -1,66 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../unique-orders-and-customers-per-month "Unique Orders and Customers Per Month")
-
-[Next >](../maximum-length-of-subarray-with-positive-product "Maximum Length of Subarray With Positive Product")
-
-## [1566. Detect Pattern of Length M Repeated K or More Times (Easy)](https://leetcode.com/problems/detect-pattern-of-length-m-repeated-k-or-more-times "重复至少 K 次且长度为 M 的模式")
-
-
Given an array of positive integers arr, find a pattern of length m that is repeated k or more times.
-
-
A pattern is a subarray (consecutive sub-sequence) that consists of one or more values, repeated multiple times consecutively without overlapping. A pattern is defined by its length and the number of repetitions.
-
-
Return trueif there exists a pattern of lengthmthat is repeatedkor more times, otherwise returnfalse.
-
-
-
Example 1:
-
-
-Input: arr = [1,2,4,4,4,4], m = 1, k = 3
-Output: true
-Explanation: The pattern (4) of length 1 is repeated 4 consecutive times. Notice that pattern can be repeated k or more times but not less.
-
-
-
Example 2:
-
-
-Input: arr = [1,2,1,2,1,1,1,3], m = 2, k = 2
-Output: true
-Explanation: The pattern (1,2) of length 2 is repeated 2 consecutive times. Another valid pattern (2,1) is also repeated 2 times.
-
-
-
Example 3:
-
-
-Input: arr = [1,2,1,2,1,3], m = 2, k = 3
-Output: false
-Explanation: The pattern (1,2) is of length 2 but is repeated only 2 times. There is no pattern of length 2 that is repeated 3 or more times.
-
-
-
-
Constraints:
-
-
-
2 <= arr.length <= 100
-
1 <= arr[i] <= 100
-
1 <= m <= 100
-
2 <= k <= 100
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Enumeration](../../tag/enumeration/README.md)]
-
-### Similar Questions
- 1. [Maximum Repeating Substring](../maximum-repeating-substring) (Easy)
-
-### Hints
-
-Hint 1
-Use a three-layer loop to check all possible patterns by iterating through all possible starting positions, all indexes less than m, and if the character at the index is repeated k times.
-
diff --git a/problems/detect-squares/README.md b/problems/detect-squares/README.md
deleted file mode 100644
index 982fcb70c..000000000
--- a/problems/detect-squares/README.md
+++ /dev/null
@@ -1,79 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../sum-of-beauty-in-the-array "Sum of Beauty in the Array")
-
-[Next >](../longest-subsequence-repeated-k-times "Longest Subsequence Repeated k Times")
-
-## [2013. Detect Squares (Medium)](https://leetcode.com/problems/detect-squares "检测正方形")
-
-
You are given a stream of points on the X-Y plane. Design an algorithm that:
-
-
-
Adds new points from the stream into a data structure. Duplicate points are allowed and should be treated as different points.
-
Given a query point, counts the number of ways to choose three points from the data structure such that the three points and the query point form an axis-aligned square with positive area.
-
-
-
An axis-aligned square is a square whose edges are all the same length and are either parallel or perpendicular to the x-axis and y-axis.
-
-
Implement the DetectSquares class:
-
-
-
DetectSquares() Initializes the object with an empty data structure.
-
void add(int[] point) Adds a new point point = [x, y] to the data structure.
-
int count(int[] point) Counts the number of ways to form axis-aligned squares with point point = [x, y] as described above.
-
-
-
-
Example 1:
-
-
-Input
-["DetectSquares", "add", "add", "add", "count", "count", "add", "count"]
-[[], [[3, 10]], [[11, 2]], [[3, 2]], [[11, 10]], [[14, 8]], [[11, 2]], [[11, 10]]]
-Output
-[null, null, null, null, 1, 0, null, 2]
-
-Explanation
-DetectSquares detectSquares = new DetectSquares();
-detectSquares.add([3, 10]);
-detectSquares.add([11, 2]);
-detectSquares.add([3, 2]);
-detectSquares.count([11, 10]); // return 1. You can choose:
- // - The first, second, and third points
-detectSquares.count([14, 8]); // return 0. The query point cannot form a square with any points in the data structure.
-detectSquares.add([11, 2]); // Adding duplicate points is allowed.
-detectSquares.count([11, 10]); // return 2. You can choose:
- // - The first, second, and third points
- // - The first, third, and fourth points
-
-
-
-
Constraints:
-
-
-
point.length == 2
-
0 <= x, y <= 1000
-
At most 3000 calls in total will be made to add and count.
-
-
-### Related Topics
- [[Design](../../tag/design/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Counting](../../tag/counting/README.md)]
-
-### Hints
-
-Hint 1
-Maintain the frequency of all the points in a hash map.
-
-
-
-Hint 2
-Traverse the hash map and if any point has the same y-coordinate as the query point, consider this point and the query point to form one of the horizontal lines of the square.
-
diff --git a/problems/determine-color-of-a-chessboard-square/README.md b/problems/determine-color-of-a-chessboard-square/README.md
deleted file mode 100644
index defbbb33c..000000000
--- a/problems/determine-color-of-a-chessboard-square/README.md
+++ /dev/null
@@ -1,68 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../find-interview-candidates "Find Interview Candidates")
-
-[Next >](../sentence-similarity-iii "Sentence Similarity III")
-
-## [1812. Determine Color of a Chessboard Square (Easy)](https://leetcode.com/problems/determine-color-of-a-chessboard-square "判断国际象棋棋盘中一个格子的颜色")
-
-
You are given coordinates, a string that represents the coordinates of a square of the chessboard. Below is a chessboard for your reference.
-
-
-
-
Return true if the square is white, and false if the square is black.
-
-
The coordinate will always represent a valid chessboard square. The coordinate will always have the letter first, and the number second.
-
-
-
Example 1:
-
-
-Input: coordinates = "a1"
-Output: false
-Explanation: From the chessboard above, the square with coordinates "a1" is black, so return false.
-
-
-
Example 2:
-
-
-Input: coordinates = "h3"
-Output: true
-Explanation: From the chessboard above, the square with coordinates "h3" is white, so return true.
-
-
-
Example 3:
-
-
-Input: coordinates = "c7"
-Output: false
-
-
-
-
Constraints:
-
-
-
coordinates.length == 2
-
'a' <= coordinates[0] <= 'h'
-
'1' <= coordinates[1] <= '8'
-
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Hints
-
-Hint 1
-Convert the coordinates to (x, y) - that is, "a1" is (1, 1), "d7" is (4, 7).
-
-
-
-Hint 2
-Try add the numbers together and look for a pattern.
-
diff --git a/problems/determine-if-string-halves-are-alike/README.md b/problems/determine-if-string-halves-are-alike/README.md
deleted file mode 100644
index 8f0453b94..000000000
--- a/problems/determine-if-string-halves-are-alike/README.md
+++ /dev/null
@@ -1,55 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-adjacent-swaps-for-k-consecutive-ones "Minimum Adjacent Swaps for K Consecutive Ones")
-
-[Next >](../maximum-number-of-eaten-apples "Maximum Number of Eaten Apples")
-
-## [1704. Determine if String Halves Are Alike (Easy)](https://leetcode.com/problems/determine-if-string-halves-are-alike "判断字符串的两半是否相似")
-
-
You are given a string s of even length. Split this string into two halves of equal lengths, and let a be the first half and b be the second half.
-
-
Two strings are alike if they have the same number of vowels ('a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U'). Notice that s contains uppercase and lowercase letters.
-
-
Return true if a and b are alike. Otherwise, return false.
-
-
-
Example 1:
-
-
-Input: s = "book"
-Output: true
-Explanation: a = "bo" and b = "ok". a has 1 vowel and b has 1 vowel. Therefore, they are alike.
-
-
-
Example 2:
-
-
-Input: s = "textbook"
-Output: false
-Explanation: a = "text" and b = "book". a has 1 vowel whereas b has 2. Therefore, they are not alike.
-Notice that the vowel o is counted twice.
-
-
-
-
Constraints:
-
-
-
2 <= s.length <= 1000
-
s.length is even.
-
s consists of uppercase and lowercase letters.
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
- [[Counting](../../tag/counting/README.md)]
-
-### Hints
-
-Hint 1
-Create a function that checks if a character is a vowel, either uppercase or lowercase.
-
diff --git a/problems/determine-if-two-strings-are-close/README.md b/problems/determine-if-two-strings-are-close/README.md
deleted file mode 100644
index a6740f403..000000000
--- a/problems/determine-if-two-strings-are-close/README.md
+++ /dev/null
@@ -1,85 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../design-an-ordered-stream "Design an Ordered Stream")
-
-[Next >](../minimum-operations-to-reduce-x-to-zero "Minimum Operations to Reduce X to Zero")
-
-## [1657. Determine if Two Strings Are Close (Medium)](https://leetcode.com/problems/determine-if-two-strings-are-close "确定两个字符串是否接近")
-
-
Two strings are considered close if you can attain one from the other using the following operations:
-
-
-
Operation 1: Swap any two existing characters.
-
-
For example, abcde -> aecdb
-
-
-
Operation 2: Transform every occurrence of one existing character into another existing character, and do the same with the other character.
-
-
For example, aacabb -> bbcbaa (all a's turn into b's, and all b's turn into a's)
-
-
-
-
-
You can use the operations on either string as many times as necessary.
-
-
Given two strings, word1 and word2, return true if word1 and word2 are close, and false otherwise.
-
-
-
Example 1:
-
-
-Input: word1 = "abc", word2 = "bca"
-Output: true
-Explanation: You can attain word2 from word1 in 2 operations.
-Apply Operation 1: "abc" -> "acb"
-Apply Operation 1: "acb" -> "bca"
-
-
-
Example 2:
-
-
-Input: word1 = "a", word2 = "aa"
-Output: false
-Explanation: It is impossible to attain word2 from word1, or vice versa, in any number of operations.
-
-
-
Example 3:
-
-
-Input: word1 = "cabbba", word2 = "abbccc"
-Output: true
-Explanation: You can attain word2 from word1 in 3 operations.
-Apply Operation 1: "cabbba" -> "caabbb"
-Apply Operation 2: "caabbb" -> "baaccc"
-Apply Operation 2: "baaccc" -> "abbccc"
-
-
-
-
Constraints:
-
-
-
1 <= word1.length, word2.length <= 105
-
word1 and word2 contain only lowercase English letters.
-
-
-### Related Topics
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Hints
-
-Hint 1
-Operation 1 allows you to freely reorder the string.
-
-
-
-Hint 2
-Operation 2 allows you to freely reassign the letters' frequencies.
-
diff --git a/problems/determine-whether-matrix-can-be-obtained-by-rotation/README.md b/problems/determine-whether-matrix-can-be-obtained-by-rotation/README.md
deleted file mode 100644
index dc07d77be..000000000
--- a/problems/determine-whether-matrix-can-be-obtained-by-rotation/README.md
+++ /dev/null
@@ -1,67 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../count-pairs-in-two-arrays "Count Pairs in Two Arrays")
-
-[Next >](../reduction-operations-to-make-the-array-elements-equal "Reduction Operations to Make the Array Elements Equal")
-
-## [1886. Determine Whether Matrix Can Be Obtained By Rotation (Easy)](https://leetcode.com/problems/determine-whether-matrix-can-be-obtained-by-rotation "判断矩阵经轮转后是否一致")
-
-
Given two n x n binary matrices mat and target, return true if it is possible to make mat equal to target by rotatingmat in 90-degree increments, or false otherwise.
-
-
-
Example 1:
-
-
-Input: mat = [[0,1],[1,0]], target = [[1,0],[0,1]]
-Output: true
-Explanation: We can rotate mat 90 degrees clockwise to make mat equal target.
-
-
-
Example 2:
-
-
-Input: mat = [[0,1],[1,1]], target = [[1,0],[0,1]]
-Output: false
-Explanation: It is impossible to make mat equal to target by rotating mat.
-
-
-
Example 3:
-
-
-Input: mat = [[0,0,0],[0,1,0],[1,1,1]], target = [[1,1,1],[0,1,0],[0,0,0]]
-Output: true
-Explanation: We can rotate mat 90 degrees clockwise two times to make mat equal target.
-
-
-
-
Constraints:
-
-
-
n == mat.length == target.length
-
n == mat[i].length == target[i].length
-
1 <= n <= 10
-
mat[i][j] and target[i][j] are either 0 or 1.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
-
-### Similar Questions
- 1. [Rotate Image](../rotate-image) (Medium)
-
-### Hints
-
-Hint 1
-What is the maximum number of rotations you have to check?
-
-
-
-Hint 2
-Is there a formula you can use to rotate a matrix 90 degrees?
-
diff --git a/problems/detonate-the-maximum-bombs/README.md b/problems/detonate-the-maximum-bombs/README.md
deleted file mode 100644
index 2a7ecfe4b..000000000
--- a/problems/detonate-the-maximum-bombs/README.md
+++ /dev/null
@@ -1,93 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../find-good-days-to-rob-the-bank "Find Good Days to Rob the Bank")
-
-[Next >](../sequentially-ordinal-rank-tracker "Sequentially Ordinal Rank Tracker")
-
-## [2101. Detonate the Maximum Bombs (Medium)](https://leetcode.com/problems/detonate-the-maximum-bombs "引爆最多的炸弹")
-
-
You are given a list of bombs. The range of a bomb is defined as the area where its effect can be felt. This area is in the shape of a circle with the center as the location of the bomb.
-
-
The bombs are represented by a 0-indexed 2D integer array bombs where bombs[i] = [xi, yi, ri]. xi and yi denote the X-coordinate and Y-coordinate of the location of the ith bomb, whereas ri denotes the radius of its range.
-
-
You may choose to detonate a single bomb. When a bomb is detonated, it will detonate all bombs that lie in its range. These bombs will further detonate the bombs that lie in their ranges.
-
-
Given the list of bombs, return the maximum number of bombs that can be detonated if you are allowed to detonate only one bomb.
-
-
-
Example 1:
-
-
-Input: bombs = [[2,1,3],[6,1,4]]
-Output: 2
-Explanation:
-The above figure shows the positions and ranges of the 2 bombs.
-If we detonate the left bomb, the right bomb will not be affected.
-But if we detonate the right bomb, both bombs will be detonated.
-So the maximum bombs that can be detonated is max(1, 2) = 2.
-
-
-
Example 2:
-
-
-Input: bombs = [[1,1,5],[10,10,5]]
-Output: 1
-Explanation:
-Detonating either bomb will not detonate the other bomb, so the maximum number of bombs that can be detonated is 1.
-
-
-
Example 3:
-
-
-Input: bombs = [[1,2,3],[2,3,1],[3,4,2],[4,5,3],[5,6,4]]
-Output: 5
-Explanation:
-The best bomb to detonate is bomb 0 because:
-- Bomb 0 detonates bombs 1 and 2. The red circle denotes the range of bomb 0.
-- Bomb 2 detonates bomb 3. The blue circle denotes the range of bomb 2.
-- Bomb 3 detonates bomb 4. The green circle denotes the range of bomb 3.
-Thus all 5 bombs are detonated.
-
-
-
-
Constraints:
-
-
-
1 <= bombs.length <= 100
-
bombs[i].length == 3
-
1 <= xi, yi, ri <= 105
-
-
-### Related Topics
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Graph](../../tag/graph/README.md)]
- [[Geometry](../../tag/geometry/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Math](../../tag/math/README.md)]
-
-### Hints
-
-Hint 1
-How can we model the relationship between different bombs? Can "graphs" help us?
-
-
-
-Hint 2
-Bombs are nodes and are connected to other bombs in their range by directed edges.
-
-
-
-Hint 3
-If we know which bombs will be affected when any bomb is detonated, how can we find the total number of bombs that will be detonated if we start from a fixed bomb?
-
-
-
-Hint 4
-Run a Depth First Search (DFS) from every node, and all the nodes it reaches are the bombs that will be detonated.
-
diff --git a/problems/di-string-match/README.md b/problems/di-string-match/README.md
deleted file mode 100644
index 178ccec19..000000000
--- a/problems/di-string-match/README.md
+++ /dev/null
@@ -1,47 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../valid-mountain-array "Valid Mountain Array")
-
-[Next >](../find-the-shortest-superstring "Find the Shortest Superstring")
-
-## [942. DI String Match (Easy)](https://leetcode.com/problems/di-string-match "增减字符串匹配")
-
-
A permutation perm of n + 1 integers of all the integers in the range [0, n] can be represented as a string s of length n where:
-
-
-
s[i] == 'I' if perm[i] < perm[i + 1], and
-
s[i] == 'D' if perm[i] > perm[i + 1].
-
-
-
Given a string s, reconstruct the permutation perm and return it. If there are multiple valid permutations perm, return any of them.
Given the root of a binary tree, return the length of the diameter of the tree.
-
-
The diameter of a binary tree is the length of the longest path between any two nodes in a tree. This path may or may not pass through the root.
-
-
The length of a path between two nodes is represented by the number of edges between them.
-
-
-
Example 1:
-
-
-Input: root = [1,2,3,4,5]
-Output: 3
-Explanation: 3 is the length of the path [4,2,1,3] or [5,2,1,3].
-
-
-
Example 2:
-
-
-Input: root = [1,2]
-Output: 1
-
-
-
-
Constraints:
-
-
-
The number of nodes in the tree is in the range [1, 104].
-
-100 <= Node.val <= 100
-
-
-### Related Topics
- [[Tree](../../tag/tree/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Binary Tree](../../tag/binary-tree/README.md)]
-
-### Similar Questions
- 1. [Diameter of N-Ary Tree](../diameter-of-n-ary-tree) (Medium)
diff --git a/problems/diameter-of-binary-tree/diameter_of_binary_tree.go b/problems/diameter-of-binary-tree/diameter_of_binary_tree.go
deleted file mode 100644
index 837e867e5..000000000
--- a/problems/diameter-of-binary-tree/diameter_of_binary_tree.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem543
diff --git a/problems/diameter-of-binary-tree/diameter_of_binary_tree_test.go b/problems/diameter-of-binary-tree/diameter_of_binary_tree_test.go
deleted file mode 100644
index 837e867e5..000000000
--- a/problems/diameter-of-binary-tree/diameter_of_binary_tree_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem543
diff --git a/problems/diameter-of-n-ary-tree/README.md b/problems/diameter-of-n-ary-tree/README.md
deleted file mode 100644
index 23080aa67..000000000
--- a/problems/diameter-of-n-ary-tree/README.md
+++ /dev/null
@@ -1,32 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../find-a-value-of-a-mysterious-function-closest-to-target "Find a Value of a Mysterious Function Closest to Target")
-
-[Next >](../count-odd-numbers-in-an-interval-range "Count Odd Numbers in an Interval Range")
-
-## [1522. Diameter of N-Ary Tree (Medium)](https://leetcode.com/problems/diameter-of-n-ary-tree "N 叉树的直径")
-
-
-
-### Related Topics
- [[Tree](../../tag/tree/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
-
-### Similar Questions
- 1. [Diameter of Binary Tree](../diameter-of-binary-tree) (Easy)
-
-### Hints
-
-Hint 1
-For the node i, calculate the height of each of its children and keep the first and second maximum heights (max1_i , max2_i).
-
-
-
-Hint 2
-Check all nodes and return max( 2 + max1_i + max2_i ).
-
diff --git a/problems/dice-roll-simulation/README.md b/problems/dice-roll-simulation/README.md
deleted file mode 100644
index 5bcd14155..000000000
--- a/problems/dice-roll-simulation/README.md
+++ /dev/null
@@ -1,68 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../queens-that-can-attack-the-king "Queens That Can Attack the King")
-
-[Next >](../maximum-equal-frequency "Maximum Equal Frequency")
-
-## [1223. Dice Roll Simulation (Hard)](https://leetcode.com/problems/dice-roll-simulation "掷骰子模拟")
-
-
A die simulator generates a random number from 1 to 6 for each roll. You introduced a constraint to the generator such that it cannot roll the number i more than rollMax[i] (1-indexed) consecutive times.
-
-
Given an array of integers rollMax and an integer n, return the number of distinct sequences that can be obtained with exact n rolls. Since the answer may be too large, return it modulo109 + 7.
-
-
Two sequences are considered different if at least one element differs from each other.
-
-
-
Example 1:
-
-
-Input: n = 2, rollMax = [1,1,2,2,2,3]
-Output: 34
-Explanation: There will be 2 rolls of die, if there are no constraints on the die, there are 6 * 6 = 36 possible combinations. In this case, looking at rollMax array, the numbers 1 and 2 appear at most once consecutively, therefore sequences (1,1) and (2,2) cannot occur, so the final answer is 36-2 = 34.
-
-
-
Example 2:
-
-
-Input: n = 2, rollMax = [1,1,1,1,1,1]
-Output: 30
-
-
-
Example 3:
-
-
-Input: n = 3, rollMax = [1,1,1,2,2,3]
-Output: 181
-
-
-
-
Constraints:
-
-
-
1 <= n <= 5000
-
rollMax.length == 6
-
1 <= rollMax[i] <= 15
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Similar Questions
- 1. [Find Missing Observations](../find-missing-observations) (Medium)
-
-### Hints
-
-Hint 1
-Think on Dynamic Programming.
-
-
-
-Hint 2
-DP(pos, last) which means we are at the position pos having as last the last character seen.
-
diff --git a/problems/diet-plan-performance/README.md b/problems/diet-plan-performance/README.md
deleted file mode 100644
index 8a830f600..000000000
--- a/problems/diet-plan-performance/README.md
+++ /dev/null
@@ -1,67 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../prime-arrangements "Prime Arrangements")
-
-[Next >](../can-make-palindrome-from-substring "Can Make Palindrome from Substring")
-
-## [1176. Diet Plan Performance (Easy)](https://leetcode.com/problems/diet-plan-performance "健身计划评估")
-
-
A dieter consumes calories[i] calories on the i-th day. For every consecutive sequence of k days, they look at T, the total calories consumed during that sequence of k days:
-
-
-
If T < lower, they performed poorly on their diet and lose 1 point;
-
If T > upper, they performed well on their diet and gain 1 point;
-
Otherwise, they performed normally and there is no change in points.
-
-
-
Return the total number of points the dieter has after all calories.length days.
-
-
Note that: The total points could be negative.
-
-
-
Example 1:
-
-
-Input: calories = [1,2,3,4,5], k = 1, lower = 3, upper = 3
-Output: 0
-Explaination: calories[0], calories[1] < lower and calories[3], calories[4] > upper, total points = 0.
Given a string expression of numbers and operators, return all possible results from computing all the different possible ways to group numbers and operators. You may return the answer in any order.
expression consists of digits and the operator '+', '-', and '*'.
-
All the integer values in the input expression are in the range [0, 99].
-
-
-### Related Topics
- [[Recursion](../../tag/recursion/README.md)]
- [[Memoization](../../tag/memoization/README.md)]
- [[Math](../../tag/math/README.md)]
- [[String](../../tag/string/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Similar Questions
- 1. [Unique Binary Search Trees II](../unique-binary-search-trees-ii) (Medium)
- 1. [Basic Calculator](../basic-calculator) (Hard)
- 1. [Expression Add Operators](../expression-add-operators) (Hard)
diff --git a/problems/different-ways-to-add-parentheses/different_ways_to_add_parentheses.go b/problems/different-ways-to-add-parentheses/different_ways_to_add_parentheses.go
deleted file mode 100644
index f00d72021..000000000
--- a/problems/different-ways-to-add-parentheses/different_ways_to_add_parentheses.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem241
diff --git a/problems/different-ways-to-add-parentheses/different_ways_to_add_parentheses_test.go b/problems/different-ways-to-add-parentheses/different_ways_to_add_parentheses_test.go
deleted file mode 100644
index f00d72021..000000000
--- a/problems/different-ways-to-add-parentheses/different_ways_to_add_parentheses_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem241
diff --git a/problems/digit-count-in-range/README.md b/problems/digit-count-in-range/README.md
deleted file mode 100644
index 144467f1b..000000000
--- a/problems/digit-count-in-range/README.md
+++ /dev/null
@@ -1,62 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../campus-bikes-ii "Campus Bikes II")
-
-[Next >](../product-sales-analysis-i "Product Sales Analysis I")
-
-## [1067. Digit Count in Range (Hard)](https://leetcode.com/problems/digit-count-in-range "范围内的数字计数")
-
-Given an integer d between 0 and 9, and two positive integers low and high as lower and upper bounds, respectively. Return the number of times that d occurs as a digit in all integers between low and high, including the bounds low and high.
-
-
-
Example 1:
-
-
-Input: d = 1, low = 1, high = 13
-Output: 6
-Explanation:
-The digit d=1 occurs 6 times in 1,10,11,12,13. Note that the digit d=1 occurs twice in the number 11.
-
-
-
-
Example 2:
-
-
-Input: d = 3, low = 100, high = 250
-Output: 35
-Explanation:
-The digit d=3 occurs 35 times in 103,113,123,130,131,...,238,239,243.
-
-
-
-
-
Note:
-
-
-
0 <= d <= 9
-
1 <= low <= high <= 2×10^8
-
-
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Similar Questions
- 1. [Number of Digit One](../number-of-digit-one) (Hard)
-
-### Hints
-
-Hint 1
-Define a function f(x) to get the requested sum from 1 to x. So the answer will be f(hi) - f(lo - 1)
-
-
-
-Hint 2
-In order to solve f(x) we need to do a DP over digits approach.
-
diff --git a/problems/dinner-plate-stacks/README.md b/problems/dinner-plate-stacks/README.md
deleted file mode 100644
index 3536498dd..000000000
--- a/problems/dinner-plate-stacks/README.md
+++ /dev/null
@@ -1,95 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../remove-zero-sum-consecutive-nodes-from-linked-list "Remove Zero Sum Consecutive Nodes from Linked List")
-
-[Next >](../immediate-food-delivery-i "Immediate Food Delivery I")
-
-## [1172. Dinner Plate Stacks (Hard)](https://leetcode.com/problems/dinner-plate-stacks "餐盘栈")
-
-
You have an infinite number of stacks arranged in a row and numbered (left to right) from 0, each of the stacks has the same maximum capacity.
-
-
Implement the DinnerPlates class:
-
-
-
DinnerPlates(int capacity) Initializes the object with the maximum capacity of the stacks capacity.
-
void push(int val) Pushes the given integer val into the leftmost stack with a size less than capacity.
-
int pop() Returns the value at the top of the rightmost non-empty stack and removes it from that stack, and returns -1 if all the stacks are empty.
-
int popAtStack(int index) Returns the value at the top of the stack with the given index index and removes it from that stack or returns -1 if the stack with that given index is empty.
-
-
-
-
Example 1:
-
-
-Input
-["DinnerPlates", "push", "push", "push", "push", "push", "popAtStack", "push", "push", "popAtStack", "popAtStack", "pop", "pop", "pop", "pop", "pop"]
-[[2], [1], [2], [3], [4], [5], [0], [20], [21], [0], [2], [], [], [], [], []]
-Output
-[null, null, null, null, null, null, 2, null, null, 20, 21, 5, 4, 3, 1, -1]
-
-Explanation:
-DinnerPlates D = DinnerPlates(2); // Initialize with capacity = 2
-D.push(1);
-D.push(2);
-D.push(3);
-D.push(4);
-D.push(5); // The stacks are now: 2 4
- 1 3 5
- ﹈ ﹈ ﹈
-D.popAtStack(0); // Returns 2. The stacks are now: 4
- 1 3 5
- ﹈ ﹈ ﹈
-D.push(20); // The stacks are now: 20 4
- 1 3 5
- ﹈ ﹈ ﹈
-D.push(21); // The stacks are now: 20 4 21
- 1 3 5
- ﹈ ﹈ ﹈
-D.popAtStack(0); // Returns 20. The stacks are now: 4 21
- 1 3 5
- ﹈ ﹈ ﹈
-D.popAtStack(2); // Returns 21. The stacks are now: 4
- 1 3 5
- ﹈ ﹈ ﹈
-D.pop() // Returns 5. The stacks are now: 4
- 1 3
- ﹈ ﹈
-D.pop() // Returns 4. The stacks are now: 1 3
- ﹈ ﹈
-D.pop() // Returns 3. The stacks are now: 1
- ﹈
-D.pop() // Returns 1. There are no stacks.
-D.pop() // Returns -1. There are still no stacks.
-
-
-
-
Constraints:
-
-
-
1 <= capacity <= 2 * 104
-
1 <= val <= 2 * 104
-
0 <= index <= 105
-
At most 2 * 105 calls will be made to push, pop, and popAtStack.
-
-
-### Related Topics
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Stack](../../tag/stack/README.md)]
- [[Design](../../tag/design/README.md)]
- [[Heap (Priority Queue)](../../tag/heap-priority-queue/README.md)]
-
-### Hints
-
-Hint 1
-Use a data structure to save the plate status. You may need to operate the exact index. Maintain the leftmost vacant stack and the rightmost non-empty stack.
-
-
-
-Hint 2
-Use a list of stack to store the plate status. Use heap to maintain the leftmost and rightmost valid stack.
-
diff --git a/problems/display-table-of-food-orders-in-a-restaurant/README.md b/problems/display-table-of-food-orders-in-a-restaurant/README.md
deleted file mode 100644
index 6ea038fe2..000000000
--- a/problems/display-table-of-food-orders-in-a-restaurant/README.md
+++ /dev/null
@@ -1,79 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../reformat-the-string "Reformat The String")
-
-[Next >](../minimum-number-of-frogs-croaking "Minimum Number of Frogs Croaking")
-
-## [1418. Display Table of Food Orders in a Restaurant (Medium)](https://leetcode.com/problems/display-table-of-food-orders-in-a-restaurant "点菜展示表")
-
-
Given the array orders, which represents the orders that customers have done in a restaurant. More specifically orders[i]=[customerNamei,tableNumberi,foodItemi] where customerNamei is the name of the customer, tableNumberi is the table customer sit at, and foodItemi is the item customer orders.
-
-
Return the restaurant's “display table”. The “display table” is a table whose row entries denote how many of each food item each table ordered. The first column is the table number and the remaining columns correspond to each food item in alphabetical order. The first row should be a header whose first column is “Table”, followed by the names of the food items. Note that the customer names are not part of the table. Additionally, the rows should be sorted in numerically increasing order.
-
-
-
Example 1:
-
-
-Input: orders = [["David","3","Ceviche"],["Corina","10","Beef Burrito"],["David","3","Fried Chicken"],["Carla","5","Water"],["Carla","5","Ceviche"],["Rous","3","Ceviche"]]
-Output: [["Table","Beef Burrito","Ceviche","Fried Chicken","Water"],["3","0","2","1","0"],["5","0","1","0","1"],["10","1","0","0","0"]]
-Explanation:
-The displaying table looks like:
-Table,Beef Burrito,Ceviche,Fried Chicken,Water
-3 ,0 ,2 ,1 ,0
-5 ,0 ,1 ,0 ,1
-10 ,1 ,0 ,0 ,0
-For the table 3: David orders "Ceviche" and "Fried Chicken", and Rous orders "Ceviche".
-For the table 5: Carla orders "Water" and "Ceviche".
-For the table 10: Corina orders "Beef Burrito".
-
-
-
Example 2:
-
-
-Input: orders = [["James","12","Fried Chicken"],["Ratesh","12","Fried Chicken"],["Amadeus","12","Fried Chicken"],["Adam","1","Canadian Waffles"],["Brianna","1","Canadian Waffles"]]
-Output: [["Table","Canadian Waffles","Fried Chicken"],["1","2","0"],["12","0","3"]]
-Explanation:
-For the table 1: Adam and Brianna order "Canadian Waffles".
-For the table 12: James, Ratesh and Amadeus order "Fried Chicken".
-
customerNamei and foodItemi consist of lowercase and uppercase English letters and the space character.
-
tableNumberiis a valid integer between 1 and 500.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
- [[Ordered Set](../../tag/ordered-set/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Hints
-
-Hint 1
-Keep the frequency of all pairs (tableNumber, foodItem) using a hashmap.
-
-
-
-Hint 2
-Sort rows by tableNumber and columns by foodItem, then process the resulted table.
-
diff --git a/problems/distance-between-bus-stops/README.md b/problems/distance-between-bus-stops/README.md
deleted file mode 100644
index f94b2ff73..000000000
--- a/problems/distance-between-bus-stops/README.md
+++ /dev/null
@@ -1,71 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-number-of-ones "Maximum Number of Ones")
-
-[Next >](../day-of-the-week "Day of the Week")
-
-## [1184. Distance Between Bus Stops (Easy)](https://leetcode.com/problems/distance-between-bus-stops "公交站间的距离")
-
-
A bus has n stops numbered from 0 to n - 1 that form a circle. We know the distance between all pairs of neighboring stops where distance[i] is the distance between the stops number i and (i + 1) % n.
-
-
The bus goes along both directions i.e. clockwise and counterclockwise.
-
-
Return the shortest distance between the given start and destination stops.
-
-
-
Example 1:
-
-
-
-
-Input: distance = [1,2,3,4], start = 0, destination = 1
-Output: 1
-Explanation: Distance between 0 and 1 is 1 or 9, minimum is 1.
-
-
-
-
Example 2:
-
-
-
-
-Input: distance = [1,2,3,4], start = 0, destination = 2
-Output: 3
-Explanation: Distance between 0 and 2 is 3 or 7, minimum is 3.
-
-
-
-
-
Example 3:
-
-
-
-
-Input: distance = [1,2,3,4], start = 0, destination = 3
-Output: 4
-Explanation: Distance between 0 and 3 is 6 or 4, minimum is 4.
-
-
-
-
Constraints:
-
-
-
1 <= n <= 10^4
-
distance.length == n
-
0 <= start, destination < n
-
0 <= distance[i] <= 10^4
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
-
-### Hints
-
-Hint 1
-Find the distance between the two stops if the bus moved in clockwise or counterclockwise directions.
-
diff --git a/problems/distant-barcodes/README.md b/problems/distant-barcodes/README.md
deleted file mode 100644
index dc8ebc8b1..000000000
--- a/problems/distant-barcodes/README.md
+++ /dev/null
@@ -1,46 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../previous-permutation-with-one-swap "Previous Permutation With One Swap")
-
-[Next >](../shortest-way-to-form-string "Shortest Way to Form String")
-
-## [1054. Distant Barcodes (Medium)](https://leetcode.com/problems/distant-barcodes "距离相等的条形码")
-
-
In a warehouse, there is a row of barcodes, where the ith barcode is barcodes[i].
-
-
Rearrange the barcodes so that no two adjacent barcodes are equal. You may return any answer, and it is guaranteed an answer exists.
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Greedy](../../tag/greedy/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
- [[Heap (Priority Queue)](../../tag/heap-priority-queue/README.md)]
- [[Counting](../../tag/counting/README.md)]
-
-### Hints
-
-Hint 1
-We want to always choose the most common or second most common element to write next. What data structure allows us to query this effectively?
-
diff --git a/problems/distant-barcodes/distant_barcodes.go b/problems/distant-barcodes/distant_barcodes.go
deleted file mode 100644
index d976f23f7..000000000
--- a/problems/distant-barcodes/distant_barcodes.go
+++ /dev/null
@@ -1,31 +0,0 @@
-package problem1054
-
-import "sort"
-
-func rearrangeBarcodes(A []int) []int {
- n := len(A)
-
- count := [10001]int{}
- for _, a := range A {
- count[a]++
- }
-
- sort.Slice(A, func(i int, j int) bool {
- if count[A[i]] == count[A[j]] {
- return A[i] < A[j]
- }
- return count[A[i]] > count[A[j]]
- })
-
- res := make([]int, n)
- i := 0
- for _, a := range A {
- res[i] = a
- i += 2
- if i >= n {
- i = 1
- }
- }
-
- return res
-}
diff --git a/problems/distinct-echo-substrings/README.md b/problems/distinct-echo-substrings/README.md
deleted file mode 100644
index e27254199..000000000
--- a/problems/distinct-echo-substrings/README.md
+++ /dev/null
@@ -1,63 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../sum-of-nodes-with-even-valued-grandparent "Sum of Nodes with Even-Valued Grandparent")
-
-[Next >](../convert-integer-to-the-sum-of-two-no-zero-integers "Convert Integer to the Sum of Two No-Zero Integers")
-
-## [1316. Distinct Echo Substrings (Hard)](https://leetcode.com/problems/distinct-echo-substrings "不同的循环子字符串")
-
-
Return the number of distinct non-empty substrings of text that can be written as the concatenation of some string with itself (i.e. it can be written as a + a where a is some string).
-
-
-
Example 1:
-
-
-Input: text = "abcabcabc"
-Output: 3
-Explanation: The 3 substrings are "abcabc", "bcabca" and "cabcab".
-
-
-
Example 2:
-
-
-Input: text = "leetcodeleetcode"
-Output: 2
-Explanation: The 2 substrings are "ee" and "leetcodeleetcode".
-
-
-
-
Constraints:
-
-
-
1 <= text.length <= 2000
-
text has only lowercase English letters.
-
-
-### Related Topics
- [[Trie](../../tag/trie/README.md)]
- [[String](../../tag/string/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Sliding Window](../../tag/sliding-window/README.md)]
- [[Hash Function](../../tag/hash-function/README.md)]
- [[Rolling Hash](../../tag/rolling-hash/README.md)]
-
-### Hints
-
-Hint 1
-Given a substring of the text, how to check if it can be written as the concatenation of a string with itself ?
-
-
-
-Hint 2
-We can do that in linear time, a faster way is to use hashing.
-
-
-
-Hint 3
-Try all substrings and use hashing to check them.
-
diff --git a/problems/distinct-numbers-in-each-subarray/README.md b/problems/distinct-numbers-in-each-subarray/README.md
deleted file mode 100644
index 7f5aeec91..000000000
--- a/problems/distinct-numbers-in-each-subarray/README.md
+++ /dev/null
@@ -1,35 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-interval-to-include-each-query "Minimum Interval to Include Each Query")
-
-[Next >](../convert-date-format "Convert Date Format")
-
-## [1852. Distinct Numbers in Each Subarray (Medium)](https://leetcode.com/problems/distinct-numbers-in-each-subarray "每个子数组的数字种类数")
-
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Sliding Window](../../tag/sliding-window/README.md)]
-
-### Hints
-
-Hint 1
-Keep a frequency map of the elements in each window.
-
-
-
-Hint 2
-When the frequency of the element is 0, remove it from the map.
-
-
-
-Hint 3
-The answer to each window is the size of the map.
-
diff --git a/problems/distinct-subsequences-ii/README.md b/problems/distinct-subsequences-ii/README.md
deleted file mode 100644
index f9799dc58..000000000
--- a/problems/distinct-subsequences-ii/README.md
+++ /dev/null
@@ -1,51 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-area-rectangle "Minimum Area Rectangle")
-
-[Next >](../valid-mountain-array "Valid Mountain Array")
-
-## [940. Distinct Subsequences II (Hard)](https://leetcode.com/problems/distinct-subsequences-ii "不同的子序列 II")
-
-
Given a string s, return the number of distinct non-empty subsequences ofs. Since the answer may be very large, return it modulo109 + 7.
-A subsequence of a string is a new string that is formed from the original string by deleting some (can be none) of the characters without disturbing the relative positions of the remaining characters. (i.e., "ace" is a subsequence of "abcde" while "aec" is not.
-
-
Example 1:
-
-
-Input: s = "abc"
-Output: 7
-Explanation: The 7 distinct subsequences are "a", "b", "c", "ab", "ac", "bc", and "abc".
-
-
-
Example 2:
-
-
-Input: s = "aba"
-Output: 6
-Explanation: The 6 distinct subsequences are "a", "b", "ab", "aa", "ba", and "aba".
-
-
-
Example 3:
-
-
-Input: s = "aaa"
-Output: 3
-Explanation: The 3 distinct subsequences are "a", "aa" and "aaa".
-
Given two strings s and t, return the number of distinct subsequences of s which equals t.
-
-
A string's subsequence is a new string formed from the original string by deleting some (can be none) of the characters without disturbing the remaining characters' relative positions. (i.e., "ACE" is a subsequence of "ABCDE" while "AEC" is not).
-
-
The test cases are generated so that the answer fits on a 32-bit signed integer.
-
-
-
Example 1:
-
-
-Input: s = "rabbbit", t = "rabbit"
-Output: 3
-Explanation:
-As shown below, there are 3 ways you can generate "rabbit" from S.
-rabbbit
-rabbbit
-rabbbit
-
-
-
Example 2:
-
-
-Input: s = "babgbag", t = "bag"
-Output: 5
-Explanation:
-As shown below, there are 5 ways you can generate "bag" from S.
-babgbag
-babgbag
-babgbag
-babgbag
-babgbag
-
-
-
Constraints:
-
-
-
1 <= s.length, t.length <= 1000
-
s and t consist of English letters.
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Similar Questions
- 1. [Number of Unique Good Subsequences](../number-of-unique-good-subsequences) (Hard)
diff --git a/problems/distinct-subsequences/distinct_subsequences.go b/problems/distinct-subsequences/distinct_subsequences.go
deleted file mode 100644
index fdfbbe8cf..000000000
--- a/problems/distinct-subsequences/distinct_subsequences.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem115
diff --git a/problems/distinct-subsequences/distinct_subsequences_test.go b/problems/distinct-subsequences/distinct_subsequences_test.go
deleted file mode 100644
index fdfbbe8cf..000000000
--- a/problems/distinct-subsequences/distinct_subsequences_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem115
diff --git a/problems/distribute-candies-to-people/README.md b/problems/distribute-candies-to-people/README.md
deleted file mode 100644
index e593c51a1..000000000
--- a/problems/distribute-candies-to-people/README.md
+++ /dev/null
@@ -1,65 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../path-with-maximum-minimum-value "Path With Maximum Minimum Value")
-
-[Next >](../path-in-zigzag-labelled-binary-tree "Path In Zigzag Labelled Binary Tree")
-
-## [1103. Distribute Candies to People (Easy)](https://leetcode.com/problems/distribute-candies-to-people "分糖果 II")
-
-
We distribute some number of candies, to a row of n = num_people people in the following way:
-
-
We then give 1 candy to the first person, 2 candies to the second person, and so on until we give n candies to the last person.
-
-
Then, we go back to the start of the row, giving n + 1 candies to the first person, n + 2 candies to the second person, and so on until we give 2 * n candies to the last person.
-
-
This process repeats (with us giving one more candy each time, and moving to the start of the row after we reach the end) until we run out of candies. The last person will receive all of our remaining candies (not necessarily one more than the previous gift).
-
-
Return an array (of length num_people and sum candies) that represents the final distribution of candies.
-
-
-
Example 1:
-
-
-Input: candies = 7, num_people = 4
-Output: [1,2,3,1]
-Explanation:
-On the first turn, ans[0] += 1, and the array is [1,0,0,0].
-On the second turn, ans[1] += 2, and the array is [1,2,0,0].
-On the third turn, ans[2] += 3, and the array is [1,2,3,0].
-On the fourth turn, ans[3] += 1 (because there is only one candy left), and the final array is [1,2,3,1].
-
-
-
Example 2:
-
-
-Input: candies = 10, num_people = 3
-Output: [5,2,3]
-Explanation:
-On the first turn, ans[0] += 1, and the array is [1,0,0].
-On the second turn, ans[1] += 2, and the array is [1,2,0].
-On the third turn, ans[2] += 3, and the array is [1,2,3].
-On the fourth turn, ans[0] += 4, and the final array is [5,2,3].
-
-
-
-
Constraints:
-
-
-
1 <= candies <= 10^9
-
1 <= num_people <= 1000
-
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
- [[Simulation](../../tag/simulation/README.md)]
-
-### Hints
-
-Hint 1
-Give candy to everyone each "turn" first [until you can't], then give candy to one person per turn.
-
diff --git a/problems/distribute-candies-to-people/distribute_candies_to_people.go b/problems/distribute-candies-to-people/distribute_candies_to_people.go
deleted file mode 100644
index 140c27e2b..000000000
--- a/problems/distribute-candies-to-people/distribute_candies_to_people.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem1103
diff --git a/problems/distribute-candies/README.md b/problems/distribute-candies/README.md
deleted file mode 100644
index 597d2572d..000000000
--- a/problems/distribute-candies/README.md
+++ /dev/null
@@ -1,78 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../winning-candidate "Winning Candidate")
-
-[Next >](../out-of-boundary-paths "Out of Boundary Paths")
-
-## [575. Distribute Candies (Easy)](https://leetcode.com/problems/distribute-candies "分糖果")
-
-
Alice has n candies, where the ith candy is of type candyType[i]. Alice noticed that she started to gain weight, so she visited a doctor.
-
-
The doctor advised Alice to only eat n / 2 of the candies she has (n is always even). Alice likes her candies very much, and she wants to eat the maximum number of different types of candies while still following the doctor's advice.
-
-
Given the integer array candyType of length n, return the maximum number of different types of candies she can eat if she only eats n / 2 of them.
-
-
-
Example 1:
-
-
-Input: candyType = [1,1,2,2,3,3]
-Output: 3
-Explanation: Alice can only eat 6 / 2 = 3 candies. Since there are only 3 types, she can eat one of each type.
-
-
-
Example 2:
-
-
-Input: candyType = [1,1,2,3]
-Output: 2
-Explanation: Alice can only eat 4 / 2 = 2 candies. Whether she eats types [1,2], [1,3], or [2,3], she still can only eat 2 different types.
-
-
-
Example 3:
-
-
-Input: candyType = [6,6,6,6]
-Output: 1
-Explanation: Alice can only eat 4 / 2 = 2 candies. Even though she can eat 2 candies, she only has 1 type.
-
-
-
-
Constraints:
-
-
-
n == candyType.length
-
2 <= n <= 104
-
n is even.
-
-105 <= candyType[i] <= 105
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
-
-### Hints
-
-Hint 1
-To maximize the number of kinds of candies, we should try to distribute candies such that sister will gain all kinds.
-
-
-
-Hint 2
-What is the upper limit of the number of kinds of candies sister will gain? Remember candies are to distributed equally.
-
-
-
-Hint 3
-Which data structure is the most suitable for finding the number of kinds of candies?
-
-
-
-Hint 4
-Will hashset solves the problem? Inserting all candies kind in the hashset and then checking its size with upper limit.
-
diff --git a/problems/distribute-candies/distribute_candies.go b/problems/distribute-candies/distribute_candies.go
deleted file mode 100644
index c36fd623f..000000000
--- a/problems/distribute-candies/distribute_candies.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem575
diff --git a/problems/distribute-candies/distribute_candies_test.go b/problems/distribute-candies/distribute_candies_test.go
deleted file mode 100644
index c36fd623f..000000000
--- a/problems/distribute-candies/distribute_candies_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem575
diff --git a/problems/distribute-coins-in-binary-tree/README.md b/problems/distribute-coins-in-binary-tree/README.md
deleted file mode 100644
index fe77331b2..000000000
--- a/problems/distribute-coins-in-binary-tree/README.md
+++ /dev/null
@@ -1,54 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../longest-turbulent-subarray "Longest Turbulent Subarray")
-
-[Next >](../unique-paths-iii "Unique Paths III")
-
-## [979. Distribute Coins in Binary Tree (Medium)](https://leetcode.com/problems/distribute-coins-in-binary-tree "在二叉树中分配硬币")
-
-
You are given the root of a binary tree with n nodes where each node in the tree has node.val coins. There are n coins in total throughout the whole tree.
-
-
In one move, we may choose two adjacent nodes and move one coin from one node to another. A move may be from parent to child, or from child to parent.
-
-
Return the minimum number of moves required to make every node have exactly one coin.
-
-
-
Example 1:
-
-
-Input: root = [3,0,0]
-Output: 2
-Explanation: From the root of the tree, we move one coin to its left child, and one coin to its right child.
-
-
-
Example 2:
-
-
-Input: root = [0,3,0]
-Output: 3
-Explanation: From the left child of the root, we move two coins to the root [taking two moves]. Then, we move one coin from the root of the tree to the right child.
-
You are given an array of n integers, nums, where there are at most 50 unique values in the array. You are also given an array of m customer order quantities, quantity, where quantity[i] is the amount of integers the ith customer ordered. Determine if it is possible to distribute nums such that:
-
-
-
The ith customer gets exactlyquantity[i] integers,
-
The integers the ith customer gets are all equal, and
-
Every customer is satisfied.
-
-
-
Return true if it is possible to distribute nums according to the above conditions.
-
-
-
Example 1:
-
-
-Input: nums = [1,2,3,4], quantity = [2]
-Output: false
-Explanation: The 0th customer cannot be given two different integers.
-
-
-
Example 2:
-
-
-Input: nums = [1,2,3,3], quantity = [2]
-Output: true
-Explanation: The 0th customer is given [3,3]. The integers [1,2] are not used.
-
-
-
Example 3:
-
-
-Input: nums = [1,1,2,2], quantity = [2,2]
-Output: true
-Explanation: The 0th customer is given [1,1], and the 1st customer is given [2,2].
-
-
-
-
Constraints:
-
-
-
n == nums.length
-
1 <= n <= 105
-
1 <= nums[i] <= 1000
-
m == quantity.length
-
1 <= m <= 10
-
1 <= quantity[i] <= 105
-
There are at most 50 unique values in nums.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Backtracking](../../tag/backtracking/README.md)]
- [[Bit Manipulation](../../tag/bit-manipulation/README.md)]
- [[Bitmask](../../tag/bitmask/README.md)]
-
-### Hints
-
-Hint 1
-Count the frequencies of each number. For example, if nums = [4,4,5,5,5], frequencies = [2,3].
-
-
-
-Hint 2
-Each customer wants all of their numbers to be the same. This means that each customer will be assigned to one number.
-
-
-
-Hint 3
-Use dynamic programming. Iterate through the numbers' frequencies, and choose some subset of customers to be assigned to this number.
-
diff --git a/problems/divide-a-string-into-groups-of-size-k/README.md b/problems/divide-a-string-into-groups-of-size-k/README.md
deleted file mode 100644
index f7fc58e35..000000000
--- a/problems/divide-a-string-into-groups-of-size-k/README.md
+++ /dev/null
@@ -1,73 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../pour-water-between-buckets-to-make-water-levels-equal "Pour Water Between Buckets to Make Water Levels Equal")
-
-[Next >](../minimum-moves-to-reach-target-score "Minimum Moves to Reach Target Score")
-
-## [2138. Divide a String Into Groups of Size k (Easy)](https://leetcode.com/problems/divide-a-string-into-groups-of-size-k "将字符串拆分为若干长度为 k 的组")
-
-
A string s can be partitioned into groups of size k using the following procedure:
-
-
-
The first group consists of the first k characters of the string, the second group consists of the next k characters of the string, and so on. Each character can be a part of exactly one group.
-
For the last group, if the string does not have k characters remaining, a character fill is used to complete the group.
-
-
-
Note that the partition is done so that after removing the fill character from the last group (if it exists) and concatenating all the groups in order, the resultant string should be s.
-
-
Given the string s, the size of each group k and the character fill, return a string array denoting the composition of every groups has been divided into, using the above procedure.
-
-
-
Example 1:
-
-
-Input: s = "abcdefghi", k = 3, fill = "x"
-Output: ["abc","def","ghi"]
-Explanation:
-The first 3 characters "abc" form the first group.
-The next 3 characters "def" form the second group.
-The last 3 characters "ghi" form the third group.
-Since all groups can be completely filled by characters from the string, we do not need to use fill.
-Thus, the groups formed are "abc", "def", and "ghi".
-
-
-
Example 2:
-
-
-Input: s = "abcdefghij", k = 3, fill = "x"
-Output: ["abc","def","ghi","jxx"]
-Explanation:
-Similar to the previous example, we are forming the first three groups "abc", "def", and "ghi".
-For the last group, we can only use the character 'j' from the string. To complete this group, we add 'x' twice.
-Thus, the 4 groups formed are "abc", "def", "ghi", and "jxx".
-
-
-
-
Constraints:
-
-
-
1 <= s.length <= 100
-
s consists of lowercase English letters only.
-
1 <= k <= 100
-
fill is a lowercase English letter.
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
- [[Simulation](../../tag/simulation/README.md)]
-
-### Hints
-
-Hint 1
-Using the length of the string and k, can you count the number of groups the string can be divided into?
-
-
-
-Hint 2
-Try completing each group using characters from the string. If there aren’t enough characters for the last group, use the fill character to complete the group.
-
diff --git a/problems/divide-array-in-sets-of-k-consecutive-numbers/README.md b/problems/divide-array-in-sets-of-k-consecutive-numbers/README.md
deleted file mode 100644
index 99aa7bbf4..000000000
--- a/problems/divide-array-in-sets-of-k-consecutive-numbers/README.md
+++ /dev/null
@@ -1,84 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../find-numbers-with-even-number-of-digits "Find Numbers with Even Number of Digits")
-
-[Next >](../maximum-number-of-occurrences-of-a-substring "Maximum Number of Occurrences of a Substring")
-
-## [1296. Divide Array in Sets of K Consecutive Numbers (Medium)](https://leetcode.com/problems/divide-array-in-sets-of-k-consecutive-numbers "划分数组为连续数字的集合")
-
-
Given an array of integers nums and a positive integer k, find whether it is possible to divide this array into sets of k consecutive numbers.
-
-
Return trueif it is possible.Otherwise, return false.
-
-
-
Example 1:
-
-
-Input: nums = [1,2,3,3,4,4,5,6], k = 4
-Output: true
-Explanation: Array can be divided into [1,2,3,4] and [3,4,5,6].
-
-
-
Example 2:
-
-
-Input: nums = [3,2,1,2,3,4,3,4,5,9,10,11], k = 3
-Output: true
-Explanation: Array can be divided into [1,2,3] , [2,3,4] , [3,4,5] and [9,10,11].
-
-
-
Example 3:
-
-
-Input: nums = [3,3,2,2,1,1], k = 3
-Output: true
-
-
-
Example 4:
-
-
-Input: nums = [1,2,3,4], k = 3
-Output: false
-Explanation: Each array should be divided in subarrays of size 3.
-
-
-
-
Constraints:
-
-
-
1 <= k <= nums.length <= 105
-
1 <= nums[i] <= 109
-
-
-
-Note: This question is the same as 846: https://leetcode.com/problems/hand-of-straights/
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Greedy](../../tag/greedy/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Similar Questions
- 1. [Split Array into Consecutive Subsequences](../split-array-into-consecutive-subsequences) (Medium)
-
-### Hints
-
-Hint 1
-If the smallest number in the possible-to-split array is V, then numbers V+1, V+2, ... V+k-1 must contain there as well.
-
-
-
-Hint 2
-You can iteratively find k sets and remove them from array until it becomes empty.
-
-
-
-Hint 3
-Failure to do so would mean that array is unsplittable.
-
diff --git a/problems/divide-array-into-increasing-sequences/README.md b/problems/divide-array-into-increasing-sequences/README.md
deleted file mode 100644
index 6863391eb..000000000
--- a/problems/divide-array-into-increasing-sequences/README.md
+++ /dev/null
@@ -1,74 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-average-subtree "Maximum Average Subtree")
-
-[Next >](../relative-sort-array "Relative Sort Array")
-
-## [1121. Divide Array Into Increasing Sequences (Hard)](https://leetcode.com/problems/divide-array-into-increasing-sequences "将数组分成几个递增序列")
-
-
Given a non-decreasing array of positive integers nums and an integer K, find out if this array can be divided into one or more disjoint increasing subsequences of length at leastK.
-
-
-
-
Example 1:
-
-
-Input: nums = [1,2,2,3,3,4,4], K = 3
-Output: true
-Explanation:
-The array can be divided into the two subsequences [1,2,3,4] and [2,3,4] with lengths at least 3 each.
-
-
-
Example 2:
-
-
-Input: nums = [5,6,6,7,8], K = 3
-Output: false
-Explanation:
-There is no way to divide the array using the conditions required.
-
-
-
-
-
Note:
-
-
-
1 <= nums.length <= 10^5
-
1 <= K <= nums.length
-
1 <= nums[i] <= 10^5
-
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[Array](../../tag/array/README.md)]
-
-### Hints
-
-Hint 1
-Think in the frequency of the numbers and how this affects the number of sequences needed.
-
-
-
-Hint 2
-What is the minimum number of sequences we need to form? Considering frequency of the numbers.
-
-
-
-Hint 3
-Think about the least number of sequences to maximize the lengths.
-
-
-
-Hint 4
-The number of sequences needed is equal to the maximum frequency of an element.
-
-
-
-Hint 5
-How to put the other elements into sequences ? Think in a greedy approach.
-
diff --git a/problems/divide-chocolate/README.md b/problems/divide-chocolate/README.md
deleted file mode 100644
index 4d9a7d8cf..000000000
--- a/problems/divide-chocolate/README.md
+++ /dev/null
@@ -1,73 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../toss-strange-coins "Toss Strange Coins")
-
-[Next >](../check-if-it-is-a-straight-line "Check If It Is a Straight Line")
-
-## [1231. Divide Chocolate (Hard)](https://leetcode.com/problems/divide-chocolate "分享巧克力")
-
-
You have one chocolate bar that consists of some chunks. Each chunk has its own sweetness given by the array sweetness.
-
-
You want to share the chocolate with your K friends so you start cutting the chocolate bar into K+1 pieces using K cuts, each piece consists of some consecutive chunks.
-
-
Being generous, you will eat the piece with the minimum total sweetness and give the other pieces to your friends.
-
-
Find the maximum total sweetness of the piece you can get by cutting the chocolate bar optimally.
-
-
-
Example 1:
-
-
-Input: sweetness = [1,2,3,4,5,6,7,8,9], K = 5
-Output: 6
-Explanation: You can divide the chocolate to [1,2,3], [4,5], [6], [7], [8], [9]
-
-
-
Example 2:
-
-
-Input: sweetness = [5,6,7,8,9,1,2,3,4], K = 8
-Output: 1
-Explanation: There is only one way to cut the bar into 9 pieces.
-
-
-
Example 3:
-
-
-Input: sweetness = [1,2,2,1,2,2,1,2,2], K = 2
-Output: 5
-Explanation: You can divide the chocolate to [1,2,2], [1,2,2], [1,2,2]
-
-
-
-
Constraints:
-
-
-
0 <= K < sweetness.length <= 10^4
-
1 <= sweetness[i] <= 10^5
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
-
-### Hints
-
-Hint 1
-After dividing the array into K+1 sub-arrays, you will pick the sub-array with the minimum sum.
-
-
-
-Hint 2
-Divide the sub-array into K+1 sub-arrays such that the minimum sub-array sum is as maximum as possible.
-
-
-
-Hint 3
-Use binary search with greedy check.
-
diff --git a/problems/divide-two-integers/README.md b/problems/divide-two-integers/README.md
deleted file mode 100644
index 54a10c62f..000000000
--- a/problems/divide-two-integers/README.md
+++ /dev/null
@@ -1,63 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../implement-strstr "Implement strStr()")
-
-[Next >](../substring-with-concatenation-of-all-words "Substring with Concatenation of All Words")
-
-## [29. Divide Two Integers (Medium)](https://leetcode.com/problems/divide-two-integers "两数相除")
-
-
Given two integers dividend and divisor, divide two integers without using multiplication, division, and mod operator.
-
-
Return the quotient after dividing dividend by divisor.
-
-
The integer division should truncate toward zero, which means losing its fractional part. For example, truncate(8.345) = 8 and truncate(-2.7335) = -2.
-
-
Note: Assume we are dealing with an environment that could only store integers within the 32-bit signed integer range: [−231, 231 − 1]. For this problem, assume that your function returns 231 − 1 when the division result overflows.
Alice and Bob take turns playing a game, with Alice starting first.
-
-
Initially, there is a number n on the chalkboard. On each player's turn, that player makes a move consisting of:
-
-
-
Choosing any x with 0 < x < n and n % x == 0.
-
Replacing the number n on the chalkboard with n - x.
-
-
-
Also, if a player cannot make a move, they lose the game.
-
-
Return trueif and only if Alice wins the game, assuming both players play optimally.
-
-
-
Example 1:
-
-
-Input: n = 2
-Output: true
-Explanation: Alice chooses 1, and Bob has no more moves.
-
-
-
Example 2:
-
-
-Input: n = 3
-Output: false
-Explanation: Alice chooses 1, Bob chooses 1, and Alice has no more moves.
-
-
-
-
Constraints:
-
-
-
1 <= n <= 1000
-
-
-### Related Topics
- [[Brainteaser](../../tag/brainteaser/README.md)]
- [[Math](../../tag/math/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Game Theory](../../tag/game-theory/README.md)]
-
-### Hints
-
-Hint 1
-If the current number is even, we can always subtract a 1 to make it odd. If the current number is odd, we must subtract an odd number to make it even.
-
diff --git a/problems/divisor-game/divisor_game.go b/problems/divisor-game/divisor_game.go
deleted file mode 100644
index 1734be824..000000000
--- a/problems/divisor-game/divisor_game.go
+++ /dev/null
@@ -1,5 +0,0 @@
-package problem1025
-
-func divisorGame(N int) bool {
- return N&1 == 0
-}
diff --git a/problems/divisor-game/divisor_game_test.go b/problems/divisor-game/divisor_game_test.go
deleted file mode 100644
index af1ba4b2d..000000000
--- a/problems/divisor-game/divisor_game_test.go
+++ /dev/null
@@ -1,27 +0,0 @@
-package problem1025
-
-import "testing"
-
-type testType struct {
- in int
- want bool
-}
-
-func TestDivisorGame(t *testing.T) {
- tests := [...]testType{
- {
- in: 2,
- want: true,
- },
- {
- in: 3,
- want: false,
- },
- }
- for _, tt := range tests {
- got := divisorGame(tt.in)
- if got != tt.want {
- t.Fatalf("in: %v, got: %v, want: %v", tt.in, got, tt.want)
- }
- }
-}
diff --git a/problems/domino-and-tromino-tiling/README.md b/problems/domino-and-tromino-tiling/README.md
deleted file mode 100644
index 0aab6467f..000000000
--- a/problems/domino-and-tromino-tiling/README.md
+++ /dev/null
@@ -1,44 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../escape-the-ghosts "Escape The Ghosts")
-
-[Next >](../custom-sort-string "Custom Sort String")
-
-## [790. Domino and Tromino Tiling (Medium)](https://leetcode.com/problems/domino-and-tromino-tiling "多米诺和托米诺平铺")
-
-
You have two types of tiles: a 2 x 1 domino shape and a tromino shape. You may rotate these shapes.
-
-
Given an integer n, return the number of ways to tile an2 x nboard. Since the answer may be very large, return it modulo109 + 7.
-
-
In a tiling, every square must be covered by a tile. Two tilings are different if and only if there are two 4-directionally adjacent cells on the board such that exactly one of the tilings has both squares occupied by a tile.
-
-
-
Example 1:
-
-
-Input: n = 3
-Output: 5
-Explanation: The five different ways are show above.
-
-
-
Example 2:
-
-
-Input: n = 1
-Output: 1
-
-
-
-
Constraints:
-
-
-
1 <= n <= 1000
-
-
-### Related Topics
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
diff --git a/problems/domino-and-tromino-tiling/domino_and_tromino_tiling.go b/problems/domino-and-tromino-tiling/domino_and_tromino_tiling.go
deleted file mode 100644
index e70dfcb9c..000000000
--- a/problems/domino-and-tromino-tiling/domino_and_tromino_tiling.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem790
diff --git a/problems/domino-and-tromino-tiling/domino_and_tromino_tiling_test.go b/problems/domino-and-tromino-tiling/domino_and_tromino_tiling_test.go
deleted file mode 100644
index e70dfcb9c..000000000
--- a/problems/domino-and-tromino-tiling/domino_and_tromino_tiling_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem790
diff --git a/problems/dot-product-of-two-sparse-vectors/README.md b/problems/dot-product-of-two-sparse-vectors/README.md
deleted file mode 100644
index 4dd93440a..000000000
--- a/problems/dot-product-of-two-sparse-vectors/README.md
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../number-of-ways-to-reorder-array-to-get-same-bst "Number of Ways to Reorder Array to Get Same BST")
-
-[Next >](../warehouse-manager "Warehouse Manager")
-
-## [1570. Dot Product of Two Sparse Vectors (Medium)](https://leetcode.com/problems/dot-product-of-two-sparse-vectors "两个稀疏向量的点积")
-
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Two Pointers](../../tag/two-pointers/README.md)]
- [[Design](../../tag/design/README.md)]
-
-### Hints
-
-Hint 1
-Because the vector is sparse, use a data structure that stores the index and value where the element is nonzero.
-
diff --git a/problems/dota2-senate/README.md b/problems/dota2-senate/README.md
deleted file mode 100644
index 9d40d16ad..000000000
--- a/problems/dota2-senate/README.md
+++ /dev/null
@@ -1,68 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../replace-words "Replace Words")
-
-[Next >](../2-keys-keyboard "2 Keys Keyboard")
-
-## [649. Dota2 Senate (Medium)](https://leetcode.com/problems/dota2-senate "Dota2 参议院")
-
-
In the world of Dota2, there are two parties: the Radiant and the Dire.
-
-
The Dota2 senate consists of senators coming from two parties. Now the Senate wants to decide on a change in the Dota2 game. The voting for this change is a round-based procedure. In each round, each senator can exercise one of the two rights:
-
-
-
Ban one senator's right: A senator can make another senator lose all his rights in this and all the following rounds.
-
Announce the victory: If this senator found the senators who still have rights to vote are all from the same party, he can announce the victory and decide on the change in the game.
-
-
-
Given a string senate representing each senator's party belonging. The character 'R' and 'D' represent the Radiant party and the Dire party. Then if there are n senators, the size of the given string will be n.
-
-
The round-based procedure starts from the first senator to the last senator in the given order. This procedure will last until the end of voting. All the senators who have lost their rights will be skipped during the procedure.
-
-
Suppose every senator is smart enough and will play the best strategy for his own party. Predict which party will finally announce the victory and change the Dota2 game. The output should be "Radiant" or "Dire".
-
-
-
Example 1:
-
-
-Input: senate = "RD"
-Output: "Radiant"
-Explanation:
-The first senator comes from Radiant and he can just ban the next senator's right in round 1.
-And the second senator can't exercise any rights anymore since his right has been banned.
-And in round 2, the first senator can just announce the victory since he is the only guy in the senate who can vote.
-
-
-
Example 2:
-
-
-Input: senate = "RDD"
-Output: "Dire"
-Explanation:
-The first senator comes from Radiant and he can just ban the next senator's right in round 1.
-And the second senator can't exercise any rights anymore since his right has been banned.
-And the third senator comes from Dire and he can ban the first senator's right in round 1.
-And in round 2, the third senator can just announce the victory since he is the only guy in the senate who can vote.
-
-
-
-
Constraints:
-
-
-
n == senate.length
-
1 <= n <= 104
-
senate[i] is either 'R' or 'D'.
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
- [[Greedy](../../tag/greedy/README.md)]
- [[Queue](../../tag/queue/README.md)]
-
-### Similar Questions
- 1. [Teemo Attacking](../teemo-attacking) (Easy)
diff --git a/problems/dota2-senate/dota2_senate.go b/problems/dota2-senate/dota2_senate.go
deleted file mode 100644
index 8a89517e7..000000000
--- a/problems/dota2-senate/dota2_senate.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem649
diff --git a/problems/dota2-senate/dota2_senate_test.go b/problems/dota2-senate/dota2_senate_test.go
deleted file mode 100644
index 8a89517e7..000000000
--- a/problems/dota2-senate/dota2_senate_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem649
diff --git a/problems/drop-type-1-orders-for-customers-with-type-0-orders/README.md b/problems/drop-type-1-orders-for-customers-with-type-0-orders/README.md
deleted file mode 100644
index 015d77373..000000000
--- a/problems/drop-type-1-orders-for-customers-with-type-0-orders/README.md
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../substrings-that-begin-and-end-with-the-same-letter "Substrings That Begin and End With the Same Letter")
-
-[Next >](../count-common-words-with-one-occurrence "Count Common Words With One Occurrence")
-
-## [2084. Drop Type 1 Orders for Customers With Type 0 Orders (Medium)](https://leetcode.com/problems/drop-type-1-orders-for-customers-with-type-0-orders "为订单类型为 0 的客户删除类型为 1 的订单")
-
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/drop-type-1-orders-for-customers-with-type-0-orders/mysql_schemas.sql b/problems/drop-type-1-orders-for-customers-with-type-0-orders/mysql_schemas.sql
deleted file mode 100644
index 22a499aa9..000000000
--- a/problems/drop-type-1-orders-for-customers-with-type-0-orders/mysql_schemas.sql
+++ /dev/null
@@ -1,10 +0,0 @@
-Create table If Not Exists Orders (order_id int, customer_id int, order_type int);
-Truncate table Orders;
-insert into Orders (order_id, customer_id, order_type) values ('1', '1', '0');
-insert into Orders (order_id, customer_id, order_type) values ('2', '1', '0');
-insert into Orders (order_id, customer_id, order_type) values ('11', '2', '0');
-insert into Orders (order_id, customer_id, order_type) values ('12', '2', '1');
-insert into Orders (order_id, customer_id, order_type) values ('21', '3', '1');
-insert into Orders (order_id, customer_id, order_type) values ('22', '3', '0');
-insert into Orders (order_id, customer_id, order_type) values ('31', '4', '1');
-insert into Orders (order_id, customer_id, order_type) values ('32', '4', '1');
diff --git a/problems/dungeon-game/README.md b/problems/dungeon-game/README.md
deleted file mode 100644
index 481597181..000000000
--- a/problems/dungeon-game/README.md
+++ /dev/null
@@ -1,60 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../binary-search-tree-iterator "Binary Search Tree Iterator")
-
-[Next >](../combine-two-tables "Combine Two Tables")
-
-## [174. Dungeon Game (Hard)](https://leetcode.com/problems/dungeon-game "地下城游戏")
-
-
The demons had captured the princess and imprisoned her in the bottom-right corner of a dungeon. The dungeon consists of m x n rooms laid out in a 2D grid. Our valiant knight was initially positioned in the top-left room and must fight his way through dungeon to rescue the princess.
-
-
The knight has an initial health point represented by a positive integer. If at any point his health point drops to 0 or below, he dies immediately.
-
-
Some of the rooms are guarded by demons (represented by negative integers), so the knight loses health upon entering these rooms; other rooms are either empty (represented as 0) or contain magic orbs that increase the knight's health (represented by positive integers).
-
-
To reach the princess as quickly as possible, the knight decides to move only rightward or downward in each step.
-
-
Return the knight's minimum initial health so that he can rescue the princess.
-
-
Note that any room can contain threats or power-ups, even the first room the knight enters and the bottom-right room where the princess is imprisoned.
-
-
-
Example 1:
-
-
-Input: dungeon = [[-2,-3,3],[-5,-10,1],[10,30,-5]]
-Output: 7
-Explanation: The initial health of the knight must be at least 7 if he follows the optimal path: RIGHT-> RIGHT -> DOWN -> DOWN.
-
-+-------------+---------+
-| Column Name | Type |
-+-------------+---------+
-| id | int |
-| email | varchar |
-+-------------+---------+
-id is the primary key column for this table.
-Each row of this table contains an email. The emails will not contain uppercase letters.
-
-
-
-
-
Write an SQL query to report all the duplicate emails.
-
-
Return the result table in any order.
-
-
The query result format is in the following example.
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/duplicate-emails/duplicate_emails.sql b/problems/duplicate-emails/duplicate_emails.sql
deleted file mode 100644
index c6d93cf24..000000000
--- a/problems/duplicate-emails/duplicate_emails.sql
+++ /dev/null
@@ -1,10 +0,0 @@
-# Write your MySQL query statement below
-
-SELECT
- Email
-FROM
- Person
-GROUP BY
- Email
-HAVING
- count(1) > 1;
diff --git a/problems/duplicate-emails/mysql_schemas.sql b/problems/duplicate-emails/mysql_schemas.sql
deleted file mode 100644
index 5e65f14b1..000000000
--- a/problems/duplicate-emails/mysql_schemas.sql
+++ /dev/null
@@ -1,5 +0,0 @@
-Create table If Not Exists Person (id int, email varchar(255));
-Truncate table Person;
-insert into Person (id, email) values ('1', 'a@b.com');
-insert into Person (id, email) values ('2', 'c@d.com');
-insert into Person (id, email) values ('3', 'a@b.com');
diff --git a/problems/duplicate-zeros/README.md b/problems/duplicate-zeros/README.md
deleted file mode 100644
index c933127d7..000000000
--- a/problems/duplicate-zeros/README.md
+++ /dev/null
@@ -1,66 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../confusing-number-ii "Confusing Number II")
-
-[Next >](../largest-values-from-labels "Largest Values From Labels")
-
-## [1089. Duplicate Zeros (Easy)](https://leetcode.com/problems/duplicate-zeros "复写零")
-
-
Given a fixed-length integer array arr, duplicate each occurrence of zero, shifting the remaining elements to the right.
-
-
Note that elements beyond the length of the original array are not written. Do the above modifications to the input array in place and do not return anything.
-
-
-
Example 1:
-
-
-Input: arr = [1,0,2,3,0,4,5,0]
-Output: [1,0,0,2,3,0,0,4]
-Explanation: After calling your function, the input array is modified to: [1,0,0,2,3,0,0,4]
-
-
-
Example 2:
-
-
-Input: arr = [1,2,3]
-Output: [1,2,3]
-Explanation: After calling your function, the input array is modified to: [1,2,3]
-
-
-
-
Constraints:
-
-
-
1 <= arr.length <= 104
-
0 <= arr[i] <= 9
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Two Pointers](../../tag/two-pointers/README.md)]
-
-### Hints
-
-Hint 1
-This is a great introductory problem for understanding and working with the concept of in-place operations. The problem statement clearly states that we are to modify the array in-place. That does not mean we cannot use another array. We just don't have to return anything.
-
-
-
-Hint 2
-A better way to solve this would be without using additional space. The only reason the problem statement allows you to make modifications in place is that it hints at avoiding any additional memory.
-
-
-
-Hint 3
-The main problem with not using additional memory is that we might override elements due to the zero duplication requirement of the problem statement. How do we get around that?
-
-
-
-Hint 4
-If we had enough space available, we would be able to accommodate all the elements properly. The new length would be the original length of the array plus the number of zeros. Can we use this information somehow to solve the problem?
-
diff --git a/problems/duplicate-zeros/duplicate_zeros.go b/problems/duplicate-zeros/duplicate_zeros.go
deleted file mode 100644
index b3d5b51f3..000000000
--- a/problems/duplicate-zeros/duplicate_zeros.go
+++ /dev/null
@@ -1,29 +0,0 @@
-package problem1089
-
-func duplicateZeros(A []int) {
- n := len(A)
- //
- count := 0
- for i := 0; i < n; i++ {
- if A[i] == 0 {
- count++
- }
- }
- // copy A[i] to A[j]
- copy := func(i, j int) {
- if j < n {
- A[j] = A[i]
- }
- }
- //
- i, j := n-1, n+count-1
- for i < j {
- copy(i, j)
- if A[i] == 0 {
- j--
- copy(i, j)
- }
- i--
- j--
- }
-}
diff --git a/problems/earliest-possible-day-of-full-bloom/README.md b/problems/earliest-possible-day-of-full-bloom/README.md
deleted file mode 100644
index ac699a6ed..000000000
--- a/problems/earliest-possible-day-of-full-bloom/README.md
+++ /dev/null
@@ -1,95 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../count-words-obtained-after-adding-a-letter "Count Words Obtained After Adding a Letter")
-
-[Next >](../pour-water-between-buckets-to-make-water-levels-equal "Pour Water Between Buckets to Make Water Levels Equal")
-
-## [2136. Earliest Possible Day of Full Bloom (Hard)](https://leetcode.com/problems/earliest-possible-day-of-full-bloom "全部开花的最早一天")
-
-
You have n flower seeds. Every seed must be planted first before it can begin to grow, then bloom. Planting a seed takes time and so does the growth of a seed. You are given two 0-indexed integer arrays plantTime and growTime, of length n each:
-
-
-
plantTime[i] is the number of full days it takes you to plant the ith seed. Every day, you can work on planting exactly one seed. You do not have to work on planting the same seed on consecutive days, but the planting of a seed is not complete until you have worked plantTime[i] days on planting it in total.
-
growTime[i] is the number of full days it takes the ith seed to grow after being completely planted. After the last day of its growth, the flower blooms and stays bloomed forever.
-
-
-
From the beginning of day 0, you can plant the seeds in any order.
-
-
Return the earliest possible day where all seeds are blooming.
-
-
-
Example 1:
-
-
-Input: plantTime = [1,4,3], growTime = [2,3,1]
-Output: 9
-Explanation: The grayed out pots represent planting days, colored pots represent growing days, and the flower represents the day it blooms.
-One optimal way is:
-On day 0, plant the 0th seed. The seed grows for 2 full days and blooms on day 3.
-On days 1, 2, 3, and 4, plant the 1st seed. The seed grows for 3 full days and blooms on day 8.
-On days 5, 6, and 7, plant the 2nd seed. The seed grows for 1 full day and blooms on day 9.
-Thus, on day 9, all the seeds are blooming.
-
-
-
Example 2:
-
-
-Input: plantTime = [1,2,3,2], growTime = [2,1,2,1]
-Output: 9
-Explanation: The grayed out pots represent planting days, colored pots represent growing days, and the flower represents the day it blooms.
-One optimal way is:
-On day 1, plant the 0th seed. The seed grows for 2 full days and blooms on day 4.
-On days 0 and 3, plant the 1st seed. The seed grows for 1 full day and blooms on day 5.
-On days 2, 4, and 5, plant the 2nd seed. The seed grows for 2 full days and blooms on day 8.
-On days 6 and 7, plant the 3rd seed. The seed grows for 1 full day and blooms on day 9.
-Thus, on day 9, all the seeds are blooming.
-
-
-
Example 3:
-
-
-Input: plantTime = [1], growTime = [1]
-Output: 2
-Explanation: On day 0, plant the 0th seed. The seed grows for 1 full day and blooms on day 2.
-Thus, on day 2, all the seeds are blooming.
-
-
-
-
Constraints:
-
-
-
n == plantTime.length == growTime.length
-
1 <= n <= 105
-
1 <= plantTime[i], growTime[i] <= 104
-
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Hints
-
-Hint 1
-List the planting like the diagram above shows, where a row represents the timeline of a seed. A row i is above another row j if the last day planting seed i is ahead of the last day for seed j. Does it have any advantage to spend some days to plant seed j before completely planting seed i?
-
-
-
-Hint 2
-No. It does not help seed j but could potentially delay the completion of seed i, resulting in a worse final answer. Remaining focused is a part of the optimal solution.
-
-
-
-Hint 3
-Sort the seeds by their growTime in descending order. Can you prove why this strategy is the other part of the optimal solution? Note the bloom time of a seed is the sum of plantTime of all seeds preceding this seed plus the growTime of this seed.
-
-
-
-Hint 4
-There is no way to improve this strategy. The seed to bloom last dominates the final answer. Exchanging the planting of this seed with another seed with either a larger or smaller growTime will result in a potentially worse answer.
-
diff --git a/problems/edit-distance/README.md b/problems/edit-distance/README.md
deleted file mode 100644
index 36f4811eb..000000000
--- a/problems/edit-distance/README.md
+++ /dev/null
@@ -1,65 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../simplify-path "Simplify Path")
-
-[Next >](../set-matrix-zeroes "Set Matrix Zeroes")
-
-## [72. Edit Distance (Hard)](https://leetcode.com/problems/edit-distance "编辑距离")
-
-
Given two strings word1 and word2, return the minimum number of operations required to convert word1 to word2.
-
-
You have the following three operations permitted on a word:
word1 and word2 consist of lowercase English letters.
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Similar Questions
- 1. [One Edit Distance](../one-edit-distance) (Medium)
- 1. [Delete Operation for Two Strings](../delete-operation-for-two-strings) (Medium)
- 1. [Minimum ASCII Delete Sum for Two Strings](../minimum-ascii-delete-sum-for-two-strings) (Medium)
- 1. [Uncrossed Lines](../uncrossed-lines) (Medium)
diff --git a/problems/edit-distance/edit_distance.go b/problems/edit-distance/edit_distance.go
deleted file mode 100644
index 1dda62473..000000000
--- a/problems/edit-distance/edit_distance.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem72
diff --git a/problems/edit-distance/edit_distance_test.go b/problems/edit-distance/edit_distance_test.go
deleted file mode 100644
index 1dda62473..000000000
--- a/problems/edit-distance/edit_distance_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem72
diff --git a/problems/egg-drop-with-2-eggs-and-n-floors/README.md b/problems/egg-drop-with-2-eggs-and-n-floors/README.md
deleted file mode 100644
index fb4e7cc26..000000000
--- a/problems/egg-drop-with-2-eggs-and-n-floors/README.md
+++ /dev/null
@@ -1,69 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-skips-to-arrive-at-meeting-on-time "Minimum Skips to Arrive at Meeting On Time")
-
-[Next >](../count-pairs-in-two-arrays "Count Pairs in Two Arrays")
-
-## [1884. Egg Drop With 2 Eggs and N Floors (Medium)](https://leetcode.com/problems/egg-drop-with-2-eggs-and-n-floors "鸡蛋掉落-两枚鸡蛋")
-
-
You are given two identical eggs and you have access to a building with n floors labeled from 1 to n.
-
-
You know that there exists a floor f where 0 <= f <= n such that any egg dropped at a floor higher than f will break, and any egg dropped at or below floor f will not break.
-
-
In each move, you may take an unbroken egg and drop it from any floor x (where 1 <= x <= n). If the egg breaks, you can no longer use it. However, if the egg does not break, you may reuse it in future moves.
-
-
Return the minimum number of moves that you need to determine with certainty what the value of f is.
-
-
-
Example 1:
-
-
-Input: n = 2
-Output: 2
-Explanation: We can drop the first egg from floor 1 and the second egg from floor 2.
-If the first egg breaks, we know that f = 0.
-If the second egg breaks but the first egg didn't, we know that f = 1.
-Otherwise, if both eggs survive, we know that f = 2.
-
-
-
Example 2:
-
-
-Input: n = 100
-Output: 14
-Explanation: One optimal strategy is:
-- Drop the 1st egg at floor 9. If it breaks, we know f is between 0 and 8. Drop the 2nd egg starting from floor 1 and going up one at a time to find f within 8 more drops. Total drops is 1 + 8 = 9.
-- If the 1st egg does not break, drop the 1st egg again at floor 22. If it breaks, we know f is between 9 and 21. Drop the 2nd egg starting from floor 10 and going up one at a time to find f within 12 more drops. Total drops is 2 + 12 = 14.
-- If the 1st egg does not break again, follow a similar process dropping the 1st egg from floors 34, 45, 55, 64, 72, 79, 85, 90, 94, 97, 99, and 100.
-Regardless of the outcome, it takes at most 14 drops to determine f.
-
-
-
-
Constraints:
-
-
-
1 <= n <= 1000
-
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Similar Questions
- 1. [Super Egg Drop](../super-egg-drop) (Hard)
-
-### Hints
-
-Hint 1
-Is it really optimal to always drop the egg on the middle floor for each move?
-
-
-
-Hint 2
-Can we create states based on the number of unbroken eggs and floors to build our solution?
-
diff --git a/problems/element-appearing-more-than-25-in-sorted-array/README.md b/problems/element-appearing-more-than-25-in-sorted-array/README.md
deleted file mode 100644
index f8ef3054c..000000000
--- a/problems/element-appearing-more-than-25-in-sorted-array/README.md
+++ /dev/null
@@ -1,56 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../iterator-for-combination "Iterator for Combination")
-
-[Next >](../remove-covered-intervals "Remove Covered Intervals")
-
-## [1287. Element Appearing More Than 25% In Sorted Array (Easy)](https://leetcode.com/problems/element-appearing-more-than-25-in-sorted-array "有序数组中出现次数超过25%的元素")
-
-
Given an integer array sorted in non-decreasing order, there is exactly one integer in the array that occurs more than 25% of the time, return that integer.
-
-
-
Example 1:
-
-
-Input: arr = [1,2,2,6,6,6,6,7,10]
-Output: 6
-
-
-
Example 2:
-
-
-Input: arr = [1,1]
-Output: 1
-
-
-
-
Constraints:
-
-
-
1 <= arr.length <= 104
-
0 <= arr[i] <= 105
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
-
-### Hints
-
-Hint 1
-Divide the array in four parts [1 - 25%] [25 - 50 %] [50 - 75 %] [75% - 100%]
-
-
-
-Hint 2
-The answer should be in one of the ends of the intervals.
-
-
-
-Hint 3
-In order to check which is element is the answer we can count the frequency with binarySearch.
-
diff --git a/problems/elements-in-array-after-removing-and-replacing-elements/README.md b/problems/elements-in-array-after-removing-and-replacing-elements/README.md
deleted file mode 100644
index 745729049..000000000
--- a/problems/elements-in-array-after-removing-and-replacing-elements/README.md
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../the-airport-with-the-most-traffic "The Airport With the Most Traffic")
-
-[Next >](../maximum-number-of-words-found-in-sentences "Maximum Number of Words Found in Sentences")
-
-## [2113. Elements in Array After Removing and Replacing Elements (Medium)](https://leetcode.com/problems/elements-in-array-after-removing-and-replacing-elements "")
-
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
-
-### Hints
-
-Hint 1
-Try to find a pattern in how nums changes.
-
-
-
-Hint 2
-Let m be the original length of nums. If time_i / m (integer division) is even, then nums is at its original size or decreasing in size. If it is odd, then it is empty, or increasing in size.
-
-
-
-Hint 3
-time_i % m can be used to find how many elements are in nums at minute time_i.
-
diff --git a/problems/eliminate-maximum-number-of-monsters/README.md b/problems/eliminate-maximum-number-of-monsters/README.md
deleted file mode 100644
index 96c3ed4ba..000000000
--- a/problems/eliminate-maximum-number-of-monsters/README.md
+++ /dev/null
@@ -1,81 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../build-array-from-permutation "Build Array from Permutation")
-
-[Next >](../count-good-numbers "Count Good Numbers")
-
-## [1921. Eliminate Maximum Number of Monsters (Medium)](https://leetcode.com/problems/eliminate-maximum-number-of-monsters "消灭怪物的最大数量")
-
-
You are playing a video game where you are defending your city from a group of n monsters. You are given a 0-indexed integer array dist of size n, where dist[i] is the initial distance in kilometers of the ith monster from the city.
-
-
The monsters walk toward the city at a constant speed. The speed of each monster is given to you in an integer array speed of size n, where speed[i] is the speed of the ith monster in kilometers per minute.
-
-
You have a weapon that, once fully charged, can eliminate a single monster. However, the weapon takes one minute to charge.The weapon is fully charged at the very start.
-
-
You lose when any monster reaches your city. If a monster reaches the city at the exact moment the weapon is fully charged, it counts as a loss, and the game ends before you can use your weapon.
-
-
Return the maximum number of monsters that you can eliminate before you lose, or n if you can eliminate all the monsters before they reach the city.
-
-
-
Example 1:
-
-
-Input: dist = [1,3,4], speed = [1,1,1]
-Output: 3
-Explanation:
-In the beginning, the distances of the monsters are [1,3,4]. You eliminate the first monster.
-After a minute, the distances of the monsters are [X,2,3]. You eliminate the second monster.
-After a minute, the distances of the monsters are [X,X,2]. You eliminate the thrid monster.
-All 3 monsters can be eliminated.
-
-
Example 2:
-
-
-Input: dist = [1,1,2,3], speed = [1,1,1,1]
-Output: 1
-Explanation:
-In the beginning, the distances of the monsters are [1,1,2,3]. You eliminate the first monster.
-After a minute, the distances of the monsters are [X,0,1,2], so you lose.
-You can only eliminate 1 monster.
-
-
-
Example 3:
-
-
-Input: dist = [3,2,4], speed = [5,3,2]
-Output: 1
-Explanation:
-In the beginning, the distances of the monsters are [3,2,4]. You eliminate the first monster.
-After a minute, the distances of the monsters are [X,0,2], so you lose.
-You can only eliminate 1 monster.
-
-
-
-
Constraints:
-
-
-
n == dist.length == speed.length
-
1 <= n <= 105
-
1 <= dist[i], speed[i] <= 105
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Greedy](../../tag/greedy/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Hints
-
-Hint 1
-Find the amount of time it takes each monster to arrive.
-
-
-
-Hint 2
-Find the order in which the monsters will arrive.
-
diff --git a/problems/elimination-game/README.md b/problems/elimination-game/README.md
deleted file mode 100644
index 2368ac99f..000000000
--- a/problems/elimination-game/README.md
+++ /dev/null
@@ -1,52 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../find-the-difference "Find the Difference")
-
-[Next >](../perfect-rectangle "Perfect Rectangle")
-
-## [390. Elimination Game (Medium)](https://leetcode.com/problems/elimination-game "消除游戏")
-
-
You have a list arr of all integers in the range [1, n] sorted in a strictly increasing order. Apply the following algorithm on arr:
-
-
-
Starting from left to right, remove the first number and every other number afterward until you reach the end of the list.
-
Repeat the previous step again, but this time from right to left, remove the rightmost number and every other number from the remaining numbers.
-
Keep repeating the steps again, alternating left to right and right to left, until a single number remains.
-
-
-
Given the integer n, return the last number that remains inarr.
Select all employee's name and bonus whose bonus is < 1000.
-
-
Table:Employee
-
-
-+-------+--------+-----------+--------+
-| empId | name | supervisor| salary |
-+-------+--------+-----------+--------+
-| 1 | John | 3 | 1000 |
-| 2 | Dan | 3 | 2000 |
-| 3 | Brad | null | 4000 |
-| 4 | Thomas | 3 | 4000 |
-+-------+--------+-----------+--------+
-empId is the primary key column for this table.
-
-
-
Table: Bonus
-
-
-+-------+-------+
-| empId | bonus |
-+-------+-------+
-| 2 | 500 |
-| 4 | 2000 |
-+-------+-------+
-empId is the primary key column for this table.
-
-
-
Example ouput:
-
-
-+-------+-------+
-| name | bonus |
-+-------+-------+
-| John | null |
-| Dan | 500 |
-| Brad | null |
-+-------+-------+
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
-
-### Similar Questions
- 1. [Combine Two Tables](../combine-two-tables) (Easy)
-
-### Hints
-
-Hint 1
-If the EmpId in table Employee has no match in table Bonus, we consider that the corresponding bonus is null and null is smaller than 1000.
-
-
-
-Hint 2
-Inner join is the default join, we can solve the mismatching problem by using outer join.
-
diff --git a/problems/employee-bonus/employee_bonus.sql b/problems/employee-bonus/employee_bonus.sql
deleted file mode 100644
index bae62cf19..000000000
--- a/problems/employee-bonus/employee_bonus.sql
+++ /dev/null
@@ -1 +0,0 @@
-# Write your MySQL query statement below
diff --git a/problems/employee-bonus/mysql_schemas.sql b/problems/employee-bonus/mysql_schemas.sql
deleted file mode 100644
index 44404f355..000000000
--- a/problems/employee-bonus/mysql_schemas.sql
+++ /dev/null
@@ -1,10 +0,0 @@
-Create table If Not Exists Employee (empId int, name varchar(255), supervisor int, salary int);
-Create table If Not Exists Bonus (empId int, bonus int);
-Truncate table Employee;
-insert into Employee (empId, name, supervisor, salary) values ('3', 'Brad', 'None', '4000');
-insert into Employee (empId, name, supervisor, salary) values ('1', 'John', '3', '1000');
-insert into Employee (empId, name, supervisor, salary) values ('2', 'Dan', '3', '2000');
-insert into Employee (empId, name, supervisor, salary) values ('4', 'Thomas', '3', '4000');
-Truncate table Bonus;
-insert into Bonus (empId, bonus) values ('2', '500');
-insert into Bonus (empId, bonus) values ('4', '2000');
diff --git a/problems/employee-free-time/README.md b/problems/employee-free-time/README.md
deleted file mode 100644
index 1353e3e34..000000000
--- a/problems/employee-free-time/README.md
+++ /dev/null
@@ -1,72 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../bold-words-in-string "Bold Words in String")
-
-[Next >](../find-anagram-mappings "Find Anagram Mappings")
-
-## [759. Employee Free Time (Hard)](https://leetcode.com/problems/employee-free-time "员工空闲时间")
-
-
We are given a list schedule of employees, which represents the working time for each employee.
-
-
Each employee has a list of non-overlapping Intervals, and these intervals are in sorted order.
-
-
Return the list of finite intervals representing common, positive-length free time for all employees, also in sorted order.
-
-
Example 1:
-
-
-Input: schedule = [[[1,2],[5,6]],[[1,3]],[[4,10]]]
-Output: [[3,4]]
-Explanation:
-There are a total of three employees, and all common
-free time intervals would be [-inf, 1], [3, 4], [10, inf].
-We discard any intervals that contain inf as they aren't finite.
-
(Even though we are representing Intervals in the form [x, y], the objects inside are Intervals, not lists or arrays. For example, schedule[0][0].start = 1, schedule[0][0].end = 2, and schedule[0][0][0] is not defined.)
-
-
Also, we wouldn't include intervals like [5, 5] in our answer, as they have zero length.
-
-
Note:
-
-
-
schedule and schedule[i] are lists with lengths in range [1, 50].
-
0 <= schedule[i].start < schedule[i].end <= 10^8.
-
-
-
NOTE: input types have been changed on June 17, 2019. Please reset to default code definition to get new method signature.
-
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
- [[Heap (Priority Queue)](../../tag/heap-priority-queue/README.md)]
-
-### Similar Questions
- 1. [Merge Intervals](../merge-intervals) (Medium)
- 1. [Interval List Intersections](../interval-list-intersections) (Medium)
-
-### Hints
-
-Hint 1
-Take all the intervals and do an "events" (or "line sweep") approach - an event of (x, OPEN) increases the number of active intervals, while (x, CLOSE) decreases it.
-
-Processing in sorted order from left to right, if the number of active intervals is zero, then you crossed a region of common free time.
-
diff --git a/problems/employee-free-time/employee_free_time.go b/problems/employee-free-time/employee_free_time.go
deleted file mode 100644
index 2ee80d646..000000000
--- a/problems/employee-free-time/employee_free_time.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem759
diff --git a/problems/employee-free-time/employee_free_time_test.go b/problems/employee-free-time/employee_free_time_test.go
deleted file mode 100644
index 2ee80d646..000000000
--- a/problems/employee-free-time/employee_free_time_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem759
diff --git a/problems/employee-importance/README.md b/problems/employee-importance/README.md
deleted file mode 100644
index 286dc6b8d..000000000
--- a/problems/employee-importance/README.md
+++ /dev/null
@@ -1,64 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-sum-of-3-non-overlapping-subarrays "Maximum Sum of 3 Non-Overlapping Subarrays")
-
-[Next >](../stickers-to-spell-word "Stickers to Spell Word")
-
-## [690. Employee Importance (Easy)](https://leetcode.com/problems/employee-importance "员工的重要性")
-
-
You have a data structure of employee information, which includes the employee's unique ID, their importance value, and their direct subordinates' IDs.
-
-
You are given an array of employees employees where:
-
-
-
employees[i].id is the ID of the ith employee.
-
employees[i].importance is the importance value of the ith employee.
-
employees[i].subordinates is a list of the IDs of the direct subordinates of the ith employee.
-
-
-
Given an integer id that represents the ID of an employee, return the total importance value of this employee and all their direct subordinates.
-
-
-
Example 1:
-
-
-Input: employees = [[1,5,[2,3]],[2,3,[]],[3,3,[]]], id = 1
-Output: 11
-Explanation: Employee 1 has an importance value of 5 and has two direct subordinates: employee 2 and employee 3.
-They both have an importance value of 3.
-Thus, the total importance value of employee 1 is 5 + 3 + 3 = 11.
-
-
-
Example 2:
-
-
-Input: employees = [[1,2,[5]],[5,-3,[]]], id = 5
-Output: -3
-Explanation: Employee 5 has an importance value of -3 and has no direct subordinates.
-Thus, the total importance value of employee 5 is -3.
-
-
-
-
Constraints:
-
-
-
1 <= employees.length <= 2000
-
1 <= employees[i].id <= 2000
-
All employees[i].id are unique.
-
-100 <= employees[i].importance <= 100
-
One employee has at most one direct leader and may have several subordinates.
-
The IDs in employees[i].subordinates are valid IDs.
-
-
-### Related Topics
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
-
-### Similar Questions
- 1. [Nested List Weight Sum](../nested-list-weight-sum) (Medium)
diff --git a/problems/employee-importance/employee_importance.go b/problems/employee-importance/employee_importance.go
deleted file mode 100644
index a8c109e65..000000000
--- a/problems/employee-importance/employee_importance.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem690
diff --git a/problems/employee-importance/employee_importance.py b/problems/employee-importance/employee_importance.py
deleted file mode 100755
index aa69362ff..000000000
--- a/problems/employee-importance/employee_importance.py
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/usr/bin/env python
-
-"""
-# Employee info
-class Employee:
- def __init__(self, id, importance, subordinates):
- # It's the unique id of each node.
- # unique id of this employee
- self.id = id
- # the importance value of this employee
- self.importance = importance
- # the id of direct subordinates
- self.subordinates = subordinates
-"""
-class Solution:
- def getImportance(self, employees, id):
- """
- :type employees: Employee
- :type id: int
- :rtype: int
- """
\ No newline at end of file
diff --git a/problems/employee-importance/employee_importance_test.go b/problems/employee-importance/employee_importance_test.go
deleted file mode 100644
index a8c109e65..000000000
--- a/problems/employee-importance/employee_importance_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem690
diff --git a/problems/employees-earning-more-than-their-managers/README.md b/problems/employees-earning-more-than-their-managers/README.md
deleted file mode 100644
index cae3f944b..000000000
--- a/problems/employees-earning-more-than-their-managers/README.md
+++ /dev/null
@@ -1,61 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../consecutive-numbers "Consecutive Numbers")
-
-[Next >](../duplicate-emails "Duplicate Emails")
-
-## [181. Employees Earning More Than Their Managers (Easy)](https://leetcode.com/problems/employees-earning-more-than-their-managers "超过经理收入的员工")
-
-
Table: Employee
-
-
-+-------------+---------+
-| Column Name | Type |
-+-------------+---------+
-| id | int |
-| name | varchar |
-| salary | int |
-| managerId | int |
-+-------------+---------+
-id is the primary key column for this table.
-Each row of this table indicates the ID of an employee, their name, salary, and the ID of their manager.
-
-
-
-
-
Write an SQL query to find the employees who earn more than their managers.
-
-
Return the result table in any order.
-
-
The query result format is in the following example.
-
-
-
Example 1:
-
-
-Input:
-Employee table:
-+----+-------+--------+-----------+
-| id | name | salary | managerId |
-+----+-------+--------+-----------+
-| 1 | Joe | 70000 | 3 |
-| 2 | Henry | 80000 | 4 |
-| 3 | Sam | 60000 | Null |
-| 4 | Max | 90000 | Null |
-+----+-------+--------+-----------+
-Output:
-+----------+
-| Employee |
-+----------+
-| Joe |
-+----------+
-Explanation: Joe is the only employee who earns more than his manager.
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/employees-earning-more-than-their-managers/employees_earning_more_than_their_managers.sql b/problems/employees-earning-more-than-their-managers/employees_earning_more_than_their_managers.sql
deleted file mode 100644
index bae62cf19..000000000
--- a/problems/employees-earning-more-than-their-managers/employees_earning_more_than_their_managers.sql
+++ /dev/null
@@ -1 +0,0 @@
-# Write your MySQL query statement below
diff --git a/problems/employees-earning-more-than-their-managers/mysql_schemas.sql b/problems/employees-earning-more-than-their-managers/mysql_schemas.sql
deleted file mode 100644
index 47d72e79c..000000000
--- a/problems/employees-earning-more-than-their-managers/mysql_schemas.sql
+++ /dev/null
@@ -1,6 +0,0 @@
-Create table If Not Exists Employee (id int, name varchar(255), salary int, managerId int);
-Truncate table Employee;
-insert into Employee (id, name, salary, managerId) values ('1', 'Joe', '70000', '3');
-insert into Employee (id, name, salary, managerId) values ('2', 'Henry', '80000', '4');
-insert into Employee (id, name, salary, managerId) values ('3', 'Sam', '60000', 'None');
-insert into Employee (id, name, salary, managerId) values ('4', 'Max', '90000', 'None');
diff --git a/problems/employees-whose-manager-left-the-company/README.md b/problems/employees-whose-manager-left-the-company/README.md
deleted file mode 100644
index f6c3b1350..000000000
--- a/problems/employees-whose-manager-left-the-company/README.md
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../number-of-ways-to-separate-numbers "Number of Ways to Separate Numbers")
-
-[Next >](../find-greatest-common-divisor-of-array "Find Greatest Common Divisor of Array")
-
-## [1978. Employees Whose Manager Left the Company (Easy)](https://leetcode.com/problems/employees-whose-manager-left-the-company "上级经理已离职的公司员工")
-
-
diff --git a/problems/employees-whose-manager-left-the-company/mysql_schemas.sql b/problems/employees-whose-manager-left-the-company/mysql_schemas.sql
deleted file mode 100644
index 8b8c69f9a..000000000
--- a/problems/employees-whose-manager-left-the-company/mysql_schemas.sql
+++ /dev/null
@@ -1,8 +0,0 @@
-Create table If Not Exists Employees (employee_id int, name varchar(20), manager_id int, salary int);
-Truncate table Employees;
-insert into Employees (employee_id, name, manager_id, salary) values ('3', 'Mila', '9', '60301');
-insert into Employees (employee_id, name, manager_id, salary) values ('12', 'Antonella', 'None', '31000');
-insert into Employees (employee_id, name, manager_id, salary) values ('13', 'Emery', 'None', '67084');
-insert into Employees (employee_id, name, manager_id, salary) values ('1', 'Kalel', '11', '21241');
-insert into Employees (employee_id, name, manager_id, salary) values ('9', 'Mikaela', 'None', '50937');
-insert into Employees (employee_id, name, manager_id, salary) values ('11', 'Joziah', '6', '28485');
diff --git a/problems/employees-with-missing-information/README.md b/problems/employees-with-missing-information/README.md
deleted file mode 100644
index 87a73e013..000000000
--- a/problems/employees-with-missing-information/README.md
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../find-the-longest-valid-obstacle-course-at-each-position "Find the Longest Valid Obstacle Course at Each Position")
-
-[Next >](../binary-searchable-numbers-in-an-unsorted-array "Binary Searchable Numbers in an Unsorted Array")
-
-## [1965. Employees With Missing Information (Easy)](https://leetcode.com/problems/employees-with-missing-information "丢失信息的雇员")
-
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/employees-with-missing-information/mysql_schemas.sql b/problems/employees-with-missing-information/mysql_schemas.sql
deleted file mode 100644
index 811fe3cbc..000000000
--- a/problems/employees-with-missing-information/mysql_schemas.sql
+++ /dev/null
@@ -1,10 +0,0 @@
-Create table If Not Exists Employees (employee_id int, name varchar(30));
-Create table If Not Exists Salaries (employee_id int, salary int);
-Truncate table Employees;
-insert into Employees (employee_id, name) values ('2', 'Crew');
-insert into Employees (employee_id, name) values ('4', 'Haven');
-insert into Employees (employee_id, name) values ('5', 'Kristian');
-Truncate table Salaries;
-insert into Salaries (employee_id, salary) values ('5', '76071');
-insert into Salaries (employee_id, salary) values ('1', '22517');
-insert into Salaries (employee_id, salary) values ('4', '63539');
diff --git a/problems/encode-and-decode-strings/README.md b/problems/encode-and-decode-strings/README.md
deleted file mode 100644
index b1676d0e4..000000000
--- a/problems/encode-and-decode-strings/README.md
+++ /dev/null
@@ -1,67 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../closest-binary-search-tree-value "Closest Binary Search Tree Value")
-
-[Next >](../closest-binary-search-tree-value-ii "Closest Binary Search Tree Value II")
-
-## [271. Encode and Decode Strings (Medium)](https://leetcode.com/problems/encode-and-decode-strings "字符串的编码与解码")
-
-
Design an algorithm to encode a list of strings to a string. The encoded string is then sent over the network and is decoded back to the original list of strings.
strs2 in Machine 2 should be the same as strs in Machine 1.
-
-
Implement the encode and decode methods.
-
-
-
-
Note:
-
-
-
The string may contain any possible characters out of 256 valid ascii characters. Your algorithm should be generalized enough to work on any possible characters.
-
Do not use class member/global/static variables to store states. Your encode and decode algorithms should be stateless.
-
Do not rely on any library method such as eval or serialize methods. You should implement your own encode/decode algorithm.
TinyURL is a URL shortening service where you enter a URL such as https://leetcode.com/problems/design-tinyurl and it returns a short URL such as http://tinyurl.com/4e9iAk. Design a class to encode a URL and decode a tiny URL.
-
-
There is no restriction on how your encode/decode algorithm should work. You just need to ensure that a URL can be encoded to a tiny URL and the tiny URL can be decoded to the original URL.
-
-
Implement the Solution class:
-
-
-
Solution() Initializes the object of the system.
-
String encode(String longUrl) Returns a tiny URL for the given longUrl.
-
String decode(String shortUrl) Returns the original long URL for the given shortUrl. It is guaranteed that the given shortUrl was encoded by the same object.
-
-
-
-
Example 1:
-
-
-Input: url = "https://leetcode.com/problems/design-tinyurl"
-Output: "https://leetcode.com/problems/design-tinyurl"
-
-Explanation:
-Solution obj = new Solution();
-string tiny = obj.encode(url); // returns the encoded tiny url.
-string ans = obj.decode(tiny); // returns the original url after deconding it.
-
-
-
-
Constraints:
-
-
-
1 <= url.length <= 104
-
url is guranteed to be a valid URL.
-
-
-### Related Topics
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
- [[Design](../../tag/design/README.md)]
- [[Hash Function](../../tag/hash-function/README.md)]
diff --git a/problems/encode-and-decode-tinyurl/encode_and_decode_tinyurl.go b/problems/encode-and-decode-tinyurl/encode_and_decode_tinyurl.go
deleted file mode 100644
index 254eaecf2..000000000
--- a/problems/encode-and-decode-tinyurl/encode_and_decode_tinyurl.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem535
diff --git a/problems/encode-and-decode-tinyurl/encode_and_decode_tinyurl.py b/problems/encode-and-decode-tinyurl/encode_and_decode_tinyurl.py
deleted file mode 100755
index bf305a603..000000000
--- a/problems/encode-and-decode-tinyurl/encode_and_decode_tinyurl.py
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/usr/bin/env python
-
-class Codec:
-
- def encode(self, longUrl):
- """Encodes a URL to a shortened URL.
-
- :type longUrl: str
- :rtype: str
- """
-
-
- def decode(self, shortUrl):
- """Decodes a shortened URL to its original URL.
-
- :type shortUrl: str
- :rtype: str
- """
-
-
-# Your Codec object will be instantiated and called as such:
-# codec = Codec()
-# codec.decode(codec.encode(url))
\ No newline at end of file
diff --git a/problems/encode-and-decode-tinyurl/encode_and_decode_tinyurl_test.go b/problems/encode-and-decode-tinyurl/encode_and_decode_tinyurl_test.go
deleted file mode 100644
index 254eaecf2..000000000
--- a/problems/encode-and-decode-tinyurl/encode_and_decode_tinyurl_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem535
diff --git a/problems/encode-n-ary-tree-to-binary-tree/README.md b/problems/encode-n-ary-tree-to-binary-tree/README.md
deleted file mode 100644
index 4ed404913..000000000
--- a/problems/encode-n-ary-tree-to-binary-tree/README.md
+++ /dev/null
@@ -1,43 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../flatten-a-multilevel-doubly-linked-list "Flatten a Multilevel Doubly Linked List")
-
-[Next >](../all-oone-data-structure "All O`one Data Structure")
-
-## [431. Encode N-ary Tree to Binary Tree (Hard)](https://leetcode.com/problems/encode-n-ary-tree-to-binary-tree "将 N 叉树编码为二叉树")
-
-
Design an algorithm to encode an N-ary tree into a binary tree and decode the binary tree to get the original N-ary tree. An N-ary tree is a rooted tree in which each node has no more than N children. Similarly, a binary tree is a rooted tree in which each node has no more than 2 children. There is no restriction on how your encode/decode algorithm should work. You just need to ensure that an N-ary tree can be encoded to a binary tree and this binary tree can be decoded to the original N-nary tree structure.
-
-
For example, you may encode the following 3-ary tree to a binary tree in this way:
-
-
-
-
-
-
-
-
Note that the above is just an example which might or might not work. You do not necessarily need to follow this format, so please be creative and come up with different approaches yourself.
-
-
-
-
Note:
-
-
-
N is in the range of [1, 1000]
-
Do not use class member/global/static variables to store states. Your encode and decode algorithms should be stateless.
Given a non-negative integer num, Return its encoding string.
-
-
The encoding is done by converting the integer to a string using a secret function that you should deduce from the following table:
-
-
-
-
-
Example 1:
-
-
-Input: num = 23
-Output: "1000"
-
-
-
Example 2:
-
-
-Input: num = 107
-Output: "101100"
-
-
-
-
Constraints:
-
-
-
0 <= num <= 10^9
-
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
- [[String](../../tag/string/README.md)]
- [[Bit Manipulation](../../tag/bit-manipulation/README.md)]
-
-### Similar Questions
- 1. [Convert to Base -2](../convert-to-base-2) (Medium)
-
-### Hints
-
-Hint 1
-Try to find the number of binary digits returned by the function.
-
-
-
-Hint 2
-The pattern is to start counting from zero after determining the number of binary digits.
-
diff --git a/problems/encode-string-with-shortest-length/README.md b/problems/encode-string-with-shortest-length/README.md
deleted file mode 100644
index 6cb5604f0..000000000
--- a/problems/encode-string-with-shortest-length/README.md
+++ /dev/null
@@ -1,84 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../implement-rand10-using-rand7 "Implement Rand10() Using Rand7()")
-
-[Next >](../concatenated-words "Concatenated Words")
-
-## [471. Encode String with Shortest Length (Hard)](https://leetcode.com/problems/encode-string-with-shortest-length "编码最短长度的字符串")
-
-
Given a non-empty string, encode the string such that its encoded length is the shortest.
-
-
The encoding rule is: k[encoded_string], where the encoded_string inside the square brackets is being repeated exactly k times.
-
-
Note:
-
-
-
k will be a positive integer and encoded string will not be empty or have extra space.
-
You may assume that the input string contains only lowercase English letters. The string's length is at most 160.
-
If an encoding process does not make the string shorter, then do not encode it. If there are several solutions, return any of them is fine.
-
-
-
-
-
Example 1:
-
-
-Input: "aaa"
-Output: "aaa"
-Explanation: There is no way to encode it such that it is shorter than the input string, so we do not encode it.
-
-
-
-
-
Example 2:
-
-
-Input: "aaaaa"
-Output: "5[a]"
-Explanation: "5[a]" is shorter than "aaaaa" by 1 character.
-
-
-
-
-
Example 3:
-
-
-Input: "aaaaaaaaaa"
-Output: "10[a]"
-Explanation: "a9[a]" or "9[a]a" are also valid solutions, both of them have the same length = 5, which is the same as "10[a]".
-
-
-
-
-
Example 4:
-
-
-Input: "aabcaabcd"
-Output: "2[aabc]d"
-Explanation: "aabc" occurs twice, so one answer can be "2[aabc]d".
-
-
-
-
-
Example 5:
-
-
-Input: "abbbabbbcabbbabbbc"
-Output: "2[2[abbb]c]"
-Explanation: "abbbabbbc" occurs twice, but "abbbabbbc" can also be encoded to "2[abbb]c", so one answer can be "2[2[abbb]c]".
-
Given two strings s and t, each of which represents a non-negative rational number, return true if and only if they represent the same number. The strings may use parentheses to denote the repeating part of the rational number.
-
-
A rational number can be represented using up to three parts: <IntegerPart>, <NonRepeatingPart>, and a <RepeatingPart>. The number will be represented in one of the following three ways:
-Input: s = "0.(52)", t = "0.5(25)"
-Output: true
-Explanation: Because "0.(52)" represents 0.52525252..., and "0.5(25)" represents 0.52525252525..... , the strings represent the same number.
-
-
-
Example 2:
-
-
-Input: s = "0.1666(6)", t = "0.166(66)"
-Output: true
-
-
-
Example 3:
-
-
-Input: s = "0.9(9)", t = "1."
-Output: true
-Explanation: "0.9(9)" represents 0.999999999... repeated forever, which equals 1. [See this link for an explanation.]
-"1." represents the number 1, which is formed correctly: (IntegerPart) = "1" and (NonRepeatingPart) = "".
-
-
-
-
Constraints:
-
-
-
Each part consists only of digits.
-
The <IntegerPart> does not have leading zeros (except for the zero itself).
You are given two arrays of integers nums1 and nums2, possibly of different lengths. The values in the arrays are between 1 and 6, inclusive.
-
-
In one operation, you can change any integer's value in any of the arrays to any value between 1 and 6, inclusive.
-
-
Return the minimum number of operations required to make the sum of values in nums1 equal to the sum of values in nums2. Return -1 if it is not possible to make the sum of the two arrays equal.
-
-
-
Example 1:
-
-
-Input: nums1 = [1,2,3,4,5,6], nums2 = [1,1,2,2,2,2]
-Output: 3
-Explanation: You can make the sums of nums1 and nums2 equal with 3 operations. All indices are 0-indexed.
-- Change nums2[0] to 6. nums1 = [1,2,3,4,5,6], nums2 = [6,1,2,2,2,2].
-- Change nums1[5] to 1. nums1 = [1,2,3,4,5,1], nums2 = [6,1,2,2,2,2].
-- Change nums1[2] to 2. nums1 = [1,2,2,4,5,1], nums2 = [6,1,2,2,2,2].
-
-
-
Example 2:
-
-
-Input: nums1 = [1,1,1,1,1,1,1], nums2 = [6]
-Output: -1
-Explanation: There is no way to decrease the sum of nums1 or to increase the sum of nums2 to make them equal.
-
-
-
Example 3:
-
-
-Input: nums1 = [6,6], nums2 = [1]
-Output: 3
-Explanation: You can make the sums of nums1 and nums2 equal with 3 operations. All indices are 0-indexed.
-- Change nums1[0] to 2. nums1 = [2,6], nums2 = [1].
-- Change nums1[1] to 2. nums1 = [2,2], nums2 = [1].
-- Change nums2[0] to 4. nums1 = [2,2], nums2 = [4].
-
-
-
-
Constraints:
-
-
-
1 <= nums1.length, nums2.length <= 105
-
1 <= nums1[i], nums2[i] <= 6
-
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Counting](../../tag/counting/README.md)]
-
-### Hints
-
-Hint 1
-Let's note that we want to either decrease the sum of the array with a larger sum or increase the array's sum with the smaller sum.
-
-
-
-Hint 2
-You can maintain the largest increase or decrease you can make in a binary search tree and each time get the maximum one.
-
diff --git a/problems/equal-tree-partition/README.md b/problems/equal-tree-partition/README.md
deleted file mode 100644
index e6ca9a94b..000000000
--- a/problems/equal-tree-partition/README.md
+++ /dev/null
@@ -1,66 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-width-of-binary-tree "Maximum Width of Binary Tree")
-
-[Next >](../strange-printer "Strange Printer")
-
-## [663. Equal Tree Partition (Medium)](https://leetcode.com/problems/equal-tree-partition "均匀树划分")
-
-
-Given a binary tree with n nodes, your task is to check if it's possible to partition the tree to two trees which have the equal sum of values after removing exactly one edge on the original tree.
-
Input:
- 1
- / \
- 2 10
- / \
- 2 20
-
-Output: False
-Explanation: You can't split the tree into two trees with equal sum after removing exactly one edge on the tree.
-
-
-
-
Note:
-
-
The range of tree node value is in the range of [-100000, 100000].
-
1 <= n <= 10000
-
-
-
-### Related Topics
- [[Tree](../../tag/tree/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Binary Tree](../../tag/binary-tree/README.md)]
diff --git a/problems/equal-tree-partition/equal_tree_partition.go b/problems/equal-tree-partition/equal_tree_partition.go
deleted file mode 100644
index 0dc0df06f..000000000
--- a/problems/equal-tree-partition/equal_tree_partition.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem663
diff --git a/problems/equal-tree-partition/equal_tree_partition_test.go b/problems/equal-tree-partition/equal_tree_partition_test.go
deleted file mode 100644
index 0dc0df06f..000000000
--- a/problems/equal-tree-partition/equal_tree_partition_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem663
diff --git a/problems/erect-the-fence-ii/README.md b/problems/erect-the-fence-ii/README.md
deleted file mode 100644
index dcc541793..000000000
--- a/problems/erect-the-fence-ii/README.md
+++ /dev/null
@@ -1,30 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../longest-common-subpath "Longest Common Subpath")
-
-[Next >](../count-square-sum-triples "Count Square Sum Triples")
-
-## [1924. Erect the Fence II (Hard)](https://leetcode.com/problems/erect-the-fence-ii "安装栅栏 II")
-
-
-
-### Related Topics
- [[Geometry](../../tag/geometry/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Math](../../tag/math/README.md)]
-
-### Hints
-
-Hint 1
-First, we need to note that this is a classic problem given n points you need to find the minimum enclosing circle to bind them
-
-
-
-Hint 2
-Second, we need to apply a well known algorithm called welzls algorithm to help us find the minimum enclosing circle
-
diff --git a/problems/erect-the-fence/README.md b/problems/erect-the-fence/README.md
deleted file mode 100644
index 3fde094a3..000000000
--- a/problems/erect-the-fence/README.md
+++ /dev/null
@@ -1,48 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../customer-placing-the-largest-number-of-orders "Customer Placing the Largest Number of Orders")
-
-[Next >](../design-in-memory-file-system "Design In-Memory File System")
-
-## [587. Erect the Fence (Hard)](https://leetcode.com/problems/erect-the-fence "安装栅栏")
-
-
You are given an array trees where trees[i] = [xi, yi] represents the location of a tree in the garden.
-
-
You are asked to fence the entire garden using the minimum length of rope as it is expensive. The garden is well fenced only if all the trees are enclosed.
-
-
Return the coordinates of trees that are exactly located on the fence perimeter.
There is a 1 million by 1 million grid on an XY-plane, and the coordinates of each grid square are (x, y).
-
-
We start at the source = [sx, sy] square and want to reach the target = [tx, ty] square. There is also an array of blocked squares, where each blocked[i] = [xi, yi] represents a blocked square with coordinates (xi, yi).
-
-
Each move, we can walk one square north, east, south, or west if the square is not in the array of blocked squares. We are also not allowed to walk outside of the grid.
-
-
Return true if and only if it is possible to reach the target square from the source square through a sequence of valid moves.
-
-
-
Example 1:
-
-
-Input: blocked = [[0,1],[1,0]], source = [0,0], target = [0,2]
-Output: false
-Explanation: The target square is inaccessible starting from the source square because we cannot move.
-We cannot move north or east because those squares are blocked.
-We cannot move south or west because we cannot go outside of the grid.
-
-
-
Example 2:
-
-
-Input: blocked = [], source = [0,0], target = [999999,999999]
-Output: true
-Explanation: Because there are no blocked cells, it is possible to reach the target square.
-
-
-
-
Constraints:
-
-
-
0 <= blocked.length <= 200
-
blocked[i].length == 2
-
0 <= xi, yi < 106
-
source.length == target.length == 2
-
0 <= sx, sy, tx, ty < 106
-
source != target
-
It is guaranteed that source and target are not blocked.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
-
-### Hints
-
-Hint 1
-If we become stuck, there's either a loop around the source or around the target.
-
-
-
-Hint 2
-If there is a loop around say, the source, what is the maximum number of squares it can have?
-
diff --git a/problems/escape-a-large-maze/escape_a_large_maze.go b/problems/escape-a-large-maze/escape_a_large_maze.go
deleted file mode 100644
index 575827977..000000000
--- a/problems/escape-a-large-maze/escape_a_large_maze.go
+++ /dev/null
@@ -1,56 +0,0 @@
-package problem1036
-
-var dx = []int{0, 0, 1, -1}
-var dy = []int{1, -1, 0, 0}
-
-// M is length and width of the large maze
-const M = 1e6
-
-// MAX is the largest number of points that can be enclosed by blocked
-// because of len(blocked)<=200
-const MAX = 19900
-
-func isEscapePossible(blocked [][]int, source []int, target []int) bool {
- isBlocked := make(map[int]bool, len(blocked))
- for _, b := range blocked {
- x, y := b[0], b[1]
- isBlocked[x<<32+y] = true
- }
- // BFS
- isOpen := func(source, target []int) bool {
- tx, ty := target[0], target[1]
- //
- points := make([][]int, 0, MAX)
- hasSeen := make(map[int]bool, MAX)
- //
- sx, sy := source[0], source[1]
- points, hasSeen[sx<<32+sy] = append(points, source), true
- //
- for len(points) > 0 {
- size := len(points)
- for i := 0; i < size; i++ {
- px, py := points[i][0], points[i][1]
- for k := 0; k < 4; k++ {
- x, y := px+dx[k], py+dy[k]
- if x == tx && y == ty {
- return true
- }
- p := x<<32 + y
- if 0 <= x && x < M &&
- 0 <= y && y < M &&
- !isBlocked[p] &&
- !hasSeen[p] {
- points, hasSeen[p] = append(points, []int{x, y}), true
- }
- }
- }
- if len(hasSeen) > MAX {
- return true
- }
- points = points[size:]
- }
- return false
- }
-
- return isOpen(source, target) && isOpen(target, source)
-}
diff --git a/problems/escape-the-ghosts/README.md b/problems/escape-the-ghosts/README.md
deleted file mode 100644
index 8457916e6..000000000
--- a/problems/escape-the-ghosts/README.md
+++ /dev/null
@@ -1,75 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../rotated-digits "Rotated Digits")
-
-[Next >](../domino-and-tromino-tiling "Domino and Tromino Tiling")
-
-## [789. Escape The Ghosts (Medium)](https://leetcode.com/problems/escape-the-ghosts "逃脱阻碍者")
-
-
You are playing a simplified PAC-MAN game on an infinite 2-D grid. You start at the point [0, 0], and you are given a destination point target = [xtarget, ytarget] that you are trying to get to. There are several ghosts on the map with their starting positions given as a 2D array ghosts, where ghosts[i] = [xi, yi] represents the starting position of the ith ghost. All inputs are integral coordinates.
-
-
Each turn, you and all the ghosts may independently choose to either move 1 unit in any of the four cardinal directions: north, east, south, or west, or stay still. All actions happen simultaneously.
-
-
You escape if and only if you can reach the target before any ghost reaches you. If you reach any square (including the target) at the same time as a ghost, it does not count as an escape.
-
-
Return true if it is possible to escape regardless of how the ghosts move, otherwise return false.
-
-
-
Example 1:
-
-
-Input: ghosts = [[1,0],[0,3]], target = [0,1]
-Output: true
-Explanation: You can reach the destination (0, 1) after 1 turn, while the ghosts located at (1, 0) and (0, 3) cannot catch up with you.
-
-
-
Example 2:
-
-
-Input: ghosts = [[1,0]], target = [2,0]
-Output: false
-Explanation: You need to reach the destination (2, 0), but the ghost at (1, 0) lies between you and the destination.
-
-
-
Example 3:
-
-
-Input: ghosts = [[2,0]], target = [1,0]
-Output: false
-Explanation: The ghost can reach the target at the same time as you.
-
You are given an array of variable pairs equations and an array of real numbers values, where equations[i] = [Ai, Bi] and values[i] represent the equation Ai / Bi = values[i]. Each Ai or Bi is a string that represents a single variable.
-
-
You are also given some queries, where queries[j] = [Cj, Dj] represents the jth query where you must find the answer for Cj / Dj = ?.
-
-
Return the answers to all queries. If a single answer cannot be determined, return -1.0.
-
-
Note: The input is always valid. You may assume that evaluating the queries will not result in division by zero and that there is no contradiction.
-
-
-
Example 1:
-
-
-Input: equations = [["a","b"],["b","c"]], values = [2.0,3.0], queries = [["a","c"],["b","a"],["a","e"],["a","a"],["x","x"]]
-Output: [6.00000,0.50000,-1.00000,1.00000,-1.00000]
-Explanation:
-Given: a / b = 2.0, b / c = 3.0
-queries are: a / c = ?, b / a = ?, a / e = ?, a / a = ?, x / x = ?
-return: [6.0, 0.5, -1.0, 1.0, -1.0 ]
-
Valid operators are +, -, *, and /. Each operand may be an integer or another expression.
-
-
Note that division between two integers should truncate toward zero.
-
-
It is guaranteed that the given RPN expression is always valid. That means the expression would always evaluate to a result, and there will not be any division by zero operation.
tokens[i] is either an operator: "+", "-", "*", or "/", or an integer in the range [-200, 200].
-
-
-### Related Topics
- [[Stack](../../tag/stack/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Math](../../tag/math/README.md)]
-
-### Similar Questions
- 1. [Basic Calculator](../basic-calculator) (Hard)
- 1. [Expression Add Operators](../expression-add-operators) (Hard)
diff --git a/problems/evaluate-reverse-polish-notation/evaluate_reverse_polish_notation.go b/problems/evaluate-reverse-polish-notation/evaluate_reverse_polish_notation.go
deleted file mode 100644
index e86fba761..000000000
--- a/problems/evaluate-reverse-polish-notation/evaluate_reverse_polish_notation.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem150
diff --git a/problems/evaluate-reverse-polish-notation/evaluate_reverse_polish_notation_test.go b/problems/evaluate-reverse-polish-notation/evaluate_reverse_polish_notation_test.go
deleted file mode 100644
index e86fba761..000000000
--- a/problems/evaluate-reverse-polish-notation/evaluate_reverse_polish_notation_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem150
diff --git a/problems/evaluate-the-bracket-pairs-of-a-string/README.md b/problems/evaluate-the-bracket-pairs-of-a-string/README.md
deleted file mode 100644
index dc2c9de26..000000000
--- a/problems/evaluate-the-bracket-pairs-of-a-string/README.md
+++ /dev/null
@@ -1,92 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-number-of-operations-to-reinitialize-a-permutation "Minimum Number of Operations to Reinitialize a Permutation")
-
-[Next >](../maximize-number-of-nice-divisors "Maximize Number of Nice Divisors")
-
-## [1807. Evaluate the Bracket Pairs of a String (Medium)](https://leetcode.com/problems/evaluate-the-bracket-pairs-of-a-string "替换字符串中的括号内容")
-
-
You are given a string s that contains some bracket pairs, with each pair containing a non-empty key.
-
-
-
For example, in the string "(name)is(age)yearsold", there are two bracket pairs that contain the keys "name" and "age".
-
-
-
You know the values of a wide range of keys. This is represented by a 2D string array knowledge where each knowledge[i] = [keyi, valuei] indicates that key keyi has a value of valuei.
-
-
You are tasked to evaluate all of the bracket pairs. When you evaluate a bracket pair that contains some key keyi, you will:
-
-
-
Replace keyi and the bracket pair with the key's corresponding valuei.
-
If you do not know the value of the key, you will replace keyi and the bracket pair with a question mark "?" (without the quotation marks).
-
-
-
Each key will appear at most once in your knowledge. There will not be any nested brackets in s.
-
-
Return the resulting string after evaluating all of the bracket pairs.
-
-
-
Example 1:
-
-
-Input: s = "(name)is(age)yearsold", knowledge = [["name","bob"],["age","two"]]
-Output: "bobistwoyearsold"
-Explanation:
-The key "name" has a value of "bob", so replace "(name)" with "bob".
-The key "age" has a value of "two", so replace "(age)" with "two".
-
-
-
Example 2:
-
-
-Input: s = "hi(name)", knowledge = [["a","b"]]
-Output: "hi?"
-Explanation: As you do not know the value of the key "name", replace "(name)" with "?".
-
-
-
Example 3:
-
-
-Input: s = "(a)(a)(a)aaa", knowledge = [["a","yes"]]
-Output: "yesyesyesaaa"
-Explanation: The same key can appear multiple times.
-The key "a" has a value of "yes", so replace all occurrences of "(a)" with "yes".
-Notice that the "a"s not in a bracket pair are not evaluated.
-
-
-
-
Constraints:
-
-
-
1 <= s.length <= 105
-
0 <= knowledge.length <= 105
-
knowledge[i].length == 2
-
1 <= keyi.length, valuei.length <= 10
-
s consists of lowercase English letters and round brackets '(' and ')'.
-
Every open bracket '(' in s will have a corresponding close bracket ')'.
-
The key in each bracket pair of s will be non-empty.
-
There will not be any nested bracket pairs in s.
-
keyi and valuei consist of lowercase English letters.
-
Each keyi in knowledge is unique.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Hints
-
-Hint 1
-Process pairs from right to left to handle repeats
-
-
-
-Hint 2
-Keep track of the current enclosed string using another string
-
diff --git a/problems/even-odd-tree/README.md b/problems/even-odd-tree/README.md
deleted file mode 100644
index 733b0e483..000000000
--- a/problems/even-odd-tree/README.md
+++ /dev/null
@@ -1,75 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../special-array-with-x-elements-greater-than-or-equal-x "Special Array With X Elements Greater Than or Equal X")
-
-[Next >](../maximum-number-of-visible-points "Maximum Number of Visible Points")
-
-## [1609. Even Odd Tree (Medium)](https://leetcode.com/problems/even-odd-tree "奇偶树")
-
-
A binary tree is named Even-Odd if it meets the following conditions:
-
-
-
The root of the binary tree is at level index 0, its children are at level index 1, their children are at level index 2, etc.
-
For every even-indexed level, all nodes at the level have odd integer values in strictly increasing order (from left to right).
-
For every odd-indexed level, all nodes at the level have even integer values in strictly decreasing order (from left to right).
-
-
-
Given the root of a binary tree, return true if the binary tree is Even-Odd, otherwise return false.
-
-
-
Example 1:
-
-
-Input: root = [1,10,4,3,null,7,9,12,8,6,null,null,2]
-Output: true
-Explanation: The node values on each level are:
-Level 0: [1]
-Level 1: [10,4]
-Level 2: [3,7,9]
-Level 3: [12,8,6,2]
-Since levels 0 and 2 are all odd and increasing and levels 1 and 3 are all even and decreasing, the tree is Even-Odd.
-
-
-
Example 2:
-
-
-Input: root = [5,4,2,3,3,7]
-Output: false
-Explanation: The node values on each level are:
-Level 0: [5]
-Level 1: [4,2]
-Level 2: [3,3,7]
-Node values in level 2 must be in strictly increasing order, so the tree is not Even-Odd.
-
-
-
Example 3:
-
-
-Input: root = [5,9,1,3,5,7]
-Output: false
-Explanation: Node values in the level 1 should be even integers.
-
-
-
-
Constraints:
-
-
-
The number of nodes in the tree is in the range [1, 105].
-
1 <= Node.val <= 106
-
-
-### Related Topics
- [[Tree](../../tag/tree/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Binary Tree](../../tag/binary-tree/README.md)]
-
-### Hints
-
-Hint 1
-Use the breadth-first search to go through all nodes layer by layer.
-
diff --git a/problems/exam-room/README.md b/problems/exam-room/README.md
deleted file mode 100644
index f57444200..000000000
--- a/problems/exam-room/README.md
+++ /dev/null
@@ -1,63 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../k-similar-strings "K-Similar Strings")
-
-[Next >](../score-of-parentheses "Score of Parentheses")
-
-## [855. Exam Room (Medium)](https://leetcode.com/problems/exam-room "考场就座")
-
-
There is an exam room with n seats in a single row labeled from 0 to n - 1.
-
-
When a student enters the room, they must sit in the seat that maximizes the distance to the closest person. If there are multiple such seats, they sit in the seat with the lowest number. If no one is in the room, then the student sits at seat number 0.
-
-
Design a class that simulates the mentioned exam room.
-
-
Implement the ExamRoom class:
-
-
-
ExamRoom(int n) Initializes the object of the exam room with the number of the seats n.
-
int seat() Returns the label of the seat at which the next student will set.
-
void leave(int p) Indicates that the student sitting at seat p will leave the room. It is guaranteed that there will be a student sitting at seat p.
-
-
-
-
Example 1:
-
-
-Input
-["ExamRoom", "seat", "seat", "seat", "seat", "leave", "seat"]
-[[10], [], [], [], [], [4], []]
-Output
-[null, 0, 9, 4, 2, null, 5]
-
-Explanation
-ExamRoom examRoom = new ExamRoom(10);
-examRoom.seat(); // return 0, no one is in the room, then the student sits at seat number 0.
-examRoom.seat(); // return 9, the student sits at the last seat number 9.
-examRoom.seat(); // return 4, the student sits at the last seat number 4.
-examRoom.seat(); // return 2, the student sits at the last seat number 2.
-examRoom.leave(4);
-examRoom.seat(); // return 5, the student sits at the last seat number 5.
-
-
-
-
-
Constraints:
-
-
-
1 <= n <= 109
-
It is guaranteed that there is a student sitting at seat p.
-+-------------+---------+
-| Column Name | Type |
-+-------------+---------+
-| id | int |
-| name | varchar |
-+-------------+---------+
-id is the primary key column for this table.
-Each row of this table indicates the name and the ID of a student.
-id is a continuous increment.
-
-
-
-
-
Write an SQL query to swap the seat id of every two consecutive students. If the number of students is odd, the id of the last student is not swapped.
-
-
Return the result table ordered by idin ascending order.
-
-
The query result format is in the following example.
-
-
-
Example 1:
-
-
-Input:
-Seat table:
-+----+---------+
-| id | student |
-+----+---------+
-| 1 | Abbot |
-| 2 | Doris |
-| 3 | Emerson |
-| 4 | Green |
-| 5 | Jeames |
-+----+---------+
-Output:
-+----+---------+
-| id | student |
-+----+---------+
-| 1 | Doris |
-| 2 | Abbot |
-| 3 | Green |
-| 4 | Emerson |
-| 5 | Jeames |
-+----+---------+
-Explanation:
-Note that if the number of students is odd, there is no need to change the last one's seat.
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/exchange-seats/exchange_seats.sql b/problems/exchange-seats/exchange_seats.sql
deleted file mode 100644
index a1ec3544b..000000000
--- a/problems/exchange-seats/exchange_seats.sql
+++ /dev/null
@@ -1,10 +0,0 @@
-# Write your MySQL query statement below
-
-SELECT
- s1.id,
- COALESCE(s2.student, s1.student) AS student
-FROM
- seat s1
- LEFT JOIN
- seat s2 ON ((s1.id + 1) ^ 1) - 1 = s2.id
-ORDER BY s1.id;
diff --git a/problems/exchange-seats/mysql_schemas.sql b/problems/exchange-seats/mysql_schemas.sql
deleted file mode 100644
index 3c3587aea..000000000
--- a/problems/exchange-seats/mysql_schemas.sql
+++ /dev/null
@@ -1,7 +0,0 @@
-Create table If Not Exists Seat (id int, student varchar(255));
-Truncate table Seat;
-insert into Seat (id, student) values ('1', 'Abbot');
-insert into Seat (id, student) values ('2', 'Doris');
-insert into Seat (id, student) values ('3', 'Emerson');
-insert into Seat (id, student) values ('4', 'Green');
-insert into Seat (id, student) values ('5', 'Jeames');
diff --git a/problems/exclusive-time-of-functions/README.md b/problems/exclusive-time-of-functions/README.md
deleted file mode 100644
index 9c6b4fb4d..000000000
--- a/problems/exclusive-time-of-functions/README.md
+++ /dev/null
@@ -1,94 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../design-log-storage-system "Design Log Storage System")
-
-[Next >](../average-of-levels-in-binary-tree "Average of Levels in Binary Tree")
-
-## [636. Exclusive Time of Functions (Medium)](https://leetcode.com/problems/exclusive-time-of-functions "函数的独占时间")
-
-
On a single-threaded CPU, we execute a program containing n functions. Each function has a unique ID between 0 and n-1.
-
-
Function calls are stored in a call stack: when a function call starts, its ID is pushed onto the stack, and when a function call ends, its ID is popped off the stack. The function whose ID is at the top of the stack is the current function being executed. Each time a function starts or ends, we write a log with the ID, whether it started or ended, and the timestamp.
-
-
You are given a list logs, where logs[i] represents the ith log message formatted as a string "{function_id}:{"start" | "end"}:{timestamp}". For example, "0:start:3" means a function call with function ID 0started at the beginning of timestamp 3, and "1:end:2" means a function call with function ID 1ended at the end of timestamp 2. Note that a function can be called multiple times, possibly recursively.
-
-
A function's exclusive time is the sum of execution times for all function calls in the program. For example, if a function is called twice, one call executing for 2 time units and another call executing for 1 time unit, the exclusive time is 2 + 1 = 3.
-
-
Return the exclusive time of each function in an array, where the value at the ith index represents the exclusive time for the function with ID i.
-
-
-
Example 1:
-
-
-Input: n = 2, logs = ["0:start:0","1:start:2","1:end:5","0:end:6"]
-Output: [3,4]
-Explanation:
-Function 0 starts at the beginning of time 0, then it executes 2 for units of time and reaches the end of time 1.
-Function 1 starts at the beginning of time 2, executes for 4 units of time, and ends at the end of time 5.
-Function 0 resumes execution at the beginning of time 6 and executes for 1 unit of time.
-So function 0 spends 2 + 1 = 3 units of total time executing, and function 1 spends 4 units of total time executing.
-
-
-
Example 2:
-
-
-Input: n = 1, logs = ["0:start:0","0:start:2","0:end:5","0:start:6","0:end:6","0:end:7"]
-Output: [8]
-Explanation:
-Function 0 starts at the beginning of time 0, executes for 2 units of time, and recursively calls itself.
-Function 0 (recursive call) starts at the beginning of time 2 and executes for 4 units of time.
-Function 0 (initial call) resumes execution then immediately calls itself again.
-Function 0 (2nd recursive call) starts at the beginning of time 6 and executes for 1 unit of time.
-Function 0 (initial call) resumes execution at the beginning of time 7 and executes for 1 unit of time.
-So function 0 spends 2 + 4 + 1 + 1 = 8 units of total time executing.
-
-
-
Example 3:
-
-
-Input: n = 2, logs = ["0:start:0","0:start:2","0:end:5","1:start:6","1:end:6","0:end:7"]
-Output: [7,1]
-Explanation:
-Function 0 starts at the beginning of time 0, executes for 2 units of time, and recursively calls itself.
-Function 0 (recursive call) starts at the beginning of time 2 and executes for 4 units of time.
-Function 0 (initial call) resumes execution then immediately calls function 1.
-Function 1 starts at the beginning of time 6, executes 1 units of time, and ends at the end of time 6.
-Function 0 resumes execution at the beginning of time 6 and executes for 2 units of time.
-So function 0 spends 2 + 4 + 1 = 7 units of total time executing, and function 1 spends 1 unit of total time executing.
-
-
-
Example 4:
-
-
-Input: n = 2, logs = ["0:start:0","0:start:2","0:end:5","1:start:7","1:end:7","0:end:8"]
-Output: [8,1]
-
-
-
Example 5:
-
-
-Input: n = 1, logs = ["0:start:0","0:end:0"]
-Output: [1]
-
-
-
-
Constraints:
-
-
-
1 <= n <= 100
-
1 <= logs.length <= 500
-
0 <= function_id < n
-
0 <= timestamp <= 109
-
No two start events will happen at the same timestamp.
-
No two end events will happen at the same timestamp.
-
Each function has an "end" log for each "start" log.
-
-
-### Related Topics
- [[Stack](../../tag/stack/README.md)]
- [[Array](../../tag/array/README.md)]
diff --git a/problems/exclusive-time-of-functions/exclusive_time_of_functions.go b/problems/exclusive-time-of-functions/exclusive_time_of_functions.go
deleted file mode 100644
index b56650067..000000000
--- a/problems/exclusive-time-of-functions/exclusive_time_of_functions.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem636
diff --git a/problems/exclusive-time-of-functions/exclusive_time_of_functions_test.go b/problems/exclusive-time-of-functions/exclusive_time_of_functions_test.go
deleted file mode 100644
index b56650067..000000000
--- a/problems/exclusive-time-of-functions/exclusive_time_of_functions_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem636
diff --git a/problems/execution-of-all-suffix-instructions-staying-in-a-grid/README.md b/problems/execution-of-all-suffix-instructions-staying-in-a-grid/README.md
deleted file mode 100644
index b462fe8ea..000000000
--- a/problems/execution-of-all-suffix-instructions-staying-in-a-grid/README.md
+++ /dev/null
@@ -1,86 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../a-number-after-a-double-reversal "A Number After a Double Reversal")
-
-[Next >](../intervals-between-identical-elements "Intervals Between Identical Elements")
-
-## [2120. Execution of All Suffix Instructions Staying in a Grid (Medium)](https://leetcode.com/problems/execution-of-all-suffix-instructions-staying-in-a-grid "执行所有后缀指令")
-
-
There is an n x n grid, with the top-left cell at (0, 0) and the bottom-right cell at (n - 1, n - 1). You are given the integer n and an integer array startPos where startPos = [startrow, startcol] indicates that a robot is initially at cell (startrow, startcol).
-
-
You are also given a 0-indexed string s of length m where s[i] is the ith instruction for the robot: 'L' (move left), 'R' (move right), 'U' (move up), and 'D' (move down).
-
-
The robot can begin executing from any ith instruction in s. It executes the instructions one by one towards the end of s but it stops if either of these conditions is met:
-
-
-
The next instruction will move the robot off the grid.
-
There are no more instructions left to execute.
-
-
-
Return an arrayanswerof lengthmwhereanswer[i]is the number of instructions the robot can execute if the robot begins executing from theithinstruction ins.
-
-
-
Example 1:
-
-
-Input: n = 3, startPos = [0,1], s = "RRDDLU"
-Output: [1,5,4,3,1,0]
-Explanation: Starting from startPos and beginning execution from the ith instruction:
-- 0th: "RRDDLU". Only one instruction "R" can be executed before it moves off the grid.
-- 1st: "RDDLU". All five instructions can be executed while it stays in the grid and ends at (1, 1).
-- 2nd: "DDLU". All four instructions can be executed while it stays in the grid and ends at (1, 0).
-- 3rd: "DLU". All three instructions can be executed while it stays in the grid and ends at (0, 0).
-- 4th: "LU". Only one instruction "L" can be executed before it moves off the grid.
-- 5th: "U". If moving up, it would move off the grid.
-
-Input: n = 1, startPos = [0,0], s = "LRUD"
-Output: [0,0,0,0]
-Explanation: No matter which instruction the robot begins execution from, it would move off the grid.
-
-
-
-
Constraints:
-
-
-
m == s.length
-
1 <= n, m <= 500
-
startPos.length == 2
-
0 <= startrow, startcol < n
-
s consists of 'L', 'R', 'U', and 'D'.
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
- [[Simulation](../../tag/simulation/README.md)]
-
-### Hints
-
-Hint 1
-The constraints are not very large. Can we simulate the execution by starting from each index of s?
-
-
-
-Hint 2
-Before any of the stopping conditions is met, stop the simulation for that index and set the answer for that index.
-
diff --git a/problems/expression-add-operators/README.md b/problems/expression-add-operators/README.md
deleted file mode 100644
index eadb58d1c..000000000
--- a/problems/expression-add-operators/README.md
+++ /dev/null
@@ -1,111 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../zigzag-iterator "Zigzag Iterator")
-
-[Next >](../move-zeroes "Move Zeroes")
-
-## [282. Expression Add Operators (Hard)](https://leetcode.com/problems/expression-add-operators "给表达式添加运算符")
-
-
Given a string num that contains only digits and an integer target, return all possibilities to insert the binary operators '+', '-', and/or '*' between the digits of num so that the resultant expression evaluates to the target value.
-
-
Note that operands in the returned expressions should not contain leading zeros.
-
-
-
Example 1:
-
-
-Input: num = "123", target = 6
-Output: ["1*2*3","1+2+3"]
-Explanation: Both "1*2*3" and "1+2+3" evaluate to 6.
-
-
-
Example 2:
-
-
-Input: num = "232", target = 8
-Output: ["2*3+2","2+3*2"]
-Explanation: Both "2*3+2" and "2+3*2" evaluate to 8.
-
-
-
Example 3:
-
-
-Input: num = "105", target = 5
-Output: ["1*0+5","10-5"]
-Explanation: Both "1*0+5" and "10-5" evaluate to 5.
-Note that "1-05" is not a valid expression because the 5 has a leading zero.
-
-
-
Example 4:
-
-
-Input: num = "00", target = 0
-Output: ["0*0","0+0","0-0"]
-Explanation: "0*0", "0+0", and "0-0" all evaluate to 0.
-Note that "00" is not a valid expression because the 0 has a leading zero.
-
-
-
Example 5:
-
-
-Input: num = "3456237490", target = 9191
-Output: []
-Explanation: There are no expressions that can be created from "3456237490" to evaluate to 9191.
-
-
-
-
Constraints:
-
-
-
1 <= num.length <= 10
-
num consists of only digits.
-
-231 <= target <= 231 - 1
-
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
- [[String](../../tag/string/README.md)]
- [[Backtracking](../../tag/backtracking/README.md)]
-
-### Similar Questions
- 1. [Evaluate Reverse Polish Notation](../evaluate-reverse-polish-notation) (Medium)
- 1. [Basic Calculator](../basic-calculator) (Hard)
- 1. [Basic Calculator II](../basic-calculator-ii) (Medium)
- 1. [Different Ways to Add Parentheses](../different-ways-to-add-parentheses) (Medium)
- 1. [Target Sum](../target-sum) (Medium)
-
-### Hints
-
-Hint 1
-Note that a number can contain multiple digits.
-
-
-
-Hint 2
-Since the question asks us to find all of the valid expressions, we need a way to iterate over all of them. (Hint: Recursion!)
-
-
-
-Hint 3
-We can keep track of the expression string and evaluate it at the very end. But that would take a lot of time. Can we keep track of the expression's value as well so as to avoid the evaluation at the very end of recursion?
-
-
-
-Hint 4
-Think carefully about the multiply operator. It has a higher precedence than the addition and subtraction operators.
-
- 1 + 2 = 3
-1 + 2 - 4 --> 3 - 4 --> -1
-1 + 2 - 4 * 12 --> -1 * 12 --> -12 (WRONG!)
-1 + 2 - 4 * 12 --> -1 - (-4) + (-4 * 12) --> 3 + (-48) --> -45 (CORRECT!)
-
-
-
-Hint 5
-We simply need to keep track of the last operand in our expression and reverse it's effect on the expression's value while considering the multiply operator.
-
diff --git a/problems/expression-add-operators/expression_add_operators.go b/problems/expression-add-operators/expression_add_operators.go
deleted file mode 100644
index 564a157c7..000000000
--- a/problems/expression-add-operators/expression_add_operators.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem282
diff --git a/problems/expression-add-operators/expression_add_operators_test.go b/problems/expression-add-operators/expression_add_operators_test.go
deleted file mode 100644
index 564a157c7..000000000
--- a/problems/expression-add-operators/expression_add_operators_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem282
diff --git a/problems/expressive-words/README.md b/problems/expressive-words/README.md
deleted file mode 100644
index 9e1612013..000000000
--- a/problems/expressive-words/README.md
+++ /dev/null
@@ -1,61 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../soup-servings "Soup Servings")
-
-[Next >](../chalkboard-xor-game "Chalkboard XOR Game")
-
-## [809. Expressive Words (Medium)](https://leetcode.com/problems/expressive-words "情感丰富的文字")
-
-
Sometimes people repeat letters to represent extra feeling. For example:
-
-
-
"hello" -> "heeellooo"
-
"hi" -> "hiiii"
-
-
-
In these strings like "heeellooo", we have groups of adjacent letters that are all the same: "h", "eee", "ll", "ooo".
-
-
You are given a string s and an array of query strings words. A query word is stretchy if it can be made to be equal to s by any number of applications of the following extension operation: choose a group consisting of characters c, and add some number of characters c to the group so that the size of the group is three or more.
-
-
-
For example, starting with "hello", we could do an extension on the group "o" to get "hellooo", but we cannot get "helloo" since the group "oo" has a size less than three. Also, we could do another extension like "ll" -> "lllll" to get "helllllooo". If s = "helllllooo", then the query word "hello" would be stretchy because of these two extension operations: query = "hello" -> "hellooo" -> "helllllooo" = s.
-
-
-
Return the number of query strings that are stretchy.
-
-
-
Example 1:
-
-
-Input: s = "heeellooo", words = ["hello", "hi", "helo"]
-Output: 1
-Explanation:
-We can extend "e" and "o" in the word "hello" to get "heeellooo".
-We can't extend "helo" to get "heeellooo" because the group "ll" is not size 3 or more.
-
-
-
Example 2:
-
-
-Input: s = "zzzzzyyyyy", words = ["zzyy","zy","zyy"]
-Output: 3
-
Alice and Bob have a different total number of candies. You are given two integer arrays aliceSizes and bobSizes where aliceSizes[i] is the number of candies of the ith box of candy that Alice has and bobSizes[j] is the number of candies of the jth box of candy that Bob has.
-
-
Since they are friends, they would like to exchange one candy box each so that after the exchange, they both have the same total amount of candy. The total amount of candy a person has is the sum of the number of candies in each box they have.
-
-
Return an integer array answer where answer[0] is the number of candies in the box that Alice must exchange, and answer[1] is the number of candies in the box that Bob must exchange. If there are multiple answers, you may return any one of them. It is guaranteed that at least one answer exists.
There are several squares being dropped onto the X-axis of a 2D plane.
-
-
You are given a 2D integer array positions where positions[i] = [lefti, sideLengthi] represents the ith square with a side length of sideLengthi that is dropped with its left edge aligned with X-coordinate lefti.
-
-
Each square is dropped one at a time from a height above any landed squares. It then falls downward (negative Y direction) until it either lands on the top side of another square or on the X-axis. A square brushing the left/right side of another square does not count as landing on it. Once it lands, it freezes in place and cannot be moved.
-
-
After each square is dropped, you must record the height of the current tallest stack of squares.
-
-
Return an integer array ans where ans[i] represents the height described above after dropping the ith square.
-
-
-
Example 1:
-
-
-Input: positions = [[1,2],[2,3],[6,1]]
-Output: [2,5,5]
-Explanation:
-After the first drop, the tallest stack is square 1 with a height of 2.
-After the second drop, the tallest stack is squares 1 and 2 with a height of 5.
-After the third drop, the tallest stack is still squares 1 and 2 with a height of 5.
-Thus, we return an answer of [2, 5, 5].
-
-
-
Example 2:
-
-
-Input: positions = [[100,100],[200,100]]
-Output: [100,100]
-Explanation:
-After the first drop, the tallest stack is square 1 with a height of 100.
-After the second drop, the tallest stack is either square 1 or square 2, both with heights of 100.
-Thus, we return an answer of [100, 100].
-Note that square 2 only brushes the right side of square 1, which does not count as landing on it.
-
-
-
-
Constraints:
-
-
-
1 <= positions.length <= 1000
-
1 <= lefti <= 108
-
1 <= sideLengthi <= 106
-
-
-### Related Topics
- [[Segment Tree](../../tag/segment-tree/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Ordered Set](../../tag/ordered-set/README.md)]
-
-### Similar Questions
- 1. [The Skyline Problem](../the-skyline-problem) (Hard)
-
-### Hints
-
-Hint 1
-If positions = [[10, 20], [20, 30]], this is the same as [[1, 2], [2, 3]]. Currently, the values of positions are very large. Can you generalize this approach so as to make the values in positions manageable?
-
diff --git a/problems/falling-squares/falling_squares.go b/problems/falling-squares/falling_squares.go
deleted file mode 100644
index 8e9da725e..000000000
--- a/problems/falling-squares/falling_squares.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem699
diff --git a/problems/falling-squares/falling_squares_test.go b/problems/falling-squares/falling_squares_test.go
deleted file mode 100644
index 8e9da725e..000000000
--- a/problems/falling-squares/falling_squares_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem699
diff --git a/problems/fancy-sequence/README.md b/problems/fancy-sequence/README.md
deleted file mode 100644
index 93301026d..000000000
--- a/problems/fancy-sequence/README.md
+++ /dev/null
@@ -1,74 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../number-of-sets-of-k-non-overlapping-line-segments "Number of Sets of K Non-Overlapping Line Segments")
-
-[Next >](../all-valid-triplets-that-can-represent-a-country "All Valid Triplets That Can Represent a Country")
-
-## [1622. Fancy Sequence (Hard)](https://leetcode.com/problems/fancy-sequence "奇妙序列")
-
-
Write an API that generates fancy sequences using the append, addAll, and multAll operations.
-
-
Implement the Fancy class:
-
-
-
Fancy() Initializes the object with an empty sequence.
-
void append(val) Appends an integer val to the end of the sequence.
-
void addAll(inc) Increments all existing values in the sequence by an integer inc.
-
void multAll(m) Multiplies all existing values in the sequence by an integer m.
-
int getIndex(idx) Gets the current value at index idx (0-indexed) of the sequence modulo109 + 7. If the index is greater or equal than the length of the sequence, return -1.
At most 105 calls total will be made to append, addAll, multAll, and getIndex.
-
-
-### Related Topics
- [[Design](../../tag/design/README.md)]
- [[Segment Tree](../../tag/segment-tree/README.md)]
- [[Math](../../tag/math/README.md)]
-
-### Hints
-
-Hint 1
-Use two arrays to save the cumulative multipliers at each time point and cumulative sums adjusted by the current multiplier.
-
-
-
-Hint 2
-The function getIndex(idx) ask to the current value modulo 10^9+7. Use modular inverse and both arrays to calculate this value.
-
diff --git a/problems/faulty-sensor/README.md b/problems/faulty-sensor/README.md
deleted file mode 100644
index 6ae59d245..000000000
--- a/problems/faulty-sensor/README.md
+++ /dev/null
@@ -1,34 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../finding-mk-average "Finding MK Average")
-
-[Next >](../minimum-operations-to-make-the-array-increasing "Minimum Operations to Make the Array Increasing")
-
-## [1826. Faulty Sensor (Easy)](https://leetcode.com/problems/faulty-sensor "有缺陷的传感器")
-
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Two Pointers](../../tag/two-pointers/README.md)]
-
-### Hints
-
-Hint 1
-Check for a common prefix of the two arrays.
-
-
-
-Hint 2
-After this common prefix, there should be one array similar to the other but shifted by one.
-
-
-
-Hint 3
-If both arrays can be shifted, return -1.
-
diff --git a/problems/fibonacci-number/README.md b/problems/fibonacci-number/README.md
deleted file mode 100644
index 1f3969905..000000000
--- a/problems/fibonacci-number/README.md
+++ /dev/null
@@ -1,64 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../most-frequent-subtree-sum "Most Frequent Subtree Sum")
-
-[Next >](../inorder-successor-in-bst-ii "Inorder Successor in BST II")
-
-## [509. Fibonacci Number (Easy)](https://leetcode.com/problems/fibonacci-number "斐波那契数")
-
-
The Fibonacci numbers, commonly denoted F(n) form a sequence, called the Fibonacci sequence, such that each number is the sum of the two preceding ones, starting from 0 and 1. That is,
-
-
-F(0) = 0, F(1) = 1
-F(n) = F(n - 1) + F(n - 2), for n > 1.
-
You are given an array books where books[i] = [thicknessi, heighti] indicates the thickness and height of the ith book. You are also given an integer shelfWidth.
-
-
We want to place these books in order onto bookcase shelves that have a total width shelfWidth.
-
-
We choose some of the books to place on this shelf such that the sum of their thickness is less than or equal to shelfWidth, then build another level of the shelf of the bookcase so that the total height of the bookcase has increased by the maximum height of the books we just put down. We repeat this process until there are no more books to place.
-
-
Note that at each step of the above process, the order of the books we place is the same order as the given sequence of books.
-
-
-
For example, if we have an ordered list of 5 books, we might place the first and second book onto the first shelf, the third book on the second shelf, and the fourth and fifth book on the last shelf.
-
-
-
Return the minimum possible height that the total bookshelf can be after placing shelves in this manner.
-
-
-
Example 1:
-
-
-Input: books = [[1,1],[2,3],[2,3],[1,1],[1,1],[1,1],[1,2]], shelf_width = 4
-Output: 6
-Explanation:
-The sum of the heights of the 3 shelves is 1 + 3 + 2 = 6.
-Notice that book number 2 does not have to be on the first shelf.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Hints
-
-Hint 1
-Use dynamic programming: dp(i) will be the answer to the problem for books[i:].
-
diff --git a/problems/filling-bookcase-shelves/filling_bookcase_shelves.go b/problems/filling-bookcase-shelves/filling_bookcase_shelves.go
deleted file mode 100644
index c9bce891f..000000000
--- a/problems/filling-bookcase-shelves/filling_bookcase_shelves.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem1105
diff --git a/problems/filter-restaurants-by-vegan-friendly-price-and-distance/README.md b/problems/filter-restaurants-by-vegan-friendly-price-and-distance/README.md
deleted file mode 100644
index 8f334288f..000000000
--- a/problems/filter-restaurants-by-vegan-friendly-price-and-distance/README.md
+++ /dev/null
@@ -1,71 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../remove-palindromic-subsequences "Remove Palindromic Subsequences")
-
-[Next >](../find-the-city-with-the-smallest-number-of-neighbors-at-a-threshold-distance "Find the City With the Smallest Number of Neighbors at a Threshold Distance")
-
-## [1333. Filter Restaurants by Vegan-Friendly, Price and Distance (Medium)](https://leetcode.com/problems/filter-restaurants-by-vegan-friendly-price-and-distance "餐厅过滤器")
-
-
Given the array restaurants where restaurants[i] = [idi, ratingi, veganFriendlyi, pricei, distancei]. You have to filter the restaurants using three filters.
-
-
The veganFriendly filter will be either true (meaning you should only include restaurants with veganFriendlyi set to true) or false (meaning you can include any restaurant). In addition, you have the filters maxPrice and maxDistance which are the maximum value for price and distance of restaurants you should consider respectively.
-
-
Return the array of restaurant IDs after filtering, ordered by rating from highest to lowest. For restaurants with the same rating, order them by id from highest to lowest. For simplicity veganFriendlyi and veganFriendly take value 1 when it is true, and 0 when it is false.
-Input: restaurants = [[1,4,1,40,10],[2,8,0,50,5],[3,8,1,30,4],[4,10,0,10,3],[5,1,1,15,1]], veganFriendly = 0, maxPrice = 50, maxDistance = 10
-Output: [4,3,2,1,5]
-Explanation: The restaurants are the same as in example 1, but in this case the filter veganFriendly = 0, therefore all restaurants are considered.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Hints
-
-Hint 1
-Do the filtering and sort as said. Note that the id may not be the index in the array.
-
diff --git a/problems/final-prices-with-a-special-discount-in-a-shop/README.md b/problems/final-prices-with-a-special-discount-in-a-shop/README.md
deleted file mode 100644
index 7c6538477..000000000
--- a/problems/final-prices-with-a-special-discount-in-a-shop/README.md
+++ /dev/null
@@ -1,63 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../delete-n-nodes-after-m-nodes-of-a-linked-list "Delete N Nodes After M Nodes of a Linked List")
-
-[Next >](../subrectangle-queries "Subrectangle Queries")
-
-## [1475. Final Prices With a Special Discount in a Shop (Easy)](https://leetcode.com/problems/final-prices-with-a-special-discount-in-a-shop "商品折扣后的最终价格")
-
-
Given the array prices where prices[i] is the price of the ith item in a shop. There is a special discount for items in the shop, if you buy the ith item, then you will receive a discount equivalent to prices[j] where j is the minimum index such that j > i and prices[j] <= prices[i], otherwise, you will not receive any discount at all.
-
-
Return an array where the ith element is the final price you will pay for the ith item of the shop considering the special discount.
-
-
-
Example 1:
-
-
-Input: prices = [8,4,6,2,3]
-Output: [4,2,4,2,3]
-Explanation:
-For item 0 with price[0]=8 you will receive a discount equivalent to prices[1]=4, therefore, the final price you will pay is 8 - 4 = 4.
-For item 1 with price[1]=4 you will receive a discount equivalent to prices[3]=2, therefore, the final price you will pay is 4 - 2 = 2.
-For item 2 with price[2]=6 you will receive a discount equivalent to prices[3]=2, therefore, the final price you will pay is 6 - 2 = 4.
-For items 3 and 4 you will not receive any discount at all.
-
-
-
Example 2:
-
-
-Input: prices = [1,2,3,4,5]
-Output: [1,2,3,4,5]
-Explanation: In this case, for all items, you will not receive any discount at all.
-
-
-
Example 3:
-
-
-Input: prices = [10,1,1,6]
-Output: [9,0,1,6]
-
-
-
-
Constraints:
-
-
-
1 <= prices.length <= 500
-
1 <= prices[i] <= 10^3
-
-
-### Related Topics
- [[Stack](../../tag/stack/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Monotonic Stack](../../tag/monotonic-stack/README.md)]
-
-### Hints
-
-Hint 1
-Use brute force: For the ith item in the shop with a loop find the first position j satisfying the conditions and apply the discount, otherwise, the discount is 0.
-
diff --git a/problems/final-value-of-variable-after-performing-operations/README.md b/problems/final-value-of-variable-after-performing-operations/README.md
deleted file mode 100644
index acb1477c9..000000000
--- a/problems/final-value-of-variable-after-performing-operations/README.md
+++ /dev/null
@@ -1,85 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../the-number-of-seniors-and-juniors-to-join-the-company-ii "The Number of Seniors and Juniors to Join the Company II")
-
-[Next >](../sum-of-beauty-in-the-array "Sum of Beauty in the Array")
-
-## [2011. Final Value of Variable After Performing Operations (Easy)](https://leetcode.com/problems/final-value-of-variable-after-performing-operations "执行操作后的变量值")
-
-
There is a programming language with only four operations and one variable X:
-
-
-
++X and X++increments the value of the variable X by 1.
-
--X and X--decrements the value of the variable X by 1.
-
-
-
Initially, the value of X is 0.
-
-
Given an array of strings operations containing a list of operations, return the final value of Xafter performing all the operations.
-
-
-
Example 1:
-
-
-Input: operations = ["--X","X++","X++"]
-Output: 1
-Explanation: The operations are performed as follows:
-Initially, X = 0.
---X: X is decremented by 1, X = 0 - 1 = -1.
-X++: X is incremented by 1, X = -1 + 1 = 0.
-X++: X is incremented by 1, X = 0 + 1 = 1.
-
-
-
Example 2:
-
-
-Input: operations = ["++X","++X","X++"]
-Output: 3
-Explanation: The operations are performed as follows:
-Initially, X = 0.
-++X: X is incremented by 1, X = 0 + 1 = 1.
-++X: X is incremented by 1, X = 1 + 1 = 2.
-X++: X is incremented by 1, X = 2 + 1 = 3.
-
-
-
Example 3:
-
-
-Input: operations = ["X++","++X","--X","X--"]
-Output: 0
-Explanation: The operations are performed as follows:
-Initially, X = 0.
-X++: X is incremented by 1, X = 0 + 1 = 1.
-++X: X is incremented by 1, X = 1 + 1 = 2.
---X: X is decremented by 1, X = 2 - 1 = 1.
-X--: X is decremented by 1, X = 1 - 1 = 0.
-
-
-
-
Constraints:
-
-
-
1 <= operations.length <= 100
-
operations[i] will be either "++X", "X++", "--X", or "X--".
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[String](../../tag/string/README.md)]
- [[Simulation](../../tag/simulation/README.md)]
-
-### Hints
-
-Hint 1
-There are only two operations to keep track of.
-
-
-
-Hint 2
-Use a variable to store the value after each operation.
-
diff --git a/problems/find-a-corresponding-node-of-a-binary-tree-in-a-clone-of-that-tree/README.md b/problems/find-a-corresponding-node-of-a-binary-tree-in-a-clone-of-that-tree/README.md
deleted file mode 100644
index 66b06bfd1..000000000
--- a/problems/find-a-corresponding-node-of-a-binary-tree-in-a-clone-of-that-tree/README.md
+++ /dev/null
@@ -1,61 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../replace-employee-id-with-the-unique-identifier "Replace Employee ID With The Unique Identifier")
-
-[Next >](../lucky-numbers-in-a-matrix "Lucky Numbers in a Matrix")
-
-## [1379. Find a Corresponding Node of a Binary Tree in a Clone of That Tree (Medium)](https://leetcode.com/problems/find-a-corresponding-node-of-a-binary-tree-in-a-clone-of-that-tree "找出克隆二叉树中的相同节点")
-
-
Given two binary trees original and cloned and given a reference to a node target in the original tree.
-
-
The cloned tree is a copy of the original tree.
-
-
Return a reference to the same node in the cloned tree.
-
-
Note that you are not allowed to change any of the two trees or the target node and the answer must be a reference to a node in the cloned tree.
-
-
-
Example 1:
-
-
-Input: tree = [7,4,3,null,null,6,19], target = 3
-Output: 3
-Explanation: In all examples the original and cloned trees are shown. The target node is a green node from the original tree. The answer is the yellow node from the cloned tree.
-
-
-
Example 2:
-
-
-Input: tree = [7], target = 7
-Output: 7
-
-
-
Example 3:
-
-
-Input: tree = [8,null,6,null,5,null,4,null,3,null,2,null,1], target = 4
-Output: 4
-
-
-
-
Constraints:
-
-
-
The number of nodes in the tree is in the range [1, 104].
-
The values of the nodes of the tree are unique.
-
target node is a node from the original tree and is not null.
-
-
-
-
Follow up: Could you solve the problem if repeated values on the tree are allowed?
-
-### Related Topics
- [[Tree](../../tag/tree/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Binary Tree](../../tag/binary-tree/README.md)]
diff --git a/problems/find-a-peak-element-ii/README.md b/problems/find-a-peak-element-ii/README.md
deleted file mode 100644
index c47255627..000000000
--- a/problems/find-a-peak-element-ii/README.md
+++ /dev/null
@@ -1,92 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../the-earliest-and-latest-rounds-where-players-compete "The Earliest and Latest Rounds Where Players Compete")
-
-[Next >](../depth-of-bst-given-insertion-order "Depth of BST Given Insertion Order")
-
-## [1901. Find a Peak Element II (Medium)](https://leetcode.com/problems/find-a-peak-element-ii "找出顶峰元素 II")
-
-
A peak element in a 2D grid is an element that is strictly greater than all of its adjacent neighbors to the left, right, top, and bottom.
-
-
Given a 0-indexedm x n matrix mat where no two adjacent cells are equal, find any peak element mat[i][j] and return the length 2 array [i,j].
-
-
You may assume that the entire matrix is surrounded by an outer perimeter with the value -1 in each cell.
-
-
You must write an algorithm that runs in O(m log(n)) or O(n log(m)) time.
-
-
-
Example 1:
-
-
-
-
-Input: mat = [[1,4],[3,2]]
-Output: [0,1]
-Explanation: Both 3 and 4 are peak elements so [1,0] and [0,1] are both acceptable answers.
-
-
-
Example 2:
-
-
-
-
-Input: mat = [[10,20,15],[21,30,14],[7,16,32]]
-Output: [1,1]
-Explanation: Both 30 and 32 are peak elements so [1,1] and [2,2] are both acceptable answers.
-
-
-
-
Constraints:
-
-
-
m == mat.length
-
n == mat[i].length
-
1 <= m, n <= 500
-
1 <= mat[i][j] <= 105
-
No two adjacent cells are equal.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
- [[Divide and Conquer](../../tag/divide-and-conquer/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
-
-### Similar Questions
- 1. [Find Peak Element](../find-peak-element) (Medium)
-
-### Hints
-
-Hint 1
-Let's assume that the width of the array is bigger than the height, otherwise, we will split in another direction.
-
-
-
-Hint 2
-Split the array into three parts: central column left side and right side.
-
-
-
-Hint 3
-Go through the central column and two neighbor columns and look for maximum.
-
-
-
-Hint 4
-If it's in the central column - this is our peak.
-
-
-
-Hint 5
-If it's on the left side, run this algorithm on subarray left_side + central_column.
-
-
-
-Hint 6
-If it's on the right side, run this algorithm on subarray right_side + central_column
-
diff --git a/problems/find-a-value-of-a-mysterious-function-closest-to-target/README.md b/problems/find-a-value-of-a-mysterious-function-closest-to-target/README.md
deleted file mode 100644
index bf5dc8ff7..000000000
--- a/problems/find-a-value-of-a-mysterious-function-closest-to-target/README.md
+++ /dev/null
@@ -1,70 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-number-of-non-overlapping-substrings "Maximum Number of Non-Overlapping Substrings")
-
-[Next >](../diameter-of-n-ary-tree "Diameter of N-Ary Tree")
-
-## [1521. Find a Value of a Mysterious Function Closest to Target (Hard)](https://leetcode.com/problems/find-a-value-of-a-mysterious-function-closest-to-target "找到最接近目标值的函数值")
-
-
-
-
Winston was given the above mysterious function func. He has an integer array arr and an integer target and he wants to find the values l and r that make the value |func(arr, l, r) - target| minimum possible.
-
-
Return the minimum possible value of |func(arr, l, r) - target|.
-
-
Notice that func should be called with the values l and r where 0 <= l, r < arr.length.
-
-
-
Example 1:
-
-
-Input: arr = [9,12,3,7,15], target = 5
-Output: 2
-Explanation: Calling func with all the pairs of [l,r] = [[0,0],[1,1],[2,2],[3,3],[4,4],[0,1],[1,2],[2,3],[3,4],[0,2],[1,3],[2,4],[0,3],[1,4],[0,4]], Winston got the following results [9,12,3,7,15,8,0,3,7,0,0,3,0,0,0]. The value closest to 5 is 7 and 3, thus the minimum difference is 2.
-
-
-
Example 2:
-
-
-Input: arr = [1000000,1000000,1000000], target = 1
-Output: 999999
-Explanation: Winston called the func with all possible values of [l,r] and he always got 1000000, thus the min difference is 999999.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
- [[Bit Manipulation](../../tag/bit-manipulation/README.md)]
- [[Segment Tree](../../tag/segment-tree/README.md)]
-
-### Hints
-
-Hint 1
-If the and value of sub-array arr[i...j] is ≥ the and value of the sub-array arr[i...j+1].
-
-
-
-Hint 2
-For each index i using binary search or ternary search find the index j where |target - AND(arr[i...j])| is minimum, minimize this value with the global answer.
-
diff --git a/problems/find-all-anagrams-in-a-string/README.md b/problems/find-all-anagrams-in-a-string/README.md
deleted file mode 100644
index d9ea68ed6..000000000
--- a/problems/find-all-anagrams-in-a-string/README.md
+++ /dev/null
@@ -1,55 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../path-sum-iii "Path Sum III")
-
-[Next >](../ternary-expression-parser "Ternary Expression Parser")
-
-## [438. Find All Anagrams in a String (Medium)](https://leetcode.com/problems/find-all-anagrams-in-a-string "找到字符串中所有字母异位词")
-
-
Given two strings s and p, return an array of all the start indices of p's anagrams in s. You may return the answer in any order.
-
-
An Anagram is a word or phrase formed by rearranging the letters of a different word or phrase, typically using all the original letters exactly once.
-
-
-
Example 1:
-
-
-Input: s = "cbaebabacd", p = "abc"
-Output: [0,6]
-Explanation:
-The substring with start index = 0 is "cba", which is an anagram of "abc".
-The substring with start index = 6 is "bac", which is an anagram of "abc".
-
-
-
Example 2:
-
-
-Input: s = "abab", p = "ab"
-Output: [0,1,2]
-Explanation:
-The substring with start index = 0 is "ab", which is an anagram of "ab".
-The substring with start index = 1 is "ba", which is an anagram of "ab".
-The substring with start index = 2 is "ab", which is an anagram of "ab".
-
Given an integer array nums of length n where all the integers of nums are in the range [1, n] and each integer appears once or twice, return an array of all the integers that appears twice.
-
-
You must write an algorithm that runs in O(n) time and uses only constant extra space.
-
-
-
Example 1:
-
Input: nums = [4,3,2,7,8,2,3,1]
-Output: [2,3]
-
Example 2:
-
Input: nums = [1,1,2]
-Output: [1]
-
Example 3:
-
Input: nums = [1]
-Output: []
-
-
-
Constraints:
-
-
-
n == nums.length
-
1 <= n <= 105
-
1 <= nums[i] <= n
-
Each element in nums appears once or twice.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
-
-### Similar Questions
- 1. [Find All Numbers Disappeared in an Array](../find-all-numbers-disappeared-in-an-array) (Easy)
diff --git a/problems/find-all-duplicates-in-an-array/find_all_duplicates_in_an_array.go b/problems/find-all-duplicates-in-an-array/find_all_duplicates_in_an_array.go
deleted file mode 100644
index 52d52ebbf..000000000
--- a/problems/find-all-duplicates-in-an-array/find_all_duplicates_in_an_array.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem442
diff --git a/problems/find-all-duplicates-in-an-array/find_all_duplicates_in_an_array_test.go b/problems/find-all-duplicates-in-an-array/find_all_duplicates_in_an_array_test.go
deleted file mode 100644
index 52d52ebbf..000000000
--- a/problems/find-all-duplicates-in-an-array/find_all_duplicates_in_an_array_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem442
diff --git a/problems/find-all-good-strings/README.md b/problems/find-all-good-strings/README.md
deleted file mode 100644
index 266e3884f..000000000
--- a/problems/find-all-good-strings/README.md
+++ /dev/null
@@ -1,68 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../design-underground-system "Design Underground System")
-
-[Next >](../customers-who-bought-products-a-and-b-but-not-c "Customers Who Bought Products A and B but Not C")
-
-## [1397. Find All Good Strings (Hard)](https://leetcode.com/problems/find-all-good-strings "找到所有好字符串")
-
-
Given the strings s1 and s2 of size n and the string evil, return the number of good strings.
-
-
A good string has size n, it is alphabetically greater than or equal to s1, it is alphabetically smaller than or equal to s2, and it does not contain the string evil as a substring. Since the answer can be a huge number, return this modulo109 + 7.
-
-
-
Example 1:
-
-
-Input: n = 2, s1 = "aa", s2 = "da", evil = "b"
-Output: 51
-Explanation: There are 25 good strings starting with 'a': "aa","ac","ad",...,"az". Then there are 25 good strings starting with 'c': "ca","cc","cd",...,"cz" and finally there is one good string starting with 'd': "da".
-
-
-
Example 2:
-
-
-Input: n = 8, s1 = "leetcode", s2 = "leetgoes", evil = "leet"
-Output: 0
-Explanation: All strings greater than or equal to s1 and smaller than or equal to s2 start with the prefix "leet", therefore, there is not any good string.
-
-
-
Example 3:
-
-
-Input: n = 2, s1 = "gx", s2 = "gz", evil = "x"
-Output: 2
-
-
-
-
Constraints:
-
-
-
s1.length == n
-
s2.length == n
-
s1 <= s2
-
1 <= n <= 500
-
1 <= evil.length <= 50
-
All strings consist of lowercase English letters.
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[String Matching](../../tag/string-matching/README.md)]
-
-### Hints
-
-Hint 1
-Use DP with 4 states (pos: Int, posEvil: Int, equalToS1: Bool, equalToS2: Bool) which compute the number of valid strings of size "pos" where the maximum common suffix with string "evil" has size "posEvil". When "equalToS1" is "true", the current valid string is equal to "S1" otherwise it is greater. In a similar way when equalToS2 is "true" the current valid string is equal to "S2" otherwise it is smaller.
-
-
-
-Hint 2
-To update the maximum common suffix with string "evil" use KMP preprocessing.
-
diff --git a/problems/find-all-groups-of-farmland/README.md b/problems/find-all-groups-of-farmland/README.md
deleted file mode 100644
index f3390da7d..000000000
--- a/problems/find-all-groups-of-farmland/README.md
+++ /dev/null
@@ -1,82 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../find-the-middle-index-in-array "Find the Middle Index in Array")
-
-[Next >](../operations-on-tree "Operations on Tree")
-
-## [1992. Find All Groups of Farmland (Medium)](https://leetcode.com/problems/find-all-groups-of-farmland "找到所有的农场组")
-
-
You are given a 0-indexedm x n binary matrix land where a 0 represents a hectare of forested land and a 1 represents a hectare of farmland.
-
-
To keep the land organized, there are designated rectangular areas of hectares that consist entirely of farmland. These rectangular areas are called groups. No two groups are adjacent, meaning farmland in one group is not four-directionally adjacent to another farmland in a different group.
-
-
land can be represented by a coordinate system where the top left corner of land is (0, 0) and the bottom right corner of land is (m-1, n-1). Find the coordinates of the top left and bottom right corner of each group of farmland. A group of farmland with a top left corner at (r1, c1) and a bottom right corner at (r2, c2) is represented by the 4-length array [r1, c1, r2, c2].
-
-
Return a 2D array containing the 4-length arrays described above for each group of farmland in land. If there are no groups of farmland, return an empty array. You may return the answer in any order.
-
-
-
Example 1:
-
-
-Input: land = [[1,0,0],[0,1,1],[0,1,1]]
-Output: [[0,0,0,0],[1,1,2,2]]
-Explanation:
-The first group has a top left corner at land[0][0] and a bottom right corner at land[0][0].
-The second group has a top left corner at land[1][1] and a bottom right corner at land[2][2].
-
-
-
Example 2:
-
-
-Input: land = [[1,1],[1,1]]
-Output: [[0,0,1,1]]
-Explanation:
-The first group has a top left corner at land[0][0] and a bottom right corner at land[1][1].
-
-
-
Example 3:
-
-
-Input: land = [[0]]
-Output: []
-Explanation:
-There are no groups of farmland.
-
-
-
-
Constraints:
-
-
-
m == land.length
-
n == land[i].length
-
1 <= m, n <= 300
-
land consists of only 0's and 1's.
-
Groups of farmland are rectangular in shape.
-
-
-### Related Topics
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
-
-### Hints
-
-Hint 1
-Since every group of farmland is rectangular, the top left corner of each group will have the smallest x-coordinate and y-coordinate of any farmland in the group.
-
-
-
-Hint 2
-Similarly, the bootm right corner of each group will have the largest x-coordinate and y-coordinate of any farmland in the group.
-
-
-
-Hint 3
-Use DFS to traverse through different groups of farmlands and keep track of the smallest and largest x-coordinate and y-coordinates you have seen in each group.
-
diff --git a/problems/find-all-lonely-numbers-in-the-array/README.md b/problems/find-all-lonely-numbers-in-the-array/README.md
deleted file mode 100644
index 3ab667e3d..000000000
--- a/problems/find-all-lonely-numbers-in-the-array/README.md
+++ /dev/null
@@ -1,67 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../rearrange-array-elements-by-sign "Rearrange Array Elements by Sign")
-
-[Next >](../maximum-good-people-based-on-statements "Maximum Good People Based on Statements")
-
-## [2150. Find All Lonely Numbers in the Array (Medium)](https://leetcode.com/problems/find-all-lonely-numbers-in-the-array "找出数组中的所有孤独数字")
-
-
You are given an integer array nums. A number x is lonely when it appears only once, and no adjacent numbers (i.e. x + 1 and x - 1) appear in the array.
-
-
Return all lonely numbers in nums. You may return the answer in any order.
-
-
-
Example 1:
-
-
-Input: nums = [10,6,5,8]
-Output: [10,8]
-Explanation:
-- 10 is a lonely number since it appears exactly once and 9 and 11 does not appear in nums.
-- 8 is a lonely number since it appears exactly once and 7 and 9 does not appear in nums.
-- 5 is not a lonely number since 6 appears in nums and vice versa.
-Hence, the lonely numbers in nums are [10, 8].
-Note that [8, 10] may also be returned.
-
-
-
Example 2:
-
-
-Input: nums = [1,3,5,3]
-Output: [1,5]
-Explanation:
-- 1 is a lonely number since it appears exactly once and 0 and 2 does not appear in nums.
-- 5 is a lonely number since it appears exactly once and 4 and 6 does not appear in nums.
-- 3 is not a lonely number since it appears twice.
-Hence, the lonely numbers in nums are [1, 5].
-Note that [5, 1] may also be returned.
-
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 105
-
0 <= nums[i] <= 106
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Counting](../../tag/counting/README.md)]
-
-### Hints
-
-Hint 1
-For a given element x, how can you quickly check if x - 1 and x + 1 are present in the array without reiterating through the entire array?
-
-
-
-Hint 2
-Use a set or a hash map.
-
diff --git a/problems/find-all-numbers-disappeared-in-an-array/README.md b/problems/find-all-numbers-disappeared-in-an-array/README.md
deleted file mode 100644
index c05834526..000000000
--- a/problems/find-all-numbers-disappeared-in-an-array/README.md
+++ /dev/null
@@ -1,58 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../number-of-boomerangs "Number of Boomerangs")
-
-[Next >](../serialize-and-deserialize-bst "Serialize and Deserialize BST")
-
-## [448. Find All Numbers Disappeared in an Array (Easy)](https://leetcode.com/problems/find-all-numbers-disappeared-in-an-array "找到所有数组中消失的数字")
-
-
Given an array nums of n integers where nums[i] is in the range [1, n], return an array of all the integers in the range[1, n]that do not appear innums.
-
-
-
Example 1:
-
Input: nums = [4,3,2,7,8,2,3,1]
-Output: [5,6]
-
Example 2:
-
Input: nums = [1,1]
-Output: [2]
-
-
-
Constraints:
-
-
-
n == nums.length
-
1 <= n <= 105
-
1 <= nums[i] <= n
-
-
-
-
Follow up: Could you do it without extra space and in O(n) runtime? You may assume the returned list does not count as extra space.
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
-
-### Similar Questions
- 1. [First Missing Positive](../first-missing-positive) (Hard)
- 1. [Find All Duplicates in an Array](../find-all-duplicates-in-an-array) (Medium)
-
-### Hints
-
-Hint 1
-This is a really easy problem if you decide to use additional memory. For those trying to write an initial solution using additional memory, think counters!
-
-
-
-Hint 2
-However, the trick really is to not use any additional space than what is already available to use. Sometimes, multiple passes over the input array help find the solution. However, there's an interesting piece of information in this problem that makes it easy to re-use the input array itself for the solution.
-
-
-
-Hint 3
-The problem specifies that the numbers in the array will be in the range [1, n] where n is the number of elements in the array. Can we use this information and modify the array in-place somehow to find what we need?
-
diff --git a/problems/find-all-numbers-disappeared-in-an-array/find_all_numbers_disappeared_in_an_array.go b/problems/find-all-numbers-disappeared-in-an-array/find_all_numbers_disappeared_in_an_array.go
deleted file mode 100644
index 44a7c54e6..000000000
--- a/problems/find-all-numbers-disappeared-in-an-array/find_all_numbers_disappeared_in_an_array.go
+++ /dev/null
@@ -1,16 +0,0 @@
-package problem448
-
-func findDisappearedNumbers(nums []int) []int {
- max, count := len(nums), 0
- s := make([]bool, max)
- for _, v := range nums {
- s[v-1] = true
- }
- for i := 1; i <= max; i++ {
- if !s[i-1] {
- nums[count] = i
- count++
- }
- }
- return nums[:count]
-}
diff --git a/problems/find-all-numbers-disappeared-in-an-array/find_all_numbers_disappeared_in_an_array_test.go b/problems/find-all-numbers-disappeared-in-an-array/find_all_numbers_disappeared_in_an_array_test.go
deleted file mode 100644
index 14d09516c..000000000
--- a/problems/find-all-numbers-disappeared-in-an-array/find_all_numbers_disappeared_in_an_array_test.go
+++ /dev/null
@@ -1,34 +0,0 @@
-package problem448
-
-import (
- "reflect"
- "testing"
-)
-
-type testType struct {
- in []int
- want []int
-}
-
-func TestFindDisappearedNumbers(t *testing.T) {
- tests := [...]testType{
- {
- in: []int{4, 3, 2, 7, 8, 2, 3, 1},
- want: []int{5, 6},
- },
- {
- in: []int{5, 4, 2, 3, 1},
- want: []int{},
- },
- {
- in: []int{1, 1},
- want: []int{2},
- },
- }
- for _, tt := range tests {
- got := findDisappearedNumbers(tt.in)
- if !reflect.DeepEqual(got, tt.want) {
- t.Fatalf("in: %v, got: %v, want: %v", tt.in, got, tt.want)
- }
- }
-}
diff --git a/problems/find-all-people-with-secret/README.md b/problems/find-all-people-with-secret/README.md
deleted file mode 100644
index 0ff67d5f5..000000000
--- a/problems/find-all-people-with-secret/README.md
+++ /dev/null
@@ -1,95 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../removing-minimum-and-maximum-from-array "Removing Minimum and Maximum From Array")
-
-[Next >](../minimum-cost-to-reach-city-with-discounts "Minimum Cost to Reach City With Discounts")
-
-## [2092. Find All People With Secret (Hard)](https://leetcode.com/problems/find-all-people-with-secret "找出知晓秘密的所有专家")
-
-
You are given an integer n indicating there are n people numbered from 0 to n - 1. You are also given a 0-indexed 2D integer array meetings where meetings[i] = [xi, yi, timei] indicates that person xi and person yi have a meeting at timei. A person may attend multiple meetings at the same time. Finally, you are given an integer firstPerson.
-
-
Person 0 has a secret and initially shares the secret with a person firstPerson at time 0. This secret is then shared every time a meeting takes place with a person that has the secret. More formally, for every meeting, if a person xi has the secret at timei, then they will share the secret with person yi, and vice versa.
-
-
The secrets are shared instantaneously. That is, a person may receive the secret and share it with people in other meetings within the same time frame.
-
-
Return a list of all the people that have the secret after all the meetings have taken place. You may return the answer in any order.
-
-
-
Example 1:
-
-
-Input: n = 6, meetings = [[1,2,5],[2,3,8],[1,5,10]], firstPerson = 1
-Output: [0,1,2,3,5]
-Explanation:
-At time 0, person 0 shares the secret with person 1.
-At time 5, person 1 shares the secret with person 2.
-At time 8, person 2 shares the secret with person 3.
-At time 10, person 1 shares the secret with person 5.
-Thus, people 0, 1, 2, 3, and 5 know the secret after all the meetings.
-
-
-
Example 2:
-
-
-Input: n = 4, meetings = [[3,1,3],[1,2,2],[0,3,3]], firstPerson = 3
-Output: [0,1,3]
-Explanation:
-At time 0, person 0 shares the secret with person 3.
-At time 2, neither person 1 nor person 2 know the secret.
-At time 3, person 3 shares the secret with person 0 and person 1.
-Thus, people 0, 1, and 3 know the secret after all the meetings.
-
-
-
Example 3:
-
-
-Input: n = 5, meetings = [[3,4,2],[1,2,1],[2,3,1]], firstPerson = 1
-Output: [0,1,2,3,4]
-Explanation:
-At time 0, person 0 shares the secret with person 1.
-At time 1, person 1 shares the secret with person 2, and person 2 shares the secret with person 3.
-Note that person 2 can share the secret at the same time as receiving it.
-At time 2, person 3 shares the secret with person 4.
-Thus, people 0, 1, 2, 3, and 4 know the secret after all the meetings.
-
-
-
-
Constraints:
-
-
-
2 <= n <= 105
-
1 <= meetings.length <= 105
-
meetings[i].length == 3
-
0 <= xi, yi <= n - 1
-
xi != yi
-
1 <= timei <= 105
-
1 <= firstPerson <= n - 1
-
-
-### Related Topics
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Union Find](../../tag/union-find/README.md)]
- [[Graph](../../tag/graph/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Hints
-
-Hint 1
-Could you model all the meetings happening at the same time as a graph?
-
-
-
-Hint 2
-What data structure can you use to efficiently share the secret?
-
-
-
-Hint 3
-You can use the union-find data structure to quickly determine who knows the secret and share the secret.
-
diff --git a/problems/find-all-possible-recipes-from-given-supplies/README.md b/problems/find-all-possible-recipes-from-given-supplies/README.md
deleted file mode 100644
index a2dc609d4..000000000
--- a/problems/find-all-possible-recipes-from-given-supplies/README.md
+++ /dev/null
@@ -1,82 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-number-of-words-found-in-sentences "Maximum Number of Words Found in Sentences")
-
-[Next >](../check-if-a-parentheses-string-can-be-valid "Check if a Parentheses String Can Be Valid")
-
-## [2115. Find All Possible Recipes from Given Supplies (Medium)](https://leetcode.com/problems/find-all-possible-recipes-from-given-supplies "从给定原材料中找到所有可以做出的菜")
-
-
You have information about n different recipes. You are given a string array recipes and a 2D string array ingredients. The ith recipe has the name recipes[i], and you can create it if you have all the needed ingredients from ingredients[i]. Ingredients to a recipe may need to be created from other recipes, i.e., ingredients[i] may contain a string that is in recipes.
-
-
You are also given a string array supplies containing all the ingredients that you initially have, and you have an infinite supply of all of them.
-
-
Return a list of all the recipes that you can create. You may return the answer in any order.
-
-
Note that two recipes may contain each other in their ingredients.
-
-
-
Example 1:
-
-
-Input: recipes = ["bread"], ingredients = [["yeast","flour"]], supplies = ["yeast","flour","corn"]
-Output: ["bread"]
-Explanation:
-We can create "bread" since we have the ingredients "yeast" and "flour".
-
-
-
Example 2:
-
-
-Input: recipes = ["bread","sandwich"], ingredients = [["yeast","flour"],["bread","meat"]], supplies = ["yeast","flour","meat"]
-Output: ["bread","sandwich"]
-Explanation:
-We can create "bread" since we have the ingredients "yeast" and "flour".
-We can create "sandwich" since we have the ingredient "meat" and can create the ingredient "bread".
-
-
-
Example 3:
-
-
-Input: recipes = ["bread","sandwich","burger"], ingredients = [["yeast","flour"],["bread","meat"],["sandwich","meat","bread"]], supplies = ["yeast","flour","meat"]
-Output: ["bread","sandwich","burger"]
-Explanation:
-We can create "bread" since we have the ingredients "yeast" and "flour".
-We can create "sandwich" since we have the ingredient "meat" and can create the ingredient "bread".
-We can create "burger" since we have the ingredient "meat" and can create the ingredients "bread" and "sandwich".
-
recipes[i], ingredients[i][j], and supplies[k] consist only of lowercase English letters.
-
All the values of recipes and supplies combined are unique.
-
Each ingredients[i] does not contain any duplicate values.
-
-
-### Related Topics
- [[Graph](../../tag/graph/README.md)]
- [[Topological Sort](../../tag/topological-sort/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Hints
-
-Hint 1
-Can we use a data structure to quickly query whether we have a certain ingredient?
-
-
-
-Hint 2
-Once we verify that we can make a recipe, we can add it to our ingredient data structure. We can then check if we can make more recipes as a result of this.
-
diff --git a/problems/find-all-the-lonely-nodes/README.md b/problems/find-all-the-lonely-nodes/README.md
deleted file mode 100644
index d7b5cec33..000000000
--- a/problems/find-all-the-lonely-nodes/README.md
+++ /dev/null
@@ -1,35 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../calculate-salaries "Calculate Salaries")
-
-[Next >](../shuffle-the-array "Shuffle the Array")
-
-## [1469. Find All The Lonely Nodes (Easy)](https://leetcode.com/problems/find-all-the-lonely-nodes "寻找所有的独生节点")
-
-
-
-### Related Topics
- [[Tree](../../tag/tree/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Binary Tree](../../tag/binary-tree/README.md)]
-
-### Similar Questions
- 1. [Binary Tree Tilt](../binary-tree-tilt) (Easy)
- 1. [Univalued Binary Tree](../univalued-binary-tree) (Easy)
-
-### Hints
-
-Hint 1
-Do a simple tree traversal, try to check if the current node is lonely or not.
-
-
-
-Hint 2
-Node is lonely if at least one of the left/right pointers is null.
-
diff --git a/problems/find-anagram-mappings/README.md b/problems/find-anagram-mappings/README.md
deleted file mode 100644
index b6077c62e..000000000
--- a/problems/find-anagram-mappings/README.md
+++ /dev/null
@@ -1,51 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../employee-free-time "Employee Free Time")
-
-[Next >](../special-binary-string "Special Binary String")
-
-## [760. Find Anagram Mappings (Easy)](https://leetcode.com/problems/find-anagram-mappings "找出变位映射")
-
-
-Given two lists Aand B, and B is an anagram of A. B is an anagram of A means B is made by randomizing the order of the elements in A.
-
-We want to find an index mappingP, from A to B. A mapping P[i] = j means the ith element in A appears in B at index j.
-
-These lists A and B may contain duplicates. If there are multiple answers, output any of them.
-
-as P[0] = 1 because the 0th element of A appears at B[1],
-and P[1] = 4 because the 1st element of A appears at B[4],
-and so on.
-
-
-
Note:
-
A, B have equal lengths in range [1, 100].
-
A[i], B[i] are integers in range [0, 10^5].
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
-
-### Hints
-
-Hint 1
-Create a hashmap so that D[x] = i whenever B[i] = x. Then, the answer is [D[x] for x in A].
-
diff --git a/problems/find-anagram-mappings/find_anagram_mappings.go b/problems/find-anagram-mappings/find_anagram_mappings.go
deleted file mode 100644
index f7889cb75..000000000
--- a/problems/find-anagram-mappings/find_anagram_mappings.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem760
diff --git a/problems/find-anagram-mappings/find_anagram_mappings_test.go b/problems/find-anagram-mappings/find_anagram_mappings_test.go
deleted file mode 100644
index f7889cb75..000000000
--- a/problems/find-anagram-mappings/find_anagram_mappings_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem760
diff --git a/problems/find-and-replace-in-string/README.md b/problems/find-and-replace-in-string/README.md
deleted file mode 100644
index 1d762c099..000000000
--- a/problems/find-and-replace-in-string/README.md
+++ /dev/null
@@ -1,73 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../flipping-an-image "Flipping an Image")
-
-[Next >](../sum-of-distances-in-tree "Sum of Distances in Tree")
-
-## [833. Find And Replace in String (Medium)](https://leetcode.com/problems/find-and-replace-in-string "字符串中的查找与替换")
-
-
You are given a 0-indexed string s that you must perform k replacement operations on. The replacement operations are given as three 0-indexed parallel arrays, indices, sources, and targets, all of length k.
-
-
To complete the ith replacement operation:
-
-
-
Check if the substringsources[i] occurs at index indices[i] in the original strings.
-
If it does not occur, do nothing.
-
Otherwise if it does occur, replace that substring with targets[i].
-
-
-
For example, if s = "abcd", indices[i] = 0, sources[i] = "ab", and targets[i] = "eee", then the result of this replacement will be "eeecd".
-
-
All replacement operations must occur simultaneously, meaning the replacement operations should not affect the indexing of each other. The testcases will be generated such that the replacements will not overlap.
-
-
-
For example, a testcase with s = "abc", indices = [0, 1], and sources = ["ab","bc"] will not be generated because the "ab" and "bc" replacements overlap.
-
-
-
Return the resulting string after performing all replacement operations on s.
-
-
A substring is a contiguous sequence of characters in a string.
-
-
-
Example 1:
-
-
-Input: s = "abcd", indices = [0, 2], sources = ["a", "cd"], targets = ["eee", "ffff"]
-Output: "eeebffff"
-Explanation:
-"a" occurs at index 0 in s, so we replace it with "eee".
-"cd" occurs at index 2 in s, so we replace it with "ffff".
-
-
-
Example 2:
-
-
-Input: s = "abcd", indices = [0, 2], sources = ["ab","ec"], targets = ["eee","ffff"]
-Output: "eeecd"
-Explanation:
-"ab" occurs at index 0 in s, so we replace it with "eee".
-"ec" does not occur at index 2 in s, so we do nothing.
-
-
-
-
Constraints:
-
-
-
1 <= s.length <= 1000
-
k == indices.length == sources.length == targets.length
-
1 <= k <= 100
-
0 <= indexes[i] < s.length
-
1 <= sources[i].length, targets[i].length <= 50
-
s consists of only lowercase English letters.
-
sources[i] and targets[i] consist of only lowercase English letters.
Given a list of strings words and a string pattern, return a list ofwords[i]that matchpattern. You may return the answer in any order.
-
-
A word matches the pattern if there exists a permutation of letters p so that after replacing every letter x in the pattern with p(x), we get the desired word.
-
-
Recall that a permutation of letters is a bijection from letters to letters: every letter maps to another letter, and no two letters map to the same letter.
-
-
-
Example 1:
-
-
-Input: words = ["abc","deq","mee","aqq","dkd","ccc"], pattern = "abb"
-Output: ["mee","aqq"]
-Explanation: "mee" matches the pattern because there is a permutation {a -> m, b -> e, ...}.
-"ccc" does not match the pattern because {a -> c, b -> c, ...} is not a permutation, since a and b map to the same letter.
-
-
-
Example 2:
-
-
-Input: words = ["a","b","c"], pattern = "a"
-Output: ["a","b","c"]
-
-
-
-
Constraints:
-
-
-
1 <= pattern.length <= 20
-
1 <= words.length <= 50
-
words[i].length == pattern.length
-
pattern and words[i] are lowercase English letters.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
diff --git a/problems/find-and-replace-pattern/find_and_replace_pattern.go b/problems/find-and-replace-pattern/find_and_replace_pattern.go
deleted file mode 100644
index df944bcaf..000000000
--- a/problems/find-and-replace-pattern/find_and_replace_pattern.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem890
diff --git a/problems/find-and-replace-pattern/find_and_replace_pattern_test.go b/problems/find-and-replace-pattern/find_and_replace_pattern_test.go
deleted file mode 100644
index df944bcaf..000000000
--- a/problems/find-and-replace-pattern/find_and_replace_pattern_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem890
diff --git a/problems/find-array-given-subset-sums/README.md b/problems/find-array-given-subset-sums/README.md
deleted file mode 100644
index 70ed5cc1f..000000000
--- a/problems/find-array-given-subset-sums/README.md
+++ /dev/null
@@ -1,78 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimize-the-difference-between-target-and-chosen-elements "Minimize the Difference Between Target and Chosen Elements")
-
-[Next >](../widest-pair-of-indices-with-equal-range-sum "Widest Pair of Indices With Equal Range Sum")
-
-## [1982. Find Array Given Subset Sums (Hard)](https://leetcode.com/problems/find-array-given-subset-sums "从子集的和还原数组")
-
-
You are given an integer n representing the length of an unknown array that you are trying to recover. You are also given an array sums containing the values of all 2nsubset sums of the unknown array (in no particular order).
-
-
Return the array ans of length n representing the unknown array. If multiple answers exist, return any of them.
-
-
An array sub is a subset of an array arr if sub can be obtained from arr by deleting some (possibly zero or all) elements of arr. The sum of the elements in sub is one possible subset sum of arr. The sum of an empty array is considered to be 0.
-
-
Note: Test cases are generated such that there will always be at least one correct answer.
-
-
-
Example 1:
-
-
-Input: n = 3, sums = [-3,-2,-1,0,0,1,2,3]
-Output: [1,2,-3]
-Explanation: [1,2,-3] is able to achieve the given subset sums:
-- []: sum is 0
-- [1]: sum is 1
-- [2]: sum is 2
-- [1,2]: sum is 3
-- [-3]: sum is -3
-- [1,-3]: sum is -2
-- [2,-3]: sum is -1
-- [1,2,-3]: sum is 0
-Note that any permutation of [1,2,-3] and also any permutation of [-1,-2,3] will also be accepted.
-
-
-
Example 2:
-
-
-Input: n = 2, sums = [0,0,0,0]
-Output: [0,0]
-Explanation: The only correct answer is [0,0].
-
-
-
Example 3:
-
-
-Input: n = 4, sums = [0,0,5,5,4,-1,4,9,9,-1,4,3,4,8,3,8]
-Output: [0,-1,4,5]
-Explanation: [0,-1,4,5] is able to achieve the given subset sums.
-
-
-
-
Constraints:
-
-
-
1 <= n <= 15
-
sums.length == 2n
-
-104 <= sums[i] <= 104
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Divide and Conquer](../../tag/divide-and-conquer/README.md)]
-
-### Hints
-
-Hint 1
-What information do the two largest elements tell us?
-
-
-
-Hint 2
-Can we use recursion to check all possible states?
-
diff --git a/problems/find-bottom-left-tree-value/README.md b/problems/find-bottom-left-tree-value/README.md
deleted file mode 100644
index 0bddae477..000000000
--- a/problems/find-bottom-left-tree-value/README.md
+++ /dev/null
@@ -1,43 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../game-play-analysis-ii "Game Play Analysis II")
-
-[Next >](../freedom-trail "Freedom Trail")
-
-## [513. Find Bottom Left Tree Value (Medium)](https://leetcode.com/problems/find-bottom-left-tree-value "找树左下角的值")
-
-
Given the root of a binary tree, return the leftmost value in the last row of the tree.
The number of nodes in the tree is in the range [1, 104].
-
-231 <= Node.val <= 231 - 1
-
-
-### Related Topics
- [[Tree](../../tag/tree/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Binary Tree](../../tag/binary-tree/README.md)]
diff --git a/problems/find-bottom-left-tree-value/find_bottom_left_tree_value.go b/problems/find-bottom-left-tree-value/find_bottom_left_tree_value.go
deleted file mode 100644
index 1052b9c03..000000000
--- a/problems/find-bottom-left-tree-value/find_bottom_left_tree_value.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem513
diff --git a/problems/find-bottom-left-tree-value/find_bottom_left_tree_value_test.go b/problems/find-bottom-left-tree-value/find_bottom_left_tree_value_test.go
deleted file mode 100644
index 1052b9c03..000000000
--- a/problems/find-bottom-left-tree-value/find_bottom_left_tree_value_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem513
diff --git a/problems/find-center-of-star-graph/README.md b/problems/find-center-of-star-graph/README.md
deleted file mode 100644
index 62c53fe1e..000000000
--- a/problems/find-center-of-star-graph/README.md
+++ /dev/null
@@ -1,63 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../check-if-one-string-swap-can-make-strings-equal "Check if One String Swap Can Make Strings Equal")
-
-[Next >](../maximum-average-pass-ratio "Maximum Average Pass Ratio")
-
-## [1791. Find Center of Star Graph (Easy)](https://leetcode.com/problems/find-center-of-star-graph "找出星型图的中心节点")
-
-
There is an undirected star graph consisting of n nodes labeled from 1 to n. A star graph is a graph where there is one center node and exactlyn - 1 edges that connect the center node with every other node.
-
-
You are given a 2D integer array edges where each edges[i] = [ui, vi] indicates that there is an edge between the nodes ui and vi. Return the center of the given star graph.
-
-
-
Example 1:
-
-
-Input: edges = [[1,2],[2,3],[4,2]]
-Output: 2
-Explanation: As shown in the figure above, node 2 is connected to every other node, so 2 is the center.
-
-
-### Related Topics
- [[Graph](../../tag/graph/README.md)]
-
-### Hints
-
-Hint 1
-The center is the only node that has more than one edge.
-
-
-
-Hint 2
-The center is also connected to all other nodes.
-
-
-
-Hint 3
-Any two edges must have a common node, which is the center.
-
diff --git a/problems/find-common-characters/README.md b/problems/find-common-characters/README.md
deleted file mode 100644
index 67afcca85..000000000
--- a/problems/find-common-characters/README.md
+++ /dev/null
@@ -1,39 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../grid-illumination "Grid Illumination")
-
-[Next >](../check-if-word-is-valid-after-substitutions "Check If Word Is Valid After Substitutions")
-
-## [1002. Find Common Characters (Easy)](https://leetcode.com/problems/find-common-characters "查找常用字符")
-
-
Given a string array words, return an array of all characters that show up in all strings within the words (including duplicates). You may return the answer in any order.
-
-
-
Example 1:
-
Input: words = ["bella","label","roller"]
-Output: ["e","l","l"]
-
Example 2:
-
Input: words = ["cool","lock","cook"]
-Output: ["c","o"]
-
-
-
Constraints:
-
-
-
1 <= words.length <= 100
-
1 <= words[i].length <= 100
-
words[i] consists of lowercase English letters.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Similar Questions
- 1. [Intersection of Two Arrays II](../intersection-of-two-arrays-ii) (Easy)
diff --git a/problems/find-common-characters/find_common_characters.go b/problems/find-common-characters/find_common_characters.go
deleted file mode 100644
index 468ed7a6d..000000000
--- a/problems/find-common-characters/find_common_characters.go
+++ /dev/null
@@ -1,29 +0,0 @@
-package problem1002
-
-import "fmt"
-
-func commonChars(A []string) []string {
- ans, m, l := make([]string, 0), make([][26]int, len(A)), len(A)
- for i, str := range A {
- for _, c := range str {
- m[i][c-'a']++
- }
- }
- for i, c := range m[0] {
- for c > 0 {
- c--
- for j := 1; j < l; j++ {
- if m[j][i] > 0 {
- m[j][i]--
- } else {
- c = -1
- break
- }
- }
- if c >= 0 {
- ans = append(ans, fmt.Sprintf("%c", i+'a'))
- }
- }
- }
- return ans
-}
diff --git a/problems/find-common-characters/find_common_characters_test.go b/problems/find-common-characters/find_common_characters_test.go
deleted file mode 100644
index 09ce43df3..000000000
--- a/problems/find-common-characters/find_common_characters_test.go
+++ /dev/null
@@ -1,30 +0,0 @@
-package problem1002
-
-import (
- "reflect"
- "testing"
-)
-
-type testType struct {
- in []string
- want []string
-}
-
-func TestCommonChars(t *testing.T) {
- tests := [...]testType{
- {
- in: []string{"bella", "label", "roller"},
- want: []string{"e", "l", "l"},
- },
- {
- in: []string{"cool", "lock", "cook"},
- want: []string{"c", "o"},
- },
- }
- for _, tt := range tests {
- got := commonChars(tt.in)
- if !reflect.DeepEqual(got, tt.want) {
- t.Fatalf("in: %v, got: %v, want: %v", tt.in, got, tt.want)
- }
- }
-}
diff --git a/problems/find-critical-and-pseudo-critical-edges-in-minimum-spanning-tree/README.md b/problems/find-critical-and-pseudo-critical-edges-in-minimum-spanning-tree/README.md
deleted file mode 100644
index 01117621a..000000000
--- a/problems/find-critical-and-pseudo-critical-edges-in-minimum-spanning-tree/README.md
+++ /dev/null
@@ -1,83 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../avoid-flood-in-the-city "Avoid Flood in The City")
-
-[Next >](../clone-n-ary-tree "Clone N-ary Tree")
-
-## [1489. Find Critical and Pseudo-Critical Edges in Minimum Spanning Tree (Hard)](https://leetcode.com/problems/find-critical-and-pseudo-critical-edges-in-minimum-spanning-tree "找到最小生成树里的关键边和伪关键边")
-
-
Given a weighted undirected connected graph with n vertices numbered from 0 to n - 1, and an array edges where edges[i] = [ai, bi, weighti] represents a bidirectional and weighted edge between nodes ai and bi. A minimum spanning tree (MST) is a subset of the graph's edges that connects all vertices without cycles and with the minimum possible total edge weight.
-
-
Find all the critical and pseudo-critical edges in the given graph's minimum spanning tree (MST). An MST edge whose deletion from the graph would cause the MST weight to increase is called a critical edge. On the other hand, a pseudo-critical edge is that which can appear in some MSTs but not all.
-
-
Note that you can return the indices of the edges in any order.
-
-
-
Example 1:
-
-
-
-
-Input: n = 5, edges = [[0,1,1],[1,2,1],[2,3,2],[0,3,2],[0,4,3],[3,4,3],[1,4,6]]
-Output: [[0,1],[2,3,4,5]]
-Explanation: The figure above describes the graph.
-The following figure shows all the possible MSTs:
-
-Notice that the two edges 0 and 1 appear in all MSTs, therefore they are critical edges, so we return them in the first list of the output.
-The edges 2, 3, 4, and 5 are only part of some MSTs, therefore they are considered pseudo-critical edges. We add them to the second list of the output.
-
-
-
Example 2:
-
-
-
-
-Input: n = 4, edges = [[0,1,1],[1,2,1],[2,3,1],[0,3,1]]
-Output: [[],[0,1,2,3]]
-Explanation: We can observe that since all 4 edges have equal weight, choosing any 3 edges from the given 4 will yield an MST. Therefore all 4 edges are pseudo-critical.
-
-
-
-
Constraints:
-
-
-
2 <= n <= 100
-
1 <= edges.length <= min(200, n * (n - 1) / 2)
-
edges[i].length == 3
-
0 <= ai < bi < n
-
1 <= weighti <= 1000
-
All pairs (ai, bi) are distinct.
-
-
-### Related Topics
- [[Union Find](../../tag/union-find/README.md)]
- [[Graph](../../tag/graph/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
- [[Minimum Spanning Tree](../../tag/minimum-spanning-tree/README.md)]
- [[Strongly Connected Component](../../tag/strongly-connected-component/README.md)]
-
-### Hints
-
-Hint 1
-Use the Kruskal algorithm to find the minimum spanning tree by sorting the edges and picking edges from ones with smaller weights.
-
-
-
-Hint 2
-Use a disjoint set to avoid adding redundant edges that result in a cycle.
-
-
-
-Hint 3
-To find if one edge is critical, delete that edge and re-run the MST algorithm and see if the weight of the new MST increases.
-
-
-
-Hint 4
-To find if one edge is non-critical (in any MST), include that edge to the accepted edge list and continue the MST algorithm, then see if the resulting MST has the same weight of the initial MST of the entire graph.
-
diff --git a/problems/find-cumulative-salary-of-an-employee/README.md b/problems/find-cumulative-salary-of-an-employee/README.md
deleted file mode 100644
index 58c172bf3..000000000
--- a/problems/find-cumulative-salary-of-an-employee/README.md
+++ /dev/null
@@ -1,101 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../get-highest-answer-rate-question "Get Highest Answer Rate Question")
-
-[Next >](../count-student-number-in-departments "Count Student Number in Departments")
-
-## [579. Find Cumulative Salary of an Employee (Hard)](https://leetcode.com/problems/find-cumulative-salary-of-an-employee "查询员工的累计薪水")
-
-
The Employee table holds the salary information in a year.
-
-
Write a SQL to get the cumulative sum of an employee's salary over a period of 3 months but exclude the most recent month.
-
-
The result should be displayed by 'Id' ascending, and then by 'Month' descending.
Employee '1' has 3 salary records for the following 3 months except the most recent month '4': salary 40 for month '3', 30 for month '2' and 20 for month '1'
-So the cumulative sum of salary of this employee over 3 months is 90(40+30+20), 50(30+20) and 20 respectively.
-Employ '3' has two salary records except its most recent pay month '4': month '3' with 60 and month '2' with 40. So the cumulative salary is as following.
-
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
-
-### Hints
-
-Hint 1
-Seem hard at first glance? Try to divide this problem into some sub-problems.
-Think about how to calculate the cumulative sum of one employee, how to get the cumulative sum for many employees, and how to except the most recent month of the result.
-
-
-
-Hint 2
-Use the technique of self-join if you have only one table but to write a complex query.
-
-
-
-Hint 3
-Still remember how to use the function `sum` and `max`?
-
diff --git a/problems/find-cumulative-salary-of-an-employee/find_cumulative_salary_of_an_employee.sql b/problems/find-cumulative-salary-of-an-employee/find_cumulative_salary_of_an_employee.sql
deleted file mode 100644
index bae62cf19..000000000
--- a/problems/find-cumulative-salary-of-an-employee/find_cumulative_salary_of_an_employee.sql
+++ /dev/null
@@ -1 +0,0 @@
-# Write your MySQL query statement below
diff --git a/problems/find-cumulative-salary-of-an-employee/mysql_schemas.sql b/problems/find-cumulative-salary-of-an-employee/mysql_schemas.sql
deleted file mode 100644
index c5a0ea410..000000000
--- a/problems/find-cumulative-salary-of-an-employee/mysql_schemas.sql
+++ /dev/null
@@ -1,13 +0,0 @@
-Create table If Not Exists Employee (Id int, Month int, Salary int);
-Truncate table Employee;
-insert into Employee (Id, Month, Salary) values ('1', '1', '20');
-insert into Employee (Id, Month, Salary) values ('2', '1', '20');
-insert into Employee (Id, Month, Salary) values ('1', '2', '30');
-insert into Employee (Id, Month, Salary) values ('2', '2', '30');
-insert into Employee (Id, Month, Salary) values ('3', '2', '40');
-insert into Employee (Id, Month, Salary) values ('1', '3', '40');
-insert into Employee (Id, Month, Salary) values ('3', '3', '60');
-insert into Employee (Id, Month, Salary) values ('1', '4', '60');
-insert into Employee (Id, Month, Salary) values ('3', '4', '70');
-insert into Employee (Id, Month, Salary) values ('1', '7', '90');
-insert into Employee (Id, Month, Salary) values ('1', '8', '90');
diff --git a/problems/find-customer-referee/README.md b/problems/find-customer-referee/README.md
deleted file mode 100644
index 1a32fee64..000000000
--- a/problems/find-customer-referee/README.md
+++ /dev/null
@@ -1,51 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../delete-operation-for-two-strings "Delete Operation for Two Strings")
-
-[Next >](../investments-in-2016 "Investments in 2016")
-
-## [584. Find Customer Referee (Easy)](https://leetcode.com/problems/find-customer-referee "寻找用户推荐人")
-
-
Given a table customer holding customers information and the referee.
-
-
-+------+------+-----------+
-| id | name | referee_id|
-+------+------+-----------+
-| 1 | Will | NULL |
-| 2 | Jane | NULL |
-| 3 | Alex | 2 |
-| 4 | Bill | NULL |
-| 5 | Zack | 1 |
-| 6 | Mark | 2 |
-+------+------+-----------+
-
-
-
Write a query to return the list of customers NOT referred by the person with id '2'.
-
-
For the sample data above, the result is:
-
-
-+------+
-| name |
-+------+
-| Will |
-| Jane |
-| Bill |
-| Zack |
-+------+
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
-
-### Hints
-
-Hint 1
-Be careful of the NULL value
-
diff --git a/problems/find-customer-referee/find_customer_referee.sql b/problems/find-customer-referee/find_customer_referee.sql
deleted file mode 100644
index bae62cf19..000000000
--- a/problems/find-customer-referee/find_customer_referee.sql
+++ /dev/null
@@ -1 +0,0 @@
-# Write your MySQL query statement below
diff --git a/problems/find-customer-referee/mysql_schemas.sql b/problems/find-customer-referee/mysql_schemas.sql
deleted file mode 100644
index 77f4671ec..000000000
--- a/problems/find-customer-referee/mysql_schemas.sql
+++ /dev/null
@@ -1,8 +0,0 @@
-Create table If Not Exists Customer (id int, name varchar(25), referee_id int);
-Truncate table Customer;
-insert into Customer (id, name, referee_id) values ('1', 'Will', 'None');
-insert into Customer (id, name, referee_id) values ('2', 'Jane', 'None');
-insert into Customer (id, name, referee_id) values ('3', 'Alex', '2');
-insert into Customer (id, name, referee_id) values ('4', 'Bill', 'None');
-insert into Customer (id, name, referee_id) values ('5', 'Zack', '1');
-insert into Customer (id, name, referee_id) values ('6', 'Mark', '2');
diff --git a/problems/find-customers-with-positive-revenue-this-year/README.md b/problems/find-customers-with-positive-revenue-this-year/README.md
deleted file mode 100644
index aff999682..000000000
--- a/problems/find-customers-with-positive-revenue-this-year/README.md
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-number-of-accepted-invitations "Maximum Number of Accepted Invitations")
-
-[Next >](../sign-of-the-product-of-an-array "Sign of the Product of an Array")
-
-## [1821. Find Customers With Positive Revenue this Year (Easy)](https://leetcode.com/problems/find-customers-with-positive-revenue-this-year "寻找今年具有正收入的客户")
-
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/find-customers-with-positive-revenue-this-year/mysql_schemas.sql b/problems/find-customers-with-positive-revenue-this-year/mysql_schemas.sql
deleted file mode 100644
index 3f9c8999d..000000000
--- a/problems/find-customers-with-positive-revenue-this-year/mysql_schemas.sql
+++ /dev/null
@@ -1,9 +0,0 @@
-Create table If Not Exists Customers (customer_id int, year int, revenue int);
-Truncate table Customers;
-insert into Customers (customer_id, year, revenue) values ('1', '2018', '50');
-insert into Customers (customer_id, year, revenue) values ('1', '2021', '30');
-insert into Customers (customer_id, year, revenue) values ('1', '2020', '70');
-insert into Customers (customer_id, year, revenue) values ('2', '2021', '-50');
-insert into Customers (customer_id, year, revenue) values ('3', '2018', '10');
-insert into Customers (customer_id, year, revenue) values ('3', '2016', '50');
-insert into Customers (customer_id, year, revenue) values ('4', '2021', '20');
diff --git a/problems/find-cutoff-score-for-each-school/README.md b/problems/find-cutoff-score-for-each-school/README.md
deleted file mode 100644
index 81a12ad5a..000000000
--- a/problems/find-cutoff-score-for-each-school/README.md
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../number-of-unique-good-subsequences "Number of Unique Good Subsequences")
-
-[Next >](../maximum-number-of-people-that-can-be-caught-in-tag "Maximum Number of People That Can Be Caught in Tag")
-
-## [1988. Find Cutoff Score for Each School (Medium)](https://leetcode.com/problems/find-cutoff-score-for-each-school "找出每所学校的最低分数要求")
-
-
diff --git a/problems/find-cutoff-score-for-each-school/mysql_schemas.sql b/problems/find-cutoff-score-for-each-school/mysql_schemas.sql
deleted file mode 100644
index 451883127..000000000
--- a/problems/find-cutoff-score-for-each-school/mysql_schemas.sql
+++ /dev/null
@@ -1,13 +0,0 @@
-Create table If Not Exists Schools (school_id int, capacity int);
-Create table If Not Exists Exam (score int, student_count int);
-Truncate table Schools;
-insert into Schools (school_id, capacity) values ('11', '151');
-insert into Schools (school_id, capacity) values ('5', '48');
-insert into Schools (school_id, capacity) values ('9', '9');
-insert into Schools (school_id, capacity) values ('10', '99');
-Truncate table Exam;
-insert into Exam (score, student_count) values ('975', '10');
-insert into Exam (score, student_count) values ('966', '60');
-insert into Exam (score, student_count) values ('844', '76');
-insert into Exam (score, student_count) values ('749', '76');
-insert into Exam (score, student_count) values ('744', '100');
diff --git a/problems/find-distance-in-a-binary-tree/README.md b/problems/find-distance-in-a-binary-tree/README.md
deleted file mode 100644
index 3daa4c20d..000000000
--- a/problems/find-distance-in-a-binary-tree/README.md
+++ /dev/null
@@ -1,32 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../building-boxes "Building Boxes")
-
-[Next >](../find-total-time-spent-by-each-employee "Find Total Time Spent by Each Employee")
-
-## [1740. Find Distance in a Binary Tree (Medium)](https://leetcode.com/problems/find-distance-in-a-binary-tree "找到二叉树中的距离")
-
-
-
-### Related Topics
- [[Tree](../../tag/tree/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Binary Tree](../../tag/binary-tree/README.md)]
-
-### Hints
-
-Hint 1
-Get the LCA of p and q.
-
-
-
-Hint 2
-The answer is the sum of distances between p-LCA and q-LCA
-
diff --git a/problems/find-duplicate-file-in-system/README.md b/problems/find-duplicate-file-in-system/README.md
deleted file mode 100644
index 2fddd47a6..000000000
--- a/problems/find-duplicate-file-in-system/README.md
+++ /dev/null
@@ -1,69 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../tree-node "Tree Node")
-
-[Next >](../triangle-judgement "Triangle Judgement")
-
-## [609. Find Duplicate File in System (Medium)](https://leetcode.com/problems/find-duplicate-file-in-system "在系统中查找重复文件")
-
-
Given a list paths of directory info, including the directory path, and all the files with contents in this directory, return all the duplicate files in the file system in terms of their paths. You may return the answer in any order.
-
-
A group of duplicate files consists of at least two files that have the same content.
-
-
A single directory info string in the input list has the following format:
It means there are n files (f1.txt, f2.txt ... fn.txt) with content (f1_content, f2_content ... fn_content) respectively in the directory "root/d1/d2/.../dm". Note that n >= 1 and m >= 0. If m = 0, it means the directory is just the root directory.
-
-
The output is a list of groups of duplicate file paths. For each group, it contains all the file paths of the files that have the same content. A file path is a string that has the following format:
The height of the binary tree is less than or equal to 20
-
The total number of nodes is between [1, 104]
-
Total calls of find() is between [1, 104]
-
0 <= target <= 106
-
-
-### Related Topics
- [[Tree](../../tag/tree/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Design](../../tag/design/README.md)]
- [[Binary Tree](../../tag/binary-tree/README.md)]
-
-### Hints
-
-Hint 1
-Use DFS to traverse the binary tree and recover it.
-
-
-
-Hint 2
-Use a hashset to store TreeNode.val for finding.
-
diff --git a/problems/find-eventual-safe-states/README.md b/problems/find-eventual-safe-states/README.md
deleted file mode 100644
index 5ed0ba863..000000000
--- a/problems/find-eventual-safe-states/README.md
+++ /dev/null
@@ -1,56 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-swaps-to-make-sequences-increasing "Minimum Swaps To Make Sequences Increasing")
-
-[Next >](../bricks-falling-when-hit "Bricks Falling When Hit")
-
-## [802. Find Eventual Safe States (Medium)](https://leetcode.com/problems/find-eventual-safe-states "找到最终的安全状态")
-
-
There is a directed graph of n nodes with each node labeled from 0 to n - 1. The graph is represented by a 0-indexed 2D integer array graph where graph[i] is an integer array of nodes adjacent to node i, meaning there is an edge from node i to each node in graph[i].
-
-
A node is a terminal node if there are no outgoing edges. A node is a safe node if every possible path starting from that node leads to a terminal node.
-
-
Return an array containing all the safe nodes of the graph. The answer should be sorted in ascending order.
-
-
-
Example 1:
-
-
-Input: graph = [[1,2],[2,3],[5],[0],[5],[],[]]
-Output: [2,4,5,6]
-Explanation: The given graph is shown above.
-Nodes 5 and 6 are terminal nodes as there are no outgoing edges from either of them.
-Every path starting at nodes 2, 4, 5, and 6 all lead to either node 5 or 6.
-
-
Example 2:
-
-
-Input: graph = [[1,2,3,4],[1,2],[3,4],[0,4],[]]
-Output: [4]
-Explanation:
-Only node 4 is a terminal node, and every path starting at node 4 leads to node 4.
-
-
-
-
Constraints:
-
-
-
n == graph.length
-
1 <= n <= 104
-
0 <= graph[i].length <= n
-
0 <= graph[i][j] <= n - 1
-
graph[i] is sorted in a strictly increasing order.
-
The graph may contain self-loops.
-
The number of edges in the graph will be in the range [1, 4 * 104].
-
-
-### Related Topics
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Graph](../../tag/graph/README.md)]
- [[Topological Sort](../../tag/topological-sort/README.md)]
diff --git a/problems/find-eventual-safe-states/find_eventual_safe_states.go b/problems/find-eventual-safe-states/find_eventual_safe_states.go
deleted file mode 100644
index 3000b5856..000000000
--- a/problems/find-eventual-safe-states/find_eventual_safe_states.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem802
diff --git a/problems/find-eventual-safe-states/find_eventual_safe_states_test.go b/problems/find-eventual-safe-states/find_eventual_safe_states_test.go
deleted file mode 100644
index 3000b5856..000000000
--- a/problems/find-eventual-safe-states/find_eventual_safe_states_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem802
diff --git a/problems/find-first-and-last-position-of-element-in-sorted-array/README.md b/problems/find-first-and-last-position-of-element-in-sorted-array/README.md
deleted file mode 100644
index bc6e12886..000000000
--- a/problems/find-first-and-last-position-of-element-in-sorted-array/README.md
+++ /dev/null
@@ -1,48 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../search-in-rotated-sorted-array "Search in Rotated Sorted Array")
-
-[Next >](../search-insert-position "Search Insert Position")
-
-## [34. Find First and Last Position of Element in Sorted Array (Medium)](https://leetcode.com/problems/find-first-and-last-position-of-element-in-sorted-array "在排序数组中查找元素的第一个和最后一个位置")
-
-
Given an array of integers nums sorted in non-decreasing order, find the starting and ending position of a given target value.
-
-
If target is not found in the array, return [-1, -1].
-
-
You must write an algorithm with O(log n) runtime complexity.
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
-
-### Similar Questions
- 1. [First Bad Version](../first-bad-version) (Easy)
- 1. [Plates Between Candles](../plates-between-candles) (Medium)
- 1. [Find Target Indices After Sorting Array](../find-target-indices-after-sorting-array) (Easy)
diff --git a/problems/find-first-and-last-position-of-element-in-sorted-array/find_first_and_last_position_of_element_in_sorted_array.go b/problems/find-first-and-last-position-of-element-in-sorted-array/find_first_and_last_position_of_element_in_sorted_array.go
deleted file mode 100644
index 2f8bf93e4..000000000
--- a/problems/find-first-and-last-position-of-element-in-sorted-array/find_first_and_last_position_of_element_in_sorted_array.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem34
diff --git a/problems/find-first-and-last-position-of-element-in-sorted-array/find_first_and_last_position_of_element_in_sorted_array_test.go b/problems/find-first-and-last-position-of-element-in-sorted-array/find_first_and_last_position_of_element_in_sorted_array_test.go
deleted file mode 100644
index 2f8bf93e4..000000000
--- a/problems/find-first-and-last-position-of-element-in-sorted-array/find_first_and_last_position_of_element_in_sorted_array_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem34
diff --git a/problems/find-first-palindromic-string-in-the-array/README.md b/problems/find-first-palindromic-string-in-the-array/README.md
deleted file mode 100644
index d10defefd..000000000
--- a/problems/find-first-palindromic-string-in-the-array/README.md
+++ /dev/null
@@ -1,67 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../number-of-unique-flavors-after-sharing-k-candies "Number of Unique Flavors After Sharing K Candies")
-
-[Next >](../adding-spaces-to-a-string "Adding Spaces to a String")
-
-## [2108. Find First Palindromic String in the Array (Easy)](https://leetcode.com/problems/find-first-palindromic-string-in-the-array "找出数组中的第一个回文字符串")
-
-
Given an array of strings words, return the first palindromic string in the array. If there is no such string, return an empty string"".
-
-
A string is palindromic if it reads the same forward and backward.
-
-
-
Example 1:
-
-
-Input: words = ["abc","car","ada","racecar","cool"]
-Output: "ada"
-Explanation: The first string that is palindromic is "ada".
-Note that "racecar" is also palindromic, but it is not the first.
-
-
-
Example 2:
-
-
-Input: words = ["notapalindrome","racecar"]
-Output: "racecar"
-Explanation: The first and only string that is palindromic is "racecar".
-
-
-
Example 3:
-
-
-Input: words = ["def","ghi"]
-Output: ""
-Explanation: There are no palindromic strings, so the empty string is returned.
-
-
-
-
Constraints:
-
-
-
1 <= words.length <= 100
-
1 <= words[i].length <= 100
-
words[i] consists only of lowercase English letters.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Two Pointers](../../tag/two-pointers/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Hints
-
-Hint 1
-Iterate through the elements in order. As soon as the current element is a palindrome, return it.
-
-
-
-Hint 2
-To check if an element is a palindrome, can you reverse the string?
-
diff --git a/problems/find-followers-count/README.md b/problems/find-followers-count/README.md
deleted file mode 100644
index 296bbf93d..000000000
--- a/problems/find-followers-count/README.md
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../cat-and-mouse-ii "Cat and Mouse II")
-
-[Next >](../shortest-path-to-get-food "Shortest Path to Get Food")
-
-## [1729. Find Followers Count (Easy)](https://leetcode.com/problems/find-followers-count "求关注者的数量")
-
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/find-followers-count/mysql_schemas.sql b/problems/find-followers-count/mysql_schemas.sql
deleted file mode 100644
index dda0ddddf..000000000
--- a/problems/find-followers-count/mysql_schemas.sql
+++ /dev/null
@@ -1,6 +0,0 @@
-Create table If Not Exists Followers(user_id int, follower_id int);
-Truncate table Followers;
-insert into Followers (user_id, follower_id) values ('0', '1');
-insert into Followers (user_id, follower_id) values ('1', '0');
-insert into Followers (user_id, follower_id) values ('2', '0');
-insert into Followers (user_id, follower_id) values ('2', '1');
diff --git a/problems/find-good-days-to-rob-the-bank/README.md b/problems/find-good-days-to-rob-the-bank/README.md
deleted file mode 100644
index 0f8c76b53..000000000
--- a/problems/find-good-days-to-rob-the-bank/README.md
+++ /dev/null
@@ -1,86 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../find-subsequence-of-length-k-with-the-largest-sum "Find Subsequence of Length K With the Largest Sum")
-
-[Next >](../detonate-the-maximum-bombs "Detonate the Maximum Bombs")
-
-## [2100. Find Good Days to Rob the Bank (Medium)](https://leetcode.com/problems/find-good-days-to-rob-the-bank "适合打劫银行的日子")
-
-
You and a gang of thieves are planning on robbing a bank. You are given a 0-indexed integer array security, where security[i] is the number of guards on duty on the ith day. The days are numbered starting from 0. You are also given an integer time.
-
-
The ith day is a good day to rob the bank if:
-
-
-
There are at least time days before and after the ith day,
-
The number of guards at the bank for the time days beforei are non-increasing, and
-
The number of guards at the bank for the time days afteri are non-decreasing.
-
-
-
More formally, this means day i is a good day to rob the bank if and only if security[i - time] >= security[i - time + 1] >= ... >= security[i] <= ... <= security[i + time - 1] <= security[i + time].
-
-
Return a list of all days (0-indexed) that are good days to rob the bank. The order that the days are returned in doesnot matter.
-
-
-
Example 1:
-
-
-Input: security = [5,3,3,3,5,6,2], time = 2
-Output: [2,3]
-Explanation:
-On day 2, we have security[0] >= security[1] >= security[2] <= security[3] <= security[4].
-On day 3, we have security[1] >= security[2] >= security[3] <= security[4] <= security[5].
-No other days satisfy this condition, so days 2 and 3 are the only good days to rob the bank.
-
-
-
Example 2:
-
-
-Input: security = [1,1,1,1,1], time = 0
-Output: [0,1,2,3,4]
-Explanation:
-Since time equals 0, every day is a good day to rob the bank, so return every day.
-
-
-
Example 3:
-
-
-Input: security = [1,2,3,4,5,6], time = 2
-Output: []
-Explanation:
-No day has 2 days before it that have a non-increasing number of guards.
-Thus, no day is a good day to rob the bank, so return an empty list.
-
-
-
-
Constraints:
-
-
-
1 <= security.length <= 105
-
0 <= security[i], time <= 105
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Prefix Sum](../../tag/prefix-sum/README.md)]
-
-### Hints
-
-Hint 1
-The trivial solution is to check the time days before and after each day. There are a lot of repeated operations using this solution. How could we optimize this solution?
-
-
-
-Hint 2
-We can use precomputation to make the solution faster.
-
-
-
-Hint 3
-Use an array to store the number of days before the ith day that is non-increasing, and another array to store the number of days after the ith day that is non-decreasing.
-
diff --git a/problems/find-greatest-common-divisor-of-array/README.md b/problems/find-greatest-common-divisor-of-array/README.md
deleted file mode 100644
index 0aca50aaa..000000000
--- a/problems/find-greatest-common-divisor-of-array/README.md
+++ /dev/null
@@ -1,73 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../employees-whose-manager-left-the-company "Employees Whose Manager Left the Company")
-
-[Next >](../find-unique-binary-string "Find Unique Binary String")
-
-## [1979. Find Greatest Common Divisor of Array (Easy)](https://leetcode.com/problems/find-greatest-common-divisor-of-array "找出数组的最大公约数")
-
-
Given an integer array nums, returnthe greatest common divisor of the smallest number and largest number in nums.
-
-
The greatest common divisor of two numbers is the largest positive integer that evenly divides both numbers.
-
-
-
Example 1:
-
-
-Input: nums = [2,5,6,9,10]
-Output: 2
-Explanation:
-The smallest number in nums is 2.
-The largest number in nums is 10.
-The greatest common divisor of 2 and 10 is 2.
-
-
-
Example 2:
-
-
-Input: nums = [7,5,6,8,3]
-Output: 1
-Explanation:
-The smallest number in nums is 3.
-The largest number in nums is 8.
-The greatest common divisor of 3 and 8 is 1.
-
-
-
Example 3:
-
-
-Input: nums = [3,3]
-Output: 3
-Explanation:
-The smallest number in nums is 3.
-The largest number in nums is 3.
-The greatest common divisor of 3 and 3 is 3.
-
-
-
-
Constraints:
-
-
-
2 <= nums.length <= 1000
-
1 <= nums[i] <= 1000
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Math](../../tag/math/README.md)]
-
-### Hints
-
-Hint 1
-Find the minimum and maximum in one iteration. Let them be mn and mx.
-
-
-
-Hint 2
-Try all the numbers in the range [1, mn] and check the largest number which divides both of them.
-
diff --git a/problems/find-if-path-exists-in-graph/README.md b/problems/find-if-path-exists-in-graph/README.md
deleted file mode 100644
index f0623ec1c..000000000
--- a/problems/find-if-path-exists-in-graph/README.md
+++ /dev/null
@@ -1,56 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../last-day-where-you-can-still-cross "Last Day Where You Can Still Cross")
-
-[Next >](../first-and-last-call-on-the-same-day "First and Last Call On the Same Day")
-
-## [1971. Find if Path Exists in Graph (Easy)](https://leetcode.com/problems/find-if-path-exists-in-graph "寻找图中是否存在路径")
-
-
There is a bi-directional graph with n vertices, where each vertex is labeled from 0 to n - 1 (inclusive). The edges in the graph are represented as a 2D integer array edges, where each edges[i] = [ui, vi] denotes a bi-directional edge between vertex ui and vertex vi. Every vertex pair is connected by at most one edge, and no vertex has an edge to itself.
-
-
You want to determine if there is a valid path that exists from vertex source to vertex destination.
-
-
Given edges and the integers n, source, and destination, return true if there is a valid path from source to destination, or false otherwise.
-
-
-
Example 1:
-
-
-Input: n = 3, edges = [[0,1],[1,2],[2,0]], source = 0, destination = 2
-Output: true
-Explanation: There are two paths from vertex 0 to vertex 2:
-- 0 → 1 → 2
-- 0 → 2
-
-
-
Example 2:
-
-
-Input: n = 6, edges = [[0,1],[0,2],[3,5],[5,4],[4,3]], source = 0, destination = 5
-Output: false
-Explanation: There is no path from vertex 0 to vertex 5.
-
You may recall that an array arr is a mountain array if and only if:
-
-
-
arr.length >= 3
-
There exists some i with 0 < i < arr.length - 1 such that:
-
-
arr[0] < arr[1] < ... < arr[i - 1] < arr[i]
-
arr[i] > arr[i + 1] > ... > arr[arr.length - 1]
-
-
-
-
-
Given a mountain array mountainArr, return the minimumindex such that mountainArr.get(index) == target. If such an index does not exist, return -1.
-
-
You cannot access the mountain array directly. You may only access the array using a MountainArray interface:
-
-
-
MountainArray.get(k) returns the element of the array at index k (0-indexed).
-
MountainArray.length() returns the length of the array.
-
-
-
Submissions making more than 100 calls to MountainArray.get will be judged Wrong Answer. Also, any solutions that attempt to circumvent the judge will result in disqualification.
-
-
-
Example 1:
-
-
-Input: array = [1,2,3,4,5,3,1], target = 3
-Output: 2
-Explanation: 3 exists in the array, at index=2 and index=5. Return the minimum index, which is 2.
-
-
Example 2:
-
-
-Input: array = [0,1,2,4,2,1], target = 3
-Output: -1
-Explanation: 3 does not exist in the array, so we return -1.
-
-
-
-
Constraints:
-
-
-
3 <= mountain_arr.length() <= 104
-
0 <= target <= 109
-
0 <= mountain_arr.get(index) <= 109
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
- [[Interactive](../../tag/interactive/README.md)]
-
-### Similar Questions
- 1. [Peak Index in a Mountain Array](../peak-index-in-a-mountain-array) (Easy)
- 1. [Minimum Number of Removals to Make Mountain Array](../minimum-number-of-removals-to-make-mountain-array) (Hard)
-
-### Hints
-
-Hint 1
-Based on whether A[i-1] < A[i] < A[i+1], A[i-1] < A[i] > A[i+1], or A[i-1] > A[i] > A[i+1], we are either at the left side, peak, or right side of the mountain. We can binary search to find the peak.
-After finding the peak, we can binary search two more times to find whether the value occurs on either side of the peak.
-
diff --git a/problems/find-in-mountain-array/find_in_mountain_array.go b/problems/find-in-mountain-array/find_in_mountain_array.go
deleted file mode 100644
index 536e1c4a2..000000000
--- a/problems/find-in-mountain-array/find_in_mountain_array.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem1095
diff --git a/problems/find-interview-candidates/README.md b/problems/find-interview-candidates/README.md
deleted file mode 100644
index 660d053e7..000000000
--- a/problems/find-interview-candidates/README.md
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-path-cost-in-a-hidden-grid "Minimum Path Cost in a Hidden Grid")
-
-[Next >](../determine-color-of-a-chessboard-square "Determine Color of a Chessboard Square")
-
-## [1811. Find Interview Candidates (Medium)](https://leetcode.com/problems/find-interview-candidates "寻找面试候选人")
-
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/find-interview-candidates/mysql_schemas.sql b/problems/find-interview-candidates/mysql_schemas.sql
deleted file mode 100644
index bfd4e69c8..000000000
--- a/problems/find-interview-candidates/mysql_schemas.sql
+++ /dev/null
@@ -1,16 +0,0 @@
-Create table If Not Exists Contests (contest_id int, gold_medal int, silver_medal int, bronze_medal int);
-Create table If Not Exists Users (user_id int, mail varchar(50), name varchar(30));
-Truncate table Contests;
-insert into Contests (contest_id, gold_medal, silver_medal, bronze_medal) values ('190', '1', '5', '2');
-insert into Contests (contest_id, gold_medal, silver_medal, bronze_medal) values ('191', '2', '3', '5');
-insert into Contests (contest_id, gold_medal, silver_medal, bronze_medal) values ('192', '5', '2', '3');
-insert into Contests (contest_id, gold_medal, silver_medal, bronze_medal) values ('193', '1', '3', '5');
-insert into Contests (contest_id, gold_medal, silver_medal, bronze_medal) values ('194', '4', '5', '2');
-insert into Contests (contest_id, gold_medal, silver_medal, bronze_medal) values ('195', '4', '2', '1');
-insert into Contests (contest_id, gold_medal, silver_medal, bronze_medal) values ('196', '1', '5', '2');
-Truncate table Users;
-insert into Users (user_id, mail, name) values ('1', 'sarah@leetcode.com', 'Sarah');
-insert into Users (user_id, mail, name) values ('2', 'bob@leetcode.com', 'Bob');
-insert into Users (user_id, mail, name) values ('3', 'alice@leetcode.com', 'Alice');
-insert into Users (user_id, mail, name) values ('4', 'hercy@leetcode.com', 'Hercy');
-insert into Users (user_id, mail, name) values ('5', 'quarz@leetcode.com', 'Quarz');
diff --git a/problems/find-k-closest-elements/README.md b/problems/find-k-closest-elements/README.md
deleted file mode 100644
index 3256c0ea8..000000000
--- a/problems/find-k-closest-elements/README.md
+++ /dev/null
@@ -1,51 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../robot-return-to-origin "Robot Return to Origin")
-
-[Next >](../split-array-into-consecutive-subsequences "Split Array into Consecutive Subsequences")
-
-## [658. Find K Closest Elements (Medium)](https://leetcode.com/problems/find-k-closest-elements "找到 K 个最接近的元素")
-
-
Given a sorted integer array arr, two integers k and x, return the k closest integers to x in the array. The result should also be sorted in ascending order.
-
-
An integer a is closer to x than an integer b if:
-
-
-
|a - x| < |b - x|, or
-
|a - x| == |b - x| and a < b
-
-
-
-
Example 1:
-
Input: arr = [1,2,3,4,5], k = 4, x = 3
-Output: [1,2,3,4]
-
Example 2:
-
Input: arr = [1,2,3,4,5], k = 4, x = -1
-Output: [1,2,3,4]
-
-
-
Constraints:
-
-
-
1 <= k <= arr.length
-
1 <= arr.length <= 104
-
arr is sorted in ascending order.
-
-104 <= arr[i], x <= 104
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Two Pointers](../../tag/two-pointers/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
- [[Heap (Priority Queue)](../../tag/heap-priority-queue/README.md)]
-
-### Similar Questions
- 1. [Guess Number Higher or Lower](../guess-number-higher-or-lower) (Easy)
- 1. [Guess Number Higher or Lower II](../guess-number-higher-or-lower-ii) (Medium)
- 1. [Find K-th Smallest Pair Distance](../find-k-th-smallest-pair-distance) (Hard)
diff --git a/problems/find-k-closest-elements/find_k_closest_elements.go b/problems/find-k-closest-elements/find_k_closest_elements.go
deleted file mode 100644
index 50cf6a5aa..000000000
--- a/problems/find-k-closest-elements/find_k_closest_elements.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem658
diff --git a/problems/find-k-closest-elements/find_k_closest_elements_test.go b/problems/find-k-closest-elements/find_k_closest_elements_test.go
deleted file mode 100644
index 50cf6a5aa..000000000
--- a/problems/find-k-closest-elements/find_k_closest_elements_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem658
diff --git a/problems/find-k-length-substrings-with-no-repeated-characters/README.md b/problems/find-k-length-substrings-with-no-repeated-characters/README.md
deleted file mode 100644
index 2ffabda34..000000000
--- a/problems/find-k-length-substrings-with-no-repeated-characters/README.md
+++ /dev/null
@@ -1,65 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../two-sum-less-than-k "Two Sum Less Than K")
-
-[Next >](../the-earliest-moment-when-everyone-become-friends "The Earliest Moment When Everyone Become Friends")
-
-## [1100. Find K-Length Substrings With No Repeated Characters (Medium)](https://leetcode.com/problems/find-k-length-substrings-with-no-repeated-characters "长度为 K 的无重复字符子串")
-
-
Given a string S, return the number of substrings of length K with no repeated characters.
-
-
-
-
Example 1:
-
-
-Input: S = "havefunonleetcode", K = 5
-Output: 6
-Explanation:
-There are 6 substrings they are : 'havef','avefu','vefun','efuno','etcod','tcode'.
-
-
-
Example 2:
-
-
-Input: S = "home", K = 5
-Output: 0
-Explanation:
-Notice K can be larger than the length of S. In this case is not possible to find any substring.
-
-
-
-
-
Note:
-
-
-
1 <= S.length <= 10^4
-
All characters of S are lowercase English letters.
-
1 <= K <= 10^4
-
-
-### Related Topics
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
- [[Sliding Window](../../tag/sliding-window/README.md)]
-
-### Hints
-
-Hint 1
-How to check efficiently each K-length substring?
-
-
-
-Hint 2
-First store the first leftmost K-length substring in a hashTable or array of frequencies.
-
-
-
-Hint 3
-Then iterate through the rest of characters and erase the first element and add the next element from the right. If in the hashTable we have K different character we add 1 to the counter. After that return as answer the counter.
-
diff --git a/problems/find-k-pairs-with-smallest-sums/README.md b/problems/find-k-pairs-with-smallest-sums/README.md
deleted file mode 100644
index 34da2c164..000000000
--- a/problems/find-k-pairs-with-smallest-sums/README.md
+++ /dev/null
@@ -1,62 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../super-pow "Super Pow")
-
-[Next >](../guess-number-higher-or-lower "Guess Number Higher or Lower")
-
-## [373. Find K Pairs with Smallest Sums (Medium)](https://leetcode.com/problems/find-k-pairs-with-smallest-sums "查找和最小的K对数字")
-
-
You are given two integer arrays nums1 and nums2 sorted in ascending order and an integer k.
-
-
Define a pair (u, v) which consists of one element from the first array and one element from the second array.
-Input: nums1 = [1,7,11], nums2 = [2,4,6], k = 3
-Output: [[1,2],[1,4],[1,6]]
-Explanation: The first 3 pairs are returned from the sequence: [1,2],[1,4],[1,6],[7,2],[7,4],[11,2],[7,6],[11,4],[11,6]
-
-
-
Example 2:
-
-
-Input: nums1 = [1,1,2], nums2 = [1,2,3], k = 2
-Output: [[1,1],[1,1]]
-Explanation: The first 2 pairs are returned from the sequence: [1,1],[1,1],[1,2],[2,1],[1,2],[2,2],[1,3],[1,3],[2,3]
-
-
-
Example 3:
-
-
-Input: nums1 = [1,2], nums2 = [3], k = 3
-Output: [[1,3],[2,3]]
-Explanation: All possible pairs are returned from the sequence: [1,3],[2,3]
-
-
-
-
Constraints:
-
-
-
1 <= nums1.length, nums2.length <= 105
-
-109 <= nums1[i], nums2[i] <= 109
-
nums1 and nums2 both are sorted in ascending order.
-
1 <= k <= 1000
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Heap (Priority Queue)](../../tag/heap-priority-queue/README.md)]
-
-### Similar Questions
- 1. [Kth Smallest Element in a Sorted Matrix](../kth-smallest-element-in-a-sorted-matrix) (Medium)
- 1. [Find K-th Smallest Pair Distance](../find-k-th-smallest-pair-distance) (Hard)
- 1. [Kth Smallest Product of Two Sorted Arrays](../kth-smallest-product-of-two-sorted-arrays) (Hard)
diff --git a/problems/find-k-pairs-with-smallest-sums/find_k_pairs_with_smallest_sums.go b/problems/find-k-pairs-with-smallest-sums/find_k_pairs_with_smallest_sums.go
deleted file mode 100644
index 04bb844dd..000000000
--- a/problems/find-k-pairs-with-smallest-sums/find_k_pairs_with_smallest_sums.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem373
diff --git a/problems/find-k-pairs-with-smallest-sums/find_k_pairs_with_smallest_sums_test.go b/problems/find-k-pairs-with-smallest-sums/find_k_pairs_with_smallest_sums_test.go
deleted file mode 100644
index 04bb844dd..000000000
--- a/problems/find-k-pairs-with-smallest-sums/find_k_pairs_with_smallest_sums_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem373
diff --git a/problems/find-k-th-smallest-pair-distance/README.md b/problems/find-k-th-smallest-pair-distance/README.md
deleted file mode 100644
index 7edbcfaf5..000000000
--- a/problems/find-k-th-smallest-pair-distance/README.md
+++ /dev/null
@@ -1,72 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-length-of-repeated-subarray "Maximum Length of Repeated Subarray")
-
-[Next >](../longest-word-in-dictionary "Longest Word in Dictionary")
-
-## [719. Find K-th Smallest Pair Distance (Hard)](https://leetcode.com/problems/find-k-th-smallest-pair-distance "找出第 k 小的距离对")
-
-
The distance of a pair of integers a and b is defined as the absolute difference between a and b.
-
-
Given an integer array nums and an integer k, return thekthsmallest distance among all the pairsnums[i]andnums[j]where0 <= i < j < nums.length.
-
-
-
Example 1:
-
-
-Input: nums = [1,3,1], k = 1
-Output: 0
-Explanation: Here are all the pairs:
-(1,3) -> 2
-(1,1) -> 0
-(3,1) -> 2
-Then the 1st smallest distance pair is (1,1), and its distance is 0.
-
-
-
Example 2:
-
-
-Input: nums = [1,1,1], k = 2
-Output: 0
-
-
-
Example 3:
-
-
-Input: nums = [1,6,1], k = 3
-Output: 5
-
-
-
-
Constraints:
-
-
-
n == nums.length
-
2 <= n <= 104
-
0 <= nums[i] <= 106
-
1 <= k <= n * (n - 1) / 2
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Two Pointers](../../tag/two-pointers/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Similar Questions
- 1. [Find K Pairs with Smallest Sums](../find-k-pairs-with-smallest-sums) (Medium)
- 1. [Kth Smallest Element in a Sorted Matrix](../kth-smallest-element-in-a-sorted-matrix) (Medium)
- 1. [Find K Closest Elements](../find-k-closest-elements) (Medium)
- 1. [Kth Smallest Number in Multiplication Table](../kth-smallest-number-in-multiplication-table) (Hard)
- 1. [K-th Smallest Prime Fraction](../k-th-smallest-prime-fraction) (Hard)
-
-### Hints
-
-Hint 1
-Binary search for the answer. How can you check how many pairs have distance <= X?
-
diff --git a/problems/find-k-th-smallest-pair-distance/find_k_th_smallest_pair_distance.go b/problems/find-k-th-smallest-pair-distance/find_k_th_smallest_pair_distance.go
deleted file mode 100644
index b54abe8d2..000000000
--- a/problems/find-k-th-smallest-pair-distance/find_k_th_smallest_pair_distance.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem719
diff --git a/problems/find-k-th-smallest-pair-distance/find_k_th_smallest_pair_distance_test.go b/problems/find-k-th-smallest-pair-distance/find_k_th_smallest_pair_distance_test.go
deleted file mode 100644
index b54abe8d2..000000000
--- a/problems/find-k-th-smallest-pair-distance/find_k_th_smallest_pair_distance_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem719
diff --git a/problems/find-kth-bit-in-nth-binary-string/README.md b/problems/find-kth-bit-in-nth-binary-string/README.md
deleted file mode 100644
index a3be3ef9b..000000000
--- a/problems/find-kth-bit-in-nth-binary-string/README.md
+++ /dev/null
@@ -1,69 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../make-the-string-great "Make The String Great")
-
-[Next >](../maximum-number-of-non-overlapping-subarrays-with-sum-equals-target "Maximum Number of Non-Overlapping Subarrays With Sum Equals Target")
-
-## [1545. Find Kth Bit in Nth Binary String (Medium)](https://leetcode.com/problems/find-kth-bit-in-nth-binary-string "找出第 N 个二进制字符串中的第 K 位")
-
-
Given two positive integers n and k, the binary string Sn is formed as follows:
-
-
-
S1 = "0"
-
Si = Si - 1 + "1" + reverse(invert(Si - 1)) for i > 1
-
-
-
Where + denotes the concatenation operation, reverse(x) returns the reversed string x, and invert(x) inverts all the bits in x (0 changes to 1 and 1 changes to 0).
-
-
For example, the first four strings in the above sequence are:
-
-
-
S1 = "0"
-
S2 = "011"
-
S3 = "0111001"
-
S4 = "011100110110001"
-
-
-
Return thekthbitinSn. It is guaranteed that k is valid for the given n.
-
-
-
Example 1:
-
-
-Input: n = 3, k = 1
-Output: "0"
-Explanation: S3 is "0111001".
-The 1st bit is "0".
-
-
-
Example 2:
-
-
-Input: n = 4, k = 11
-Output: "1"
-Explanation: S4 is "011100110110001".
-The 11th bit is "1".
-
-
-
-
Constraints:
-
-
-
1 <= n <= 20
-
1 <= k <= 2n - 1
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
- [[Recursion](../../tag/recursion/README.md)]
-
-### Hints
-
-Hint 1
-Since n is small, we can simply simulate the process of constructing S1 to Sn.
-
diff --git a/problems/find-kth-largest-xor-coordinate-value/README.md b/problems/find-kth-largest-xor-coordinate-value/README.md
deleted file mode 100644
index 1e1e0f942..000000000
--- a/problems/find-kth-largest-xor-coordinate-value/README.md
+++ /dev/null
@@ -1,68 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../change-minimum-characters-to-satisfy-one-of-three-conditions "Change Minimum Characters to Satisfy One of Three Conditions")
-
-[Next >](../building-boxes "Building Boxes")
-
-## [1738. Find Kth Largest XOR Coordinate Value (Medium)](https://leetcode.com/problems/find-kth-largest-xor-coordinate-value "找出第 K 大的异或坐标值")
-
-
You are given a 2D matrix of size m x n, consisting of non-negative integers. You are also given an integer k.
-
-
The value of coordinate (a, b) of the matrix is the XOR of all matrix[i][j] where 0 <= i <= a < m and 0 <= j <= b < n(0-indexed).
-
-
Find the kth largest value (1-indexed) of all the coordinates of matrix.
-
-
-
Example 1:
-
-
-Input: matrix = [[5,2],[1,6]], k = 1
-Output: 7
-Explanation: The value of coordinate (0,1) is 5 XOR 2 = 7, which is the largest value.
-
-
-
Example 2:
-
-
-Input: matrix = [[5,2],[1,6]], k = 2
-Output: 5
-Explanation: The value of coordinate (0,0) is 5 = 5, which is the 2nd largest value.
-
-
-
Example 3:
-
-
-Input: matrix = [[5,2],[1,6]], k = 3
-Output: 4
-Explanation: The value of coordinate (1,0) is 5 XOR 1 = 4, which is the 3rd largest value.
-
-
-
Constraints:
-
-
-
m == matrix.length
-
n == matrix[i].length
-
1 <= m, n <= 1000
-
0 <= matrix[i][j] <= 106
-
1 <= k <= m * n
-
-
-### Related Topics
- [[Bit Manipulation](../../tag/bit-manipulation/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Divide and Conquer](../../tag/divide-and-conquer/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
- [[Prefix Sum](../../tag/prefix-sum/README.md)]
- [[Quickselect](../../tag/quickselect/README.md)]
- [[Heap (Priority Queue)](../../tag/heap-priority-queue/README.md)]
-
-### Hints
-
-Hint 1
-Use a 2D prefix sum to precalculate the xor-sum of the upper left submatrix.
-
diff --git a/problems/find-largest-value-in-each-tree-row/README.md b/problems/find-largest-value-in-each-tree-row/README.md
deleted file mode 100644
index 28388634d..000000000
--- a/problems/find-largest-value-in-each-tree-row/README.md
+++ /dev/null
@@ -1,66 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../freedom-trail "Freedom Trail")
-
-[Next >](../longest-palindromic-subsequence "Longest Palindromic Subsequence")
-
-## [515. Find Largest Value in Each Tree Row (Medium)](https://leetcode.com/problems/find-largest-value-in-each-tree-row "在每个树行中找最大值")
-
-
Given the root of a binary tree, return an array of the largest value in each row of the tree (0-indexed).
The number of nodes in the tree will be in the range [0, 104].
-
-231 <= Node.val <= 231 - 1
-
-
-### Related Topics
- [[Tree](../../tag/tree/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Binary Tree](../../tag/binary-tree/README.md)]
diff --git a/problems/find-largest-value-in-each-tree-row/find_largest_value_in_each_tree_row.go b/problems/find-largest-value-in-each-tree-row/find_largest_value_in_each_tree_row.go
deleted file mode 100644
index 9503b7e30..000000000
--- a/problems/find-largest-value-in-each-tree-row/find_largest_value_in_each_tree_row.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem515
diff --git a/problems/find-largest-value-in-each-tree-row/find_largest_value_in_each_tree_row_test.go b/problems/find-largest-value-in-each-tree-row/find_largest_value_in_each_tree_row_test.go
deleted file mode 100644
index 9503b7e30..000000000
--- a/problems/find-largest-value-in-each-tree-row/find_largest_value_in_each_tree_row_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem515
diff --git a/problems/find-latest-group-of-size-m/README.md b/problems/find-latest-group-of-size-m/README.md
deleted file mode 100644
index a9082fdad..000000000
--- a/problems/find-latest-group-of-size-m/README.md
+++ /dev/null
@@ -1,80 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-number-of-coins-you-can-get "Maximum Number of Coins You Can Get")
-
-[Next >](../stone-game-v "Stone Game V")
-
-## [1562. Find Latest Group of Size M (Medium)](https://leetcode.com/problems/find-latest-group-of-size-m "查找大小为 M 的最新分组")
-
-
Given an array arr that represents a permutation of numbers from 1 to n.
-
-
You have a binary string of size n that initially has all its bits set to zero. At each step i (assuming both the binary string and arr are 1-indexed) from 1 to n, the bit at position arr[i] is set to 1.
-
-
You are also given an integer m. Find the latest step at which there exists a group of ones of length m. A group of ones is a contiguous substring of 1's such that it cannot be extended in either direction.
-
-
Return the latest step at which there exists a group of ones of length exactlym. If no such group exists, return-1.
-
-
-
Example 1:
-
-
-Input: arr = [3,5,1,2,4], m = 1
-Output: 4
-Explanation:
-Step 1: "00100", groups: ["1"]
-Step 2: "00101", groups: ["1", "1"]
-Step 3: "10101", groups: ["1", "1", "1"]
-Step 4: "11101", groups: ["111", "1"]
-Step 5: "11111", groups: ["11111"]
-The latest step at which there exists a group of size 1 is step 4.
-
-
-
Example 2:
-
-
-Input: arr = [3,1,5,4,2], m = 2
-Output: -1
-Explanation:
-Step 1: "00100", groups: ["1"]
-Step 2: "10100", groups: ["1", "1"]
-Step 3: "10101", groups: ["1", "1", "1"]
-Step 4: "10111", groups: ["1", "111"]
-Step 5: "11111", groups: ["11111"]
-No group of size 2 exists during any step.
-
-
-
-
Constraints:
-
-
-
n == arr.length
-
1 <= m <= n <= 105
-
1 <= arr[i] <= n
-
All integers in arr are distinct.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
- [[Simulation](../../tag/simulation/README.md)]
-
-### Hints
-
-Hint 1
-Since the problem asks for the latest step, can you start the searching from the end of arr?
-
-
-
-Hint 2
-Use a map to store the current “1” groups.
-
-
-
-Hint 3
-At each step (going backwards) you need to split one group and update the map.
-
diff --git a/problems/find-leaves-of-binary-tree/README.md b/problems/find-leaves-of-binary-tree/README.md
deleted file mode 100644
index 581997b73..000000000
--- a/problems/find-leaves-of-binary-tree/README.md
+++ /dev/null
@@ -1,63 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../water-and-jug-problem "Water and Jug Problem")
-
-[Next >](../valid-perfect-square "Valid Perfect Square")
-
-## [366. Find Leaves of Binary Tree (Medium)](https://leetcode.com/problems/find-leaves-of-binary-tree "寻找二叉树的叶子节点")
-
-
Given a binary tree, collect a tree's nodes as if you were doing this: Collect and remove all leaves, repeat until the tree is empty.
You are given a string s. An awesome substring is a non-empty substring of s such that we can make any number of swaps in order to make it a palindrome.
-
-
Return the length of the maximum length awesome substring ofs.
-
-
-
Example 1:
-
-
-Input: s = "3242415"
-Output: 5
-Explanation: "24241" is the longest awesome substring, we can form the palindrome "24142" with some swaps.
-
-
-
Example 2:
-
-
-Input: s = "12345678"
-Output: 1
-
-
-
Example 3:
-
-
-Input: s = "213123"
-Output: 6
-Explanation: "213123" is the longest awesome substring, we can form the palindrome "231132" with some swaps.
-
-
-
-
Constraints:
-
-
-
1 <= s.length <= 105
-
s consists only of digits.
-
-
-### Related Topics
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
- [[Bit Manipulation](../../tag/bit-manipulation/README.md)]
-
-### Hints
-
-Hint 1
-Given the character counts, under what conditions can a palindrome be formed ?
-
-
-
-Hint 2
-From left to right, use bitwise xor-operation to compute for any prefix the number of times modulo 2 of each digit. (mask ^= (1<<(s[i]-'0')).
-
-
-
-Hint 3
-Expected complexity is O(n*A) where A is the alphabet (10).
-
diff --git a/problems/find-lucky-integer-in-an-array/README.md b/problems/find-lucky-integer-in-an-array/README.md
deleted file mode 100644
index 197c818bd..000000000
--- a/problems/find-lucky-integer-in-an-array/README.md
+++ /dev/null
@@ -1,65 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../capital-gainloss "Capital Gain/Loss")
-
-[Next >](../count-number-of-teams "Count Number of Teams")
-
-## [1394. Find Lucky Integer in an Array (Easy)](https://leetcode.com/problems/find-lucky-integer-in-an-array "找出数组中的幸运数")
-
-
Given an array of integers arr, a lucky integer is an integer that has a frequency in the array equal to its value.
-
-
Return the largest lucky integer in the array. If there is no lucky integer return -1.
-
-
-
Example 1:
-
-
-Input: arr = [2,2,3,4]
-Output: 2
-Explanation: The only lucky number in the array is 2 because frequency[2] == 2.
-
-
-
Example 2:
-
-
-Input: arr = [1,2,2,3,3,3]
-Output: 3
-Explanation: 1, 2 and 3 are all lucky numbers, return the largest of them.
-
-
-
Example 3:
-
-
-Input: arr = [2,2,2,3,3]
-Output: -1
-Explanation: There are no lucky numbers in the array.
-
-
-
-
Constraints:
-
-
-
1 <= arr.length <= 500
-
1 <= arr[i] <= 500
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Counting](../../tag/counting/README.md)]
-
-### Hints
-
-Hint 1
-Count the frequency of each integer in the array.
-
-
-
-Hint 2
-Get all lucky numbers and return the largest of them.
-
diff --git a/problems/find-lucky-integer-in-an-array/find_lucky_integer_in_an_array.go b/problems/find-lucky-integer-in-an-array/find_lucky_integer_in_an_array.go
deleted file mode 100644
index 26e83d6dd..000000000
--- a/problems/find-lucky-integer-in-an-array/find_lucky_integer_in_an_array.go
+++ /dev/null
@@ -1,15 +0,0 @@
-package problem1394
-
-func findLucky(arr []int) int {
- m := make(map[int]int)
- for _, v := range arr {
- m[v]++
- }
- ans, max := -1, 0
- for k, v := range m {
- if k > max && k == v {
- ans, max = k, v
- }
- }
- return ans
-}
diff --git a/problems/find-lucky-integer-in-an-array/find_lucky_integer_in_an_array_test.go b/problems/find-lucky-integer-in-an-array/find_lucky_integer_in_an_array_test.go
deleted file mode 100644
index bf75d1b17..000000000
--- a/problems/find-lucky-integer-in-an-array/find_lucky_integer_in_an_array_test.go
+++ /dev/null
@@ -1,39 +0,0 @@
-package problem1394
-
-import "testing"
-
-type testType struct {
- in []int
- want int
-}
-
-func TestFindLucky(t *testing.T) {
- tests := [...]testType{
- {
- in: []int{2, 2, 3, 4},
- want: 2,
- },
- {
- in: []int{1, 2, 2, 3, 3, 3},
- want: 3,
- },
- {
- in: []int{2, 2, 2, 3, 3},
- want: -1,
- },
- {
- in: []int{5},
- want: -1,
- },
- {
- in: []int{7, 7, 7, 7, 7, 7, 7},
- want: 7,
- },
- }
- for _, tt := range tests {
- got := findLucky(tt.in)
- if got != tt.want {
- t.Fatalf("in: %v, got: %v, want: %v", tt.in, got, tt.want)
- }
- }
-}
diff --git a/problems/find-median-from-data-stream/README.md b/problems/find-median-from-data-stream/README.md
deleted file mode 100644
index 0c980debd..000000000
--- a/problems/find-median-from-data-stream/README.md
+++ /dev/null
@@ -1,74 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../flip-game-ii "Flip Game II")
-
-[Next >](../best-meeting-point "Best Meeting Point")
-
-## [295. Find Median from Data Stream (Hard)](https://leetcode.com/problems/find-median-from-data-stream "数据流的中位数")
-
-
The median is the middle value in an ordered integer list. If the size of the list is even, there is no middle value and the median is the mean of the two middle values.
-
-
-
For example, for arr = [2,3,4], the median is 3.
-
For example, for arr = [2,3], the median is (2 + 3) / 2 = 2.5.
-
-
-
Implement the MedianFinder class:
-
-
-
MedianFinder() initializes the MedianFinder object.
-
void addNum(int num) adds the integer num from the data stream to the data structure.
-
double findMedian() returns the median of all elements so far. Answers within 10-5 of the actual answer will be accepted.
In this table, the numbers are 0, 0, 0, 0, 0, 0, 0, 1, 2, 2, 2, 3, so the median is (0 + 0) / 2 = 0.
-
-
-+--------+
-| median |
-+--------|
-| 0.0000 |
-+--------+
-
-
-
Write a query to find the median of all numbers and name the result as median.
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
-
-### Similar Questions
- 1. [Median Employee Salary](../median-employee-salary) (Hard)
diff --git a/problems/find-median-given-frequency-of-numbers/find_median_given_frequency_of_numbers.sql b/problems/find-median-given-frequency-of-numbers/find_median_given_frequency_of_numbers.sql
deleted file mode 100644
index bae62cf19..000000000
--- a/problems/find-median-given-frequency-of-numbers/find_median_given_frequency_of_numbers.sql
+++ /dev/null
@@ -1 +0,0 @@
-# Write your MySQL query statement below
diff --git a/problems/find-median-given-frequency-of-numbers/mysql_schemas.sql b/problems/find-median-given-frequency-of-numbers/mysql_schemas.sql
deleted file mode 100644
index 045c651e6..000000000
--- a/problems/find-median-given-frequency-of-numbers/mysql_schemas.sql
+++ /dev/null
@@ -1,6 +0,0 @@
-Create table If Not Exists Numbers (num int, frequency int);
-Truncate table Numbers;
-insert into Numbers (num, frequency) values ('0', '7');
-insert into Numbers (num, frequency) values ('1', '1');
-insert into Numbers (num, frequency) values ('2', '3');
-insert into Numbers (num, frequency) values ('3', '1');
diff --git a/problems/find-minimum-in-rotated-sorted-array-ii/README.md b/problems/find-minimum-in-rotated-sorted-array-ii/README.md
deleted file mode 100644
index 5fa38008e..000000000
--- a/problems/find-minimum-in-rotated-sorted-array-ii/README.md
+++ /dev/null
@@ -1,55 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../find-minimum-in-rotated-sorted-array "Find Minimum in Rotated Sorted Array")
-
-[Next >](../min-stack "Min Stack")
-
-## [154. Find Minimum in Rotated Sorted Array II (Hard)](https://leetcode.com/problems/find-minimum-in-rotated-sorted-array-ii "寻找旋转排序数组中的最小值 II")
-
-
Suppose an array of length n sorted in ascending order is rotated between 1 and n times. For example, the array nums = [0,1,4,4,5,6,7] might become:
-
-
-
[4,5,6,7,0,1,4] if it was rotated 4 times.
-
[0,1,4,4,5,6,7] if it was rotated 7 times.
-
-
-
Notice that rotating an array [a[0], a[1], a[2], ..., a[n-1]] 1 time results in the array [a[n-1], a[0], a[1], a[2], ..., a[n-2]].
-
-
Given the sorted rotated array nums that may contain duplicates, return the minimum element of this array.
-
-
You must decrease the overall operation steps as much as possible.
-
-
-
Example 1:
-
Input: nums = [1,3,5]
-Output: 1
-
Example 2:
-
Input: nums = [2,2,2,0,1]
-Output: 0
-
-
-
Constraints:
-
-
-
n == nums.length
-
1 <= n <= 5000
-
-5000 <= nums[i] <= 5000
-
nums is sorted and rotated between 1 and n times.
-
-
-
-
Follow up: This problem is similar to Find Minimum in Rotated Sorted Array, but nums may contain duplicates. Would this affect the runtime complexity? How and why?
Suppose an array of length n sorted in ascending order is rotated between 1 and n times. For example, the array nums = [0,1,2,4,5,6,7] might become:
-
-
-
[4,5,6,7,0,1,2] if it was rotated 4 times.
-
[0,1,2,4,5,6,7] if it was rotated 7 times.
-
-
-
Notice that rotating an array [a[0], a[1], a[2], ..., a[n-1]] 1 time results in the array [a[n-1], a[0], a[1], a[2], ..., a[n-2]].
-
-
Given the sorted rotated array nums of unique elements, return the minimum element of this array.
-
-
You must write an algorithm that runs in O(log n) time.
-
-
-
Example 1:
-
-
-Input: nums = [3,4,5,1,2]
-Output: 1
-Explanation: The original array was [1,2,3,4,5] rotated 3 times.
-
-
-
Example 2:
-
-
-Input: nums = [4,5,6,7,0,1,2]
-Output: 0
-Explanation: The original array was [0,1,2,4,5,6,7] and it was rotated 4 times.
-
-
-
Example 3:
-
-
-Input: nums = [11,13,15,17]
-Output: 11
-Explanation: The original array was [11,13,15,17] and it was rotated 4 times.
-
-
-
-
Constraints:
-
-
-
n == nums.length
-
1 <= n <= 5000
-
-5000 <= nums[i] <= 5000
-
All the integers of nums are unique.
-
nums is sorted and rotated between 1 and n times.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
-
-### Similar Questions
- 1. [Search in Rotated Sorted Array](../search-in-rotated-sorted-array) (Medium)
- 1. [Find Minimum in Rotated Sorted Array II](../find-minimum-in-rotated-sorted-array-ii) (Hard)
-
-### Hints
-
-Hint 1
-Array was originally in ascending order. Now that the array is rotated, there would be a point in the array where there is a small deflection from the increasing sequence. eg. The array would be something like [4, 5, 6, 7, 0, 1, 2].
-
-
-
-Hint 2
-You can divide the search space into two and see which direction to go.
-Can you think of an algorithm which has O(logN) search complexity?
-
-
-
-Hint 3
-
-
All the elements to the left of inflection point > first element of the array.
-
All the elements to the right of inflection point < first element of the array.
-
-
diff --git a/problems/find-minimum-in-rotated-sorted-array/find_minimum_in_rotated_sorted_array.go b/problems/find-minimum-in-rotated-sorted-array/find_minimum_in_rotated_sorted_array.go
deleted file mode 100644
index 028b3ae46..000000000
--- a/problems/find-minimum-in-rotated-sorted-array/find_minimum_in_rotated_sorted_array.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem153
diff --git a/problems/find-minimum-in-rotated-sorted-array/find_minimum_in_rotated_sorted_array_test.go b/problems/find-minimum-in-rotated-sorted-array/find_minimum_in_rotated_sorted_array_test.go
deleted file mode 100644
index 028b3ae46..000000000
--- a/problems/find-minimum-in-rotated-sorted-array/find_minimum_in_rotated_sorted_array_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem153
diff --git a/problems/find-minimum-time-to-finish-all-jobs/README.md b/problems/find-minimum-time-to-finish-all-jobs/README.md
deleted file mode 100644
index 04d2f0c05..000000000
--- a/problems/find-minimum-time-to-finish-all-jobs/README.md
+++ /dev/null
@@ -1,58 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimize-hamming-distance-after-swap-operations "Minimize Hamming Distance After Swap Operations")
-
-[Next >](../checking-existence-of-edge-length-limited-paths-ii "Checking Existence of Edge Length Limited Paths II")
-
-## [1723. Find Minimum Time to Finish All Jobs (Hard)](https://leetcode.com/problems/find-minimum-time-to-finish-all-jobs "完成所有工作的最短时间")
-
-
You are given an integer array jobs, where jobs[i] is the amount of time it takes to complete the ith job.
-
-
There are k workers that you can assign jobs to. Each job should be assigned to exactly one worker. The working time of a worker is the sum of the time it takes to complete all jobs assigned to them. Your goal is to devise an optimal assignment such that the maximum working time of any worker is minimized.
-
-
Return the minimum possible maximum working time of any assignment.
-
-
-
Example 1:
-
-
-Input: jobs = [3,2,3], k = 3
-Output: 3
-Explanation: By assigning each person one job, the maximum time is 3.
-
-
-
Example 2:
-
-
-Input: jobs = [1,2,4,7,8], k = 2
-Output: 11
-Explanation: Assign the jobs the following way:
-Worker 1: 1, 2, 8 (working time = 1 + 2 + 8 = 11)
-Worker 2: 4, 7 (working time = 4 + 7 = 11)
-The maximum working time is 11.
-
-
-
Constraints:
-
-
-
1 <= k <= jobs.length <= 12
-
1 <= jobs[i] <= 107
-
-
-### Related Topics
- [[Bit Manipulation](../../tag/bit-manipulation/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Backtracking](../../tag/backtracking/README.md)]
- [[Bitmask](../../tag/bitmask/README.md)]
-
-### Hints
-
-Hint 1
-We can select a subset of tasks and assign it to a worker then solve the subproblem on the remaining tasks
-
diff --git a/problems/find-missing-observations/README.md b/problems/find-missing-observations/README.md
deleted file mode 100644
index 65ccb1f6d..000000000
--- a/problems/find-missing-observations/README.md
+++ /dev/null
@@ -1,72 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-moves-to-convert-string "Minimum Moves to Convert String")
-
-[Next >](../stone-game-ix "Stone Game IX")
-
-## [2028. Find Missing Observations (Medium)](https://leetcode.com/problems/find-missing-observations "找出缺失的观测数据")
-
-
You have observations of n + m6-sided dice rolls with each face numbered from 1 to 6. n of the observations went missing, and you only have the observations of m rolls. Fortunately, you have also calculated the average value of the n + m rolls.
-
-
You are given an integer array rolls of length m where rolls[i] is the value of the ith observation. You are also given the two integers mean and n.
-
-
Return an array of length n containing the missing observations such that the average value of the n + m rolls is exactlymean. If there are multiple valid answers, return any of them. If no such array exists, return an empty array.
-
-
The average value of a set of k numbers is the sum of the numbers divided by k.
-
-
Note that mean is an integer, so the sum of the n + m rolls should be divisible by n + m.
-
-
-
Example 1:
-
-
-Input: rolls = [3,2,4,3], mean = 4, n = 2
-Output: [6,6]
-Explanation: The mean of all n + m rolls is (3 + 2 + 4 + 3 + 6 + 6) / 6 = 4.
-
-
-
Example 2:
-
-
-Input: rolls = [1,5,6], mean = 3, n = 4
-Output: [2,3,2,2]
-Explanation: The mean of all n + m rolls is (1 + 5 + 6 + 2 + 3 + 2 + 2) / 7 = 3.
-
-
-
Example 3:
-
-
-Input: rolls = [1,2,3,4], mean = 6, n = 4
-Output: []
-Explanation: It is impossible for the mean to be 6 no matter what the 4 missing rolls are.
-
-
-
-
Constraints:
-
-
-
m == rolls.length
-
1 <= n, m <= 105
-
1 <= rolls[i], mean <= 6
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Math](../../tag/math/README.md)]
- [[Simulation](../../tag/simulation/README.md)]
-
-### Hints
-
-Hint 1
-What should the sum of the n rolls be?
-
-
-
-Hint 2
-Could you generate an array of size n such that each element is between 1 and 6?
-
diff --git a/problems/find-mode-in-binary-search-tree/README.md b/problems/find-mode-in-binary-search-tree/README.md
deleted file mode 100644
index 854f06464..000000000
--- a/problems/find-mode-in-binary-search-tree/README.md
+++ /dev/null
@@ -1,59 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../keyboard-row "Keyboard Row")
-
-[Next >](../ipo "IPO")
-
-## [501. Find Mode in Binary Search Tree (Easy)](https://leetcode.com/problems/find-mode-in-binary-search-tree "二叉搜索树中的众数")
-
-
Given the root of a binary search tree (BST) with duplicates, return all the mode(s) (i.e., the most frequently occurred element) in it.
-
-
If the tree has more than one mode, return them in any order.
-
-
Assume a BST is defined as follows:
-
-
-
The left subtree of a node contains only nodes with keys less than or equal to the node's key.
-
The right subtree of a node contains only nodes with keys greater than or equal to the node's key.
-
Both the left and right subtrees must also be binary search trees.
-
-
-
-
Example 1:
-
-
-Input: root = [1,null,2,2]
-Output: [2]
-
-
-
Example 2:
-
-
-Input: root = [0]
-Output: [0]
-
-
-
-
Constraints:
-
-
-
The number of nodes in the tree is in the range [1, 104].
-
-105 <= Node.val <= 105
-
-
-
-Follow up: Could you do that without using any extra space? (Assume that the implicit stack space incurred due to recursion does not count).
-
-### Related Topics
- [[Tree](../../tag/tree/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Binary Search Tree](../../tag/binary-search-tree/README.md)]
- [[Binary Tree](../../tag/binary-tree/README.md)]
-
-### Similar Questions
- 1. [Validate Binary Search Tree](../validate-binary-search-tree) (Medium)
diff --git a/problems/find-mode-in-binary-search-tree/find_mode_in_binary_search_tree.go b/problems/find-mode-in-binary-search-tree/find_mode_in_binary_search_tree.go
deleted file mode 100644
index d43c7d962..000000000
--- a/problems/find-mode-in-binary-search-tree/find_mode_in_binary_search_tree.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem501
diff --git a/problems/find-mode-in-binary-search-tree/find_mode_in_binary_search_tree_test.go b/problems/find-mode-in-binary-search-tree/find_mode_in_binary_search_tree_test.go
deleted file mode 100644
index d43c7d962..000000000
--- a/problems/find-mode-in-binary-search-tree/find_mode_in_binary_search_tree_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem501
diff --git a/problems/find-n-unique-integers-sum-up-to-zero/README.md b/problems/find-n-unique-integers-sum-up-to-zero/README.md
deleted file mode 100644
index adcf4c9f1..000000000
--- a/problems/find-n-unique-integers-sum-up-to-zero/README.md
+++ /dev/null
@@ -1,59 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../find-the-team-size "Find the Team Size")
-
-[Next >](../all-elements-in-two-binary-search-trees "All Elements in Two Binary Search Trees")
-
-## [1304. Find N Unique Integers Sum up to Zero (Easy)](https://leetcode.com/problems/find-n-unique-integers-sum-up-to-zero "和为零的N个唯一整数")
-
-
Given an integer n, return any array containing nunique integers such that they add up to 0.
-
-
-
Example 1:
-
-
-Input: n = 5
-Output: [-7,-1,1,3,4]
-Explanation: These arrays also are accepted [-5,-1,1,2,3] , [-3,-1,2,-2,4].
-
-
-
Example 2:
-
-
-Input: n = 3
-Output: [-1,0,1]
-
-
-
Example 3:
-
-
-Input: n = 1
-Output: [0]
-
-
-
-
Constraints:
-
-
-
1 <= n <= 1000
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Math](../../tag/math/README.md)]
-
-### Hints
-
-Hint 1
-Return an array where the values are symmetric. (+x , -x).
-
-
-
-Hint 2
-If n is odd, append value 0 in your returned array.
-
diff --git a/problems/find-nearest-point-that-has-the-same-x-or-y-coordinate/README.md b/problems/find-nearest-point-that-has-the-same-x-or-y-coordinate/README.md
deleted file mode 100644
index f390364e6..000000000
--- a/problems/find-nearest-point-that-has-the-same-x-or-y-coordinate/README.md
+++ /dev/null
@@ -1,61 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../shortest-path-in-a-hidden-grid "Shortest Path in a Hidden Grid")
-
-[Next >](../check-if-number-is-a-sum-of-powers-of-three "Check if Number is a Sum of Powers of Three")
-
-## [1779. Find Nearest Point That Has the Same X or Y Coordinate (Easy)](https://leetcode.com/problems/find-nearest-point-that-has-the-same-x-or-y-coordinate "找到最近的有相同 X 或 Y 坐标的点")
-
-
You are given two integers, x and y, which represent your current location on a Cartesian grid: (x, y). You are also given an array points where each points[i] = [ai, bi] represents that a point exists at (ai, bi). A point is valid if it shares the same x-coordinate or the same y-coordinate as your location.
-
-
Return the index (0-indexed) of the valid point with the smallest Manhattan distance from your current location. If there are multiple, return the valid point with the smallest index. If there are no valid points, return -1.
-
-
The Manhattan distance between two points (x1, y1) and (x2, y2) is abs(x1 - x2) + abs(y1 - y2).
-
-
-
Example 1:
-
-
-Input: x = 3, y = 4, points = [[1,2],[3,1],[2,4],[2,3],[4,4]]
-Output: 2
-Explanation: Of all the points, only [3,1], [2,4] and [4,4] are valid. Of the valid points, [2,4] and [4,4] have the smallest Manhattan distance from your current location, with a distance of 1. [2,4] has the smallest index, so return 2.
-
-
Example 2:
-
-
-Input: x = 3, y = 4, points = [[3,4]]
-Output: 0
-Explanation: The answer is allowed to be on the same location as your current location.
-
-
Example 3:
-
-
-Input: x = 3, y = 4, points = [[2,3]]
-Output: -1
-Explanation: There are no valid points.
-
-
-
Constraints:
-
-
-
1 <= points.length <= 104
-
points[i].length == 2
-
1 <= x, y, ai, bi <= 104
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
-
-### Similar Questions
- 1. [K Closest Points to Origin](../k-closest-points-to-origin) (Medium)
-
-### Hints
-
-Hint 1
-Iterate through each point, and keep track of the current point with the smallest Manhattan distance from your current location.
-
diff --git a/problems/find-nearest-right-node-in-binary-tree/README.md b/problems/find-nearest-right-node-in-binary-tree/README.md
deleted file mode 100644
index 3202654d0..000000000
--- a/problems/find-nearest-right-node-in-binary-tree/README.md
+++ /dev/null
@@ -1,40 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-number-of-achievable-transfer-requests "Maximum Number of Achievable Transfer Requests")
-
-[Next >](../design-parking-system "Design Parking System")
-
-## [1602. Find Nearest Right Node in Binary Tree (Medium)](https://leetcode.com/problems/find-nearest-right-node-in-binary-tree "找到二叉树中最近的右侧节点")
-
-
-
-### Related Topics
- [[Tree](../../tag/tree/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Binary Tree](../../tag/binary-tree/README.md)]
-
-### Hints
-
-Hint 1
-Use BFS, traverse the tree level by level and always push the left node first
-
-
-
-Hint 2
-When you reach the target node, mark a boolean variable true
-
-
-
-Hint 3
-If you meet another node in the same level after marking the boolean true, return this node.
-
-
-
-Hint 4
-If you did not meet new nodes in the same level and started traversing a new level, return Null
-
diff --git a/problems/find-numbers-with-even-number-of-digits/README.md b/problems/find-numbers-with-even-number-of-digits/README.md
deleted file mode 100644
index 22abd4751..000000000
--- a/problems/find-numbers-with-even-number-of-digits/README.md
+++ /dev/null
@@ -1,63 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../weather-type-in-each-country "Weather Type in Each Country")
-
-[Next >](../divide-array-in-sets-of-k-consecutive-numbers "Divide Array in Sets of K Consecutive Numbers")
-
-## [1295. Find Numbers with Even Number of Digits (Easy)](https://leetcode.com/problems/find-numbers-with-even-number-of-digits "统计位数为偶数的数字")
-
-
Given an array nums of integers, return how many of them contain an even number of digits.
-
-
-
Example 1:
-
-
-Input: nums = [12,345,2,6,7896]
-Output: 2
-Explanation:
-12 contains 2 digits (even number of digits).
-345 contains 3 digits (odd number of digits).
-2 contains 1 digit (odd number of digits).
-6 contains 1 digit (odd number of digits).
-7896 contains 4 digits (even number of digits).
-Therefore only 12 and 7896 contain an even number of digits.
-
-
-
Example 2:
-
-
-Input: nums = [555,901,482,1771]
-Output: 1
-Explanation:
-Only 1771 contains an even number of digits.
-
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 500
-
1 <= nums[i] <= 105
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
-
-### Similar Questions
- 1. [Finding 3-Digit Even Numbers](../finding-3-digit-even-numbers) (Easy)
-
-### Hints
-
-Hint 1
-How to compute the number of digits of a number ?
-
-
-
-Hint 2
-Divide the number by 10 again and again to get the number of digits.
-
diff --git a/problems/find-original-array-from-doubled-array/README.md b/problems/find-original-array-from-doubled-array/README.md
deleted file mode 100644
index 82ef650df..000000000
--- a/problems/find-original-array-from-doubled-array/README.md
+++ /dev/null
@@ -1,75 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../count-number-of-pairs-with-absolute-difference-k "Count Number of Pairs With Absolute Difference K")
-
-[Next >](../maximum-earnings-from-taxi "Maximum Earnings From Taxi")
-
-## [2007. Find Original Array From Doubled Array (Medium)](https://leetcode.com/problems/find-original-array-from-doubled-array "从双倍数组中还原原数组")
-
-
An integer array original is transformed into a doubled array changed by appending twice the value of every element in original, and then randomly shuffling the resulting array.
-
-
Given an array changed, return original if changed is a doubled array. If changed is not a doubled array, return an empty array. The elements inoriginalmay be returned in any order.
-
-
-
Example 1:
-
-
-Input: changed = [1,3,4,2,6,8]
-Output: [1,3,4]
-Explanation: One possible original array could be [1,3,4]:
-- Twice the value of 1 is 1 * 2 = 2.
-- Twice the value of 3 is 3 * 2 = 6.
-- Twice the value of 4 is 4 * 2 = 8.
-Other original arrays could be [4,3,1] or [3,1,4].
-
-
-
Example 2:
-
-
-Input: changed = [6,3,0,1]
-Output: []
-Explanation: changed is not a doubled array.
-
-
-
Example 3:
-
-
-Input: changed = [1]
-Output: []
-Explanation: changed is not a doubled array.
-
-
-
-
Constraints:
-
-
-
1 <= changed.length <= 105
-
0 <= changed[i] <= 105
-
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Hints
-
-Hint 1
-If changed is a doubled array, you should be able to delete elements and their doubled values until the array is empty.
-
-
-
-Hint 2
-Which element is guaranteed to not be a doubled value? It is the smallest element.
-
-
-
-Hint 3
-After removing the smallest element and its double from changed, is there another number that is guaranteed to not be a doubled value?
-
diff --git a/problems/find-peak-element/README.md b/problems/find-peak-element/README.md
deleted file mode 100644
index 88656e492..000000000
--- a/problems/find-peak-element/README.md
+++ /dev/null
@@ -1,52 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../one-edit-distance "One Edit Distance")
-
-[Next >](../missing-ranges "Missing Ranges")
-
-## [162. Find Peak Element (Medium)](https://leetcode.com/problems/find-peak-element "寻找峰值")
-
-
A peak element is an element that is strictly greater than its neighbors.
-
-
Given an integer array nums, find a peak element, and return its index. If the array contains multiple peaks, return the index to any of the peaks.
-
-
You may imagine that nums[-1] = nums[n] = -∞.
-
-
You must write an algorithm that runs in O(log n) time.
-
-
-
Example 1:
-
-
-Input: nums = [1,2,3,1]
-Output: 2
-Explanation: 3 is a peak element and your function should return the index number 2.
-
-
Example 2:
-
-
-Input: nums = [1,2,1,3,5,6,4]
-Output: 5
-Explanation: Your function can return either index number 1 where the peak element is 2, or index number 5 where the peak element is 6.
-By now, you are given a secret signature consisting of character 'D' and 'I'. 'D' represents a decreasing relationship between two numbers, 'I' represents an increasing relationship between two numbers. And our secret signature was constructed by a special integer array, which contains uniquely all the different number from 1 to n (n is the length of the secret signature plus 1). For example, the secret signature "DI" can be constructed by array [2,1,3] or [3,1,2], but won't be constructed by array [3,2,4] or [2,1,3,4], which are both illegal constructing special string that can't represent the "DI" secret signature.
-
-
-
-On the other hand, now your job is to find the lexicographically smallest permutation of [1, 2, ... n] could refer to the given secret signature in the input.
-
-
-
Example 1:
-
Input: "I"
-Output: [1,2]
-Explanation: [1,2] is the only legal initial spectial string can construct secret signature "I", where the number 1 and 2 construct an increasing relationship.
-
-
-
-
Example 2:
-
Input: "DI"
-Output: [2,1,3]
-Explanation: Both [2,1,3] and [3,1,2] can construct the secret signature "DI", but since we want to find the one with the smallest lexicographical permutation, you need to output [2,1,3]
-
-
-
-
Note:
-
The input string will only contain the character 'D' and 'I'.
-
The length of input string is a positive integer and will not exceed 10,000
Given an array of integers nums, calculate the pivot index of this array.
-
-
The pivot index is the index where the sum of all the numbers strictly to the left of the index is equal to the sum of all the numbers strictly to the index's right.
-
-
If the index is on the left edge of the array, then the left sum is 0 because there are no elements to the left. This also applies to the right edge of the array.
-
-
Return the leftmost pivot index. If no such index exists, return -1.
-Input: nums = [1,2,3]
-Output: -1
-Explanation:
-There is no index that satisfies the conditions in the problem statement.
-
-
Example 3:
-
-
-Input: nums = [2,1,-1]
-Output: 0
-Explanation:
-The pivot index is 0.
-Left sum = 0 (no elements to the left of index 0)
-Right sum = nums[1] + nums[2] = 1 + -1 = 0
-
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 104
-
-1000 <= nums[i] <= 1000
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Prefix Sum](../../tag/prefix-sum/README.md)]
-
-### Similar Questions
- 1. [Subarray Sum Equals K](../subarray-sum-equals-k) (Medium)
-
-### Hints
-
-Hint 1
-We can precompute prefix sums P[i] = nums[0] + nums[1] + ... + nums[i-1].
-Then for each index, the left sum is P[i], and the right sum is P[P.length - 1] - P[i] - nums[i].
-
diff --git a/problems/find-pivot-index/find_pivot_index.go b/problems/find-pivot-index/find_pivot_index.go
deleted file mode 100644
index 7e72cc4de..000000000
--- a/problems/find-pivot-index/find_pivot_index.go
+++ /dev/null
@@ -1,15 +0,0 @@
-package problem724
-
-func pivotIndex(nums []int) int {
- left, right := 0, 0
- for _, v := range nums {
- right += v
- }
- for i, v := range nums {
- if right -= v; left == right {
- return i
- }
- left += v
- }
- return -1
-}
diff --git a/problems/find-pivot-index/find_pivot_index_test.go b/problems/find-pivot-index/find_pivot_index_test.go
deleted file mode 100644
index e1d79c6e5..000000000
--- a/problems/find-pivot-index/find_pivot_index_test.go
+++ /dev/null
@@ -1,43 +0,0 @@
-package problem724
-
-import "testing"
-
-type testType struct {
- in []int
- want int
-}
-
-func TestPivotIndex(t *testing.T) {
- tests := [...]testType{
- {
- in: []int{1, 7, 3, 6, 5, 6},
- want: 3,
- },
- {
- in: []int{1, 2, 3},
- want: -1,
- },
- {
- in: []int{0},
- want: 0,
- },
- {
- in: []int{0, 0},
- want: 0,
- },
- {
- in: []int{1, 2, 1},
- want: 1,
- },
- {
- in: []int{},
- want: -1,
- },
- }
- for _, tt := range tests {
- got := pivotIndex(tt.in)
- if got != tt.want {
- t.Fatalf("in: %v, got: %v, want: %v", tt.in, got, tt.want)
- }
- }
-}
diff --git a/problems/find-positive-integer-solution-for-a-given-equation/README.md b/problems/find-positive-integer-solution-for-a-given-equation/README.md
deleted file mode 100644
index 51ee21ffb..000000000
--- a/problems/find-positive-integer-solution-for-a-given-equation/README.md
+++ /dev/null
@@ -1,87 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../web-crawler "Web Crawler")
-
-[Next >](../circular-permutation-in-binary-representation "Circular Permutation in Binary Representation")
-
-## [1237. Find Positive Integer Solution for a Given Equation (Medium)](https://leetcode.com/problems/find-positive-integer-solution-for-a-given-equation "找出给定方程的正整数解")
-
-
Given a callable function f(x, y)with a hidden formula and a value z, reverse engineer the formula and return all positive integer pairs x and y where f(x,y) == z. You may return the pairs in any order.
-
-
While the exact formula is hidden, the function is monotonically increasing, i.e.:
-
-
-
f(x, y) < f(x + 1, y)
-
f(x, y) < f(x, y + 1)
-
-
-
The function interface is defined like this:
-
-
-interface CustomFunction {
-public:
- // Returns some positive integer f(x, y) for two positive integers x and y based on a formula.
- int f(int x, int y);
-};
-
-
-
We will judge your solution as follows:
-
-
-
The judge has a list of 9 hidden implementations of CustomFunction, along with a way to generate an answer key of all valid pairs for a specific z.
-
The judge will receive two inputs: a function_id (to determine which implementation to test your code with), and the target z.
-
The judge will call your findSolution and compare your results with the answer key.
-
If your results match the answer key, your solution will be Accepted.
-
-
-
-
Example 1:
-
-
-Input: function_id = 1, z = 5
-Output: [[1,4],[2,3],[3,2],[4,1]]
-Explanation: The hidden formula for function_id = 1 is f(x, y) = x + y.
-The following positive integer values of x and y make f(x, y) equal to 5:
-x=1, y=4 -> f(1, 4) = 1 + 4 = 5.
-x=2, y=3 -> f(2, 3) = 2 + 3 = 5.
-x=3, y=2 -> f(3, 2) = 3 + 2 = 5.
-x=4, y=1 -> f(4, 1) = 4 + 1 = 5.
-
-
-
Example 2:
-
-
-Input: function_id = 2, z = 5
-Output: [[1,5],[5,1]]
-Explanation: The hidden formula for function_id = 2 is f(x, y) = x * y.
-The following positive integer values of x and y make f(x, y) equal to 5:
-x=1, y=5 -> f(1, 5) = 1 * 5 = 5.
-x=5, y=1 -> f(5, 1) = 5 * 1 = 5.
-
-
-
-
Constraints:
-
-
-
1 <= function_id <= 9
-
1 <= z <= 100
-
It is guaranteed that the solutions of f(x, y) == z will be in the range 1 <= x, y <= 1000.
-
It is also guaranteed that f(x, y) will fit in 32 bit signed integer if 1 <= x, y <= 1000.
-
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
- [[Two Pointers](../../tag/two-pointers/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
- [[Interactive](../../tag/interactive/README.md)]
-
-### Hints
-
-Hint 1
-Loop over 1 ≤ x,y ≤ 1000 and check if f(x,y) == z.
-
diff --git a/problems/find-right-interval/README.md b/problems/find-right-interval/README.md
deleted file mode 100644
index 629b32340..000000000
--- a/problems/find-right-interval/README.md
+++ /dev/null
@@ -1,64 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../non-overlapping-intervals "Non-overlapping Intervals")
-
-[Next >](../path-sum-iii "Path Sum III")
-
-## [436. Find Right Interval (Medium)](https://leetcode.com/problems/find-right-interval "寻找右区间")
-
-
You are given an array of intervals, where intervals[i] = [starti, endi] and each starti is unique.
-
-
The right interval for an interval i is an interval j such that startj >= endi and startj is minimized.
-
-
Return an array of right interval indices for each interval i. If no right interval exists for interval i, then put -1 at index i.
-
-
-
Example 1:
-
-
-Input: intervals = [[1,2]]
-Output: [-1]
-Explanation: There is only one interval in the collection, so it outputs -1.
-
-
-
Example 2:
-
-
-Input: intervals = [[3,4],[2,3],[1,2]]
-Output: [-1,0,1]
-Explanation: There is no right interval for [3,4].
-The right interval for [2,3] is [3,4] since start0 = 3 is the smallest start that is >= end1 = 3.
-The right interval for [1,2] is [2,3] since start1 = 2 is the smallest start that is >= end2 = 2.
-
-
-
Example 3:
-
-
-Input: intervals = [[1,4],[2,3],[3,4]]
-Output: [-1,2,-1]
-Explanation: There is no right interval for [1,4] and [3,4].
-The right interval for [2,3] is [3,4] since start2 = 3 is the smallest start that is >= end1 = 3.
-
-
-
-
Constraints:
-
-
-
1 <= intervals.length <= 2 * 104
-
intervals[i].length == 2
-
-106 <= starti <= endi <= 106
-
The start point of each interval is unique.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Similar Questions
- 1. [Data Stream as Disjoint Intervals](../data-stream-as-disjoint-intervals) (Hard)
diff --git a/problems/find-right-interval/find_right_interval.go b/problems/find-right-interval/find_right_interval.go
deleted file mode 100644
index 7a31fc39c..000000000
--- a/problems/find-right-interval/find_right_interval.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem436
diff --git a/problems/find-right-interval/find_right_interval_test.go b/problems/find-right-interval/find_right_interval_test.go
deleted file mode 100644
index 7a31fc39c..000000000
--- a/problems/find-right-interval/find_right_interval_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem436
diff --git a/problems/find-root-of-n-ary-tree/README.md b/problems/find-root-of-n-ary-tree/README.md
deleted file mode 100644
index 1e76d79f4..000000000
--- a/problems/find-root-of-n-ary-tree/README.md
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-possible-integer-after-at-most-k-adjacent-swaps-on-digits "Minimum Possible Integer After at Most K Adjacent Swaps On Digits")
-
-[Next >](../reformat-date "Reformat Date")
-
-## [1506. Find Root of N-Ary Tree (Medium)](https://leetcode.com/problems/find-root-of-n-ary-tree "找到 N 叉树的根节点")
-
-
-
-### Related Topics
- [[Bit Manipulation](../../tag/bit-manipulation/README.md)]
- [[Tree](../../tag/tree/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
-
-### Hints
-
-Hint 1
-Node with indegree 0 is the root
-
diff --git a/problems/find-servers-that-handled-most-number-of-requests/README.md b/problems/find-servers-that-handled-most-number-of-requests/README.md
deleted file mode 100644
index ac8510ccd..000000000
--- a/problems/find-servers-that-handled-most-number-of-requests/README.md
+++ /dev/null
@@ -1,86 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../find-valid-matrix-given-row-and-column-sums "Find Valid Matrix Given Row and Column Sums")
-
-[Next >](../sellers-with-no-sales "Sellers With No Sales")
-
-## [1606. Find Servers That Handled Most Number of Requests (Hard)](https://leetcode.com/problems/find-servers-that-handled-most-number-of-requests "找到处理最多请求的服务器")
-
-
You have k servers numbered from 0 to k-1 that are being used to handle multiple requests simultaneously. Each server has infinite computational capacity but cannot handle more than one request at a time. The requests are assigned to servers according to a specific algorithm:
-
-
-
The ith (0-indexed) request arrives.
-
If all servers are busy, the request is dropped (not handled at all).
-
If the (i % k)th server is available, assign the request to that server.
-
Otherwise, assign the request to the next available server (wrapping around the list of servers and starting from 0 if necessary). For example, if the ith server is busy, try to assign the request to the (i+1)th server, then the (i+2)th server, and so on.
-
-
-
You are given a strictly increasing array arrival of positive integers, where arrival[i] represents the arrival time of the ith request, and another array load, where load[i] represents the load of the ith request (the time it takes to complete). Your goal is to find the busiest server(s). A server is considered busiest if it handled the most number of requests successfully among all the servers.
-
-
Return a list containing the IDs (0-indexed) of the busiest server(s). You may return the IDs in any order.
-
-
-
Example 1:
-
-
-Input: k = 3, arrival = [1,2,3,4,5], load = [5,2,3,3,3]
-Output: [1]
-Explanation:
-All of the servers start out available.
-The first 3 requests are handled by the first 3 servers in order.
-Request 3 comes in. Server 0 is busy, so it's assigned to the next available server, which is 1.
-Request 4 comes in. It cannot be handled since all servers are busy, so it is dropped.
-Servers 0 and 2 handled one request each, while server 1 handled two requests. Hence server 1 is the busiest server.
-
-
-
Example 2:
-
-
-Input: k = 3, arrival = [1,2,3,4], load = [1,2,1,2]
-Output: [0]
-Explanation:
-The first 3 requests are handled by first 3 servers.
-Request 3 comes in. It is handled by server 0 since the server is available.
-Server 0 handled two requests, while servers 1 and 2 handled one request each. Hence server 0 is the busiest server.
-
-
-
Example 3:
-
-
-Input: k = 3, arrival = [1,2,3], load = [10,12,11]
-Output: [0,1,2]
-Explanation: Each server handles a single request, so they are all considered the busiest.
-
-
-
-
Constraints:
-
-
-
1 <= k <= 105
-
1 <= arrival.length, load.length <= 105
-
arrival.length == load.length
-
1 <= arrival[i], load[i] <= 109
-
arrival is strictly increasing.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Greedy](../../tag/greedy/README.md)]
- [[Heap (Priority Queue)](../../tag/heap-priority-queue/README.md)]
- [[Ordered Set](../../tag/ordered-set/README.md)]
-
-### Hints
-
-Hint 1
-To speed up the next available server search, keep track of the available servers in a sorted structure such as an ordered set.
-
-
-
-Hint 2
-To determine if a server is available, keep track of the end times for each task in a heap and add the server to the available set once the soonest task ending time is less than or equal to the next task to add.
-
diff --git a/problems/find-smallest-common-element-in-all-rows/README.md b/problems/find-smallest-common-element-in-all-rows/README.md
deleted file mode 100644
index e59271161..000000000
--- a/problems/find-smallest-common-element-in-all-rows/README.md
+++ /dev/null
@@ -1,59 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-knight-moves "Minimum Knight Moves")
-
-[Next >](../minimum-time-to-build-blocks "Minimum Time to Build Blocks")
-
-## [1198. Find Smallest Common Element in All Rows (Medium)](https://leetcode.com/problems/find-smallest-common-element-in-all-rows "找出所有行中最小公共元素")
-
-
Given a matrix mat where every row is sorted in increasing order, return the smallest common element in all rows.
-
-
If there is no common element, return -1.
-
-
-
-
Example 1:
-
Input: mat = [[1,2,3,4,5],[2,4,5,8,10],[3,5,7,9,11],[1,3,5,7,9]]
-Output: 5
-
-
-
Constraints:
-
-
-
1 <= mat.length, mat[i].length <= 500
-
1 <= mat[i][j] <= 10^4
-
mat[i] is sorted in increasing order.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
- [[Counting](../../tag/counting/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
-
-### Hints
-
-Hint 1
-Notice that each row has no duplicates.
-
-
-
-Hint 2
-Is counting the frequency of elements enough to find the answer?
-
-
-
-Hint 3
-Use a data structure to count the frequency of elements.
-
-
-
-Hint 4
-Find an element whose frequency equals the number of rows.
-
diff --git a/problems/find-smallest-letter-greater-than-target/README.md b/problems/find-smallest-letter-greater-than-target/README.md
deleted file mode 100644
index 49127e3fe..000000000
--- a/problems/find-smallest-letter-greater-than-target/README.md
+++ /dev/null
@@ -1,77 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../network-delay-time "Network Delay Time")
-
-[Next >](../prefix-and-suffix-search "Prefix and Suffix Search")
-
-## [744. Find Smallest Letter Greater Than Target (Easy)](https://leetcode.com/problems/find-smallest-letter-greater-than-target "寻找比目标字母大的最小字母")
-
-
Given a characters array letters that is sorted in non-decreasing order and a character target, return the smallest character in the array that is larger than target.
-
-
Note that the letters wrap around.
-
-
-
For example, if target == 'z' and letters == ['a', 'b'], the answer is 'a'.
-
-
-
-
Example 1:
-
-
-Input: letters = ["c","f","j"], target = "a"
-Output: "c"
-
letters contains at least two different characters.
-
target is a lowercase English letter.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
-
-### Hints
-
-Hint 1
-Try to find whether each of 26 next letters are in the given string array.
-
diff --git a/problems/find-smallest-letter-greater-than-target/find_smallest_letter_greater_than_target.go b/problems/find-smallest-letter-greater-than-target/find_smallest_letter_greater_than_target.go
deleted file mode 100644
index 22d1ed62d..000000000
--- a/problems/find-smallest-letter-greater-than-target/find_smallest_letter_greater_than_target.go
+++ /dev/null
@@ -1,10 +0,0 @@
-package problem744
-
-func nextGreatestLetter(letters []byte, target byte) byte {
- for _, v := range letters {
- if v > target {
- return v
- }
- }
- return letters[0]
-}
diff --git a/problems/find-smallest-letter-greater-than-target/find_smallest_letter_greater_than_target_test.go b/problems/find-smallest-letter-greater-than-target/find_smallest_letter_greater_than_target_test.go
deleted file mode 100644
index aa9ca5644..000000000
--- a/problems/find-smallest-letter-greater-than-target/find_smallest_letter_greater_than_target_test.go
+++ /dev/null
@@ -1,50 +0,0 @@
-package problem744
-
-import "testing"
-
-type testType struct {
- in []byte
- target byte
- want byte
-}
-
-func TestNextGreatestLetter(t *testing.T) {
- tests := [...]testType{
- {
- in: []byte{'c', 'f', 'j'},
- target: 'a',
- want: 'c',
- },
- {
- in: []byte{'c', 'f', 'j'},
- target: 'c',
- want: 'f',
- },
- {
- in: []byte{'c', 'f', 'j'},
- target: 'd',
- want: 'f',
- },
- {
- in: []byte{'c', 'f', 'j'},
- target: 'g',
- want: 'j',
- },
- {
- in: []byte{'c', 'f', 'j'},
- target: 'j',
- want: 'c',
- },
- {
- in: []byte{'c', 'f', 'j'},
- target: 'k',
- want: 'c',
- },
- }
- for _, tt := range tests {
- got := nextGreatestLetter(tt.in, tt.target)
- if got != tt.want {
- t.Fatalf("in: %v, got: %v, want: %v", tt.in, got, tt.want)
- }
- }
-}
diff --git a/problems/find-subsequence-of-length-k-with-the-largest-sum/README.md b/problems/find-subsequence-of-length-k-with-the-largest-sum/README.md
deleted file mode 100644
index dcdab30b2..000000000
--- a/problems/find-subsequence-of-length-k-with-the-largest-sum/README.md
+++ /dev/null
@@ -1,72 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../subsequence-of-size-k-with-the-largest-even-sum "Subsequence of Size K With the Largest Even Sum")
-
-[Next >](../find-good-days-to-rob-the-bank "Find Good Days to Rob the Bank")
-
-## [2099. Find Subsequence of Length K With the Largest Sum (Easy)](https://leetcode.com/problems/find-subsequence-of-length-k-with-the-largest-sum "找到和最大的长度为 K 的子序列")
-
-
You are given an integer array nums and an integer k. You want to find a subsequence of nums of length k that has the largest sum.
-
-
Returnany such subsequence as an integer array of length k.
-
-
A subsequence is an array that can be derived from another array by deleting some or no elements without changing the order of the remaining elements.
-
-
-
Example 1:
-
-
-Input: nums = [2,1,3,3], k = 2
-Output: [3,3]
-Explanation:
-The subsequence has the largest sum of 3 + 3 = 6.
-
-
Example 2:
-
-
-Input: nums = [-1,-2,3,4], k = 3
-Output: [-1,3,4]
-Explanation:
-The subsequence has the largest sum of -1 + 3 + 4 = 6.
-
-
-
Example 3:
-
-
-Input: nums = [3,4,3,3], k = 2
-Output: [3,4]
-Explanation:
-The subsequence has the largest sum of 3 + 4 = 7.
-Another possible subsequence is [4, 3].
-
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 1000
-
-105 <= nums[i] <= 105
-
1 <= k <= nums.length
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
- [[Heap (Priority Queue)](../../tag/heap-priority-queue/README.md)]
-
-### Hints
-
-Hint 1
-From a greedy perspective, what k elements should you pick?
-
-
-
-Hint 2
-Could you sort the array while maintaining the index?
-
diff --git a/problems/find-substring-with-given-hash-value/README.md b/problems/find-substring-with-given-hash-value/README.md
deleted file mode 100644
index 0c9182b7e..000000000
--- a/problems/find-substring-with-given-hash-value/README.md
+++ /dev/null
@@ -1,75 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../all-divisions-with-the-highest-score-of-a-binary-array "All Divisions With the Highest Score of a Binary Array")
-
-[Next >](../groups-of-strings "Groups of Strings")
-
-## [2156. Find Substring With Given Hash Value (Medium)](https://leetcode.com/problems/find-substring-with-given-hash-value "查找给定哈希值的子串")
-
-
The hash of a 0-indexed string s of length k, given integers p and m, is computed using the following function:
-
-
-
hash(s, p, m) = (val(s[0]) * p0 + val(s[1]) * p1 + ... + val(s[k-1]) * pk-1) mod m.
-
-
-
Where val(s[i]) represents the index of s[i] in the alphabet from val('a') = 1 to val('z') = 26.
-
-
You are given a string s and the integers power, modulo, k, and hashValue. Return sub, the firstsubstring of s of length k such that hash(sub, power, modulo) == hashValue.
-
-
The test cases will be generated such that an answer always exists.
-
-
A substring is a contiguous non-empty sequence of characters within a string.
-
-
-
Example 1:
-
-
-Input: s = "leetcode", power = 7, modulo = 20, k = 2, hashValue = 0
-Output: "ee"
-Explanation: The hash of "ee" can be computed to be hash("ee", 7, 20) = (5 * 1 + 5 * 7) mod 20 = 40 mod 20 = 0.
-"ee" is the first substring of length 2 with hashValue 0. Hence, we return "ee".
-
-
-
Example 2:
-
-
-Input: s = "fbxzaad", power = 31, modulo = 100, k = 3, hashValue = 32
-Output: "fbx"
-Explanation: The hash of "fbx" can be computed to be hash("fbx", 31, 100) = (6 * 1 + 2 * 31 + 24 * 312) mod 100 = 23132 mod 100 = 32.
-The hash of "bxz" can be computed to be hash("bxz", 31, 100) = (2 * 1 + 24 * 31 + 26 * 312) mod 100 = 25732 mod 100 = 32.
-"fbx" is the first substring of length 3 with hashValue 32. Hence, we return "fbx".
-Note that "bxz" also has a hash of 32 but it appears later than "fbx".
-
-
-
-
Constraints:
-
-
-
1 <= k <= s.length <= 2 * 104
-
1 <= power, modulo <= 109
-
0 <= hashValue < modulo
-
s consists of lowercase English letters only.
-
The test cases are generated such that an answer always exists.
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
- [[Sliding Window](../../tag/sliding-window/README.md)]
- [[Hash Function](../../tag/hash-function/README.md)]
- [[Rolling Hash](../../tag/rolling-hash/README.md)]
-
-### Hints
-
-Hint 1
-How can we update the hash value efficiently while iterating instead of recalculating it each time?
-
-
-
-Hint 2
-Use the rolling hash method.
-
diff --git a/problems/find-target-indices-after-sorting-array/README.md b/problems/find-target-indices-after-sorting-array/README.md
deleted file mode 100644
index ef7f2708f..000000000
--- a/problems/find-target-indices-after-sorting-array/README.md
+++ /dev/null
@@ -1,70 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../count-fertile-pyramids-in-a-land "Count Fertile Pyramids in a Land")
-
-[Next >](../k-radius-subarray-averages "K Radius Subarray Averages")
-
-## [2089. Find Target Indices After Sorting Array (Easy)](https://leetcode.com/problems/find-target-indices-after-sorting-array "找出数组排序后的目标下标")
-
-
You are given a 0-indexed integer array nums and a target element target.
-
-
A target index is an index i such that nums[i] == target.
-
-
Return a list of the target indices ofnums after sorting nums in non-decreasing order. If there are no target indices, return an empty list. The returned list must be sorted in increasing order.
-
-
-
Example 1:
-
-
-Input: nums = [1,2,5,2,3], target = 2
-Output: [1,2]
-Explanation: After sorting, nums is [1,2,2,3,5].
-The indices where nums[i] == 2 are 1 and 2.
-
-
-
Example 2:
-
-
-Input: nums = [1,2,5,2,3], target = 3
-Output: [3]
-Explanation: After sorting, nums is [1,2,2,3,5].
-The index where nums[i] == 3 is 3.
-
-
-
Example 3:
-
-
-Input: nums = [1,2,5,2,3], target = 5
-Output: [4]
-Explanation: After sorting, nums is [1,2,2,3,5].
-The index where nums[i] == 5 is 4.
-
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 100
-
1 <= nums[i], target <= 100
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Hints
-
-Hint 1
-Try "sorting" the array first.
-
-
-
-Hint 2
-Now find all indices in the array whose values are equal to target.
-
diff --git a/problems/find-the-celebrity/README.md b/problems/find-the-celebrity/README.md
deleted file mode 100644
index 41679c4a7..000000000
--- a/problems/find-the-celebrity/README.md
+++ /dev/null
@@ -1,76 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../paint-fence "Paint Fence")
-
-[Next >](../first-bad-version "First Bad Version")
-
-## [277. Find the Celebrity (Medium)](https://leetcode.com/problems/find-the-celebrity "搜寻名人")
-
-
Suppose you are at a party with n people (labeled from 0 to n - 1) and among them, there may exist one celebrity. The definition of a celebrity is that all the other n - 1 people know him/her but he/she does not know any of them.
-
-
Now you want to find out who the celebrity is or verify that there is not one. The only thing you are allowed to do is to ask questions like: "Hi, A. Do you know B?" to get information of whether A knows B. You need to find out the celebrity (or verify there is not one) by asking as few questions as possible (in the asymptotic sense).
-
-
You are given a helper function bool knows(a, b) which tells you whether A knows B. Implement a function int findCelebrity(n). There will be exactly one celebrity if he/she is in the party. Return the celebrity's label if there is a celebrity in the party. If there is no celebrity, return -1.
-
-
-
-
Example 1:
-
-
-Input: graph = [
- [1,1,0],
- [0,1,0],
- [1,1,1]
-]
-Output: 1
-Explanation: There are three persons labeled with 0, 1 and 2. graph[i][j] = 1 means person i knows person j, otherwise graph[i][j] = 0 means person i does not know person j. The celebrity is the person labeled as 1 because both 0 and 2 know him but 1 does not know anybody.
-
-
-
Example 2:
-
-
-Input: graph = [
- [1,0,1],
- [1,1,0],
- [0,1,1]
-]
-Output: -1
-Explanation: There is no celebrity.
-
-
-
-
-
Note:
-
-
-
The directed graph is represented as an adjacency matrix, which is an n x n matrix where a[i][j] = 1 means person i knows person j while a[i][j] = 0 means the contrary.
-
Remember that you won't have direct access to the adjacency matrix.
-
-
-### Related Topics
- [[Two Pointers](../../tag/two-pointers/README.md)]
- [[Greedy](../../tag/greedy/README.md)]
- [[Graph](../../tag/graph/README.md)]
- [[Interactive](../../tag/interactive/README.md)]
-
-### Similar Questions
- 1. [Find the Town Judge](../find-the-town-judge) (Easy)
-
-### Hints
-
-Hint 1
-The best hint for this problem can be provided by the following figure:
-
-
-
-
-
-
-Hint 2
-Well, if you understood the gist of the above idea, you can extend it to find a candidate that can possibly be a celebrity. Why do we say a "candidate"? That is for you to think. This is clearly a greedy approach to find the answer. However, there is some information that would still remain to be verified without which we can't obtain an answer with certainty. To get that stake in the ground, we would need some more calls to the knows API.
-
diff --git a/problems/find-the-celebrity/find_the_celebrity.go b/problems/find-the-celebrity/find_the_celebrity.go
deleted file mode 100644
index f701a935b..000000000
--- a/problems/find-the-celebrity/find_the_celebrity.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem277
diff --git a/problems/find-the-celebrity/find_the_celebrity_test.go b/problems/find-the-celebrity/find_the_celebrity_test.go
deleted file mode 100644
index f701a935b..000000000
--- a/problems/find-the-celebrity/find_the_celebrity_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem277
diff --git a/problems/find-the-city-with-the-smallest-number-of-neighbors-at-a-threshold-distance/README.md b/problems/find-the-city-with-the-smallest-number-of-neighbors-at-a-threshold-distance/README.md
deleted file mode 100644
index fe8cd7fdf..000000000
--- a/problems/find-the-city-with-the-smallest-number-of-neighbors-at-a-threshold-distance/README.md
+++ /dev/null
@@ -1,79 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../filter-restaurants-by-vegan-friendly-price-and-distance "Filter Restaurants by Vegan-Friendly, Price and Distance")
-
-[Next >](../minimum-difficulty-of-a-job-schedule "Minimum Difficulty of a Job Schedule")
-
-## [1334. Find the City With the Smallest Number of Neighbors at a Threshold Distance (Medium)](https://leetcode.com/problems/find-the-city-with-the-smallest-number-of-neighbors-at-a-threshold-distance "阈值距离内邻居最少的城市")
-
-
There are n cities numbered from 0 to n-1. Given the array edges where edges[i] = [fromi, toi, weighti] represents a bidirectional and weighted edge between cities fromi and toi, and given the integer distanceThreshold.
-
-
Return the city with the smallest number of cities that are reachable through some path and whose distance is at mostdistanceThreshold, If there are multiple such cities, return the city with the greatest number.
-
-
Notice that the distance of a path connecting cities i and j is equal to the sum of the edges' weights along that path.
-
-
-
Example 1:
-
-
-Input: n = 4, edges = [[0,1,3],[1,2,1],[1,3,4],[2,3,1]], distanceThreshold = 4
-Output: 3
-Explanation: The figure above describes the graph.
-The neighboring cities at a distanceThreshold = 4 for each city are:
-City 0 -> [City 1, City 2]
-City 1 -> [City 0, City 2, City 3]
-City 2 -> [City 0, City 1, City 3]
-City 3 -> [City 1, City 2]
-Cities 0 and 3 have 2 neighboring cities at a distanceThreshold = 4, but we have to return city 3 since it has the greatest number.
-
-
-
Example 2:
-
-
-Input: n = 5, edges = [[0,1,2],[0,4,8],[1,2,3],[1,4,2],[2,3,1],[3,4,1]], distanceThreshold = 2
-Output: 0
-Explanation: The figure above describes the graph.
-The neighboring cities at a distanceThreshold = 2 for each city are:
-City 0 -> [City 1]
-City 1 -> [City 0, City 4]
-City 2 -> [City 3, City 4]
-City 3 -> [City 2, City 4]
-City 4 -> [City 1, City 2, City 3]
-The city 0 has 1 neighboring city at a distanceThreshold = 2.
-
-
-
-
Constraints:
-
-
-
2 <= n <= 100
-
1 <= edges.length <= n * (n - 1) / 2
-
edges[i].length == 3
-
0 <= fromi < toi < n
-
1 <= weighti, distanceThreshold <= 10^4
-
All pairs (fromi, toi) are distinct.
-
-
-### Related Topics
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Graph](../../tag/graph/README.md)]
- [[Shortest Path](../../tag/shortest-path/README.md)]
-
-### Similar Questions
- 1. [Second Minimum Time to Reach Destination](../second-minimum-time-to-reach-destination) (Hard)
-
-### Hints
-
-Hint 1
-Use Floyd-Warshall's algorithm to compute any-point to any-point distances. (Or can also do Dijkstra from every node due to the weights are non-negative).
-
-
-
-Hint 2
-For each city calculate the number of reachable cities within the threshold, then search for the optimal city.
-
diff --git a/problems/find-the-closest-palindrome/README.md b/problems/find-the-closest-palindrome/README.md
deleted file mode 100644
index 59015a153..000000000
--- a/problems/find-the-closest-palindrome/README.md
+++ /dev/null
@@ -1,70 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../binary-tree-tilt "Binary Tree Tilt")
-
-[Next >](../array-nesting "Array Nesting")
-
-## [564. Find the Closest Palindrome (Hard)](https://leetcode.com/problems/find-the-closest-palindrome "寻找最近的回文数")
-
-
Given a string n representing an integer, return the closest integer (not including itself), which is a palindrome. If there is a tie, return the smaller one.
-
-
The closest is defined as the absolute difference minimized between two integers.
-
-
-
Example 1:
-
-
-Input: n = "123"
-Output: "121"
-
-
-
Example 2:
-
-
-Input: n = "1"
-Output: "0"
-Explanation: 0 and 2 are the closest palindromes but we return the smallest which is 0.
-
-
-
-
Constraints:
-
-
-
1 <= n.length <= 18
-
n consists of only digits.
-
n does not have leading zeros.
-
n is representing an integer in the range [1, 1018 - 1].
-
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Similar Questions
- 1. [Next Palindrome Using Same Digits](../next-palindrome-using-same-digits) (Hard)
-
-### Hints
-
-Hint 1
-Will brute force work for this problem? Think of something else.
-
-
-
-Hint 2
-Take some examples like 1234, 999,1000, etc and check their closest palindromes. How many different cases are possible?
-
-
-
-Hint 3
-Do we have to consider only left half or right half of the string or both?
-
-
-
-Hint 4
-Try to find the closest palindrome of these numbers- 12932, 99800, 12120. Did you observe something?
-
diff --git a/problems/find-the-closest-palindrome/find_the_closest_palindrome.go b/problems/find-the-closest-palindrome/find_the_closest_palindrome.go
deleted file mode 100644
index 514f80ae9..000000000
--- a/problems/find-the-closest-palindrome/find_the_closest_palindrome.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem564
diff --git a/problems/find-the-closest-palindrome/find_the_closest_palindrome_test.go b/problems/find-the-closest-palindrome/find_the_closest_palindrome_test.go
deleted file mode 100644
index 514f80ae9..000000000
--- a/problems/find-the-closest-palindrome/find_the_closest_palindrome_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem564
diff --git a/problems/find-the-derangement-of-an-array/README.md b/problems/find-the-derangement-of-an-array/README.md
deleted file mode 100644
index 0bfe1bf04..000000000
--- a/problems/find-the-derangement-of-an-array/README.md
+++ /dev/null
@@ -1,40 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../sum-of-square-numbers "Sum of Square Numbers")
-
-[Next >](../design-log-storage-system "Design Log Storage System")
-
-## [634. Find the Derangement of An Array (Medium)](https://leetcode.com/problems/find-the-derangement-of-an-array "寻找数组的错位排列")
-
-
-In combinatorial mathematics, a derangement is a permutation of the elements of a set, such that no element appears in its original position.
-
-
-
-There's originally an array consisting of n integers from 1 to n in ascending order, you need to find the number of derangement it can generate.
-
-
-
-Also, since the answer may be very large, you should return the output mod 109 + 7.
-
-
-
Example 1:
-
-Input: 3
-Output: 2
-Explanation: The original array is [1,2,3]. The two derangements are [2,3,1] and [3,1,2].
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Two Pointers](../../tag/two-pointers/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Hints
-
-Hint 1
-Sort 'arr2' and use binary search to get the closest element for each 'arr1[i]', it gives a time complexity of O(nlogn).
-
diff --git a/problems/find-the-duplicate-number/README.md b/problems/find-the-duplicate-number/README.md
deleted file mode 100644
index aa3962156..000000000
--- a/problems/find-the-duplicate-number/README.md
+++ /dev/null
@@ -1,63 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../walls-and-gates "Walls and Gates")
-
-[Next >](../unique-word-abbreviation "Unique Word Abbreviation")
-
-## [287. Find the Duplicate Number (Medium)](https://leetcode.com/problems/find-the-duplicate-number "寻找重复数")
-
-
Given an array of integers nums containing n + 1 integers where each integer is in the range [1, n] inclusive.
-
-
There is only one repeated number in nums, return this repeated number.
-
-
You must solve the problem without modifying the array nums and uses only constant extra space.
-
-
-
Example 1:
-
Input: nums = [1,3,4,2,2]
-Output: 2
-
Example 2:
-
Input: nums = [3,1,3,4,2]
-Output: 3
-
Example 3:
-
Input: nums = [1,1]
-Output: 1
-
Example 4:
-
Input: nums = [1,1,2]
-Output: 1
-
-
-
Constraints:
-
-
-
1 <= n <= 105
-
nums.length == n + 1
-
1 <= nums[i] <= n
-
All the integers in nums appear only once except for precisely one integer which appears two or more times.
-
-
-
-
Follow up:
-
-
-
How can we prove that at least one duplicate number must exist in nums?
-
Can you solve the problem in linear runtime complexity?
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Two Pointers](../../tag/two-pointers/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
- [[Bit Manipulation](../../tag/bit-manipulation/README.md)]
-
-### Similar Questions
- 1. [First Missing Positive](../first-missing-positive) (Hard)
- 1. [Single Number](../single-number) (Easy)
- 1. [Linked List Cycle II](../linked-list-cycle-ii) (Medium)
- 1. [Missing Number](../missing-number) (Easy)
- 1. [Set Mismatch](../set-mismatch) (Easy)
diff --git a/problems/find-the-duplicate-number/find_the_duplicate_number.go b/problems/find-the-duplicate-number/find_the_duplicate_number.go
deleted file mode 100644
index b3ced95a6..000000000
--- a/problems/find-the-duplicate-number/find_the_duplicate_number.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem287
diff --git a/problems/find-the-duplicate-number/find_the_duplicate_number_test.go b/problems/find-the-duplicate-number/find_the_duplicate_number_test.go
deleted file mode 100644
index b3ced95a6..000000000
--- a/problems/find-the-duplicate-number/find_the_duplicate_number_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem287
diff --git a/problems/find-the-highest-altitude/README.md b/problems/find-the-highest-altitude/README.md
deleted file mode 100644
index d4cdabadb..000000000
--- a/problems/find-the-highest-altitude/README.md
+++ /dev/null
@@ -1,57 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../the-number-of-employees-which-report-to-each-employee "The Number of Employees Which Report to Each Employee")
-
-[Next >](../minimum-number-of-people-to-teach "Minimum Number of People to Teach")
-
-## [1732. Find the Highest Altitude (Easy)](https://leetcode.com/problems/find-the-highest-altitude "找到最高海拔")
-
-
There is a biker going on a road trip. The road trip consists of n + 1 points at different altitudes. The biker starts his trip on point 0 with altitude equal 0.
-
-
You are given an integer array gain of length n where gain[i] is the net gain in altitude between points i and i + 1 for all (0 <= i < n). Return the highest altitude of a point.
-
-
-
Example 1:
-
-
-Input: gain = [-5,1,5,0,-7]
-Output: 1
-Explanation: The altitudes are [0,-5,-4,1,1,-6]. The highest is 1.
-
-
-
Example 2:
-
-
-Input: gain = [-4,-3,-2,-1,4,3,2]
-Output: 0
-Explanation: The altitudes are [0,-4,-7,-9,-10,-6,-3,-1]. The highest is 0.
-
-
-
-
Constraints:
-
-
-
n == gain.length
-
1 <= n <= 100
-
-100 <= gain[i] <= 100
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Prefix Sum](../../tag/prefix-sum/README.md)]
-
-### Hints
-
-Hint 1
-Let's note that the altitude of an element is the sum of gains of all the elements behind it
-
-
-
-Hint 2
-Getting the altitudes can be done by getting the prefix sum array of the given array
-
diff --git a/problems/find-the-index-of-the-large-integer/README.md b/problems/find-the-index-of-the-large-integer/README.md
deleted file mode 100644
index 4206c138e..000000000
--- a/problems/find-the-index-of-the-large-integer/README.md
+++ /dev/null
@@ -1,30 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../the-most-recent-three-orders "The Most Recent Three Orders")
-
-[Next >](../count-good-triplets "Count Good Triplets")
-
-## [1533. Find the Index of the Large Integer (Medium)](https://leetcode.com/problems/find-the-index-of-the-large-integer "找到最大整数的索引")
-
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
- [[Interactive](../../tag/interactive/README.md)]
-
-### Hints
-
-Hint 1
-Do a binary search over the array, exclude the half of the array that doesn't contain the largest number.
-
-
-
-Hint 2
-Keep shrinking the search space till it reaches the size of 2 where you can easily determine which one has the largest integer.
-
diff --git a/problems/find-the-kth-largest-integer-in-the-array/README.md b/problems/find-the-kth-largest-integer-in-the-array/README.md
deleted file mode 100644
index 26ca0ca05..000000000
--- a/problems/find-the-kth-largest-integer-in-the-array/README.md
+++ /dev/null
@@ -1,88 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-difference-between-highest-and-lowest-of-k-scores "Minimum Difference Between Highest and Lowest of K Scores")
-
-[Next >](../minimum-number-of-work-sessions-to-finish-the-tasks "Minimum Number of Work Sessions to Finish the Tasks")
-
-## [1985. Find the Kth Largest Integer in the Array (Medium)](https://leetcode.com/problems/find-the-kth-largest-integer-in-the-array "找出数组中的第 K 大整数")
-
-
You are given an array of strings nums and an integer k. Each string in nums represents an integer without leading zeros.
-
-
Return the string that represents the kth largest integer in nums.
-
-
Note: Duplicate numbers should be counted distinctly. For example, if nums is ["1","2","2"], "2" is the first largest integer, "2" is the second-largest integer, and "1" is the third-largest integer.
-
-
-
Example 1:
-
-
-Input: nums = ["3","6","7","10"], k = 4
-Output: "3"
-Explanation:
-The numbers in nums sorted in non-decreasing order are ["3","6","7","10"].
-The 4th largest integer in nums is "3".
-
-
-
Example 2:
-
-
-Input: nums = ["2","21","12","1"], k = 3
-Output: "2"
-Explanation:
-The numbers in nums sorted in non-decreasing order are ["1","2","12","21"].
-The 3rd largest integer in nums is "2".
-
-
-
Example 3:
-
-
-Input: nums = ["0","0"], k = 2
-Output: "0"
-Explanation:
-The numbers in nums sorted in non-decreasing order are ["0","0"].
-The 2nd largest integer in nums is "0".
-
-
-
-
Constraints:
-
-
-
1 <= k <= nums.length <= 104
-
1 <= nums[i].length <= 100
-
nums[i] consists of only digits.
-
nums[i] will not have any leading zeros.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[String](../../tag/string/README.md)]
- [[Divide and Conquer](../../tag/divide-and-conquer/README.md)]
- [[Quickselect](../../tag/quickselect/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
- [[Heap (Priority Queue)](../../tag/heap-priority-queue/README.md)]
-
-### Hints
-
-Hint 1
-If two numbers have different lengths, which one will be larger?
-
-
-
-Hint 2
-The longer number is the larger number.
-
-
-
-Hint 3
-If two numbers have the same length, which one will be larger?
-
-
-
-Hint 4
-Compare the two numbers starting from the most significant digit. Once you have found the first digit that differs, the one with the larger digit is the larger number.
-
diff --git a/problems/find-the-kth-smallest-sum-of-a-matrix-with-sorted-rows/README.md b/problems/find-the-kth-smallest-sum-of-a-matrix-with-sorted-rows/README.md
deleted file mode 100644
index 04ac15592..000000000
--- a/problems/find-the-kth-smallest-sum-of-a-matrix-with-sorted-rows/README.md
+++ /dev/null
@@ -1,68 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../longest-continuous-subarray-with-absolute-diff-less-than-or-equal-to-limit "Longest Continuous Subarray With Absolute Diff Less Than or Equal to Limit")
-
-[Next >](../evaluate-boolean-expression "Evaluate Boolean Expression")
-
-## [1439. Find the Kth Smallest Sum of a Matrix With Sorted Rows (Hard)](https://leetcode.com/problems/find-the-kth-smallest-sum-of-a-matrix-with-sorted-rows "有序矩阵中的第 k 个最小数组和")
-
-
You are given an m x n matrix mat that has its rows sorted in non-decreasing order and an integer k.
-
-
You are allowed to choose exactly one element from each row to form an array.
-
-
Return the kth smallest array sum among all possible arrays.
-
-
-
Example 1:
-
-
-Input: mat = [[1,3,11],[2,4,6]], k = 5
-Output: 7
-Explanation: Choosing one element from each row, the first k smallest sum are:
-[1,2], [1,4], [3,2], [3,4], [1,6]. Where the 5th sum is 7.
-
-
-
Example 2:
-
-
-Input: mat = [[1,3,11],[2,4,6]], k = 9
-Output: 17
-
-
-
Example 3:
-
-
-Input: mat = [[1,10,10],[1,4,5],[2,3,6]], k = 7
-Output: 9
-Explanation: Choosing one element from each row, the first k smallest sum are:
-[1,1,2], [1,1,3], [1,4,2], [1,4,3], [1,1,6], [1,5,2], [1,5,3]. Where the 7th sum is 9.
-
-
-
-
Constraints:
-
-
-
m == mat.length
-
n == mat.length[i]
-
1 <= m, n <= 40
-
1 <= mat[i][j] <= 5000
-
1 <= k <= min(200, nm)
-
mat[i] is a non-decreasing array.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
- [[Heap (Priority Queue)](../../tag/heap-priority-queue/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
-
-### Hints
-
-Hint 1
-Save all visited sums and corresponding indexes in a priority queue. Then, once you pop the smallest sum so far, you can quickly identify the next m candidates for smallest sum by incrementing each row index by 1.
-
diff --git a/problems/find-the-longest-substring-containing-vowels-in-even-counts/README.md b/problems/find-the-longest-substring-containing-vowels-in-even-counts/README.md
deleted file mode 100644
index 686360ad1..000000000
--- a/problems/find-the-longest-substring-containing-vowels-in-even-counts/README.md
+++ /dev/null
@@ -1,64 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../increasing-decreasing-string "Increasing Decreasing String")
-
-[Next >](../longest-zigzag-path-in-a-binary-tree "Longest ZigZag Path in a Binary Tree")
-
-## [1371. Find the Longest Substring Containing Vowels in Even Counts (Medium)](https://leetcode.com/problems/find-the-longest-substring-containing-vowels-in-even-counts "每个元音包含偶数次的最长子字符串")
-
-
Given the string s, return the size of the longest substring containing each vowel an even number of times. That is, 'a', 'e', 'i', 'o', and 'u' must appear an even number of times.
-
-
-
Example 1:
-
-
-Input: s = "eleetminicoworoep"
-Output: 13
-Explanation: The longest substring is "leetminicowor" which contains two each of the vowels: e, i and o and zero of the vowels: a and u.
-
-
-
Example 2:
-
-
-Input: s = "leetcodeisgreat"
-Output: 5
-Explanation: The longest substring is "leetc" which contains two e's.
-
-
-
Example 3:
-
-
-Input: s = "bcbcbc"
-Output: 6
-Explanation: In this case, the given string "bcbcbc" is the longest because all vowels: a, e, i, o and u appear zero times.
-
-
-
-
Constraints:
-
-
-
1 <= s.length <= 5 x 10^5
-
s contains only lowercase English letters.
-
-
-### Related Topics
- [[Bit Manipulation](../../tag/bit-manipulation/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
- [[Prefix Sum](../../tag/prefix-sum/README.md)]
-
-### Hints
-
-Hint 1
-Represent the counts (odd or even) of vowels with a bitmask.
-
-
-
-Hint 2
-Precompute the prefix xor for the bitmask of vowels and then get the longest valid substring.
-
diff --git a/problems/find-the-longest-valid-obstacle-course-at-each-position/README.md b/problems/find-the-longest-valid-obstacle-course-at-each-position/README.md
deleted file mode 100644
index 92086d4ed..000000000
--- a/problems/find-the-longest-valid-obstacle-course-at-each-position/README.md
+++ /dev/null
@@ -1,88 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-number-of-swaps-to-make-the-string-balanced "Minimum Number of Swaps to Make the String Balanced")
-
-[Next >](../employees-with-missing-information "Employees With Missing Information")
-
-## [1964. Find the Longest Valid Obstacle Course at Each Position (Hard)](https://leetcode.com/problems/find-the-longest-valid-obstacle-course-at-each-position "找出到每个位置为止最长的有效障碍赛跑路线")
-
-
You want to build some obstacle courses. You are given a 0-indexed integer array obstacles of length n, where obstacles[i] describes the height of the ith obstacle.
-
-
For every index i between 0 and n - 1 (inclusive), find the length of the longest obstacle course in obstacles such that:
-
-
-
You choose any number of obstacles between 0 and iinclusive.
-
You must include the ith obstacle in the course.
-
You must put the chosen obstacles in the same order as they appear in obstacles.
-
Every obstacle (except the first) is taller than or the same height as the obstacle immediately before it.
-
-
-
Return an arrayansof lengthn, whereans[i]is the length of the longest obstacle course for indexi as described above.
-
-
-
Example 1:
-
-
-Input: obstacles = [1,2,3,2]
-Output: [1,2,3,3]
-Explanation: The longest valid obstacle course at each position is:
-- i = 0: [1], [1] has length 1.
-- i = 1: [1,2], [1,2] has length 2.
-- i = 2: [1,2,3], [1,2,3] has length 3.
-- i = 3: [1,2,3,2], [1,2,2] has length 3.
-
-
-
Example 2:
-
-
-Input: obstacles = [2,2,1]
-Output: [1,2,1]
-Explanation: The longest valid obstacle course at each position is:
-- i = 0: [2], [2] has length 1.
-- i = 1: [2,2], [2,2] has length 2.
-- i = 2: [2,2,1], [1] has length 1.
-
-
-
Example 3:
-
-
-Input: obstacles = [3,1,5,6,4,2]
-Output: [1,1,2,3,2,2]
-Explanation: The longest valid obstacle course at each position is:
-- i = 0: [3], [3] has length 1.
-- i = 1: [3,1], [1] has length 1.
-- i = 2: [3,1,5], [3,5] has length 2. [1,5] is also valid.
-- i = 3: [3,1,5,6], [3,5,6] has length 3. [1,5,6] is also valid.
-- i = 4: [3,1,5,6,4], [3,4] has length 2. [1,4] is also valid.
-- i = 5: [3,1,5,6,4,2], [1,2] has length 2.
-
-
-
-
Constraints:
-
-
-
n == obstacles.length
-
1 <= n <= 105
-
1 <= obstacles[i] <= 107
-
-
-### Related Topics
- [[Binary Indexed Tree](../../tag/binary-indexed-tree/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
-
-### Hints
-
-Hint 1
-Can you keep track of the minimum height for each obstacle course length?
-
-
-
-Hint 2
-You can use binary search to find the longest previous obstacle course length that satisfies the conditions.
-
diff --git a/problems/find-the-middle-index-in-array/README.md b/problems/find-the-middle-index-in-array/README.md
deleted file mode 100644
index 5a9991797..000000000
--- a/problems/find-the-middle-index-in-array/README.md
+++ /dev/null
@@ -1,78 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../count-the-number-of-experiments "Count the Number of Experiments")
-
-[Next >](../find-all-groups-of-farmland "Find All Groups of Farmland")
-
-## [1991. Find the Middle Index in Array (Easy)](https://leetcode.com/problems/find-the-middle-index-in-array "找到数组的中间位置")
-
-
Given a 0-indexed integer array nums, find the leftmostmiddleIndex (i.e., the smallest amongst all the possible ones).
-
-
A middleIndex is an index where nums[0] + nums[1] + ... + nums[middleIndex-1] == nums[middleIndex+1] + nums[middleIndex+2] + ... + nums[nums.length-1].
-
-
If middleIndex == 0, the left side sum is considered to be 0. Similarly, if middleIndex == nums.length - 1, the right side sum is considered to be 0.
-
-
Return the leftmostmiddleIndex that satisfies the condition, or -1 if there is no such index.
-
-
-
Example 1:
-
-
-Input: nums = [2,3,-1,8,4]
-Output: 3
-Explanation: The sum of the numbers before index 3 is: 2 + 3 + -1 = 4
-The sum of the numbers after index 3 is: 4 = 4
-
-
-
Example 2:
-
-
-Input: nums = [1,-1,4]
-Output: 2
-Explanation: The sum of the numbers before index 2 is: 1 + -1 = 0
-The sum of the numbers after index 2 is: 0
-
-
-
Example 3:
-
-
-Input: nums = [2,5]
-Output: -1
-Explanation: There is no valid middleIndex.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Prefix Sum](../../tag/prefix-sum/README.md)]
-
-### Hints
-
-Hint 1
-Could we go from left to right and check to see if an index is a middle index?
-
-
-
-Hint 2
-Do we need to sum every number to the left and right of an index each time?
-
-
-
-Hint 3
-Use a prefix sum array where prefix[i] = nums[0] + nums[1] + ... + nums[i].
-
diff --git a/problems/find-the-minimum-and-maximum-number-of-nodes-between-critical-points/README.md b/problems/find-the-minimum-and-maximum-number-of-nodes-between-critical-points/README.md
deleted file mode 100644
index e614c8384..000000000
--- a/problems/find-the-minimum-and-maximum-number-of-nodes-between-critical-points/README.md
+++ /dev/null
@@ -1,79 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../smallest-index-with-equal-value "Smallest Index With Equal Value")
-
-[Next >](../minimum-operations-to-convert-number "Minimum Operations to Convert Number")
-
-## [2058. Find the Minimum and Maximum Number of Nodes Between Critical Points (Medium)](https://leetcode.com/problems/find-the-minimum-and-maximum-number-of-nodes-between-critical-points "找出临界点之间的最小和最大距离")
-
-
A critical point in a linked list is defined as either a local maxima or a local minima.
-
-
A node is a local maxima if the current node has a value strictly greater than the previous node and the next node.
-
-
A node is a local minima if the current node has a value strictly smaller than the previous node and the next node.
-
-
Note that a node can only be a local maxima/minima if there exists both a previous node and a next node.
-
-
Given a linked list head, return an array of length 2 containing [minDistance, maxDistance] where minDistance is the minimum distance between any two distinct critical points and maxDistance is the maximum distance between any two distinct critical points. If there are fewer than two critical points, return [-1, -1].
-
-
-
Example 1:
-
-
-Input: head = [3,1]
-Output: [-1,-1]
-Explanation: There are no critical points in [3,1].
-
-
-
Example 2:
-
-
-Input: head = [5,3,1,2,5,1,2]
-Output: [1,3]
-Explanation: There are three critical points:
-- [5,3,1,2,5,1,2]: The third node is a local minima because 1 is less than 3 and 2.
-- [5,3,1,2,5,1,2]: The fifth node is a local maxima because 5 is greater than 2 and 1.
-- [5,3,1,2,5,1,2]: The sixth node is a local minima because 1 is less than 5 and 2.
-The minimum distance is between the fifth and the sixth node. minDistance = 6 - 5 = 1.
-The maximum distance is between the third and the sixth node. maxDistance = 6 - 3 = 3.
-
-
-
Example 3:
-
-
-Input: head = [1,3,2,2,3,2,2,2,7]
-Output: [3,3]
-Explanation: There are two critical points:
-- [1,3,2,2,3,2,2,2,7]: The second node is a local maxima because 3 is greater than 1 and 2.
-- [1,3,2,2,3,2,2,2,7]: The fifth node is a local maxima because 3 is greater than 2 and 2.
-Both the minimum and maximum distances are between the second and the fifth node.
-Thus, minDistance and maxDistance is 5 - 2 = 3.
-Note that the last node is not considered a local maxima because it does not have a next node.
-
-
-
-
Constraints:
-
-
-
The number of nodes in the list is in the range [2, 105].
-
1 <= Node.val <= 105
-
-
-### Related Topics
- [[Linked List](../../tag/linked-list/README.md)]
-
-### Hints
-
-Hint 1
-The maximum distance must be the distance between the first and last critical point.
-
-
-
-Hint 2
-For each adjacent critical point, calculate the difference and check if it is the minimum distance.
-
diff --git a/problems/find-the-minimum-number-of-fibonacci-numbers-whose-sum-is-k/README.md b/problems/find-the-minimum-number-of-fibonacci-numbers-whose-sum-is-k/README.md
deleted file mode 100644
index 1d1f7e2c6..000000000
--- a/problems/find-the-minimum-number-of-fibonacci-numbers-whose-sum-is-k/README.md
+++ /dev/null
@@ -1,68 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-value-to-get-positive-step-by-step-sum "Minimum Value to Get Positive Step by Step Sum")
-
-[Next >](../the-k-th-lexicographical-string-of-all-happy-strings-of-length-n "The k-th Lexicographical String of All Happy Strings of Length n")
-
-## [1414. Find the Minimum Number of Fibonacci Numbers Whose Sum Is K (Medium)](https://leetcode.com/problems/find-the-minimum-number-of-fibonacci-numbers-whose-sum-is-k "和为 K 的最少斐波那契数字数目")
-
-
Given an integer k, return the minimum number of Fibonacci numbers whose sum is equal to k. The same Fibonacci number can be used multiple times.
-
-
The Fibonacci numbers are defined as:
-
-
-
F1 = 1
-
F2 = 1
-
Fn = Fn-1 + Fn-2 for n > 2.
-
-It is guaranteed that for the given constraints we can always find such Fibonacci numbers that sum up to k.
-
-
Example 1:
-
-
-Input: k = 7
-Output: 2
-Explanation: The Fibonacci numbers are: 1, 1, 2, 3, 5, 8, 13, ...
-For k = 7 we can use 2 + 5 = 7.
-
-
Example 2:
-
-
-Input: k = 10
-Output: 2
-Explanation: For k = 10 we can use 2 + 8 = 10.
-
-
-
Example 3:
-
-
-Input: k = 19
-Output: 3
-Explanation: For k = 19 we can use 1 + 5 + 13 = 19.
-
-
-
-
Constraints:
-
-
-
1 <= k <= 109
-
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
-
-### Hints
-
-Hint 1
-Generate all Fibonacci numbers up to the limit (they are few).
-
-
-
-Hint 2
-Use greedy solution, taking at every time the greatest Fibonacci number which is smaller than or equal to the current number. Subtract this Fibonacci number from the current number and repeat again the process.
-
diff --git a/problems/find-the-missing-ids/README.md b/problems/find-the-missing-ids/README.md
deleted file mode 100644
index ad3d152ac..000000000
--- a/problems/find-the-missing-ids/README.md
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../check-if-two-expression-trees-are-equivalent "Check If Two Expression Trees are Equivalent")
-
-[Next >](../maximum-nesting-depth-of-the-parentheses "Maximum Nesting Depth of the Parentheses")
-
-## [1613. Find the Missing IDs (Medium)](https://leetcode.com/problems/find-the-missing-ids "找到遗失的ID")
-
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
-
-### Similar Questions
- 1. [Report Contiguous Dates](../report-contiguous-dates) (Hard)
- 1. [Find the Start and End Number of Continuous Ranges](../find-the-start-and-end-number-of-continuous-ranges) (Medium)
- 1. [Number of Transactions per Visit](../number-of-transactions-per-visit) (Hard)
diff --git a/problems/find-the-missing-ids/mysql_schemas.sql b/problems/find-the-missing-ids/mysql_schemas.sql
deleted file mode 100644
index 150f5ff9b..000000000
--- a/problems/find-the-missing-ids/mysql_schemas.sql
+++ /dev/null
@@ -1,5 +0,0 @@
-Create table If Not Exists Customers (customer_id int, customer_name varchar(20));
-Truncate table Customers;
-insert into Customers (customer_id, customer_name) values ('1', 'Alice');
-insert into Customers (customer_id, customer_name) values ('4', 'Bob');
-insert into Customers (customer_id, customer_name) values ('5', 'Charlie');
diff --git a/problems/find-the-most-competitive-subsequence/README.md b/problems/find-the-most-competitive-subsequence/README.md
deleted file mode 100644
index 6f21e4840..000000000
--- a/problems/find-the-most-competitive-subsequence/README.md
+++ /dev/null
@@ -1,55 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../richest-customer-wealth "Richest Customer Wealth")
-
-[Next >](../minimum-moves-to-make-array-complementary "Minimum Moves to Make Array Complementary")
-
-## [1673. Find the Most Competitive Subsequence (Medium)](https://leetcode.com/problems/find-the-most-competitive-subsequence "找出最具竞争力的子序列")
-
-
Given an integer array nums and a positive integer k, return the most competitive subsequence of numsof size k.
-
-
An array's subsequence is a resulting sequence obtained by erasing some (possibly zero) elements from the array.
-
-
We define that a subsequence a is more competitive than a subsequence b (of the same length) if in the first position where a and b differ, subsequence a has a number less than the corresponding number in b. For example, [1,3,4] is more competitive than [1,3,5] because the first position they differ is at the final number, and 4 is less than 5.
-
-
-
Example 1:
-
-
-Input: nums = [3,5,2,6], k = 2
-Output: [2,6]
-Explanation: Among the set of every possible subsequence: {[3,5], [3,2], [3,6], [5,2], [5,6], [2,6]}, [2,6] is the most competitive.
-
-
-
Example 2:
-
-
-Input: nums = [2,4,3,3,5,4,9,6], k = 4
-Output: [2,3,3,4]
-
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 105
-
0 <= nums[i] <= 109
-
1 <= k <= nums.length
-
-
-### Related Topics
- [[Stack](../../tag/stack/README.md)]
- [[Greedy](../../tag/greedy/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Monotonic Stack](../../tag/monotonic-stack/README.md)]
-
-### Hints
-
-Hint 1
-In lexicographical order, the elements to the left have higher priority than those that come after. Can you think of a strategy that incrementally builds the answer from left to right?
-
diff --git a/problems/find-the-quiet-students-in-all-exams/README.md b/problems/find-the-quiet-students-in-all-exams/README.md
deleted file mode 100644
index 82f0db71d..000000000
--- a/problems/find-the-quiet-students-in-all-exams/README.md
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../number-of-ways-to-paint-n-3-grid "Number of Ways to Paint N × 3 Grid")
-
-[Next >](../minimum-value-to-get-positive-step-by-step-sum "Minimum Value to Get Positive Step by Step Sum")
-
-## [1412. Find the Quiet Students in All Exams (Hard)](https://leetcode.com/problems/find-the-quiet-students-in-all-exams "查找成绩处于中游的学生")
-
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/find-the-quiet-students-in-all-exams/mysql_schemas.sql b/problems/find-the-quiet-students-in-all-exams/mysql_schemas.sql
deleted file mode 100644
index 66fe906ec..000000000
--- a/problems/find-the-quiet-students-in-all-exams/mysql_schemas.sql
+++ /dev/null
@@ -1,19 +0,0 @@
-Create table If Not Exists Student (student_id int, student_name varchar(30));
-Create table If Not Exists Exam (exam_id int, student_id int, score int);
-Truncate table Student;
-insert into Student (student_id, student_name) values ('1', 'Daniel');
-insert into Student (student_id, student_name) values ('2', 'Jade');
-insert into Student (student_id, student_name) values ('3', 'Stella');
-insert into Student (student_id, student_name) values ('4', 'Jonathan');
-insert into Student (student_id, student_name) values ('5', 'Will');
-Truncate table Exam;
-insert into Exam (exam_id, student_id, score) values ('10', '1', '70');
-insert into Exam (exam_id, student_id, score) values ('10', '2', '80');
-insert into Exam (exam_id, student_id, score) values ('10', '3', '90');
-insert into Exam (exam_id, student_id, score) values ('20', '1', '80');
-insert into Exam (exam_id, student_id, score) values ('30', '1', '70');
-insert into Exam (exam_id, student_id, score) values ('30', '3', '80');
-insert into Exam (exam_id, student_id, score) values ('30', '4', '90');
-insert into Exam (exam_id, student_id, score) values ('40', '1', '60');
-insert into Exam (exam_id, student_id, score) values ('40', '2', '70');
-insert into Exam (exam_id, student_id, score) values ('40', '4', '80');
diff --git a/problems/find-the-shortest-superstring/README.md b/problems/find-the-shortest-superstring/README.md
deleted file mode 100644
index 970d892fd..000000000
--- a/problems/find-the-shortest-superstring/README.md
+++ /dev/null
@@ -1,49 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../di-string-match "DI String Match")
-
-[Next >](../delete-columns-to-make-sorted "Delete Columns to Make Sorted")
-
-## [943. Find the Shortest Superstring (Hard)](https://leetcode.com/problems/find-the-shortest-superstring "最短超级串")
-
-
Given an array of strings words, return the smallest string that contains each string inwordsas a substring. If there are multiple valid strings of the smallest length, return any of them.
-
-
You may assume that no string in words is a substring of another string in words.
-
-
-
Example 1:
-
-
-Input: words = ["alex","loves","leetcode"]
-Output: "alexlovesleetcode"
-Explanation: All permutations of "alex","loves","leetcode" would also be accepted.
-
-
-
Example 2:
-
-
-Input: words = ["catg","ctaagt","gcta","ttca","atgcatc"]
-Output: "gctaagttcatgcatc"
-
-
-
-
Constraints:
-
-
-
1 <= words.length <= 12
-
1 <= words[i].length <= 20
-
words[i] consists of lowercase English letters.
-
All the strings of words are unique.
-
-
-### Related Topics
- [[Bit Manipulation](../../tag/bit-manipulation/README.md)]
- [[Array](../../tag/array/README.md)]
- [[String](../../tag/string/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Bitmask](../../tag/bitmask/README.md)]
diff --git a/problems/find-the-shortest-superstring/find_the_shortest_superstring.go b/problems/find-the-shortest-superstring/find_the_shortest_superstring.go
deleted file mode 100644
index e232c6d39..000000000
--- a/problems/find-the-shortest-superstring/find_the_shortest_superstring.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem943
diff --git a/problems/find-the-shortest-superstring/find_the_shortest_superstring_test.go b/problems/find-the-shortest-superstring/find_the_shortest_superstring_test.go
deleted file mode 100644
index e232c6d39..000000000
--- a/problems/find-the-shortest-superstring/find_the_shortest_superstring_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem943
diff --git a/problems/find-the-smallest-divisor-given-a-threshold/README.md b/problems/find-the-smallest-divisor-given-a-threshold/README.md
deleted file mode 100644
index 45f02e814..000000000
--- a/problems/find-the-smallest-divisor-given-a-threshold/README.md
+++ /dev/null
@@ -1,59 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../group-the-people-given-the-group-size-they-belong-to "Group the People Given the Group Size They Belong To")
-
-[Next >](../minimum-number-of-flips-to-convert-binary-matrix-to-zero-matrix "Minimum Number of Flips to Convert Binary Matrix to Zero Matrix")
-
-## [1283. Find the Smallest Divisor Given a Threshold (Medium)](https://leetcode.com/problems/find-the-smallest-divisor-given-a-threshold "使结果不超过阈值的最小除数")
-
-
Given an array of integers nums and an integer threshold, we will choose a positive integer divisor, divide all the array by it, and sum the division's result. Find the smallestdivisor such that the result mentioned above is less than or equal to threshold.
-
-
Each result of the division is rounded to the nearest integer greater than or equal to that element. (For example: 7/3 = 3 and 10/2 = 5).
-
-
The test cases are generated so that there will be an answer.
-
-
-
Example 1:
-
-
-Input: nums = [1,2,5,9], threshold = 6
-Output: 5
-Explanation: We can get a sum to 17 (1+2+5+9) if the divisor is 1.
-If the divisor is 4 we can get a sum of 7 (1+1+2+3) and if the divisor is 5 the sum will be 5 (1+1+1+2).
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
-
-### Hints
-
-Hint 1
-Examine every possible number for solution. Choose the largest of them.
-
-
-
-Hint 2
-Use binary search to reduce the time complexity.
-
diff --git a/problems/find-the-start-and-end-number-of-continuous-ranges/README.md b/problems/find-the-start-and-end-number-of-continuous-ranges/README.md
deleted file mode 100644
index 5521814a1..000000000
--- a/problems/find-the-start-and-end-number-of-continuous-ranges/README.md
+++ /dev/null
@@ -1,64 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-number-of-flips-to-convert-binary-matrix-to-zero-matrix "Minimum Number of Flips to Convert Binary Matrix to Zero Matrix")
-
-[Next >](../iterator-for-combination "Iterator for Combination")
-
-## [1285. Find the Start and End Number of Continuous Ranges (Medium)](https://leetcode.com/problems/find-the-start-and-end-number-of-continuous-ranges "找到连续区间的开始和结束数字")
-
-
Table: Logs
-
-+---------------+---------+
-| Column Name | Type |
-+---------------+---------+
-| log_id | int |
-+---------------+---------+
-id is the primary key for this table.
-Each row of this table contains the ID in a log Table.
-
-
-Since some IDs have been removed from Logs. Write an SQL query to find the start and end number of continuous ranges in table Logs.
-
-Order the result table by start_id.
-
-The query result format is in the following example:
-
-Logs table:
-+------------+
-| log_id |
-+------------+
-| 1 |
-| 2 |
-| 3 |
-| 7 |
-| 8 |
-| 10 |
-+------------+
-
-Result table:
-+------------+--------------+
-| start_id | end_id |
-+------------+--------------+
-| 1 | 3 |
-| 7 | 8 |
-| 10 | 10 |
-+------------+--------------+
-The result table should contain all ranges in table Logs.
-From 1 to 3 is contained in the table.
-From 4 to 6 is missing in the table
-From 7 to 8 is contained in the table.
-Number 9 is missing in the table.
-Number 10 is contained in the table.
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
-
-### Similar Questions
- 1. [Report Contiguous Dates](../report-contiguous-dates) (Hard)
- 1. [Find the Missing IDs](../find-the-missing-ids) (Medium)
diff --git a/problems/find-the-start-and-end-number-of-continuous-ranges/mysql_schemas.sql b/problems/find-the-start-and-end-number-of-continuous-ranges/mysql_schemas.sql
deleted file mode 100644
index 3f578ff5a..000000000
--- a/problems/find-the-start-and-end-number-of-continuous-ranges/mysql_schemas.sql
+++ /dev/null
@@ -1,8 +0,0 @@
-Create table If Not Exists Logs (log_id int);
-Truncate table Logs;
-insert into Logs (log_id) values ('1');
-insert into Logs (log_id) values ('2');
-insert into Logs (log_id) values ('3');
-insert into Logs (log_id) values ('7');
-insert into Logs (log_id) values ('8');
-insert into Logs (log_id) values ('10');
diff --git a/problems/find-the-student-that-will-replace-the-chalk/README.md b/problems/find-the-student-that-will-replace-the-chalk/README.md
deleted file mode 100644
index ed3062efa..000000000
--- a/problems/find-the-student-that-will-replace-the-chalk/README.md
+++ /dev/null
@@ -1,78 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../check-if-all-the-integers-in-a-range-are-covered "Check if All the Integers in a Range Are Covered")
-
-[Next >](../largest-magic-square "Largest Magic Square")
-
-## [1894. Find the Student that Will Replace the Chalk (Medium)](https://leetcode.com/problems/find-the-student-that-will-replace-the-chalk "找到需要补充粉笔的学生编号")
-
-
There are n students in a class numbered from 0 to n - 1. The teacher will give each student a problem starting with the student number 0, then the student number 1, and so on until the teacher reaches the student number n - 1. After that, the teacher will restart the process, starting with the student number 0 again.
-
-
You are given a 0-indexed integer array chalk and an integer k. There are initially k pieces of chalk. When the student number i is given a problem to solve, they will use chalk[i] pieces of chalk to solve that problem. However, if the current number of chalk pieces is strictly less than chalk[i], then the student number i will be asked to replace the chalk.
-
-
Return the index of the student that will replace the chalk.
-
-
-
Example 1:
-
-
-Input: chalk = [5,1,5], k = 22
-Output: 0
-Explanation: The students go in turns as follows:
-- Student number 0 uses 5 chalk, so k = 17.
-- Student number 1 uses 1 chalk, so k = 16.
-- Student number 2 uses 5 chalk, so k = 11.
-- Student number 0 uses 5 chalk, so k = 6.
-- Student number 1 uses 1 chalk, so k = 5.
-- Student number 2 uses 5 chalk, so k = 0.
-Student number 0 does not have enough chalk, so they will have to replace it.
-
-
Example 2:
-
-
-Input: chalk = [3,4,1,2], k = 25
-Output: 1
-Explanation: The students go in turns as follows:
-- Student number 0 uses 3 chalk so k = 22.
-- Student number 1 uses 4 chalk so k = 18.
-- Student number 2 uses 1 chalk so k = 17.
-- Student number 3 uses 2 chalk so k = 15.
-- Student number 0 uses 3 chalk so k = 12.
-- Student number 1 uses 4 chalk so k = 8.
-- Student number 2 uses 1 chalk so k = 7.
-- Student number 3 uses 2 chalk so k = 5.
-- Student number 0 uses 3 chalk so k = 2.
-Student number 1 does not have enough chalk, so they will have to replace it.
-
-
-
-
Constraints:
-
-
-
chalk.length == n
-
1 <= n <= 105
-
1 <= chalk[i] <= 105
-
1 <= k <= 109
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
- [[Simulation](../../tag/simulation/README.md)]
- [[Prefix Sum](../../tag/prefix-sum/README.md)]
-
-### Hints
-
-Hint 1
-Subtract the sum of chalk[i] from k until k is less than that sum
-
-
-
-Hint 2
-Now just iterate over the array if chalk[i] is less thank k this is your answer otherwise this i is the answer
-
diff --git a/problems/find-the-subtasks-that-did-not-execute/README.md b/problems/find-the-subtasks-that-did-not-execute/README.md
deleted file mode 100644
index 8d94adad5..000000000
--- a/problems/find-the-subtasks-that-did-not-execute/README.md
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../tree-of-coprimes "Tree of Coprimes")
-
-[Next >](../merge-strings-alternately "Merge Strings Alternately")
-
-## [1767. Find the Subtasks That Did Not Execute (Hard)](https://leetcode.com/problems/find-the-subtasks-that-did-not-execute "寻找没有被执行的任务对")
-
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/find-the-subtasks-that-did-not-execute/mysql_schemas.sql b/problems/find-the-subtasks-that-did-not-execute/mysql_schemas.sql
deleted file mode 100644
index fd4398ea6..000000000
--- a/problems/find-the-subtasks-that-did-not-execute/mysql_schemas.sql
+++ /dev/null
@@ -1,12 +0,0 @@
-Create table If Not Exists Tasks (task_id int, subtasks_count int);
-Create table If Not Exists Executed (task_id int, subtask_id int);
-Truncate table Tasks;
-insert into Tasks (task_id, subtasks_count) values ('1', '3');
-insert into Tasks (task_id, subtasks_count) values ('2', '2');
-insert into Tasks (task_id, subtasks_count) values ('3', '4');
-Truncate table Executed;
-insert into Executed (task_id, subtask_id) values ('1', '2');
-insert into Executed (task_id, subtask_id) values ('3', '1');
-insert into Executed (task_id, subtask_id) values ('3', '2');
-insert into Executed (task_id, subtask_id) values ('3', '3');
-insert into Executed (task_id, subtask_id) values ('3', '4');
diff --git a/problems/find-the-team-size/README.md b/problems/find-the-team-size/README.md
deleted file mode 100644
index dd11cf0b0..000000000
--- a/problems/find-the-team-size/README.md
+++ /dev/null
@@ -1,60 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../deepest-leaves-sum "Deepest Leaves Sum")
-
-[Next >](../find-n-unique-integers-sum-up-to-zero "Find N Unique Integers Sum up to Zero")
-
-## [1303. Find the Team Size (Easy)](https://leetcode.com/problems/find-the-team-size "求团队人数")
-
-
Table: Employee
-
-+---------------+---------+
-| Column Name | Type |
-+---------------+---------+
-| employee_id | int |
-| team_id | int |
-+---------------+---------+
-employee_id is the primary key for this table.
-Each row of this table contains the ID of each employee and their respective team.
-
-
-Write an SQL query to find the team size of each of the employees.
-
-Return result table in any order.
-
-The query result format is in the following example:
-
-Employee Table:
-+-------------+------------+
-| employee_id | team_id |
-+-------------+------------+
-| 1 | 8 |
-| 2 | 8 |
-| 3 | 8 |
-| 4 | 7 |
-| 5 | 9 |
-| 6 | 9 |
-+-------------+------------+
-Result table:
-+-------------+------------+
-| employee_id | team_size |
-+-------------+------------+
-| 1 | 3 |
-| 2 | 3 |
-| 3 | 3 |
-| 4 | 1 |
-| 5 | 2 |
-| 6 | 2 |
-+-------------+------------+
-Employees with Id 1,2,3 are part of a team with team_id = 8.
-Employees with Id 4 is part of a team with team_id = 7.
-Employees with Id 5,6 are part of a team with team_id = 9.
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/find-the-team-size/mysql_schemas.sql b/problems/find-the-team-size/mysql_schemas.sql
deleted file mode 100644
index bd2dc77d2..000000000
--- a/problems/find-the-team-size/mysql_schemas.sql
+++ /dev/null
@@ -1,8 +0,0 @@
-Create table If Not Exists Employee (employee_id int, team_id int);
-Truncate table Employee;
-insert into Employee (employee_id, team_id) values ('1', '8');
-insert into Employee (employee_id, team_id) values ('2', '8');
-insert into Employee (employee_id, team_id) values ('3', '8');
-insert into Employee (employee_id, team_id) values ('4', '7');
-insert into Employee (employee_id, team_id) values ('5', '9');
-insert into Employee (employee_id, team_id) values ('6', '9');
diff --git a/problems/find-the-town-judge/README.md b/problems/find-the-town-judge/README.md
deleted file mode 100644
index ff1d47922..000000000
--- a/problems/find-the-town-judge/README.md
+++ /dev/null
@@ -1,82 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../number-of-squareful-arrays "Number of Squareful Arrays")
-
-[Next >](../maximum-binary-tree-ii "Maximum Binary Tree II")
-
-## [997. Find the Town Judge (Easy)](https://leetcode.com/problems/find-the-town-judge "找到小镇的法官")
-
-
In a town, there are n people labeled from 1 to n. There is a rumor that one of these people is secretly the town judge.
-
-
If the town judge exists, then:
-
-
-
The town judge trusts nobody.
-
Everybody (except for the town judge) trusts the town judge.
-
There is exactly one person that satisfies properties 1 and 2.
-
-
-
You are given an array trust where trust[i] = [ai, bi] representing that the person labeled ai trusts the person labeled bi.
-
-
Return the label of the town judge if the town judge exists and can be identified, or return -1 otherwise.
-
-
-
Example 1:
-
-
-Input: n = 2, trust = [[1,2]]
-Output: 2
-
-
-
Example 2:
-
-
-Input: n = 3, trust = [[1,3],[2,3]]
-Output: 3
-
-
-
Example 3:
-
-
-Input: n = 3, trust = [[1,3],[2,3],[3,1]]
-Output: -1
-
-
-
Example 4:
-
-
-Input: n = 3, trust = [[1,2],[2,3]]
-Output: -1
-
-
-
Example 5:
-
-
-Input: n = 4, trust = [[1,3],[1,4],[2,3],[2,4],[4,3]]
-Output: 3
-
Given an integer array arr of distinct integers and an integer k.
-
-
A game will be played between the first two elements of the array (i.e. arr[0] and arr[1]). In each round of the game, we compare arr[0] with arr[1], the larger integer wins and remains at position 0, and the smaller integer moves to the end of the array. The game ends when an integer wins k consecutive rounds.
-
-
Return the integer which will win the game.
-
-
It is guaranteed that there will be a winner of the game.
-
-
-
Example 1:
-
-
-Input: arr = [2,1,3,5,4,6,7], k = 2
-Output: 5
-Explanation: Let's see the rounds of the game:
-Round | arr | winner | win_count
- 1 | [2,1,3,5,4,6,7] | 2 | 1
- 2 | [2,3,5,4,6,7,1] | 3 | 1
- 3 | [3,5,4,6,7,1,2] | 5 | 1
- 4 | [5,4,6,7,1,2,3] | 5 | 2
-So we can see that 4 rounds will be played and 5 is the winner because it wins 2 consecutive games.
-
-
-
Example 2:
-
-
-Input: arr = [3,2,1], k = 10
-Output: 3
-Explanation: 3 will win the first 10 rounds consecutively.
-
-
-
-
Constraints:
-
-
-
2 <= arr.length <= 105
-
1 <= arr[i] <= 106
-
arr contains distinct integers.
-
1 <= k <= 109
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Simulation](../../tag/simulation/README.md)]
-
-### Hints
-
-Hint 1
-If k ≥ arr.length return the max element of the array.
-
-
-
-Hint 2
-If k < arr.length simulate the game until a number wins k consecutive games.
-
diff --git a/problems/find-the-winner-of-the-circular-game/README.md b/problems/find-the-winner-of-the-circular-game/README.md
deleted file mode 100644
index f697c1c36..000000000
--- a/problems/find-the-winner-of-the-circular-game/README.md
+++ /dev/null
@@ -1,81 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../sign-of-the-product-of-an-array "Sign of the Product of an Array")
-
-[Next >](../minimum-sideway-jumps "Minimum Sideway Jumps")
-
-## [1823. Find the Winner of the Circular Game (Medium)](https://leetcode.com/problems/find-the-winner-of-the-circular-game "找出游戏的获胜者")
-
-
There are n friends that are playing a game. The friends are sitting in a circle and are numbered from 1 to n in clockwise order. More formally, moving clockwise from the ith friend brings you to the (i+1)th friend for 1 <= i < n, and moving clockwise from the nth friend brings you to the 1st friend.
-
-
The rules of the game are as follows:
-
-
-
Start at the 1st friend.
-
Count the next k friends in the clockwise direction including the friend you started at. The counting wraps around the circle and may count some friends more than once.
-
The last friend you counted leaves the circle and loses the game.
-
If there is still more than one friend in the circle, go back to step 2starting from the friend immediately clockwise of the friend who just lost and repeat.
-
Else, the last friend in the circle wins the game.
-
-
-
Given the number of friends, n, and an integer k, return the winner of the game.
-
-
-
Example 1:
-
-
-Input: n = 5, k = 2
-Output: 3
-Explanation: Here are the steps of the game:
-1) Start at friend 1.
-2) Count 2 friends clockwise, which are friends 1 and 2.
-3) Friend 2 leaves the circle. Next start is friend 3.
-4) Count 2 friends clockwise, which are friends 3 and 4.
-5) Friend 4 leaves the circle. Next start is friend 5.
-6) Count 2 friends clockwise, which are friends 5 and 1.
-7) Friend 1 leaves the circle. Next start is friend 3.
-8) Count 2 friends clockwise, which are friends 3 and 5.
-9) Friend 5 leaves the circle. Only friend 3 is left, so they are the winner.
-
-
Example 2:
-
-
-Input: n = 6, k = 5
-Output: 1
-Explanation: The friends leave in this order: 5, 4, 6, 2, 3. The winner is friend 1.
-
-
-
-
Constraints:
-
-
-
1 <= k <= n <= 500
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Math](../../tag/math/README.md)]
- [[Recursion](../../tag/recursion/README.md)]
- [[Queue](../../tag/queue/README.md)]
- [[Simulation](../../tag/simulation/README.md)]
-
-### Hints
-
-Hint 1
-Simulate the process.
-
-
-
-Hint 2
-Maintain in a circular list the people who are still in the circle and the current person you are standing at.
-
-
-
-Hint 3
-In each turn, count k people and remove the last person from the list.
-
diff --git a/problems/find-total-time-spent-by-each-employee/README.md b/problems/find-total-time-spent-by-each-employee/README.md
deleted file mode 100644
index 280619629..000000000
--- a/problems/find-total-time-spent-by-each-employee/README.md
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../find-distance-in-a-binary-tree "Find Distance in a Binary Tree")
-
-[Next >](../maximum-number-of-balls-in-a-box "Maximum Number of Balls in a Box")
-
-## [1741. Find Total Time Spent by Each Employee (Easy)](https://leetcode.com/problems/find-total-time-spent-by-each-employee "查找每个员工花费的总时间")
-
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/find-total-time-spent-by-each-employee/mysql_schemas.sql b/problems/find-total-time-spent-by-each-employee/mysql_schemas.sql
deleted file mode 100644
index 1431641c1..000000000
--- a/problems/find-total-time-spent-by-each-employee/mysql_schemas.sql
+++ /dev/null
@@ -1,7 +0,0 @@
-Create table If Not Exists Employees(emp_id int, event_day date, in_time int, out_time int);
-Truncate table Employees;
-insert into Employees (emp_id, event_day, in_time, out_time) values ('1', '2020-11-28', '4', '32');
-insert into Employees (emp_id, event_day, in_time, out_time) values ('1', '2020-11-28', '55', '200');
-insert into Employees (emp_id, event_day, in_time, out_time) values ('1', '2020-12-3', '1', '42');
-insert into Employees (emp_id, event_day, in_time, out_time) values ('2', '2020-11-28', '3', '33');
-insert into Employees (emp_id, event_day, in_time, out_time) values ('2', '2020-12-9', '47', '74');
diff --git a/problems/find-two-non-overlapping-sub-arrays-each-with-target-sum/README.md b/problems/find-two-non-overlapping-sub-arrays-each-with-target-sum/README.md
deleted file mode 100644
index 8f35b94cf..000000000
--- a/problems/find-two-non-overlapping-sub-arrays-each-with-target-sum/README.md
+++ /dev/null
@@ -1,75 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../subrectangle-queries "Subrectangle Queries")
-
-[Next >](../allocate-mailboxes "Allocate Mailboxes")
-
-## [1477. Find Two Non-overlapping Sub-arrays Each With Target Sum (Medium)](https://leetcode.com/problems/find-two-non-overlapping-sub-arrays-each-with-target-sum "找两个和为目标值且不重叠的子数组")
-
-
You are given an array of integers arr and an integer target.
-
-
You have to find two non-overlapping sub-arrays of arr each with a sum equal target. There can be multiple answers so you have to find an answer where the sum of the lengths of the two sub-arrays is minimum.
-
-
Return the minimum sum of the lengths of the two required sub-arrays, or return -1 if you cannot find such two sub-arrays.
-
-
-
Example 1:
-
-
-Input: arr = [3,2,2,4,3], target = 3
-Output: 2
-Explanation: Only two sub-arrays have sum = 3 ([3] and [3]). The sum of their lengths is 2.
-
-
-
Example 2:
-
-
-Input: arr = [7,3,4,7], target = 7
-Output: 2
-Explanation: Although we have three non-overlapping sub-arrays of sum = 7 ([7], [3,4] and [7]), but we will choose the first and third sub-arrays as the sum of their lengths is 2.
-
-
-
Example 3:
-
-
-Input: arr = [4,3,2,6,2,3,4], target = 6
-Output: -1
-Explanation: We have only one sub-array of sum = 6.
-
-
-
-
Constraints:
-
-
-
1 <= arr.length <= 105
-
1 <= arr[i] <= 1000
-
1 <= target <= 108
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Sliding Window](../../tag/sliding-window/README.md)]
-
-### Hints
-
-Hint 1
-Let's create two arrays prefix and suffix where prefix[i] is the minimum length of sub-array ends before i and has sum = k, suffix[i] is the minimum length of sub-array starting at or after i and has sum = k.
-
-
-
-Hint 2
-The answer we are searching for is min(prefix[i] + suffix[i]) for all values of i from 0 to n-1 where n == arr.length.
-
-
-
-Hint 3
-If you are still stuck with how to build prefix and suffix, you can store for each index i the length of the sub-array starts at i and has sum = k or infinity otherwise, and you can use it to build both prefix and suffix.
-
diff --git a/problems/find-unique-binary-string/README.md b/problems/find-unique-binary-string/README.md
deleted file mode 100644
index 986125758..000000000
--- a/problems/find-unique-binary-string/README.md
+++ /dev/null
@@ -1,66 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../find-greatest-common-divisor-of-array "Find Greatest Common Divisor of Array")
-
-[Next >](../minimize-the-difference-between-target-and-chosen-elements "Minimize the Difference Between Target and Chosen Elements")
-
-## [1980. Find Unique Binary String (Medium)](https://leetcode.com/problems/find-unique-binary-string "找出不同的二进制字符串")
-
-
Given an array of strings nums containing nunique binary strings each of length n, return a binary string of length n that does not appear in nums. If there are multiple answers, you may return any of them.
-
-
-
Example 1:
-
-
-Input: nums = ["01","10"]
-Output: "11"
-Explanation: "11" does not appear in nums. "00" would also be correct.
-
-
-
Example 2:
-
-
-Input: nums = ["00","01"]
-Output: "11"
-Explanation: "11" does not appear in nums. "10" would also be correct.
-
-
-
Example 3:
-
-
-Input: nums = ["111","011","001"]
-Output: "101"
-Explanation: "101" does not appear in nums. "000", "010", "100", and "110" would also be correct.
-
-
-
-
Constraints:
-
-
-
n == nums.length
-
1 <= n <= 16
-
nums[i].length == n
-
nums[i] is either '0' or '1'.
-
All the strings of nums are unique.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[String](../../tag/string/README.md)]
- [[Backtracking](../../tag/backtracking/README.md)]
-
-### Hints
-
-Hint 1
-We can convert the given strings into base 10 integers.
-
-
-
-Hint 2
-Can we use recursion to generate all possible strings?
-
diff --git a/problems/find-users-with-valid-e-mails/README.md b/problems/find-users-with-valid-e-mails/README.md
deleted file mode 100644
index d28cde732..000000000
--- a/problems/find-users-with-valid-e-mails/README.md
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../move-sub-tree-of-n-ary-tree "Move Sub-Tree of N-Ary Tree")
-
-[Next >](../water-bottles "Water Bottles")
-
-## [1517. Find Users With Valid E-Mails (Easy)](https://leetcode.com/problems/find-users-with-valid-e-mails "查找拥有有效邮箱的用户")
-
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/find-users-with-valid-e-mails/mysql_schemas.sql b/problems/find-users-with-valid-e-mails/mysql_schemas.sql
deleted file mode 100644
index a9fe9964d..000000000
--- a/problems/find-users-with-valid-e-mails/mysql_schemas.sql
+++ /dev/null
@@ -1,9 +0,0 @@
-Create table If Not Exists Users (user_id int, name varchar(30), mail varchar(50));
-Truncate table Users;
-insert into Users (user_id, name, mail) values ('1', 'Winston', 'winston@leetcode.com');
-insert into Users (user_id, name, mail) values ('2', 'Jonathan', 'jonathanisgreat');
-insert into Users (user_id, name, mail) values ('3', 'Annabelle', 'bella-@leetcode.com');
-insert into Users (user_id, name, mail) values ('4', 'Sally', 'sally.come@leetcode.com');
-insert into Users (user_id, name, mail) values ('5', 'Marwan', 'quarz#2020@leetcode.com');
-insert into Users (user_id, name, mail) values ('6', 'David', 'david69@gmail.com');
-insert into Users (user_id, name, mail) values ('7', 'Shapiro', '.shapo@leetcode.com');
diff --git a/problems/find-valid-matrix-given-row-and-column-sums/README.md b/problems/find-valid-matrix-given-row-and-column-sums/README.md
deleted file mode 100644
index 1ca194f17..000000000
--- a/problems/find-valid-matrix-given-row-and-column-sums/README.md
+++ /dev/null
@@ -1,64 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../alert-using-same-key-card-three-or-more-times-in-a-one-hour-period "Alert Using Same Key-Card Three or More Times in a One Hour Period")
-
-[Next >](../find-servers-that-handled-most-number-of-requests "Find Servers That Handled Most Number of Requests")
-
-## [1605. Find Valid Matrix Given Row and Column Sums (Medium)](https://leetcode.com/problems/find-valid-matrix-given-row-and-column-sums "给定行和列的和求可行矩阵")
-
-
You are given two arrays rowSum and colSum of non-negative integers where rowSum[i] is the sum of the elements in the ith row and colSum[j] is the sum of the elements of the jth column of a 2D matrix. In other words, you do not know the elements of the matrix, but you do know the sums of each row and column.
-
-
Find any matrix of non-negative integers of size rowSum.length x colSum.length that satisfies the rowSum and colSum requirements.
-
-
Return a 2D array representing any matrix that fulfills the requirements. It's guaranteed that at least one matrix that fulfills the requirements exists.
-
-
-
Example 1:
-
-
-Input: rowSum = [3,8], colSum = [4,7]
-Output: [[3,0],
- [1,7]]
-Explanation:
-0th row: 3 + 0 = 3 == rowSum[0]
-1st row: 1 + 7 = 8 == rowSum[1]
-0th column: 3 + 1 = 4 == colSum[0]
-1st column: 0 + 7 = 7 == colSum[1]
-The row and column sums match, and all matrix elements are non-negative.
-Another possible matrix is: [[1,2],
- [3,5]]
-
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
-
-### Hints
-
-Hint 1
-Find the smallest rowSum or colSum, and let it be x. Place that number in the grid, and subtract x from rowSum and colSum. Continue until all the sums are satisfied.
-
diff --git a/problems/find-winner-on-a-tic-tac-toe-game/README.md b/problems/find-winner-on-a-tic-tac-toe-game/README.md
deleted file mode 100644
index b92f461f3..000000000
--- a/problems/find-winner-on-a-tic-tac-toe-game/README.md
+++ /dev/null
@@ -1,80 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../number-of-ships-in-a-rectangle "Number of Ships in a Rectangle")
-
-[Next >](../number-of-burgers-with-no-waste-of-ingredients "Number of Burgers with No Waste of Ingredients")
-
-## [1275. Find Winner on a Tic Tac Toe Game (Easy)](https://leetcode.com/problems/find-winner-on-a-tic-tac-toe-game "找出井字棋的获胜者")
-
-
Tic-tac-toe is played by two players A and B on a 3 x 3 grid. The rules of Tic-Tac-Toe are:
-
-
-
Players take turns placing characters into empty squares ' '.
-
The first player A always places 'X' characters, while the second player B always places 'O' characters.
-
'X' and 'O' characters are always placed into empty squares, never on filled ones.
-
The game ends when there are three of the same (non-empty) character filling any row, column, or diagonal.
-
The game also ends if all squares are non-empty.
-
No more moves can be played if the game is over.
-
-
-
Given a 2D integer array moves where moves[i] = [rowi, coli] indicates that the ith move will be played on grid[rowi][coli]. return the winner of the game if it exists (A or B). In case the game ends in a draw return "Draw". If there are still movements to play return "Pending".
-
-
You can assume that moves is valid (i.e., it follows the rules of Tic-Tac-Toe), the grid is initially empty, and A will play first.
-
-
-
Example 1:
-
-
-Input: moves = [[0,0],[2,0],[1,1],[2,1],[2,2]]
-Output: "A"
-Explanation: A wins, they always play first.
-
-
-
Example 2:
-
-
-Input: moves = [[0,0],[1,1],[0,1],[0,2],[1,0],[2,0]]
-Output: "B"
-Explanation: B wins.
-
-
-
Example 3:
-
-
-Input: moves = [[0,0],[1,1],[2,0],[1,0],[1,2],[2,1],[0,1],[0,2],[2,2]]
-Output: "Draw"
-Explanation: The game ends in a draw since there are no moves to make.
-
-
-
-
Constraints:
-
-
-
1 <= moves.length <= 9
-
moves[i].length == 2
-
0 <= rowi, coli <= 2
-
There are no repeated elements on moves.
-
moves follow the rules of tic tac toe.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
- [[Simulation](../../tag/simulation/README.md)]
-
-### Hints
-
-Hint 1
-It's straightforward to check if A or B won or not, check for each row/column/diag if all the three are the same.
-
-
-
-Hint 2
-Then if no one wins, the game is a draw iff the board is full, i.e. moves.length = 9 otherwise is pending.
-
diff --git a/problems/find-words-that-can-be-formed-by-characters/README.md b/problems/find-words-that-can-be-formed-by-characters/README.md
deleted file mode 100644
index 86c08abca..000000000
--- a/problems/find-words-that-can-be-formed-by-characters/README.md
+++ /dev/null
@@ -1,70 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../market-analysis-ii "Market Analysis II")
-
-[Next >](../maximum-level-sum-of-a-binary-tree "Maximum Level Sum of a Binary Tree")
-
-## [1160. Find Words That Can Be Formed by Characters (Easy)](https://leetcode.com/problems/find-words-that-can-be-formed-by-characters "拼写单词")
-
-
You are given an array of strings words and a string chars.
-
-
A string is good if it can be formed by characters from chars (each character can only be used once).
-
-
Return the sum of lengths of all good strings in words.
-
-
-
Example 1:
-
-
-Input: words = ["cat","bt","hat","tree"], chars = "atach"
-Output: 6
-Explanation: The strings that can be formed are "cat" and "hat" so the answer is 3 + 3 = 6.
-
-
-
Example 2:
-
-
-Input: words = ["hello","world","leetcode"], chars = "welldonehoneyr"
-Output: 10
-Explanation: The strings that can be formed are "hello" and "world" so the answer is 5 + 5 = 10.
-
-
-
-
Constraints:
-
-
-
1 <= words.length <= 1000
-
1 <= words[i].length, chars.length <= 100
-
words[i] and chars consist of lowercase English letters.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Hints
-
-Hint 1
-Solve the problem for each string in words independently.
-
-
-
-Hint 2
-Now try to think in frequency of letters.
-
-
-
-Hint 3
-Count how many times each character occurs in string chars.
-
-
-
-Hint 4
-To form a string using characters from chars, the frequency of each character in chars must be greater than or equal the frequency of that character in the string to be formed.
-
diff --git a/problems/find-xor-sum-of-all-pairs-bitwise-and/README.md b/problems/find-xor-sum-of-all-pairs-bitwise-and/README.md
deleted file mode 100644
index 188930335..000000000
--- a/problems/find-xor-sum-of-all-pairs-bitwise-and/README.md
+++ /dev/null
@@ -1,71 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../single-threaded-cpu "Single-Threaded CPU")
-
-[Next >](../remove-duplicates-from-an-unsorted-linked-list "Remove Duplicates From an Unsorted Linked List")
-
-## [1835. Find XOR Sum of All Pairs Bitwise AND (Hard)](https://leetcode.com/problems/find-xor-sum-of-all-pairs-bitwise-and "所有数对按位与结果的异或和")
-
-
The XOR sum of a list is the bitwise XOR of all its elements. If the list only contains one element, then its XOR sum will be equal to this element.
-
-
-
For example, the XOR sum of [1,2,3,4] is equal to 1 XOR 2 XOR 3 XOR 4 = 4, and the XOR sum of [3] is equal to 3.
-
-
-
You are given two 0-indexed arrays arr1 and arr2 that consist only of non-negative integers.
-
-
Consider the list containing the result of arr1[i] AND arr2[j] (bitwise AND) for every (i, j) pair where 0 <= i < arr1.length and 0 <= j < arr2.length.
-
-
Return the XOR sum of the aforementioned list.
-
-
-
Example 1:
-
-
-Input: arr1 = [1,2,3], arr2 = [6,5]
-Output: 0
-Explanation: The list = [1 AND 6, 1 AND 5, 2 AND 6, 2 AND 5, 3 AND 6, 3 AND 5] = [0,1,2,0,2,1].
-The XOR sum = 0 XOR 1 XOR 2 XOR 0 XOR 2 XOR 1 = 0.
-
-
-
Example 2:
-
-
-Input: arr1 = [12], arr2 = [4]
-Output: 4
-Explanation: The list = [12 AND 4] = [4]. The XOR sum = 4.
-
-
-
-
Constraints:
-
-
-
1 <= arr1.length, arr2.length <= 105
-
0 <= arr1[i], arr2[j] <= 109
-
-
-### Related Topics
- [[Bit Manipulation](../../tag/bit-manipulation/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Math](../../tag/math/README.md)]
-
-### Hints
-
-Hint 1
-Think about (a&b) ^ (a&c). Can you simplify this expression?
-
-
-
-Hint 2
-It is equal to a&(b^c). Then, (arr1[i]&arr2[0])^(arr1[i]&arr2[1]).. = arr1[i]&(arr2[0]^arr2[1]^arr[2]...).
-
-
-
-Hint 3
-Let arr2XorSum = (arr2[0]^arr2[1]^arr2[2]...), arr1XorSum = (arr1[0]^arr1[1]^arr1[2]...) so the final answer is (arr2XorSum&arr1[0]) ^ (arr2XorSum&arr1[1]) ^ (arr2XorSum&arr1[2]) ^ ... = arr2XorSum & arr1XorSum.
-
diff --git a/problems/finding-3-digit-even-numbers/README.md b/problems/finding-3-digit-even-numbers/README.md
deleted file mode 100644
index b3b7cc928..000000000
--- a/problems/finding-3-digit-even-numbers/README.md
+++ /dev/null
@@ -1,73 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-cost-to-reach-city-with-discounts "Minimum Cost to Reach City With Discounts")
-
-[Next >](../delete-the-middle-node-of-a-linked-list "Delete the Middle Node of a Linked List")
-
-## [2094. Finding 3-Digit Even Numbers (Easy)](https://leetcode.com/problems/finding-3-digit-even-numbers "找出 3 位偶数")
-
-
You are given an integer array digits, where each element is a digit. The array may contain duplicates.
-
-
You need to find all the unique integers that follow the given requirements:
-
-
-
The integer consists of the concatenation of three elements from digits in any arbitrary order.
-
The integer does not have leading zeros.
-
The integer is even.
-
-
-
For example, if the given digits were [1, 2, 3], integers 132 and 312 follow the requirements.
-
-
Return a sorted array of the unique integers.
-
-
-
Example 1:
-
-
-Input: digits = [2,1,3,0]
-Output: [102,120,130,132,210,230,302,310,312,320]
-Explanation: All the possible integers that follow the requirements are in the output array.
-Notice that there are no odd integers or integers with leading zeros.
-
-
-
Example 2:
-
-
-Input: digits = [2,2,8,8,2]
-Output: [222,228,282,288,822,828,882]
-Explanation: The same digit can be used as many times as it appears in digits.
-In this example, the digit 8 is used twice each time in 288, 828, and 882.
-
-
-
Example 3:
-
-
-Input: digits = [3,7,5]
-Output: []
-Explanation: No even integers can be formed using the given digits.
-
-
-
-
Constraints:
-
-
-
3 <= digits.length <= 100
-
0 <= digits[i] <= 9
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Enumeration](../../tag/enumeration/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Hints
-
-Hint 1
-The range of possible answers includes all even numbers between 100 and 999 inclusive. Could you check each possible answer to see if it could be formed from the digits in the array?
-
diff --git a/problems/finding-mk-average/README.md b/problems/finding-mk-average/README.md
deleted file mode 100644
index 8986cc95c..000000000
--- a/problems/finding-mk-average/README.md
+++ /dev/null
@@ -1,89 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-sideway-jumps "Minimum Sideway Jumps")
-
-[Next >](../faulty-sensor "Faulty Sensor")
-
-## [1825. Finding MK Average (Hard)](https://leetcode.com/problems/finding-mk-average "求出 MK 平均值")
-
-
You are given two integers, m and k, and a stream of integers. You are tasked to implement a data structure that calculates the MKAverage for the stream.
-
-
The MKAverage can be calculated using these steps:
-
-
-
If the number of the elements in the stream is less than m you should consider the MKAverage to be -1. Otherwise, copy the last m elements of the stream to a separate container.
-
Remove the smallest k elements and the largest k elements from the container.
-
Calculate the average value for the rest of the elements rounded down to the nearest integer.
-
-
-
Implement the MKAverage class:
-
-
-
MKAverage(int m, int k) Initializes the MKAverage object with an empty stream and the two integers m and k.
-
void addElement(int num) Inserts a new element num into the stream.
-
int calculateMKAverage() Calculates and returns the MKAverage for the current stream rounded down to the nearest integer.
-
-
-
-
Example 1:
-
-
-Input
-["MKAverage", "addElement", "addElement", "calculateMKAverage", "addElement", "calculateMKAverage", "addElement", "addElement", "addElement", "calculateMKAverage"]
-[[3, 1], [3], [1], [], [10], [], [5], [5], [5], []]
-Output
-[null, null, null, -1, null, 3, null, null, null, 5]
-
-Explanation
-MKAverage obj = new MKAverage(3, 1);
-obj.addElement(3); // current elements are [3]
-obj.addElement(1); // current elements are [3,1]
-obj.calculateMKAverage(); // return -1, because m = 3 and only 2 elements exist.
-obj.addElement(10); // current elements are [3,1,10]
-obj.calculateMKAverage(); // The last 3 elements are [3,1,10].
- // After removing smallest and largest 1 element the container will be [3].
- // The average of [3] equals 3/1 = 3, return 3
-obj.addElement(5); // current elements are [3,1,10,5]
-obj.addElement(5); // current elements are [3,1,10,5,5]
-obj.addElement(5); // current elements are [3,1,10,5,5,5]
-obj.calculateMKAverage(); // The last 3 elements are [5,5,5].
- // After removing smallest and largest 1 element the container will be [5].
- // The average of [5] equals 5/1 = 5, return 5
-
-
-
-
Constraints:
-
-
-
3 <= m <= 105
-
1 <= k*2 < m
-
1 <= num <= 105
-
At most 105 calls will be made to addElement and calculateMKAverage.
-
-
-### Related Topics
- [[Design](../../tag/design/README.md)]
- [[Queue](../../tag/queue/README.md)]
- [[Heap (Priority Queue)](../../tag/heap-priority-queue/README.md)]
- [[Ordered Set](../../tag/ordered-set/README.md)]
-
-### Similar Questions
- 1. [Find Median from Data Stream](../find-median-from-data-stream) (Hard)
- 1. [Kth Largest Element in a Stream](../kth-largest-element-in-a-stream) (Easy)
- 1. [Sequentially Ordinal Rank Tracker](../sequentially-ordinal-rank-tracker) (Hard)
-
-### Hints
-
-Hint 1
-At each query, try to save and update the sum of the elements needed to calculate MKAverage.
-
-
-
-Hint 2
-You can use BSTs for fast insertion and deletion of the elements.
-
diff --git a/problems/finding-pairs-with-a-certain-sum/README.md b/problems/finding-pairs-with-a-certain-sum/README.md
deleted file mode 100644
index 618963a92..000000000
--- a/problems/finding-pairs-with-a-certain-sum/README.md
+++ /dev/null
@@ -1,81 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-number-of-swaps-to-make-the-binary-string-alternating "Minimum Number of Swaps to Make the Binary String Alternating")
-
-[Next >](../number-of-ways-to-rearrange-sticks-with-k-sticks-visible "Number of Ways to Rearrange Sticks With K Sticks Visible")
-
-## [1865. Finding Pairs With a Certain Sum (Medium)](https://leetcode.com/problems/finding-pairs-with-a-certain-sum "找出和为指定值的下标对")
-
-
You are given two integer arrays nums1 and nums2. You are tasked to implement a data structure that supports queries of two types:
-
-
-
Add a positive integer to an element of a given index in the array nums2.
-
Count the number of pairs (i, j) such that nums1[i] + nums2[j] equals a given value (0 <= i < nums1.length and 0 <= j < nums2.length).
-
-
-
Implement the FindSumPairs class:
-
-
-
FindSumPairs(int[] nums1, int[] nums2) Initializes the FindSumPairs object with two integer arrays nums1 and nums2.
-
void add(int index, int val) Adds val to nums2[index], i.e., apply nums2[index] += val.
-
int count(int tot) Returns the number of pairs (i, j) such that nums1[i] + nums2[j] == tot.
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Design](../../tag/design/README.md)]
-
-### Similar Questions
- 1. [Count Number of Pairs With Absolute Difference K](../count-number-of-pairs-with-absolute-difference-k) (Easy)
-
-### Hints
-
-Hint 1
-The length of nums1 is small in comparison to that of nums2
-
-
-
-Hint 2
-If we iterate over elements of nums1 we just need to find the count of tot - element for all elements in nums1
-
diff --git a/problems/finding-the-users-active-minutes/README.md b/problems/finding-the-users-active-minutes/README.md
deleted file mode 100644
index 4b7acd96b..000000000
--- a/problems/finding-the-users-active-minutes/README.md
+++ /dev/null
@@ -1,71 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../truncate-sentence "Truncate Sentence")
-
-[Next >](../minimum-absolute-sum-difference "Minimum Absolute Sum Difference")
-
-## [1817. Finding the Users Active Minutes (Medium)](https://leetcode.com/problems/finding-the-users-active-minutes "查找用户活跃分钟数")
-
-
You are given the logs for users' actions on LeetCode, and an integer k. The logs are represented by a 2D integer array logs where each logs[i] = [IDi, timei] indicates that the user with IDi performed an action at the minute timei.
-
-
Multiple users can perform actions simultaneously, and a single user can perform multiple actions in the same minute.
-
-
The user active minutes (UAM) for a given user is defined as the number of unique minutes in which the user performed an action on LeetCode. A minute can only be counted once, even if multiple actions occur during it.
-
-
You are to calculate a 1-indexed array answer of size k such that, for each j (1 <= j <= k), answer[j] is the number of users whose UAM equals j.
-
-
Return the array answer as described above.
-
-
-
Example 1:
-
-
-Input: logs = [[0,5],[1,2],[0,2],[0,5],[1,3]], k = 5
-Output: [0,2,0,0,0]
-Explanation:
-The user with ID=0 performed actions at minutes 5, 2, and 5 again. Hence, they have a UAM of 2 (minute 5 is only counted once).
-The user with ID=1 performed actions at minutes 2 and 3. Hence, they have a UAM of 2.
-Since both users have a UAM of 2, answer[2] is 2, and the remaining answer[j] values are 0.
-
-
-
Example 2:
-
-
-Input: logs = [[1,1],[2,2],[2,3]], k = 4
-Output: [1,1,0,0]
-Explanation:
-The user with ID=1 performed a single action at minute 1. Hence, they have a UAM of 1.
-The user with ID=2 performed actions at minutes 2 and 3. Hence, they have a UAM of 2.
-There is one user with a UAM of 1 and one with a UAM of 2.
-Hence, answer[1] = 1, answer[2] = 1, and the remaining values are 0.
-
-
-
-
Constraints:
-
-
-
1 <= logs.length <= 104
-
0 <= IDi <= 109
-
1 <= timei <= 105
-
k is in the range [The maximum UAM for a user, 105].
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
-
-### Hints
-
-Hint 1
-Try to find the number of different minutes when action happened for each user.
-
-
-
-Hint 2
-For each user increase the value of the answer array index which matches the UAM for this user.
-
diff --git a/problems/first-and-last-call-on-the-same-day/README.md b/problems/first-and-last-call-on-the-same-day/README.md
deleted file mode 100644
index c8755953e..000000000
--- a/problems/first-and-last-call-on-the-same-day/README.md
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../find-if-path-exists-in-graph "Find if Path Exists in Graph")
-
-[Next >](../count-nodes-equal-to-sum-of-descendants "Count Nodes Equal to Sum of Descendants")
-
-## [1972. First and Last Call On the Same Day (Hard)](https://leetcode.com/problems/first-and-last-call-on-the-same-day "同一天的第一个电话和最后一个电话")
-
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/first-and-last-call-on-the-same-day/mysql_schemas.sql b/problems/first-and-last-call-on-the-same-day/mysql_schemas.sql
deleted file mode 100644
index ff703d10f..000000000
--- a/problems/first-and-last-call-on-the-same-day/mysql_schemas.sql
+++ /dev/null
@@ -1,8 +0,0 @@
-Create table If Not Exists Calls (caller_id int, recipient_id int, call_time datetime);
-Truncate table Calls;
-insert into Calls (caller_id, recipient_id, call_time) values ('8', '4', '2021-08-24 17:46:07');
-insert into Calls (caller_id, recipient_id, call_time) values ('4', '8', '2021-08-24 19:57:13');
-insert into Calls (caller_id, recipient_id, call_time) values ('5', '1', '2021-08-11 05:28:44');
-insert into Calls (caller_id, recipient_id, call_time) values ('8', '3', '2021-08-17 04:04:15');
-insert into Calls (caller_id, recipient_id, call_time) values ('11', '3', '2021-08-17 13:07:00');
-insert into Calls (caller_id, recipient_id, call_time) values ('8', '11', '2021-08-17 22:22:22');
diff --git a/problems/first-bad-version/README.md b/problems/first-bad-version/README.md
deleted file mode 100644
index 8c880f141..000000000
--- a/problems/first-bad-version/README.md
+++ /dev/null
@@ -1,54 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../find-the-celebrity "Find the Celebrity")
-
-[Next >](../perfect-squares "Perfect Squares")
-
-## [278. First Bad Version (Easy)](https://leetcode.com/problems/first-bad-version "第一个错误的版本")
-
-
You are a product manager and currently leading a team to develop a new product. Unfortunately, the latest version of your product fails the quality check. Since each version is developed based on the previous version, all the versions after a bad version are also bad.
-
-
Suppose you have n versions [1, 2, ..., n] and you want to find out the first bad one, which causes all the following ones to be bad.
-
-
You are given an API bool isBadVersion(version) which returns whether version is bad. Implement a function to find the first bad version. You should minimize the number of calls to the API.
-
-
-
Example 1:
-
-
-Input: n = 5, bad = 4
-Output: 4
-Explanation:
-call isBadVersion(3) -> false
-call isBadVersion(5) -> true
-call isBadVersion(4) -> true
-Then 4 is the first bad version.
-
-
-
Example 2:
-
-
-Input: n = 1, bad = 1
-Output: 1
-
-
-
-
Constraints:
-
-
-
1 <= bad <= n <= 231 - 1
-
-
-### Related Topics
- [[Binary Search](../../tag/binary-search/README.md)]
- [[Interactive](../../tag/interactive/README.md)]
-
-### Similar Questions
- 1. [Find First and Last Position of Element in Sorted Array](../find-first-and-last-position-of-element-in-sorted-array) (Medium)
- 1. [Search Insert Position](../search-insert-position) (Easy)
- 1. [Guess Number Higher or Lower](../guess-number-higher-or-lower) (Easy)
diff --git a/problems/first-bad-version/first_bad_version.go b/problems/first-bad-version/first_bad_version.go
deleted file mode 100644
index d0d112d08..000000000
--- a/problems/first-bad-version/first_bad_version.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem278
diff --git a/problems/first-bad-version/first_bad_version.py b/problems/first-bad-version/first_bad_version.py
deleted file mode 100755
index 7c7a45bb0..000000000
--- a/problems/first-bad-version/first_bad_version.py
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/usr/bin/env python
-
-# The isBadVersion API is already defined for you.
-# @param version, an integer
-# @return a bool
-# def isBadVersion(version):
-
-class Solution:
- def firstBadVersion(self, n):
- """
- :type n: int
- :rtype: int
- """
-
\ No newline at end of file
diff --git a/problems/first-bad-version/first_bad_version_test.go b/problems/first-bad-version/first_bad_version_test.go
deleted file mode 100644
index d0d112d08..000000000
--- a/problems/first-bad-version/first_bad_version_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem278
diff --git a/problems/first-day-where-you-have-been-in-all-the-rooms/README.md b/problems/first-day-where-you-have-been-in-all-the-rooms/README.md
deleted file mode 100644
index 856a5085b..000000000
--- a/problems/first-day-where-you-have-been-in-all-the-rooms/README.md
+++ /dev/null
@@ -1,87 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../the-number-of-weak-characters-in-the-game "The Number of Weak Characters in the Game")
-
-[Next >](../gcd-sort-of-an-array "GCD Sort of an Array")
-
-## [1997. First Day Where You Have Been in All the Rooms (Medium)](https://leetcode.com/problems/first-day-where-you-have-been-in-all-the-rooms "访问完所有房间的第一天")
-
-
There are n rooms you need to visit, labeled from 0 to n - 1. Each day is labeled, starting from 0. You will go in and visit one room a day.
-
-
Initially on day 0, you visit room 0. The order you visit the rooms for the coming days is determined by the following rules and a given 0-indexed array nextVisit of length n:
-
-
-
Assuming that on a day, you visit room i,
-
if you have been in room i an odd number of times (including the current visit), on the next day you will visit a room with a lower or equal room number specified by nextVisit[i] where 0 <= nextVisit[i] <= i;
-
if you have been in room i an even number of times (including the current visit), on the next day you will visit room (i + 1) mod n.
-
-
-
Return the label of the first day where you have been in all the rooms. It can be shown that such a day exists. Since the answer may be very large, return it modulo109 + 7.
-
-
-
Example 1:
-
-
-Input: nextVisit = [0,0]
-Output: 2
-Explanation:
-- On day 0, you visit room 0. The total times you have been in room 0 is 1, which is odd.
- On the next day you will visit room nextVisit[0] = 0
-- On day 1, you visit room 0, The total times you have been in room 0 is 2, which is even.
- On the next day you will visit room (0 + 1) mod 2 = 1
-- On day 2, you visit room 1. This is the first day where you have been in all the rooms.
-
-
-
Example 2:
-
-
-Input: nextVisit = [0,0,2]
-Output: 6
-Explanation:
-Your room visiting order for each day is: [0,0,1,0,0,1,2,...].
-Day 6 is the first day where you have been in all the rooms.
-
-
-
Example 3:
-
-
-Input: nextVisit = [0,1,2,0]
-Output: 6
-Explanation:
-Your room visiting order for each day is: [0,0,1,1,2,2,3,...].
-Day 6 is the first day where you have been in all the rooms.
-
-
-
-
Constraints:
-
-
-
n == nextVisit.length
-
2 <= n <= 105
-
0 <= nextVisit[i] <= i
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Hints
-
-Hint 1
-The only way to get to room i+1 is when you are visiting room i and room i has been visited an even number of times.
-
-
-
-Hint 2
-After visiting room i an odd number of times, you are required to visit room nextVisit[i] where nextVisit[i] <= i. It takes a fixed amount of days for you to come back from room nextVisit[i] to room i. Then, you have visited room i even number of times.nextVisit[i]
-
-
-
-Hint 3
-Can you use Dynamic Programming to avoid recomputing the number of days it takes to visit room i from room nextVisit[i]?
-
diff --git a/problems/first-missing-positive/README.md b/problems/first-missing-positive/README.md
deleted file mode 100644
index efea25ae1..000000000
--- a/problems/first-missing-positive/README.md
+++ /dev/null
@@ -1,61 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../combination-sum-ii "Combination Sum II")
-
-[Next >](../trapping-rain-water "Trapping Rain Water")
-
-## [41. First Missing Positive (Hard)](https://leetcode.com/problems/first-missing-positive "缺失的第一个正数")
-
-
Given an unsorted integer array nums, return the smallest missing positive integer.
-
-
You must implement an algorithm that runs in O(n) time and uses constant extra space.
-
-
-
Example 1:
-
Input: nums = [1,2,0]
-Output: 3
-
Example 2:
-
Input: nums = [3,4,-1,1]
-Output: 2
-
Example 3:
-
Input: nums = [7,8,9,11,12]
-Output: 1
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 5 * 105
-
-231 <= nums[i] <= 231 - 1
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
-
-### Similar Questions
- 1. [Missing Number](../missing-number) (Easy)
- 1. [Find the Duplicate Number](../find-the-duplicate-number) (Medium)
- 1. [Find All Numbers Disappeared in an Array](../find-all-numbers-disappeared-in-an-array) (Easy)
- 1. [Couples Holding Hands](../couples-holding-hands) (Hard)
-
-### Hints
-
-Hint 1
-Think about how you would solve the problem in non-constant space. Can you apply that logic to the existing space?
-
-
-
-Hint 2
-We don't care about duplicates or non-positive integers
-
-
-
-Hint 3
-Remember that O(2n) = O(n)
-
diff --git a/problems/first-missing-positive/first_missing_positive.go b/problems/first-missing-positive/first_missing_positive.go
deleted file mode 100644
index 0681dcbe8..000000000
--- a/problems/first-missing-positive/first_missing_positive.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem41
diff --git a/problems/first-missing-positive/first_missing_positive_test.go b/problems/first-missing-positive/first_missing_positive_test.go
deleted file mode 100644
index 0681dcbe8..000000000
--- a/problems/first-missing-positive/first_missing_positive_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem41
diff --git a/problems/first-unique-character-in-a-string/README.md b/problems/first-unique-character-in-a-string/README.md
deleted file mode 100644
index 6935d8b35..000000000
--- a/problems/first-unique-character-in-a-string/README.md
+++ /dev/null
@@ -1,42 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../lexicographical-numbers "Lexicographical Numbers")
-
-[Next >](../longest-absolute-file-path "Longest Absolute File Path")
-
-## [387. First Unique Character in a String (Easy)](https://leetcode.com/problems/first-unique-character-in-a-string "字符串中的第一个唯一字符")
-
-
Given a string s, find the first non-repeating character in it and return its index. If it does not exist, return -1.
-
-
-
Example 1:
-
Input: s = "leetcode"
-Output: 0
-
Example 2:
-
Input: s = "loveleetcode"
-Output: 2
-
Example 3:
-
Input: s = "aabb"
-Output: -1
-
-
-
Constraints:
-
-
-
1 <= s.length <= 105
-
s consists of only lowercase English letters.
-
-
-### Related Topics
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
- [[Queue](../../tag/queue/README.md)]
- [[Counting](../../tag/counting/README.md)]
-
-### Similar Questions
- 1. [Sort Characters By Frequency](../sort-characters-by-frequency) (Medium)
diff --git a/problems/first-unique-character-in-a-string/first_unique_character_in_a_string.go b/problems/first-unique-character-in-a-string/first_unique_character_in_a_string.go
deleted file mode 100644
index 8ec545324..000000000
--- a/problems/first-unique-character-in-a-string/first_unique_character_in_a_string.go
+++ /dev/null
@@ -1,17 +0,0 @@
-package problem387
-
-func firstUniqChar(s string) int {
- var count [256]byte
- l := len(s)
- for i := 0; i < l; i++ {
- if count[s[i]] < 2 {
- count[s[i]]++
- }
- }
- for i := 0; i < l; i++ {
- if count[s[i]] == 1 {
- return i
- }
- }
- return -1
-}
diff --git a/problems/first-unique-character-in-a-string/first_unique_character_in_a_string_test.go b/problems/first-unique-character-in-a-string/first_unique_character_in_a_string_test.go
deleted file mode 100644
index 2f905c371..000000000
--- a/problems/first-unique-character-in-a-string/first_unique_character_in_a_string_test.go
+++ /dev/null
@@ -1,19 +0,0 @@
-package problem387
-
-import "testing"
-
-func TestFirstUniqChar(t *testing.T) {
- tests := map[string]int{
- "leetcode": 0,
- "loveleetcode": 2,
- "hello world": 0,
- "aabbccddeeff": -1,
- }
-
- for in, want := range tests {
- got := firstUniqChar(in)
- if got != want {
- t.Fatalf("in: %v, got: %v, want: %v", in, got, want)
- }
- }
-}
diff --git a/problems/first-unique-number/README.md b/problems/first-unique-number/README.md
deleted file mode 100644
index 5c9046d3d..000000000
--- a/problems/first-unique-number/README.md
+++ /dev/null
@@ -1,37 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../leftmost-column-with-at-least-a-one "Leftmost Column with at Least a One")
-
-[Next >](../check-if-a-string-is-a-valid-sequence-from-root-to-leaves-path-in-a-binary-tree "Check If a String Is a Valid Sequence from Root to Leaves Path in a Binary Tree")
-
-## [1429. First Unique Number (Medium)](https://leetcode.com/problems/first-unique-number "第一个唯一数字")
-
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Design](../../tag/design/README.md)]
- [[Queue](../../tag/queue/README.md)]
- [[Data Stream](../../tag/data-stream/README.md)]
-
-### Hints
-
-Hint 1
-Use doubly Linked list with hashmap of pointers to linked list nodes. add unique number to the linked list. When add is called check if the added number is unique then it have to be added to the linked list and if it is repeated remove it from the linked list if exists. When showFirstUnique is called retrieve the head of the linked list.
-
-
-
-Hint 2
-Use queue and check that first element of the queue is always unique.
-
-
-
-Hint 3
-Use set or heap to make running time of each function O(logn).
-
diff --git a/problems/fix-names-in-a-table/README.md b/problems/fix-names-in-a-table/README.md
deleted file mode 100644
index 3a3b17e11..000000000
--- a/problems/fix-names-in-a-table/README.md
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../change-the-root-of-a-binary-tree "Change the Root of a Binary Tree")
-
-[Next >](../maximum-repeating-substring "Maximum Repeating Substring")
-
-## [1667. Fix Names in a Table (Easy)](https://leetcode.com/problems/fix-names-in-a-table "修复表中的名字")
-
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/fix-names-in-a-table/mysql_schemas.sql b/problems/fix-names-in-a-table/mysql_schemas.sql
deleted file mode 100644
index 2f40f9f43..000000000
--- a/problems/fix-names-in-a-table/mysql_schemas.sql
+++ /dev/null
@@ -1,4 +0,0 @@
-Create table If Not Exists Users (user_id int, name varchar(40));
-Truncate table Users;
-insert into Users (user_id, name) values ('1', 'aLice');
-insert into Users (user_id, name) values ('2', 'bOB');
diff --git a/problems/fix-product-name-format/README.md b/problems/fix-product-name-format/README.md
deleted file mode 100644
index 1ac7a026a..000000000
--- a/problems/fix-product-name-format/README.md
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../find-longest-awesome-substring "Find Longest Awesome Substring")
-
-[Next >](../make-the-string-great "Make The String Great")
-
-## [1543. Fix Product Name Format (Easy)](https://leetcode.com/problems/fix-product-name-format "产品名称格式修复")
-
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/fix-product-name-format/mysql_schemas.sql b/problems/fix-product-name-format/mysql_schemas.sql
deleted file mode 100644
index cfc6ec934..000000000
--- a/problems/fix-product-name-format/mysql_schemas.sql
+++ /dev/null
@@ -1,9 +0,0 @@
-Create table If Not Exists Sales (sale_id int, product_name varchar(30), sale_date date)
-;
-Truncate table Sales;
-insert into Sales (sale_id, product_name, sale_date) values ('1', 'LCPHONE', '2000-01-16');
-insert into Sales (sale_id, product_name, sale_date) values ('2', 'LCPhone', '2000-01-17');
-insert into Sales (sale_id, product_name, sale_date) values ('3', 'LcPhOnE', '2000-02-18');
-insert into Sales (sale_id, product_name, sale_date) values ('4', 'LCKeyCHAiN', '2000-02-19');
-insert into Sales (sale_id, product_name, sale_date) values ('5', 'LCKeyChain', '2000-02-28');
-insert into Sales (sale_id, product_name, sale_date) values ('6', 'Matryoshka', '2000-03-31');
diff --git a/problems/fixed-point/README.md b/problems/fixed-point/README.md
deleted file mode 100644
index d3983ae1a..000000000
--- a/problems/fixed-point/README.md
+++ /dev/null
@@ -1,62 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../number-of-valid-subarrays "Number of Valid Subarrays")
-
-[Next >](../index-pairs-of-a-string "Index Pairs of a String")
-
-## [1064. Fixed Point (Easy)](https://leetcode.com/problems/fixed-point "不动点")
-
-
Given an array A of distinct integers sorted in ascending order, return the smallest index i that satisfies A[i] == i. Return -1 if no such i exists.
-
-
-
-
Example 1:
-
-
-Input: [-10,-5,0,3,7]
-Output: 3
-Explanation:
-For the given array, A[0] = -10, A[1] = -5, A[2] = 0, A[3] = 3, thus the output is 3.
-
-
-
Example 2:
-
-
-Input: [0,2,5,8,17]
-Output: 0
-Explanation:
-A[0] = 0, thus the output is 0.
-
-
-
Example 3:
-
-
-Input: [-10,-5,3,4,7,9]
-Output: -1
-Explanation:
-There is no such i that A[i] = i, thus the output is -1.
-
-
-
-
-
Note:
-
-
-
1 <= A.length < 10^4
-
-10^9 <= A[i] <= 10^9
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
-
-### Hints
-
-Hint 1
-Loop over the array and check the first index i such A[i] == i
-
diff --git a/problems/fizz-buzz-multithreaded/README.md b/problems/fizz-buzz-multithreaded/README.md
deleted file mode 100644
index 64187532e..000000000
--- a/problems/fizz-buzz-multithreaded/README.md
+++ /dev/null
@@ -1,71 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../tournament-winners "Tournament Winners")
-
-[Next >](../how-many-apples-can-you-put-into-the-basket "How Many Apples Can You Put into the Basket")
-
-## [1195. Fizz Buzz Multithreaded (Medium)](https://leetcode.com/problems/fizz-buzz-multithreaded "交替打印字符串")
-
-
You have the four functions:
-
-
-
printFizz that prints the word "Fizz" to the console,
-
printBuzz that prints the word "Buzz" to the console,
-
printFizzBuzz that prints the word "FizzBuzz" to the console, and
-
printNumber that prints a given integer to the console.
-
-
-
You are given an instance of the class FizzBuzz that has four functions: fizz, buzz, fizzbuzz and number. The same instance of FizzBuzz will be passed to four different threads:
-
-
-
Thread A: calls fizz() that should output the word "Fizz".
-
Thread B: calls buzz() that should output the word "Buzz".
-
Thread C: calls fizzbuzz() that should output the word "FizzBuzz".
-
Thread D: calls number() that should only output the integers.
-
-
-
Modify the given class to output the series [1, 2, "Fizz", 4, "Buzz", ...] where the ith token (1-indexed) of the series is:
-
-
-
"FizzBuzz" if i is divisible by 3 and 5,
-
"Fizz" if i is divisible by 3 and not 5,
-
"Buzz" if i is divisible by 5 and not 3, or
-
i if i is not divisible by 3 or 5.
-
-
-
Implement the FizzBuzz class:
-
-
-
FizzBuzz(int n) Initializes the object with the number n that represents the length of the sequence that should be printed.
-
void fizz(printFizz) Calls printFizz to output "Fizz".
-
void buzz(printBuzz) Calls printBuzz to output "Buzz".
-
void fizzbuzz(printFizzBuzz) Calls printFizzBuzz to output "FizzBuzz".
-
void number(printNumber) Calls printnumber to output the numbers.
-
-
-
-
Example 1:
-
Input: n = 15
-Output: [1,2,"fizz",4,"buzz","fizz",7,8,"fizz","buzz",11,"fizz",13,14,"fizzbuzz"]
-
Please remember to RESET your class variables declared in Vector2D, as static/class variables are persisted across multiple test cases. Please see here for more details.
-
You may assume that next() call will always be valid, that is, there will be at least a next element in the 2d vector when next() is called.
-
-### Related Topics
- [[Design](../../tag/design/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Two Pointers](../../tag/two-pointers/README.md)]
- [[Iterator](../../tag/iterator/README.md)]
-
-### Similar Questions
- 1. [Binary Search Tree Iterator](../binary-search-tree-iterator) (Medium)
- 1. [Zigzag Iterator](../zigzag-iterator) (Medium)
- 1. [Peeking Iterator](../peeking-iterator) (Medium)
- 1. [Flatten Nested List Iterator](../flatten-nested-list-iterator) (Medium)
-
-### Hints
-
-Hint 1
-How many variables do you need to keep track?
-
-
-
-Hint 2
-Two variables is all you need. Try with x and y.
-
-
-
-Hint 3
-Beware of empty rows. It could be the first few rows.
-
-
-
-Hint 4
-To write correct code, think about the invariant to maintain. What is it?
-
-
-
-Hint 5
-The invariant is x and y must always point to a valid point in the 2d vector. Should you maintain your invariant ahead of time or right when you need it?
-
-
-
-Hint 6
-Not sure? Think about how you would implement hasNext(). Which is more complex?
-
-
-
-Hint 7
-Common logic in two different places should be refactored into a common method.
-
diff --git a/problems/flatten-2d-vector/flatten_2d_vector.go b/problems/flatten-2d-vector/flatten_2d_vector.go
deleted file mode 100644
index 04d026c6e..000000000
--- a/problems/flatten-2d-vector/flatten_2d_vector.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem251
diff --git a/problems/flatten-2d-vector/flatten_2d_vector_test.go b/problems/flatten-2d-vector/flatten_2d_vector_test.go
deleted file mode 100644
index 04d026c6e..000000000
--- a/problems/flatten-2d-vector/flatten_2d_vector_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem251
diff --git a/problems/flatten-a-multilevel-doubly-linked-list/README.md b/problems/flatten-a-multilevel-doubly-linked-list/README.md
deleted file mode 100644
index 45570d484..000000000
--- a/problems/flatten-a-multilevel-doubly-linked-list/README.md
+++ /dev/null
@@ -1,99 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../n-ary-tree-level-order-traversal "N-ary Tree Level Order Traversal")
-
-[Next >](../encode-n-ary-tree-to-binary-tree "Encode N-ary Tree to Binary Tree")
-
-## [430. Flatten a Multilevel Doubly Linked List (Medium)](https://leetcode.com/problems/flatten-a-multilevel-doubly-linked-list "扁平化多级双向链表")
-
-
You are given a doubly linked list, which contains nodes that have a next pointer, a previous pointer, and an additional child pointer. This child pointer may or may not point to a separate doubly linked list, also containing these special nodes. These child lists may have one or more children of their own, and so on, to produce a multilevel data structure as shown in the example below.
-
-
Given the head of the first level of the list, flatten the list so that all the nodes appear in a single-level, doubly linked list. Let curr be a node with a child list. The nodes in the child list should appear aftercurr and beforecurr.next in the flattened list.
-
-
Return the head of the flattened list. The nodes in the list must have all of their child pointers set to null.
-
-
-
Example 1:
-
-
-Input: head = [1,2,3,4,5,6,null,null,null,7,8,9,10,null,null,11,12]
-Output: [1,2,3,7,8,11,12,9,10,4,5,6]
-Explanation: The multilevel linked list in the input is shown.
-After flattening the multilevel linked list it becomes:
-
-
-
-
Example 2:
-
-
-Input: head = [1,2,null,3]
-Output: [1,3,2]
-Explanation: The multilevel linked list in the input is shown.
-After flattening the multilevel linked list it becomes:
-
-
-
-
Example 3:
-
-
-Input: head = []
-Output: []
-Explanation: There could be empty list in the input.
-
-
-
-
Constraints:
-
-
-
The number of Nodes will not exceed 1000.
-
1 <= Node.val <= 105
-
-
-
-
How the multilevel linked list is represented in test cases:
-
-
We use the multilevel linked list from Example 1 above:
To serialize all levels together, we will add nulls in each level to signify no node connects to the upper node of the previous level. The serialization becomes:
-
-### Related Topics
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Linked List](../../tag/linked-list/README.md)]
- [[Doubly-Linked List](../../tag/doubly-linked-list/README.md)]
-
-### Similar Questions
- 1. [Flatten Binary Tree to Linked List](../flatten-binary-tree-to-linked-list) (Medium)
diff --git a/problems/flatten-a-multilevel-doubly-linked-list/flatten_a_multilevel_doubly_linked_list.go b/problems/flatten-a-multilevel-doubly-linked-list/flatten_a_multilevel_doubly_linked_list.go
deleted file mode 100644
index cfb9a734b..000000000
--- a/problems/flatten-a-multilevel-doubly-linked-list/flatten_a_multilevel_doubly_linked_list.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem430
diff --git a/problems/flatten-a-multilevel-doubly-linked-list/flatten_a_multilevel_doubly_linked_list.py b/problems/flatten-a-multilevel-doubly-linked-list/flatten_a_multilevel_doubly_linked_list.py
deleted file mode 100755
index 6e0ca2a4b..000000000
--- a/problems/flatten-a-multilevel-doubly-linked-list/flatten_a_multilevel_doubly_linked_list.py
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/usr/bin/env python
-
-"""
-# Definition for a Node.
-class Node:
- def __init__(self, val, prev, next, child):
- self.val = val
- self.prev = prev
- self.next = next
- self.child = child
-"""
-class Solution:
- def flatten(self, head: 'Node') -> 'Node':
-
\ No newline at end of file
diff --git a/problems/flatten-a-multilevel-doubly-linked-list/flatten_a_multilevel_doubly_linked_list_test.go b/problems/flatten-a-multilevel-doubly-linked-list/flatten_a_multilevel_doubly_linked_list_test.go
deleted file mode 100644
index cfb9a734b..000000000
--- a/problems/flatten-a-multilevel-doubly-linked-list/flatten_a_multilevel_doubly_linked_list_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem430
diff --git a/problems/flatten-binary-tree-to-linked-list/README.md b/problems/flatten-binary-tree-to-linked-list/README.md
deleted file mode 100644
index 3ec60780b..000000000
--- a/problems/flatten-binary-tree-to-linked-list/README.md
+++ /dev/null
@@ -1,68 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../path-sum-ii "Path Sum II")
-
-[Next >](../distinct-subsequences "Distinct Subsequences")
-
-## [114. Flatten Binary Tree to Linked List (Medium)](https://leetcode.com/problems/flatten-binary-tree-to-linked-list "二叉树展开为链表")
-
-
Given the root of a binary tree, flatten the tree into a "linked list":
-
-
-
The "linked list" should use the same TreeNode class where the right child pointer points to the next node in the list and the left child pointer is always null.
-
The "linked list" should be in the same order as a pre-order traversal of the binary tree.
The number of nodes in the tree is in the range [0, 2000].
-
-100 <= Node.val <= 100
-
-
-
-Follow up: Can you flatten the tree in-place (with O(1) extra space)?
-
-### Related Topics
- [[Stack](../../tag/stack/README.md)]
- [[Tree](../../tag/tree/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Linked List](../../tag/linked-list/README.md)]
- [[Binary Tree](../../tag/binary-tree/README.md)]
-
-### Similar Questions
- 1. [Flatten a Multilevel Doubly Linked List](../flatten-a-multilevel-doubly-linked-list) (Medium)
-
-### Hints
-
-Hint 1
-If you notice carefully in the flattened tree, each node's right child points to the next node of a pre-order traversal.
-
diff --git a/problems/flatten-binary-tree-to-linked-list/flatten_binary_tree_to_linked_list.go b/problems/flatten-binary-tree-to-linked-list/flatten_binary_tree_to_linked_list.go
deleted file mode 100644
index a99984e17..000000000
--- a/problems/flatten-binary-tree-to-linked-list/flatten_binary_tree_to_linked_list.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem114
diff --git a/problems/flatten-binary-tree-to-linked-list/flatten_binary_tree_to_linked_list_test.go b/problems/flatten-binary-tree-to-linked-list/flatten_binary_tree_to_linked_list_test.go
deleted file mode 100644
index a99984e17..000000000
--- a/problems/flatten-binary-tree-to-linked-list/flatten_binary_tree_to_linked_list_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem114
diff --git a/problems/flatten-nested-list-iterator/README.md b/problems/flatten-nested-list-iterator/README.md
deleted file mode 100644
index de96115b9..000000000
--- a/problems/flatten-nested-list-iterator/README.md
+++ /dev/null
@@ -1,73 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../longest-substring-with-at-most-k-distinct-characters "Longest Substring with At Most K Distinct Characters")
-
-[Next >](../power-of-four "Power of Four")
-
-## [341. Flatten Nested List Iterator (Medium)](https://leetcode.com/problems/flatten-nested-list-iterator "扁平化嵌套列表迭代器")
-
-
You are given a nested list of integers nestedList. Each element is either an integer or a list whose elements may also be integers or other lists. Implement an iterator to flatten it.
-
-
Implement the NestedIterator class:
-
-
-
NestedIterator(List<NestedInteger> nestedList) Initializes the iterator with the nested list nestedList.
-
int next() Returns the next integer in the nested list.
-
boolean hasNext() Returns true if there are still some integers in the nested list and false otherwise.
-
-
-
Your code will be tested with the following pseudocode:
-
-
-initialize iterator with nestedList
-res = []
-while iterator.hasNext()
- append iterator.next() to the end of res
-return res
-
-
-
If res matches the expected flattened list, then your code will be judged as correct.
-
-
-
Example 1:
-
-
-Input: nestedList = [[1,1],2,[1,1]]
-Output: [1,1,2,1,1]
-Explanation: By calling next repeatedly until hasNext returns false, the order of elements returned by next should be: [1,1,2,1,1].
-
-
-
Example 2:
-
-
-Input: nestedList = [1,[4,[6]]]
-Output: [1,4,6]
-Explanation: By calling next repeatedly until hasNext returns false, the order of elements returned by next should be: [1,4,6].
-
-
-
-
Constraints:
-
-
-
1 <= nestedList.length <= 500
-
The values of the integers in the nested list is in the range [-106, 106].
-
-
-### Related Topics
- [[Stack](../../tag/stack/README.md)]
- [[Tree](../../tag/tree/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Design](../../tag/design/README.md)]
- [[Queue](../../tag/queue/README.md)]
- [[Iterator](../../tag/iterator/README.md)]
-
-### Similar Questions
- 1. [Flatten 2D Vector](../flatten-2d-vector) (Medium)
- 1. [Zigzag Iterator](../zigzag-iterator) (Medium)
- 1. [Mini Parser](../mini-parser) (Medium)
- 1. [Array Nesting](../array-nesting) (Medium)
diff --git a/problems/flatten-nested-list-iterator/flatten_nested_list_iterator.go b/problems/flatten-nested-list-iterator/flatten_nested_list_iterator.go
deleted file mode 100644
index db0204365..000000000
--- a/problems/flatten-nested-list-iterator/flatten_nested_list_iterator.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem341
diff --git a/problems/flatten-nested-list-iterator/flatten_nested_list_iterator.py b/problems/flatten-nested-list-iterator/flatten_nested_list_iterator.py
deleted file mode 100755
index bb4c59534..000000000
--- a/problems/flatten-nested-list-iterator/flatten_nested_list_iterator.py
+++ /dev/null
@@ -1,51 +0,0 @@
-#!/usr/bin/env python
-
-# """
-# This is the interface that allows for creating nested lists.
-# You should not implement it, or speculate about its implementation
-# """
-#class NestedInteger(object):
-# def isInteger(self):
-# """
-# @return True if this NestedInteger holds a single integer, rather than a nested list.
-# :rtype bool
-# """
-#
-# def getInteger(self):
-# """
-# @return the single integer that this NestedInteger holds, if it holds a single integer
-# Return None if this NestedInteger holds a nested list
-# :rtype int
-# """
-#
-# def getList(self):
-# """
-# @return the nested list that this NestedInteger holds, if it holds a nested list
-# Return None if this NestedInteger holds a single integer
-# :rtype List[NestedInteger]
-# """
-
-class NestedIterator(object):
-
- def __init__(self, nestedList):
- """
- Initialize your data structure here.
- :type nestedList: List[NestedInteger]
- """
-
-
- def next(self):
- """
- :rtype: int
- """
-
-
- def hasNext(self):
- """
- :rtype: bool
- """
-
-
-# Your NestedIterator object will be instantiated and called as such:
-# i, v = NestedIterator(nestedList), []
-# while i.hasNext(): v.append(i.next())
\ No newline at end of file
diff --git a/problems/flatten-nested-list-iterator/flatten_nested_list_iterator_test.go b/problems/flatten-nested-list-iterator/flatten_nested_list_iterator_test.go
deleted file mode 100644
index db0204365..000000000
--- a/problems/flatten-nested-list-iterator/flatten_nested_list_iterator_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem341
diff --git a/problems/flip-binary-tree-to-match-preorder-traversal/README.md b/problems/flip-binary-tree-to-match-preorder-traversal/README.md
deleted file mode 100644
index c9c6d7295..000000000
--- a/problems/flip-binary-tree-to-match-preorder-traversal/README.md
+++ /dev/null
@@ -1,61 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../powerful-integers "Powerful Integers")
-
-[Next >](../equal-rational-numbers "Equal Rational Numbers")
-
-## [971. Flip Binary Tree To Match Preorder Traversal (Medium)](https://leetcode.com/problems/flip-binary-tree-to-match-preorder-traversal "翻转二叉树以匹配先序遍历")
-
-
You are given the root of a binary tree with n nodes, where each node is uniquely assigned a value from 1 to n. You are also given a sequence of n values voyage, which is the desiredpre-order traversal of the binary tree.
-
-
Any node in the binary tree can be flipped by swapping its left and right subtrees. For example, flipping node 1 will have the following effect:
-
-
Flip the smallest number of nodes so that the pre-order traversal of the tree matchesvoyage.
-
-
Return a list of the values of all flipped nodes. You may return the answer in any order. If it is impossible to flip the nodes in the tree to make the pre-order traversal match voyage, return the list [-1].
-
-
-
Example 1:
-
-
-Input: root = [1,2], voyage = [2,1]
-Output: [-1]
-Explanation: It is impossible to flip the nodes such that the pre-order traversal matches voyage.
-
-
-
Example 2:
-
-
-Input: root = [1,2,3], voyage = [1,3,2]
-Output: [1]
-Explanation: Flipping node 1 swaps nodes 2 and 3, so the pre-order traversal matches voyage.
-
-
Example 3:
-
-
-Input: root = [1,2,3], voyage = [1,2,3]
-Output: []
-Explanation: The tree's pre-order traversal already matches voyage, so no nodes need to be flipped.
-
-
-
-
Constraints:
-
-
-
The number of nodes in the tree is n.
-
n == voyage.length
-
1 <= n <= 100
-
1 <= Node.val, voyage[i] <= n
-
All the values in the tree are unique.
-
All the values in voyage are unique.
-
-
-### Related Topics
- [[Tree](../../tag/tree/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Binary Tree](../../tag/binary-tree/README.md)]
diff --git a/problems/flip-binary-tree-to-match-preorder-traversal/flip_binary_tree_to_match_preorder_traversal.go b/problems/flip-binary-tree-to-match-preorder-traversal/flip_binary_tree_to_match_preorder_traversal.go
deleted file mode 100644
index 6f689c95b..000000000
--- a/problems/flip-binary-tree-to-match-preorder-traversal/flip_binary_tree_to_match_preorder_traversal.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem971
diff --git a/problems/flip-columns-for-maximum-number-of-equal-rows/README.md b/problems/flip-columns-for-maximum-number-of-equal-rows/README.md
deleted file mode 100644
index a1bae20b6..000000000
--- a/problems/flip-columns-for-maximum-number-of-equal-rows/README.md
+++ /dev/null
@@ -1,64 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../greatest-common-divisor-of-strings "Greatest Common Divisor of Strings")
-
-[Next >](../adding-two-negabinary-numbers "Adding Two Negabinary Numbers")
-
-## [1072. Flip Columns For Maximum Number of Equal Rows (Medium)](https://leetcode.com/problems/flip-columns-for-maximum-number-of-equal-rows "按列翻转得到最大值等行数")
-
-
You are given an m x n binary matrix matrix.
-
-
You can choose any number of columns in the matrix and flip every cell in that column (i.e., Change the value of the cell from 0 to 1 or vice versa).
-
-
Return the maximum number of rows that have all values equal after some number of flips.
-
-
-
Example 1:
-
-
-Input: matrix = [[0,1],[1,1]]
-Output: 1
-Explanation: After flipping no values, 1 row has all values equal.
-
-
-
Example 2:
-
-
-Input: matrix = [[0,1],[1,0]]
-Output: 2
-Explanation: After flipping values in the first column, both rows have equal values.
-
-
-
Example 3:
-
-
-Input: matrix = [[0,0,0],[0,0,1],[1,1,0]]
-Output: 2
-Explanation: After flipping values in the first two columns, the last two rows have equal values.
-
-
-
-
Constraints:
-
-
-
m == matrix.length
-
n == matrix[i].length
-
1 <= m, n <= 300
-
matrix[i][j] is either 0 or 1.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
-
-### Hints
-
-Hint 1
-Flipping a subset of columns is like doing a bitwise XOR of some number K onto each row. We want rows X with X ^ K = all 0s or all 1s. This is the same as X = X^K ^K = (all 0s or all 1s) ^ K, so we want to count rows that have opposite bits set. For example, if K = 1, then we count rows X = (00000...001, or 1111....110).
-
diff --git a/problems/flip-columns-for-maximum-number-of-equal-rows/flip_columns_for_maximum_number_of_equal_rows.go b/problems/flip-columns-for-maximum-number-of-equal-rows/flip_columns_for_maximum_number_of_equal_rows.go
deleted file mode 100644
index b20c67935..000000000
--- a/problems/flip-columns-for-maximum-number-of-equal-rows/flip_columns_for_maximum_number_of_equal_rows.go
+++ /dev/null
@@ -1,31 +0,0 @@
-package problem1072
-
-import "strings"
-
-func maxEqualRowsAfterFlips(A [][]int) int {
- count := make(map[string]int, 300)
- var sb strings.Builder
- for _, r := range A {
- r0 := r[0]
- for _, x := range r {
- sb.WriteByte(byte(x ^ r0 + '0'))
- }
- count[sb.String()]++
- sb.Reset()
- }
-
- res := 0
-
- for _, c := range count {
- res = max(res, c)
- }
-
- return res
-}
-
-func max(a, b int) int {
- if a > b {
- return a
- }
- return b
-}
diff --git a/problems/flip-equivalent-binary-trees/README.md b/problems/flip-equivalent-binary-trees/README.md
deleted file mode 100644
index ee433b677..000000000
--- a/problems/flip-equivalent-binary-trees/README.md
+++ /dev/null
@@ -1,68 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../reveal-cards-in-increasing-order "Reveal Cards In Increasing Order")
-
-[Next >](../largest-component-size-by-common-factor "Largest Component Size by Common Factor")
-
-## [951. Flip Equivalent Binary Trees (Medium)](https://leetcode.com/problems/flip-equivalent-binary-trees "翻转等价二叉树")
-
-
For a binary tree T, we can define a flip operation as follows: choose any node, and swap the left and right child subtrees.
-
-
A binary tree X is flip equivalent to a binary tree Y if and only if we can make X equal to Y after some number of flip operations.
-
-
Given the roots of two binary trees root1 and root2, return true if the two trees are flip equivelent or false otherwise.
-
-
-
Example 1:
-
-
-Input: root1 = [1,2,3,4,5,6,null,null,null,7,8], root2 = [1,3,2,null,6,4,5,null,null,null,null,8,7]
-Output: true
-Explanation: We flipped at nodes with values 1, 3, and 5.
-
You are playing the following Flip Game with your friend: Given a string that contains only these two characters: + and -, you and your friend take turns to flip two consecutive"++" into "--". The game ends when a person can no longer make a move and therefore the other person will be the winner.
-
-
Write a function to determine if the starting player can guarantee a win.
-
-
Example:
-
-
-Input:s = "++++"
-Output: true
-Explanation: The starting player can guarantee a win by flipping the middle "++" to become "+--+".
-
-
-
Follow up:
-Derive your algorithm's runtime complexity.
You are playing the following Flip Game with your friend: Given a string that contains only these two characters: + and -, you and your friend take turns to flip two consecutive"++" into "--". The game ends when a person can no longer make a move and therefore the other person will be the winner.
-
-
Write a function to compute all possible states of the string after one valid move.
An image is represented by an m x n integer grid image where image[i][j] represents the pixel value of the image.
-
-
You are also given three integers sr, sc, and newColor. You should perform a flood fill on the image starting from the pixel image[sr][sc].
-
-
To perform a flood fill, consider the starting pixel, plus any pixels connected 4-directionally to the starting pixel of the same color as the starting pixel, plus any pixels connected 4-directionally to those pixels (also with the same color), and so on. Replace the color of all of the aforementioned pixels with newColor.
-
-
Return the modified image after performing the flood fill.
-
-
-
Example 1:
-
-
-Input: image = [[1,1,1],[1,1,0],[1,0,1]], sr = 1, sc = 1, newColor = 2
-Output: [[2,2,2],[2,2,0],[2,0,1]]
-Explanation: From the center of the image with position (sr, sc) = (1, 1) (i.e., the red pixel), all pixels connected by a path of the same color as the starting pixel (i.e., the blue pixels) are colored with the new color.
-Note the bottom corner is not colored 2, because it is not 4-directionally connected to the starting pixel.
-
-
-### Related Topics
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
-
-### Similar Questions
- 1. [Island Perimeter](../island-perimeter) (Easy)
-
-### Hints
-
-Hint 1
-Write a recursive function that paints the pixel if it's the correct color, then recurses on neighboring pixels.
-
diff --git a/problems/flood-fill/flood_fill.go b/problems/flood-fill/flood_fill.go
deleted file mode 100644
index 3ea542c93..000000000
--- a/problems/flood-fill/flood_fill.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem733
diff --git a/problems/flood-fill/flood_fill_test.go b/problems/flood-fill/flood_fill_test.go
deleted file mode 100644
index 3ea542c93..000000000
--- a/problems/flood-fill/flood_fill_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem733
diff --git a/problems/flower-planting-with-no-adjacent/README.md b/problems/flower-planting-with-no-adjacent/README.md
deleted file mode 100644
index 18eb5ebdd..000000000
--- a/problems/flower-planting-with-no-adjacent/README.md
+++ /dev/null
@@ -1,70 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../robot-bounded-in-circle "Robot Bounded In Circle")
-
-[Next >](../partition-array-for-maximum-sum "Partition Array for Maximum Sum")
-
-## [1042. Flower Planting With No Adjacent (Medium)](https://leetcode.com/problems/flower-planting-with-no-adjacent "不邻接植花")
-
-
You have n gardens, labeled from 1 to n, and an array paths where paths[i] = [xi, yi] describes a bidirectional path between garden xi to garden yi. In each garden, you want to plant one of 4 types of flowers.
-
-
All gardens have at most 3 paths coming into or leaving it.
-
-
Your task is to choose a flower type for each garden such that, for any two gardens connected by a path, they have different types of flowers.
-
-
Return any such a choice as an array answer, where answer[i] is the type of flower planted in the (i+1)th garden. The flower types are denoted 1, 2, 3, or 4. It is guaranteed an answer exists.
-
-
-
Example 1:
-
-
-Input: n = 3, paths = [[1,2],[2,3],[3,1]]
-Output: [1,2,3]
-Explanation:
-Gardens 1 and 2 have different types.
-Gardens 2 and 3 have different types.
-Gardens 3 and 1 have different types.
-Hence, [1,2,3] is a valid answer. Other valid answers include [1,2,4], [1,4,2], and [3,2,1].
-
-
-
Example 2:
-
-
-Input: n = 4, paths = [[1,2],[3,4]]
-Output: [1,2,1,2]
-
-
-
Example 3:
-
-
-Input: n = 4, paths = [[1,2],[2,3],[3,4],[4,1],[1,3],[2,4]]
-Output: [1,2,3,4]
-
-
-
-
Constraints:
-
-
-
1 <= n <= 104
-
0 <= paths.length <= 2 * 104
-
paths[i].length == 2
-
1 <= xi, yi <= n
-
xi != yi
-
Every garden has at most 3 paths coming into or leaving it.
-
-
-### Related Topics
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Graph](../../tag/graph/README.md)]
-
-### Hints
-
-Hint 1
-Since each garden is connected to at most 3 gardens, there's always an available color for each garden. For example, if one garden is next to gardens with colors 1, 3, 4, then color #2 is available.
-
diff --git a/problems/flower-planting-with-no-adjacent/flower_planting_with_no_adjacent.go b/problems/flower-planting-with-no-adjacent/flower_planting_with_no_adjacent.go
deleted file mode 100644
index b07231504..000000000
--- a/problems/flower-planting-with-no-adjacent/flower_planting_with_no_adjacent.go
+++ /dev/null
@@ -1,23 +0,0 @@
-package problem1042
-
-func gardenNoAdj(N int, paths [][]int) []int {
- ans, adjGarden, flowerUsed := make([]int, N), make([][]int, N), make([][4]bool, N)
- for _, path := range paths {
- if path[0] > path[1] {
- path[0], path[1] = path[1], path[0]
- }
- adjGarden[path[0]-1] = append(adjGarden[path[0]-1], path[1]-1)
- }
- for i := 0; i < N; i++ {
- for flower, used := range flowerUsed[i] {
- if !used {
- ans[i] = flower + 1
- break
- }
- }
- for _, garden := range adjGarden[i] {
- flowerUsed[garden][ans[i]-1] = true
- }
- }
- return ans
-}
diff --git a/problems/flower-planting-with-no-adjacent/flower_planting_with_no_adjacent_test.go b/problems/flower-planting-with-no-adjacent/flower_planting_with_no_adjacent_test.go
deleted file mode 100644
index 5abf05d23..000000000
--- a/problems/flower-planting-with-no-adjacent/flower_planting_with_no_adjacent_test.go
+++ /dev/null
@@ -1,52 +0,0 @@
-package problem1042
-
-import (
- "reflect"
- "testing"
-)
-
-type testType struct {
- n int
- paths [][]int
- want []int
-}
-
-func TestGardenNoAdj(t *testing.T) {
- tests := [...]testType{
- {
- n: 3,
- paths: [][]int{
- {1, 2},
- {2, 3},
- {3, 1},
- },
- want: []int{1, 2, 3},
- },
- {
- n: 4,
- paths: [][]int{
- {1, 2},
- {3, 4},
- },
- want: []int{1, 2, 1, 2},
- },
- {
- n: 4,
- paths: [][]int{
- {1, 2},
- {2, 3},
- {3, 4},
- {4, 1},
- {1, 3},
- {2, 4},
- },
- want: []int{1, 2, 3, 4},
- },
- }
- for _, tt := range tests {
- got := gardenNoAdj(tt.n, tt.paths)
- if !reflect.DeepEqual(got, tt.want) {
- t.Fatalf("in: %v, got: %v, want: %v", tt.n, got, tt.want)
- }
- }
-}
diff --git a/problems/form-array-by-concatenating-subarrays-of-another-array/README.md b/problems/form-array-by-concatenating-subarrays-of-another-array/README.md
deleted file mode 100644
index 6cc68179e..000000000
--- a/problems/form-array-by-concatenating-subarrays-of-another-array/README.md
+++ /dev/null
@@ -1,75 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../longest-nice-substring "Longest Nice Substring")
-
-[Next >](../map-of-highest-peak "Map of Highest Peak")
-
-## [1764. Form Array by Concatenating Subarrays of Another Array (Medium)](https://leetcode.com/problems/form-array-by-concatenating-subarrays-of-another-array "通过连接另一个数组的子数组得到一个数组")
-
-
You are given a 2D integer array groups of length n. You are also given an integer array nums.
-
-
You are asked if you can choose ndisjoint subarrays from the array nums such that the ith subarray is equal to groups[i] (0-indexed), and if i > 0, the (i-1)th subarray appears before the ith subarray in nums (i.e. the subarrays must be in the same order as groups).
-
-
Return trueif you can do this task, andfalseotherwise.
-
-
Note that the subarrays are disjoint if and only if there is no index k such that nums[k] belongs to more than one subarray. A subarray is a contiguous sequence of elements within an array.
-
-
-
Example 1:
-
-
-Input: groups = [[1,-1,-1],[3,-2,0]], nums = [1,-1,0,1,-1,-1,3,-2,0]
-Output: true
-Explanation: You can choose the 0th subarray as [1,-1,0,1,-1,-1,3,-2,0] and the 1st one as [1,-1,0,1,-1,-1,3,-2,0].
-These subarrays are disjoint as they share no common nums[k] element.
-
-
-
Example 2:
-
-
-Input: groups = [[10,-2],[1,2,3,4]], nums = [1,2,3,4,10,-2]
-Output: false
-Explanation: Note that choosing the subarrays [1,2,3,4,10,-2] and [1,2,3,4,10,-2] is incorrect because they are not in the same order as in groups.
-[10,-2] must come before [1,2,3,4].
-
-
-
Example 3:
-
-
-Input: groups = [[1,2,3],[3,4]], nums = [7,7,1,2,3,4,7,7]
-Output: false
-Explanation: Note that choosing the subarrays [7,7,1,2,3,4,7,7] and [7,7,1,2,3,4,7,7] is invalid because they are not disjoint.
-They share a common elements nums[4] (0-indexed).
-
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[Array](../../tag/array/README.md)]
- [[String Matching](../../tag/string-matching/README.md)]
-
-### Hints
-
-Hint 1
-When we use a subarray, the room for the next subarrays will be the suffix after the used subarray.
-
-
-
-Hint 2
-If we can match a group with multiple subarrays, we should choose the first one, as this will just leave the largest room for the next subarrays.
-
diff --git a/problems/form-largest-integer-with-digits-that-add-up-to-target/README.md b/problems/form-largest-integer-with-digits-that-add-up-to-target/README.md
deleted file mode 100644
index 939b93d2f..000000000
--- a/problems/form-largest-integer-with-digits-that-add-up-to-target/README.md
+++ /dev/null
@@ -1,80 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../count-good-nodes-in-binary-tree "Count Good Nodes in Binary Tree")
-
-[Next >](../number-of-students-doing-homework-at-a-given-time "Number of Students Doing Homework at a Given Time")
-
-## [1449. Form Largest Integer With Digits That Add up to Target (Hard)](https://leetcode.com/problems/form-largest-integer-with-digits-that-add-up-to-target "数位成本和为目标值的最大数字")
-
-
Given an array of integers cost and an integer target, return the maximum integer you can paint under the following rules:
-
-
-
The cost of painting a digit (i + 1) is given by cost[i] (0-indexed).
-
The total cost used must be equal to target.
-
The integer does not have 0 digits.
-
-
-
Since the answer may be very large, return it as a string. If there is no way to paint any integer given the condition, return "0".
-
-
-
Example 1:
-
-
-Input: cost = [4,3,2,5,6,7,2,5,5], target = 9
-Output: "7772"
-Explanation: The cost to paint the digit '7' is 2, and the digit '2' is 3. Then cost("7772") = 2*3+ 3*1 = 9. You could also paint "977", but "7772" is the largest number.
-Digit cost
- 1 -> 4
- 2 -> 3
- 3 -> 2
- 4 -> 5
- 5 -> 6
- 6 -> 7
- 7 -> 2
- 8 -> 5
- 9 -> 5
-
-
-
Example 2:
-
-
-Input: cost = [7,6,5,5,5,6,8,7,8], target = 12
-Output: "85"
-Explanation: The cost to paint the digit '8' is 7, and the digit '5' is 5. Then cost("85") = 7 + 5 = 12.
-
-
-
Example 3:
-
-
-Input: cost = [2,4,6,2,4,6,4,4,4], target = 5
-Output: "0"
-Explanation: It is impossible to paint any integer with total cost equal to target.
-
-
-
-
Constraints:
-
-
-
cost.length == 9
-
1 <= cost[i], target <= 5000
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Hints
-
-Hint 1
-Use dynamic programming to find the maximum digits to paint given a total cost.
-
-
-
-Hint 2
-Build the largest number possible using this DP table.
-
diff --git a/problems/four-divisors/README.md b/problems/four-divisors/README.md
deleted file mode 100644
index 0bdc98273..000000000
--- a/problems/four-divisors/README.md
+++ /dev/null
@@ -1,64 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../create-target-array-in-the-given-order "Create Target Array in the Given Order")
-
-[Next >](../check-if-there-is-a-valid-path-in-a-grid "Check if There is a Valid Path in a Grid")
-
-## [1390. Four Divisors (Medium)](https://leetcode.com/problems/four-divisors "四因数")
-
-
Given an integer array nums, return the sum of divisors of the integers in that array that have exactly four divisors. If there is no such integer in the array, return 0.
-
-
-
Example 1:
-
-
-Input: nums = [21,4,7]
-Output: 32
-Explanation:
-21 has 4 divisors: 1, 3, 7, 21
-4 has 3 divisors: 1, 2, 4
-7 has 2 divisors: 1, 7
-The answer is the sum of divisors of 21 only.
-
-
-
Example 2:
-
-
-Input: nums = [21,21]
-Output: 64
-
-
-
Example 3:
-
-
-Input: nums = [1,2,3,4,5]
-Output: 0
-
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 104
-
1 <= nums[i] <= 105
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Math](../../tag/math/README.md)]
-
-### Hints
-
-Hint 1
-Find the divisors of each element in the array.
-
-
-
-Hint 2
-You only need to loop to the square root of a number to find its divisors.
-
diff --git a/problems/fraction-addition-and-subtraction/README.md b/problems/fraction-addition-and-subtraction/README.md
deleted file mode 100644
index 56530a40d..000000000
--- a/problems/fraction-addition-and-subtraction/README.md
+++ /dev/null
@@ -1,64 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../tag-validator "Tag Validator")
-
-[Next >](../valid-square "Valid Square")
-
-## [592. Fraction Addition and Subtraction (Medium)](https://leetcode.com/problems/fraction-addition-and-subtraction "分数加减运算")
-
-
Given a string expression representing an expression of fraction addition and subtraction, return the calculation result in string format.
-
-
The final result should be an irreducible fraction. If your final result is an integer, say 2, you need to change it to the format of a fraction that has a denominator 1. So in this case, 2 should be converted to 2/1.
The input string only contains '0' to '9', '/', '+' and '-'. So does the output.
-
Each fraction (input and output) has the format ±numerator/denominator. If the first input fraction or the output is positive, then '+' will be omitted.
-
The input only contains valid irreducible fractions, where the numerator and denominator of each fraction will always be in the range [1, 10]. If the denominator is 1, it means this fraction is actually an integer in a fraction format defined above.
-
The number of given fractions will be in the range [1, 10].
-
The numerator and denominator of the final result are guaranteed to be valid and in the range of 32-bit int.
-
-### Related Topics
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Math](../../tag/math/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Hints
-
-Hint 1
-No scary math, just apply elementary math knowledge. Still remember how to perform a long division?
-
-
-
-Hint 2
-Try a long division on 4/9, the repeating part is obvious. Now try 4/333. Do you see a pattern?
-
-
-
-Hint 3
-Notice that once the remainder starts repeating, so does the divided result.
-
-
-
-Hint 4
-Be wary of edge cases! List out as many test cases as you can think of and test your code thoroughly.
-
diff --git a/problems/fraction-to-recurring-decimal/fraction_to_recurring_decimal.go b/problems/fraction-to-recurring-decimal/fraction_to_recurring_decimal.go
deleted file mode 100644
index f955807cf..000000000
--- a/problems/fraction-to-recurring-decimal/fraction_to_recurring_decimal.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem166
diff --git a/problems/fraction-to-recurring-decimal/fraction_to_recurring_decimal_test.go b/problems/fraction-to-recurring-decimal/fraction_to_recurring_decimal_test.go
deleted file mode 100644
index f955807cf..000000000
--- a/problems/fraction-to-recurring-decimal/fraction_to_recurring_decimal_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem166
diff --git a/problems/freedom-trail/README.md b/problems/freedom-trail/README.md
deleted file mode 100644
index 3590b27dd..000000000
--- a/problems/freedom-trail/README.md
+++ /dev/null
@@ -1,60 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../find-bottom-left-tree-value "Find Bottom Left Tree Value")
-
-[Next >](../find-largest-value-in-each-tree-row "Find Largest Value in Each Tree Row")
-
-## [514. Freedom Trail (Hard)](https://leetcode.com/problems/freedom-trail "自由之路")
-
-
In the video game Fallout 4, the quest "Road to Freedom" requires players to reach a metal dial called the "Freedom Trail Ring" and use the dial to spell a specific keyword to open the door.
-
-
Given a string ring that represents the code engraved on the outer ring and another string key that represents the keyword that needs to be spelled, return the minimum number of steps to spell all the characters in the keyword.
-
-
Initially, the first character of the ring is aligned at the "12:00" direction. You should spell all the characters in key one by one by rotating ring clockwise or anticlockwise to make each character of the string key aligned at the "12:00" direction and then by pressing the center button.
-
-
At the stage of rotating the ring to spell the key character key[i]:
-
-
-
You can rotate the ring clockwise or anticlockwise by one place, which counts as one step. The final purpose of the rotation is to align one of ring's characters at the "12:00" direction, where this character must equal key[i].
-
If the character key[i] has been aligned at the "12:00" direction, press the center button to spell, which also counts as one step. After the pressing, you could begin to spell the next character in the key (next stage). Otherwise, you have finished all the spelling.
-
-
-
-
Example 1:
-
-
-Input: ring = "godding", key = "gd"
-Output: 4
-Explanation:
-For the first key character 'g', since it is already in place, we just need 1 step to spell this character.
-For the second key character 'd', we need to rotate the ring "godding" anticlockwise by two steps to make it become "ddinggo".
-Also, we need 1 more step for spelling.
-So the final output is 4.
-
-
-
Example 2:
-
-
-Input: ring = "godding", key = "godding"
-Output: 13
-
-
-
-
Constraints:
-
-
-
1 <= ring.length, key.length <= 100
-
ring and key consist of only lower case English letters.
-
It is guaranteed that key could always be spelled by rotating ring.
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
diff --git a/problems/freedom-trail/freedom_trail.go b/problems/freedom-trail/freedom_trail.go
deleted file mode 100644
index 93cda278f..000000000
--- a/problems/freedom-trail/freedom_trail.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem514
diff --git a/problems/freedom-trail/freedom_trail_test.go b/problems/freedom-trail/freedom_trail_test.go
deleted file mode 100644
index 93cda278f..000000000
--- a/problems/freedom-trail/freedom_trail_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem514
diff --git a/problems/frequency-of-the-most-frequent-element/README.md b/problems/frequency-of-the-most-frequent-element/README.md
deleted file mode 100644
index 82187cf4f..000000000
--- a/problems/frequency-of-the-most-frequent-element/README.md
+++ /dev/null
@@ -1,71 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../sum-of-digits-in-base-k "Sum of Digits in Base K")
-
-[Next >](../longest-substring-of-all-vowels-in-order "Longest Substring Of All Vowels in Order")
-
-## [1838. Frequency of the Most Frequent Element (Medium)](https://leetcode.com/problems/frequency-of-the-most-frequent-element "最高频元素的频数")
-
-
The frequency of an element is the number of times it occurs in an array.
-
-
You are given an integer array nums and an integer k. In one operation, you can choose an index of nums and increment the element at that index by 1.
-
-
Return the maximum possible frequency of an element after performing at mostk operations.
-
-
-
Example 1:
-
-
-Input: nums = [1,2,4], k = 5
-Output: 3
-Explanation: Increment the first element three times and the second element two times to make nums = [4,4,4].
-4 has a frequency of 3.
-
-
Example 2:
-
-
-Input: nums = [1,4,8,13], k = 5
-Output: 2
-Explanation: There are multiple optimal solutions:
-- Increment the first element three times to make nums = [4,4,8,13]. 4 has a frequency of 2.
-- Increment the second element four times to make nums = [1,8,8,13]. 8 has a frequency of 2.
-- Increment the third element five times to make nums = [1,4,13,13]. 13 has a frequency of 2.
-
-
-
Example 3:
-
-
-Input: nums = [3,9,6], k = 2
-Output: 1
-
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 105
-
1 <= nums[i] <= 105
-
1 <= k <= 105
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
- [[Prefix Sum](../../tag/prefix-sum/README.md)]
- [[Sliding Window](../../tag/sliding-window/README.md)]
-
-### Hints
-
-Hint 1
-Note that you can try all values in a brute force manner and find the maximum frequency of that value.
-
-
-
-Hint 2
-To find the maximum frequency of a value consider the biggest elements smaller than or equal to this value
-
diff --git a/problems/friend-circles/README.md b/problems/friend-circles/README.md
deleted file mode 100644
index dea5595e2..000000000
--- a/problems/friend-circles/README.md
+++ /dev/null
@@ -1,63 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../remove-boxes "Remove Boxes")
-
-[Next >](../split-array-with-equal-sum "Split Array with Equal Sum")
-
-## [547. Friend Circles (Medium)](https://leetcode.com/problems/friend-circles "朋友圈")
-
-
There are N students in a class. Some of them are friends, while some are not. Their friendship is transitive in nature. For example, if A is a direct friend of B, and B is a direct friend of C, then A is an indirect friend of C. And we defined a friend circle is a group of students who are direct or indirect friends.
-
-
Given a N*N matrix M representing the friend relationship between students in the class. If M[i][j] = 1, then the ith and jth students are direct friends with each other, otherwise not. And you have to output the total number of friend circles among all the students.
-
-
Example 1:
-
-
-Input:
-[[1,1,0],
- [1,1,0],
- [0,0,1]]
-Output: 2
-Explanation:The 0th and 1st students are direct friends, so they are in a friend circle.
-The 2nd student himself is in a friend circle. So return 2.
-
-
-
-
-
Example 2:
-
-
-Input:
-[[1,1,0],
- [1,1,1],
- [0,1,1]]
-Output: 1
-Explanation:The 0th and 1st students are direct friends, the 1st and 2nd students are direct friends,
-so the 0th and 2nd students are indirect friends. All of them are in the same friend circle, so return 1.
-
-
-
-
-
Constraints:
-
-
-
1 <= N <= 200
-
M[i][i] == 1
-
M[i][j] == M[j][i]
-
-
-### Related Topics
- [[Depth-first Search](../../tag/depth-first-search/README.md)]
- [[Union Find](../../tag/union-find/README.md)]
-
-### Similar Questions
- 1. [Number of Connected Components in an Undirected Graph](../number-of-connected-components-in-an-undirected-graph) (Medium)
- 1. [Robot Return to Origin](../robot-return-to-origin) (Easy)
- 1. [Sentence Similarity](../sentence-similarity) (Easy)
- 1. [Sentence Similarity II](../sentence-similarity-ii) (Medium)
- 1. [The Earliest Moment When Everyone Become Friends](../the-earliest-moment-when-everyone-become-friends) (Medium)
diff --git a/problems/friend-circles/friend_circles.go b/problems/friend-circles/friend_circles.go
deleted file mode 100644
index 49ade3b03..000000000
--- a/problems/friend-circles/friend_circles.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem547
diff --git a/problems/friend-circles/friend_circles_test.go b/problems/friend-circles/friend_circles_test.go
deleted file mode 100644
index 49ade3b03..000000000
--- a/problems/friend-circles/friend_circles_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem547
diff --git a/problems/friend-requests-i-overall-acceptance-rate/README.md b/problems/friend-requests-i-overall-acceptance-rate/README.md
deleted file mode 100644
index 70e41d79e..000000000
--- a/problems/friend-requests-i-overall-acceptance-rate/README.md
+++ /dev/null
@@ -1,87 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../classes-more-than-5-students "Classes More Than 5 Students")
-
-[Next >](../range-addition-ii "Range Addition II")
-
-## [597. Friend Requests I: Overall Acceptance Rate (Easy)](https://leetcode.com/problems/friend-requests-i-overall-acceptance-rate "好友申请 I:总体通过率")
-
-In social network like Facebook or Twitter, people send friend requests and accept others’ requests as well. Now given two tables as below:
-
-Write a query to find the overall acceptance rate of requests rounded to 2 decimals, which is the number of acceptance divide the number of requests.
-
-
-For the sample data above, your query should return the following result.
-
-
-
-
-|accept_rate|
-|-----------|
-| 0.80|
-
-
-
-Note:
-
-
-
The accepted requests are not necessarily from the table friend_request. In this case, you just need to simply count the total accepted requests (no matter whether they are in the original requests), and divide it by the number of requests to get the acceptance rate.
-
It is possible that a sender sends multiple requests to the same receiver, and a request could be accepted more than once. In this case, the ‘duplicated’ requests or acceptances are only counted once.
-
If there is no requests at all, you should return 0.00 as the accept_rate.
-
-
-
-Explanation: There are 4 unique accepted requests, and there are 5 requests in total. So the rate is 0.80.
-
-
-Follow-up:
-
-
-
Can you write a query to return the accept rate but for every month?
-
How about the cumulative accept rate for every day?
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
-
-### Hints
-
-Hint 1
-Still remember how to count the number of rows in a table?
-
-
-
-Hint 2
-What is the keyword to filter the duplicated records in a table?
-
diff --git a/problems/friend-requests-i-overall-acceptance-rate/friend_requests_i_overall_acceptance_rate.sql b/problems/friend-requests-i-overall-acceptance-rate/friend_requests_i_overall_acceptance_rate.sql
deleted file mode 100644
index bae62cf19..000000000
--- a/problems/friend-requests-i-overall-acceptance-rate/friend_requests_i_overall_acceptance_rate.sql
+++ /dev/null
@@ -1 +0,0 @@
-# Write your MySQL query statement below
diff --git a/problems/friend-requests-i-overall-acceptance-rate/mysql_schemas.sql b/problems/friend-requests-i-overall-acceptance-rate/mysql_schemas.sql
deleted file mode 100644
index c5b60b0ec..000000000
--- a/problems/friend-requests-i-overall-acceptance-rate/mysql_schemas.sql
+++ /dev/null
@@ -1,14 +0,0 @@
-Create table If Not Exists FriendRequest (sender_id int, send_to_id int, request_date date);
-Create table If Not Exists RequestAccepted (requester_id int, accepter_id int, accept_date date);
-Truncate table FriendRequest;
-insert into FriendRequest (sender_id, send_to_id, request_date) values ('1', '2', '2016/06/01');
-insert into FriendRequest (sender_id, send_to_id, request_date) values ('1', '3', '2016/06/01');
-insert into FriendRequest (sender_id, send_to_id, request_date) values ('1', '4', '2016/06/01');
-insert into FriendRequest (sender_id, send_to_id, request_date) values ('2', '3', '2016/06/02');
-insert into FriendRequest (sender_id, send_to_id, request_date) values ('3', '4', '2016/06/09');
-Truncate table RequestAccepted;
-insert into RequestAccepted (requester_id, accepter_id, accept_date) values ('1', '2', '2016/06/03');
-insert into RequestAccepted (requester_id, accepter_id, accept_date) values ('1', '3', '2016/06/08');
-insert into RequestAccepted (requester_id, accepter_id, accept_date) values ('2', '3', '2016/06/08');
-insert into RequestAccepted (requester_id, accepter_id, accept_date) values ('3', '4', '2016/06/09');
-insert into RequestAccepted (requester_id, accepter_id, accept_date) values ('3', '4', '2016/06/10');
diff --git a/problems/friend-requests-ii-who-has-the-most-friends/README.md b/problems/friend-requests-ii-who-has-the-most-friends/README.md
deleted file mode 100644
index fc66fee5a..000000000
--- a/problems/friend-requests-ii-who-has-the-most-friends/README.md
+++ /dev/null
@@ -1,63 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../human-traffic-of-stadium "Human Traffic of Stadium")
-
-[Next >](../consecutive-available-seats "Consecutive Available Seats")
-
-## [602. Friend Requests II: Who Has the Most Friends (Medium)](https://leetcode.com/problems/friend-requests-ii-who-has-the-most-friends "好友申请 II :谁有最多的好友")
-
-
In social network like Facebook or Twitter, people send friend requests and accept others' requests as well.
-
-
-
-
Table request_accepted
-
-
-+--------------+-------------+------------+
-| requester_id | accepter_id | accept_date|
-|--------------|-------------|------------|
-| 1 | 2 | 2016_06-03 |
-| 1 | 3 | 2016-06-08 |
-| 2 | 3 | 2016-06-08 |
-| 3 | 4 | 2016-06-09 |
-+--------------+-------------+------------+
-This table holds the data of friend acceptance, while requester_id and accepter_id both are the id of a person.
-
-
-
-
-
Write a query to find the the people who has most friends and the most friends number under the following rules:
-
-
-
It is guaranteed there is only 1 people having the most friends.
-
The friend request could only been accepted once, which mean there is no multiple records with the same requester_id and accepter_id value.
-
-
-
For the sample data above, the result is:
-
-
-Result table:
-+------+------+
-| id | num |
-|------|------|
-| 3 | 3 |
-+------+------+
-The person with id '3' is a friend of people '1', '2' and '4', so he has 3 friends in total, which is the most number than any others.
-
-
-
Follow-up:
-In the real world, multiple people could have the same most number of friends, can you find all these people in this case?
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
-
-### Hints
-
-Hint 1
-Being friends is bidirectional. If you accept someone's adding friend request, both you and the other person will have one more friend.
-
diff --git a/problems/friend-requests-ii-who-has-the-most-friends/friend_requests_ii_who_has_the_most_friends.sql b/problems/friend-requests-ii-who-has-the-most-friends/friend_requests_ii_who_has_the_most_friends.sql
deleted file mode 100644
index bae62cf19..000000000
--- a/problems/friend-requests-ii-who-has-the-most-friends/friend_requests_ii_who_has_the_most_friends.sql
+++ /dev/null
@@ -1 +0,0 @@
-# Write your MySQL query statement below
diff --git a/problems/friend-requests-ii-who-has-the-most-friends/mysql_schemas.sql b/problems/friend-requests-ii-who-has-the-most-friends/mysql_schemas.sql
deleted file mode 100644
index 331165b54..000000000
--- a/problems/friend-requests-ii-who-has-the-most-friends/mysql_schemas.sql
+++ /dev/null
@@ -1,6 +0,0 @@
-Create table If Not Exists RequestAccepted (requester_id int not null, accepter_id int null, accept_date date null);
-Truncate table RequestAccepted;
-insert into RequestAccepted (requester_id, accepter_id, accept_date) values ('1', '2', '2016/06/03');
-insert into RequestAccepted (requester_id, accepter_id, accept_date) values ('1', '3', '2016/06/08');
-insert into RequestAccepted (requester_id, accepter_id, accept_date) values ('2', '3', '2016/06/08');
-insert into RequestAccepted (requester_id, accepter_id, accept_date) values ('3', '4', '2016/06/09');
diff --git a/problems/friendly-movies-streamed-last-month/README.md b/problems/friendly-movies-streamed-last-month/README.md
deleted file mode 100644
index 406712a31..000000000
--- a/problems/friendly-movies-streamed-last-month/README.md
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../parallel-courses-ii "Parallel Courses II")
-
-[Next >](../path-crossing "Path Crossing")
-
-## [1495. Friendly Movies Streamed Last Month (Easy)](https://leetcode.com/problems/friendly-movies-streamed-last-month "上月播放的儿童适宜电影")
-
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/friendly-movies-streamed-last-month/mysql_schemas.sql b/problems/friendly-movies-streamed-last-month/mysql_schemas.sql
deleted file mode 100644
index 44becd868..000000000
--- a/problems/friendly-movies-streamed-last-month/mysql_schemas.sql
+++ /dev/null
@@ -1,15 +0,0 @@
-Create table If Not Exists TVProgram (program_date date, content_id int, channel varchar(30));
-Create table If Not Exists Content (content_id varchar(30), title varchar(30), Kids_content ENUM('Y', 'N'), content_type varchar(30));
-Truncate table TVProgram;
-insert into TVProgram (program_date, content_id, channel) values ('2020-06-10 08:00', '1', 'LC-Channel');
-insert into TVProgram (program_date, content_id, channel) values ('2020-05-11 12:00', '2', 'LC-Channel');
-insert into TVProgram (program_date, content_id, channel) values ('2020-05-12 12:00', '3', 'LC-Channel');
-insert into TVProgram (program_date, content_id, channel) values ('2020-05-13 14:00', '4', 'Disney Ch');
-insert into TVProgram (program_date, content_id, channel) values ('2020-06-18 14:00', '4', 'Disney Ch');
-insert into TVProgram (program_date, content_id, channel) values ('2020-07-15 16:00', '5', 'Disney Ch');
-Truncate table Content;
-insert into Content (content_id, title, Kids_content, content_type) values ('1', 'Leetcode Movie', 'N', 'Movies');
-insert into Content (content_id, title, Kids_content, content_type) values ('2', 'Alg. for Kids', 'Y', 'Series');
-insert into Content (content_id, title, Kids_content, content_type) values ('3', 'Database Sols', 'N', 'Series');
-insert into Content (content_id, title, Kids_content, content_type) values ('4', 'Aladdin', 'Y', 'Movies');
-insert into Content (content_id, title, Kids_content, content_type) values ('5', 'Cinderella', 'Y', 'Movies');
diff --git a/problems/friends-of-appropriate-ages/README.md b/problems/friends-of-appropriate-ages/README.md
deleted file mode 100644
index 2cb361627..000000000
--- a/problems/friends-of-appropriate-ages/README.md
+++ /dev/null
@@ -1,68 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../goat-latin "Goat Latin")
-
-[Next >](../most-profit-assigning-work "Most Profit Assigning Work")
-
-## [825. Friends Of Appropriate Ages (Medium)](https://leetcode.com/problems/friends-of-appropriate-ages "适龄的朋友")
-
-
There are n persons on a social media website. You are given an integer array ages where ages[i] is the age of the ith person.
-
-
A Person x will not send a friend request to a person y (x != y) if any of the following conditions is true:
-
-
-
age[y] <= 0.5 * age[x] + 7
-
age[y] > age[x]
-
age[y] > 100 && age[x] < 100
-
-
-
Otherwise, x will send a friend request to y.
-
-
Note that if x sends a request to y, y will not necessarily send a request to x. Also, a person will not send a friend request to themself.
-
-
Return the total number of friend requests made.
-
-
-
Example 1:
-
-
-Input: ages = [16,16]
-Output: 2
-Explanation: 2 people friend request each other.
-
-
-
Example 2:
-
-
-Input: ages = [16,17,18]
-Output: 2
-Explanation: Friend requests are made 17 -> 16, 18 -> 17.
-
A frog is crossing a river. The river is divided into some number of units, and at each unit, there may or may not exist a stone. The frog can jump on a stone, but it must not jump into the water.
-
-
Given a list of stones' positions (in units) in sorted ascending order, determine if the frog can cross the river by landing on the last stone. Initially, the frog is on the first stone and assumes the first jump must be 1 unit.
-
-
If the frog's last jump was k units, its next jump must be either k - 1, k, or k + 1 units. The frog can only jump in the forward direction.
-
-
-
Example 1:
-
-
-Input: stones = [0,1,3,5,6,8,12,17]
-Output: true
-Explanation: The frog can jump to the last stone by jumping 1 unit to the 2nd stone, then 2 units to the 3rd stone, then 2 units to the 4th stone, then 3 units to the 6th stone, 4 units to the 7th stone, and 5 units to the 8th stone.
-
-
-
Example 2:
-
-
-Input: stones = [0,1,2,3,4,8,9,11]
-Output: false
-Explanation: There is no way to jump to the last stone as the gap between the 5th and 6th stone is too large.
-
-
-
-
Constraints:
-
-
-
2 <= stones.length <= 2000
-
0 <= stones[i] <= 231 - 1
-
stones[0] == 0
-
stones is sorted in a strictly increasing order.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
diff --git a/problems/frog-jump/frog_jump.go b/problems/frog-jump/frog_jump.go
deleted file mode 100644
index 816b09908..000000000
--- a/problems/frog-jump/frog_jump.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem403
diff --git a/problems/frog-jump/frog_jump_test.go b/problems/frog-jump/frog_jump_test.go
deleted file mode 100644
index 816b09908..000000000
--- a/problems/frog-jump/frog_jump_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem403
diff --git a/problems/frog-position-after-t-seconds/README.md b/problems/frog-position-after-t-seconds/README.md
deleted file mode 100644
index 1e6ecd7bf..000000000
--- a/problems/frog-position-after-t-seconds/README.md
+++ /dev/null
@@ -1,65 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../time-needed-to-inform-all-employees "Time Needed to Inform All Employees")
-
-[Next >](../replace-employee-id-with-the-unique-identifier "Replace Employee ID With The Unique Identifier")
-
-## [1377. Frog Position After T Seconds (Hard)](https://leetcode.com/problems/frog-position-after-t-seconds "T 秒后青蛙的位置")
-
-
Given an undirected tree consisting of n vertices numbered from 1 to n. A frog starts jumping from vertex 1. In one second, the frog jumps from its current vertex to another unvisited vertex if they are directly connected. The frog can not jump back to a visited vertex. In case the frog can jump to several vertices, it jumps randomly to one of them with the same probability. Otherwise, when the frog can not jump to any unvisited vertex, it jumps forever on the same vertex.
-
-
The edges of the undirected tree are given in the array edges, where edges[i] = [ai, bi] means that exists an edge connecting the vertices ai and bi.
-
-
Return the probability that after t seconds the frog is on the vertex target. Answers within 10-5 of the actual answer will be accepted.
-
-
-
Example 1:
-
-
-Input: n = 7, edges = [[1,2],[1,3],[1,7],[2,4],[2,6],[3,5]], t = 2, target = 4
-Output: 0.16666666666666666
-Explanation: The figure above shows the given graph. The frog starts at vertex 1, jumping with 1/3 probability to the vertex 2 after second 1 and then jumping with 1/2 probability to vertex 4 after second 2. Thus the probability for the frog is on the vertex 4 after 2 seconds is 1/3 * 1/2 = 1/6 = 0.16666666666666666.
-
-
-
Example 2:
-
-
-
-Input: n = 7, edges = [[1,2],[1,3],[1,7],[2,4],[2,6],[3,5]], t = 1, target = 7
-Output: 0.3333333333333333
-Explanation: The figure above shows the given graph. The frog starts at vertex 1, jumping with 1/3 = 0.3333333333333333 probability to the vertex 7 after second 1.
-
-
-
-
Constraints:
-
-
-
1 <= n <= 100
-
edges.length == n - 1
-
edges[i].length == 2
-
1 <= ai, bi <= n
-
1 <= t <= 50
-
1 <= target <= n
-
-
-### Related Topics
- [[Tree](../../tag/tree/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Graph](../../tag/graph/README.md)]
-
-### Hints
-
-Hint 1
-Use a variation of DFS with parameters 'curent_vertex' and 'current_time'.
-
-
-
-Hint 2
-Update the probability considering to jump to one of the children vertices.
-
diff --git a/problems/fruit-into-baskets/README.md b/problems/fruit-into-baskets/README.md
deleted file mode 100644
index e4961b828..000000000
--- a/problems/fruit-into-baskets/README.md
+++ /dev/null
@@ -1,64 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../valid-permutations-for-di-sequence "Valid Permutations for DI Sequence")
-
-[Next >](../sort-array-by-parity "Sort Array By Parity")
-
-## [904. Fruit Into Baskets (Medium)](https://leetcode.com/problems/fruit-into-baskets "水果成篮")
-
-
You are visiting a farm that has a single row of fruit trees arranged from left to right. The trees are represented by an integer array fruits where fruits[i] is the type of fruit the ith tree produces.
-
-
You want to collect as much fruit as possible. However, the owner has some strict rules that you must follow:
-
-
-
You only have two baskets, and each basket can only hold a single type of fruit. There is no limit on the amount of fruit each basket can hold.
-
Starting from any tree of your choice, you must pick exactly one fruit from every tree (including the start tree) while moving to the right. The picked fruits must fit in one of your baskets.
-
Once you reach a tree with fruit that cannot fit in your baskets, you must stop.
-
-
-
Given the integer array fruits, return the maximum number of fruits you can pick.
-
-
-
Example 1:
-
-
-Input: fruits = [1,2,1]
-Output: 3
-Explanation: We can pick from all 3 trees.
-
-
-
Example 2:
-
-
-Input: fruits = [0,1,2,2]
-Output: 3
-Explanation: We can pick from trees [1,2,2].
-If we had started at the first tree, we would only pick from trees [0,1].
-
-
-
Example 3:
-
-
-Input: fruits = [1,2,3,2,2]
-Output: 4
-Explanation: We can pick from trees [2,3,2,2].
-If we had started at the first tree, we would only pick from trees [1,2].
-
You are given an integer array heights representing the heights of buildings, some bricks, and some ladders.
-
-
You start your journey from building 0 and move to the next building by possibly using bricks or ladders.
-
-
While moving from building i to building i+1 (0-indexed),
-
-
-
If the current building's height is greater than or equal to the next building's height, you do not need a ladder or bricks.
-
If the current building's height is less than the next building's height, you can either use one ladder or (h[i+1] - h[i])bricks.
-
-
-
Return the furthest building index (0-indexed) you can reach if you use the given ladders and bricks optimally.
-
-
-
Example 1:
-
-
-Input: heights = [4,2,7,6,9,14,12], bricks = 5, ladders = 1
-Output: 4
-Explanation: Starting at building 0, you can follow these steps:
-- Go to building 1 without using ladders nor bricks since 4 >= 2.
-- Go to building 2 using 5 bricks. You must use either bricks or ladders because 2 < 7.
-- Go to building 3 without using ladders nor bricks since 7 >= 6.
-- Go to building 4 using your only ladder. You must use either bricks or ladders because 6 < 9.
-It is impossible to go beyond building 4 because you do not have any more bricks or ladders.
-
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Heap (Priority Queue)](../../tag/heap-priority-queue/README.md)]
-
-### Hints
-
-Hint 1
-Assume the problem is to check whether you can reach the last building or not.
-
-
-
-Hint 2
-You'll have to do a set of jumps, and choose for each one whether to do it using a ladder or bricks. It's always optimal to use ladders in the largest jumps.
-
-
-
-Hint 3
-Iterate on the buildings, maintaining the largest r jumps and the sum of the remaining ones so far, and stop whenever this sum exceeds b.
-
diff --git a/problems/game-of-life/README.md b/problems/game-of-life/README.md
deleted file mode 100644
index 1353108f0..000000000
--- a/problems/game-of-life/README.md
+++ /dev/null
@@ -1,66 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../unique-word-abbreviation "Unique Word Abbreviation")
-
-[Next >](../word-pattern "Word Pattern")
-
-## [289. Game of Life (Medium)](https://leetcode.com/problems/game-of-life "生命游戏")
-
-
According to Wikipedia's article: "The Game of Life, also known simply as Life, is a cellular automaton devised by the British mathematician John Horton Conway in 1970."
-
-
The board is made up of an m x n grid of cells, where each cell has an initial state: live (represented by a 1) or dead (represented by a 0). Each cell interacts with its eight neighbors (horizontal, vertical, diagonal) using the following four rules (taken from the above Wikipedia article):
-
-
-
Any live cell with fewer than two live neighbors dies as if caused by under-population.
-
Any live cell with two or three live neighbors lives on to the next generation.
-
Any live cell with more than three live neighbors dies, as if by over-population.
-
Any dead cell with exactly three live neighbors becomes a live cell, as if by reproduction.
-
-
-
The next state is created by applying the above rules simultaneously to every cell in the current state, where births and deaths occur simultaneously. Given the current state of the m x n grid board, return the next state.
Could you solve it in-place? Remember that the board needs to be updated simultaneously: You cannot update some cells first and then use their updated values to update other cells.
-
In this question, we represent the board using a 2D array. In principle, the board is infinite, which would cause problems when the active area encroaches upon the border of the array (i.e., live cells reach the border). How would you address these problems?
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
- [[Simulation](../../tag/simulation/README.md)]
-
-### Similar Questions
- 1. [Set Matrix Zeroes](../set-matrix-zeroes) (Medium)
diff --git a/problems/game-of-life/game_of_life.go b/problems/game-of-life/game_of_life.go
deleted file mode 100644
index 1efaa79ca..000000000
--- a/problems/game-of-life/game_of_life.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem289
diff --git a/problems/game-of-life/game_of_life_test.go b/problems/game-of-life/game_of_life_test.go
deleted file mode 100644
index 1efaa79ca..000000000
--- a/problems/game-of-life/game_of_life_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem289
diff --git a/problems/game-of-nim/README.md b/problems/game-of-nim/README.md
deleted file mode 100644
index fcbf6020d..000000000
--- a/problems/game-of-nim/README.md
+++ /dev/null
@@ -1,28 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../count-salary-categories "Count Salary Categories")
-
-[Next >](../remove-one-element-to-make-the-array-strictly-increasing "Remove One Element to Make the Array Strictly Increasing")
-
-## [1908. Game of Nim (Medium)](https://leetcode.com/problems/game-of-nim "Nim 游戏 II")
-
-
-
-### Related Topics
- [[Bit Manipulation](../../tag/bit-manipulation/README.md)]
- [[Brainteaser](../../tag/brainteaser/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Math](../../tag/math/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Game Theory](../../tag/game-theory/README.md)]
-
-### Hints
-
-Hint 1
-Simulate the game and try all possible moves for each player.
-
diff --git a/problems/game-play-analysis-i/README.md b/problems/game-play-analysis-i/README.md
deleted file mode 100644
index 5fccd1c99..000000000
--- a/problems/game-play-analysis-i/README.md
+++ /dev/null
@@ -1,62 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../inorder-successor-in-bst-ii "Inorder Successor in BST II")
-
-[Next >](../game-play-analysis-ii "Game Play Analysis II")
-
-## [511. Game Play Analysis I (Easy)](https://leetcode.com/problems/game-play-analysis-i "游戏玩法分析 I")
-
-
Table: Activity
-
-
-+--------------+---------+
-| Column Name | Type |
-+--------------+---------+
-| player_id | int |
-| device_id | int |
-| event_date | date |
-| games_played | int |
-+--------------+---------+
-(player_id, event_date) is the primary key of this table.
-This table shows the activity of players of some game.
-Each row is a record of a player who logged in and played a number of games (possibly 0) before logging out on some day using some device.
-
-
-
-
-
Write an SQL query that reports the first login date for each player.
-
-
The query result format is in the following example:
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
-
-### Similar Questions
- 1. [Game Play Analysis II](../game-play-analysis-ii) (Easy)
diff --git a/problems/game-play-analysis-i/game_play_analysis_i.sql b/problems/game-play-analysis-i/game_play_analysis_i.sql
deleted file mode 100644
index bae62cf19..000000000
--- a/problems/game-play-analysis-i/game_play_analysis_i.sql
+++ /dev/null
@@ -1 +0,0 @@
-# Write your MySQL query statement below
diff --git a/problems/game-play-analysis-i/mysql_schemas.sql b/problems/game-play-analysis-i/mysql_schemas.sql
deleted file mode 100644
index 519a7e42c..000000000
--- a/problems/game-play-analysis-i/mysql_schemas.sql
+++ /dev/null
@@ -1,7 +0,0 @@
-Create table If Not Exists Activity (player_id int, device_id int, event_date date, games_played int);
-Truncate table Activity;
-insert into Activity (player_id, device_id, event_date, games_played) values ('1', '2', '2016-03-01', '5');
-insert into Activity (player_id, device_id, event_date, games_played) values ('1', '2', '2016-05-02', '6');
-insert into Activity (player_id, device_id, event_date, games_played) values ('2', '3', '2017-06-25', '1');
-insert into Activity (player_id, device_id, event_date, games_played) values ('3', '1', '2016-03-02', '0');
-insert into Activity (player_id, device_id, event_date, games_played) values ('3', '4', '2018-07-03', '5');
diff --git a/problems/game-play-analysis-ii/README.md b/problems/game-play-analysis-ii/README.md
deleted file mode 100644
index d71bce674..000000000
--- a/problems/game-play-analysis-ii/README.md
+++ /dev/null
@@ -1,62 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../game-play-analysis-i "Game Play Analysis I")
-
-[Next >](../find-bottom-left-tree-value "Find Bottom Left Tree Value")
-
-## [512. Game Play Analysis II (Easy)](https://leetcode.com/problems/game-play-analysis-ii "游戏玩法分析 II")
-
-
Table: Activity
-
-
-+--------------+---------+
-| Column Name | Type |
-+--------------+---------+
-| player_id | int |
-| device_id | int |
-| event_date | date |
-| games_played | int |
-+--------------+---------+
-(player_id, event_date) is the primary key of this table.
-This table shows the activity of players of some game.
-Each row is a record of a player who logged in and played a number of games (possibly 0) before logging out on some day using some device.
-
-
-
-
-
Write a SQL query that reports the device that is first logged in for each player.
-
-
The query result format is in the following example:
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
-
-### Similar Questions
- 1. [Game Play Analysis I](../game-play-analysis-i) (Easy)
- 1. [Game Play Analysis III](../game-play-analysis-iii) (Medium)
diff --git a/problems/game-play-analysis-ii/game_play_analysis_ii.sql b/problems/game-play-analysis-ii/game_play_analysis_ii.sql
deleted file mode 100644
index bae62cf19..000000000
--- a/problems/game-play-analysis-ii/game_play_analysis_ii.sql
+++ /dev/null
@@ -1 +0,0 @@
-# Write your MySQL query statement below
diff --git a/problems/game-play-analysis-ii/mysql_schemas.sql b/problems/game-play-analysis-ii/mysql_schemas.sql
deleted file mode 100644
index 519a7e42c..000000000
--- a/problems/game-play-analysis-ii/mysql_schemas.sql
+++ /dev/null
@@ -1,7 +0,0 @@
-Create table If Not Exists Activity (player_id int, device_id int, event_date date, games_played int);
-Truncate table Activity;
-insert into Activity (player_id, device_id, event_date, games_played) values ('1', '2', '2016-03-01', '5');
-insert into Activity (player_id, device_id, event_date, games_played) values ('1', '2', '2016-05-02', '6');
-insert into Activity (player_id, device_id, event_date, games_played) values ('2', '3', '2017-06-25', '1');
-insert into Activity (player_id, device_id, event_date, games_played) values ('3', '1', '2016-03-02', '0');
-insert into Activity (player_id, device_id, event_date, games_played) values ('3', '4', '2018-07-03', '5');
diff --git a/problems/game-play-analysis-iii/README.md b/problems/game-play-analysis-iii/README.md
deleted file mode 100644
index 27f77f9b4..000000000
--- a/problems/game-play-analysis-iii/README.md
+++ /dev/null
@@ -1,68 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../lonely-pixel-ii "Lonely Pixel II")
-
-[Next >](../encode-and-decode-tinyurl "Encode and Decode TinyURL")
-
-## [534. Game Play Analysis III (Medium)](https://leetcode.com/problems/game-play-analysis-iii "游戏玩法分析 III")
-
-
Table: Activity
-
-
-+--------------+---------+
-| Column Name | Type |
-+--------------+---------+
-| player_id | int |
-| device_id | int |
-| event_date | date |
-| games_played | int |
-+--------------+---------+
-(player_id, event_date) is the primary key of this table.
-This table shows the activity of players of some game.
-Each row is a record of a player who logged in and played a number of games (possibly 0) before logging out on some day using some device.
-
-
-
-
-
Write an SQL query that reports for each player and date, how many games played so far by the player. That is, the total number of games played by the player until that date. Check the example for clarity.
-
-
The query result format is in the following example:
-
-
-Activity table:
-+-----------+-----------+------------+--------------+
-| player_id | device_id | event_date | games_played |
-+-----------+-----------+------------+--------------+
-| 1 | 2 | 2016-03-01 | 5 |
-| 1 | 2 | 2016-05-02 | 6 |
-| 1 | 3 | 2017-06-25 | 1 |
-| 3 | 1 | 2016-03-02 | 0 |
-| 3 | 4 | 2018-07-03 | 5 |
-+-----------+-----------+------------+--------------+
-
-Result table:
-+-----------+------------+---------------------+
-| player_id | event_date | games_played_so_far |
-+-----------+------------+---------------------+
-| 1 | 2016-03-01 | 5 |
-| 1 | 2016-05-02 | 11 |
-| 1 | 2017-06-25 | 12 |
-| 3 | 2016-03-02 | 0 |
-| 3 | 2018-07-03 | 5 |
-+-----------+------------+---------------------+
-For the player with id 1, 5 + 6 = 11 games played by 2016-05-02, and 5 + 6 + 1 = 12 games played by 2017-06-25.
-For the player with id 3, 0 + 5 = 5 games played by 2018-07-03.
-Note that for each player we only care about the days when the player logged in.
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
-
-### Similar Questions
- 1. [Game Play Analysis II](../game-play-analysis-ii) (Easy)
- 1. [Game Play Analysis IV](../game-play-analysis-iv) (Medium)
diff --git a/problems/game-play-analysis-iii/game_play_analysis_iii.sql b/problems/game-play-analysis-iii/game_play_analysis_iii.sql
deleted file mode 100644
index bae62cf19..000000000
--- a/problems/game-play-analysis-iii/game_play_analysis_iii.sql
+++ /dev/null
@@ -1 +0,0 @@
-# Write your MySQL query statement below
diff --git a/problems/game-play-analysis-iii/mysql_schemas.sql b/problems/game-play-analysis-iii/mysql_schemas.sql
deleted file mode 100644
index cb1a27f6d..000000000
--- a/problems/game-play-analysis-iii/mysql_schemas.sql
+++ /dev/null
@@ -1,7 +0,0 @@
-Create table If Not Exists Activity (player_id int, device_id int, event_date date, games_played int);
-Truncate table Activity;
-insert into Activity (player_id, device_id, event_date, games_played) values ('1', '2', '2016-03-01', '5');
-insert into Activity (player_id, device_id, event_date, games_played) values ('1', '2', '2016-05-02', '6');
-insert into Activity (player_id, device_id, event_date, games_played) values ('1', '3', '2017-06-25', '1');
-insert into Activity (player_id, device_id, event_date, games_played) values ('3', '1', '2016-03-02', '0');
-insert into Activity (player_id, device_id, event_date, games_played) values ('3', '4', '2018-07-03', '5');
diff --git a/problems/game-play-analysis-iv/README.md b/problems/game-play-analysis-iv/README.md
deleted file mode 100644
index 78c3fc2e1..000000000
--- a/problems/game-play-analysis-iv/README.md
+++ /dev/null
@@ -1,62 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../binary-tree-longest-consecutive-sequence-ii "Binary Tree Longest Consecutive Sequence II")
-
-[Next >](../student-attendance-record-i "Student Attendance Record I")
-
-## [550. Game Play Analysis IV (Medium)](https://leetcode.com/problems/game-play-analysis-iv "游戏玩法分析 IV")
-
-
Table: Activity
-
-
-+--------------+---------+
-| Column Name | Type |
-+--------------+---------+
-| player_id | int |
-| device_id | int |
-| event_date | date |
-| games_played | int |
-+--------------+---------+
-(player_id, event_date) is the primary key of this table.
-This table shows the activity of players of some game.
-Each row is a record of a player who logged in and played a number of games (possibly 0) before logging out on some day using some device.
-
-
-
-
-
Write an SQL query that reports the fraction of players that logged in again on the day after the day they first logged in, rounded to 2 decimal places. In other words, you need to count the number of players that logged in for at least two consecutive days starting from their first login date, then divide that number by the total number of players.
-
-
The query result format is in the following example:
-
-
-Activity table:
-+-----------+-----------+------------+--------------+
-| player_id | device_id | event_date | games_played |
-+-----------+-----------+------------+--------------+
-| 1 | 2 | 2016-03-01 | 5 |
-| 1 | 2 | 2016-03-02 | 6 |
-| 2 | 3 | 2017-06-25 | 1 |
-| 3 | 1 | 2016-03-02 | 0 |
-| 3 | 4 | 2018-07-03 | 5 |
-+-----------+-----------+------------+--------------+
-
-Result table:
-+-----------+
-| fraction |
-+-----------+
-| 0.33 |
-+-----------+
-Only the player with id 1 logged back in after the first day he had logged in so the answer is 1/3 = 0.33
-
-+--------------+---------+
-| Column Name | Type |
-+--------------+---------+
-| player_id | int |
-| device_id | int |
-| event_date | date |
-| games_played | int |
-+--------------+---------+
-(player_id, event_date) is the primary key of this table.
-This table shows the activity of players of some game.
-Each row is a record of a player who logged in and played a number of games (possibly 0) before logging out on some day using some device.
-
-
-
-
-
We define the install date of a player to be the first login day of that player.
-
-
We also define day 1 retention of some date X to be the number of players whose install date is X and they logged back in on the day right after X, divided by the number of players whose install date is X, rounded to 2 decimal places.
-
-
Write an SQL query that reports for each install date, the number of players that installed the game on that day and the day 1 retention.
-
-
The query result format is in the following example:
-
-
-Activity table:
-+-----------+-----------+------------+--------------+
-| player_id | device_id | event_date | games_played |
-+-----------+-----------+------------+--------------+
-| 1 | 2 | 2016-03-01 | 5 |
-| 1 | 2 | 2016-03-02 | 6 |
-| 2 | 3 | 2017-06-25 | 1 |
-| 3 | 1 | 2016-03-01 | 0 |
-| 3 | 4 | 2016-07-03 | 5 |
-+-----------+-----------+------------+--------------+
-
-Result table:
-+------------+----------+----------------+
-| install_dt | installs | Day1_retention |
-+------------+----------+----------------+
-| 2016-03-01 | 2 | 0.50 |
-| 2017-06-25 | 1 | 0.00 |
-+------------+----------+----------------+
-Player 1 and 3 installed the game on 2016-03-01 but only player 1 logged back in on 2016-03-02 so the day 1 retention of 2016-03-01 is 1 / 2 = 0.50
-Player 2 installed the game on 2017-06-25 but didn't log back in on 2017-06-26 so the day 1 retention of 2017-06-25 is 0 / 1 = 0.00
-
There are n gas stations along a circular route, where the amount of gas at the ith station is gas[i].
-
-
You have a car with an unlimited gas tank and it costs cost[i] of gas to travel from the ith station to its next (i + 1)th station. You begin the journey with an empty tank at one of the gas stations.
-
-
Given two integer arrays gas and cost, return the starting gas station's index if you can travel around the circuit once in the clockwise direction, otherwise return-1. If there exists a solution, it is guaranteed to be unique
-
-
-
Example 1:
-
-
-Input: gas = [1,2,3,4,5], cost = [3,4,5,1,2]
-Output: 3
-Explanation:
-Start at station 3 (index 3) and fill up with 4 unit of gas. Your tank = 0 + 4 = 4
-Travel to station 4. Your tank = 4 - 1 + 5 = 8
-Travel to station 0. Your tank = 8 - 2 + 1 = 7
-Travel to station 1. Your tank = 7 - 3 + 2 = 6
-Travel to station 2. Your tank = 6 - 4 + 3 = 5
-Travel to station 3. The cost is 5. Your gas is just enough to travel back to station 3.
-Therefore, return 3 as the starting index.
-
-
-
Example 2:
-
-
-Input: gas = [2,3,4], cost = [3,4,3]
-Output: -1
-Explanation:
-You can't start at station 0 or 1, as there is not enough gas to travel to the next station.
-Let's start at station 2 and fill up with 4 unit of gas. Your tank = 0 + 4 = 4
-Travel to station 0. Your tank = 4 - 3 + 2 = 3
-Travel to station 1. Your tank = 3 - 3 + 3 = 3
-You cannot travel back to station 2, as it requires 4 unit of gas but you only have 3.
-Therefore, you can't travel around the circuit once no matter where you start.
-
-
-
-
Constraints:
-
-
-
gas.length == n
-
cost.length == n
-
1 <= n <= 105
-
0 <= gas[i], cost[i] <= 104
-
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[Array](../../tag/array/README.md)]
diff --git a/problems/gas-station/gas_station.go b/problems/gas-station/gas_station.go
deleted file mode 100644
index 209fb0c3e..000000000
--- a/problems/gas-station/gas_station.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem134
diff --git a/problems/gas-station/gas_station_test.go b/problems/gas-station/gas_station_test.go
deleted file mode 100644
index 209fb0c3e..000000000
--- a/problems/gas-station/gas_station_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem134
diff --git a/problems/gcd-sort-of-an-array/README.md b/problems/gcd-sort-of-an-array/README.md
deleted file mode 100644
index 963bb3455..000000000
--- a/problems/gcd-sort-of-an-array/README.md
+++ /dev/null
@@ -1,75 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../first-day-where-you-have-been-in-all-the-rooms "First Day Where You Have Been in All the Rooms")
-
-[Next >](../smallest-greater-multiple-made-of-two-digits "Smallest Greater Multiple Made of Two Digits")
-
-## [1998. GCD Sort of an Array (Hard)](https://leetcode.com/problems/gcd-sort-of-an-array "数组的最大公因数排序")
-
-
You are given an integer array nums, and you can perform the following operation any number of times on nums:
-
-
-
Swap the positions of two elements nums[i] and nums[j] if gcd(nums[i], nums[j]) > 1 where gcd(nums[i], nums[j]) is the greatest common divisor of nums[i] and nums[j].
-
-
-
Return trueif it is possible to sort nums in non-decreasing order using the above swap method, or false otherwise.
-
-
-
Example 1:
-
-
-Input: nums = [7,21,3]
-Output: true
-Explanation: We can sort [7,21,3] by performing the following operations:
-- Swap 7 and 21 because gcd(7,21) = 7. nums = [21,7,3]
-- Swap 21 and 3 because gcd(21,3) = 3. nums = [3,7,21]
-
-
-
Example 2:
-
-
-Input: nums = [5,2,6,2]
-Output: false
-Explanation: It is impossible to sort the array because 5 cannot be swapped with any other element.
-
-
-
Example 3:
-
-
-Input: nums = [10,5,9,3,15]
-Output: true
-We can sort [10,5,9,3,15] by performing the following operations:
-- Swap 10 and 15 because gcd(10,15) = 5. nums = [15,5,9,3,10]
-- Swap 15 and 3 because gcd(15,3) = 3. nums = [3,5,9,15,10]
-- Swap 10 and 15 because gcd(10,15) = 5. nums = [3,5,9,10,15]
-
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 3 * 104
-
2 <= nums[i] <= 105
-
-
-### Related Topics
- [[Union Find](../../tag/union-find/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Math](../../tag/math/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Hints
-
-Hint 1
-Can we build a graph with all the prime numbers and the original array?
-
-
-
-Hint 2
-We can use union-find to determine which indices are connected (i.e., which indices can be swapped).
-
diff --git a/problems/generalized-abbreviation/README.md b/problems/generalized-abbreviation/README.md
deleted file mode 100644
index 017a197f6..000000000
--- a/problems/generalized-abbreviation/README.md
+++ /dev/null
@@ -1,36 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../bulb-switcher "Bulb Switcher")
-
-[Next >](../create-maximum-number "Create Maximum Number")
-
-## [320. Generalized Abbreviation (Medium)](https://leetcode.com/problems/generalized-abbreviation "列举单词的全部缩写")
-
-
Write a function to generate the generalized abbreviations of a word.
-
-### Related Topics
- [[String](../../tag/string/README.md)]
- [[Backtracking](../../tag/backtracking/README.md)]
- [[Bit Manipulation](../../tag/bit-manipulation/README.md)]
-
-### Similar Questions
- 1. [Subsets](../subsets) (Medium)
- 1. [Unique Word Abbreviation](../unique-word-abbreviation) (Medium)
- 1. [Minimum Unique Word Abbreviation](../minimum-unique-word-abbreviation) (Hard)
diff --git a/problems/generalized-abbreviation/generalized_abbreviation.go b/problems/generalized-abbreviation/generalized_abbreviation.go
deleted file mode 100644
index aa0bcaa6d..000000000
--- a/problems/generalized-abbreviation/generalized_abbreviation.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem320
diff --git a/problems/generalized-abbreviation/generalized_abbreviation_test.go b/problems/generalized-abbreviation/generalized_abbreviation_test.go
deleted file mode 100644
index aa0bcaa6d..000000000
--- a/problems/generalized-abbreviation/generalized_abbreviation_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem320
diff --git a/problems/generate-a-string-with-characters-that-have-odd-counts/README.md b/problems/generate-a-string-with-characters-that-have-odd-counts/README.md
deleted file mode 100644
index f92d2f599..000000000
--- a/problems/generate-a-string-with-characters-that-have-odd-counts/README.md
+++ /dev/null
@@ -1,56 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-sum-bst-in-binary-tree "Maximum Sum BST in Binary Tree")
-
-[Next >](../bulb-switcher-iii "Bulb Switcher III")
-
-## [1374. Generate a String With Characters That Have Odd Counts (Easy)](https://leetcode.com/problems/generate-a-string-with-characters-that-have-odd-counts "生成每种字符都是奇数个的字符串")
-
-
Given an integer n, return a string with n characters such that each character in such string occurs an odd number of times.
-
-
The returned string must contain only lowercase English letters. If there are multiples valid strings, return any of them.
-
-
-
Example 1:
-
-
-Input: n = 4
-Output: "pppz"
-Explanation: "pppz" is a valid string since the character 'p' occurs three times and the character 'z' occurs once. Note that there are many other valid strings such as "ohhh" and "love".
-
-
-
Example 2:
-
-
-Input: n = 2
-Output: "xy"
-Explanation: "xy" is a valid string since the characters 'x' and 'y' occur once. Note that there are many other valid strings such as "ag" and "ur".
-
-
-
Example 3:
-
-
-Input: n = 7
-Output: "holasss"
-
-
-
-
Constraints:
-
-
-
1 <= n <= 500
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
-
-### Hints
-
-Hint 1
-If n is odd, return a string of size n formed only by 'a', else return string formed with n-1 'a' and 1 'b''.
-
diff --git a/problems/generate-a-string-with-characters-that-have-odd-counts/generate_a_string_with_characters_that_have_odd_counts.go b/problems/generate-a-string-with-characters-that-have-odd-counts/generate_a_string_with_characters_that_have_odd_counts.go
deleted file mode 100644
index 707bfb46d..000000000
--- a/problems/generate-a-string-with-characters-that-have-odd-counts/generate_a_string_with_characters_that_have_odd_counts.go
+++ /dev/null
@@ -1,12 +0,0 @@
-package problem1374
-
-func generateTheString(n int) string {
- b := make([]byte, n)
- for i := 0; i < n; i++ {
- b[i] = 'x'
- }
- if n%2 == 0 {
- b[n-1] = 'y'
- }
- return string(b)
-}
diff --git a/problems/generate-a-string-with-characters-that-have-odd-counts/generate_a_string_with_characters_that_have_odd_counts_test.go b/problems/generate-a-string-with-characters-that-have-odd-counts/generate_a_string_with_characters_that_have_odd_counts_test.go
deleted file mode 100644
index 3c121cfee..000000000
--- a/problems/generate-a-string-with-characters-that-have-odd-counts/generate_a_string_with_characters_that_have_odd_counts_test.go
+++ /dev/null
@@ -1,35 +0,0 @@
-package problem1374
-
-import "testing"
-
-type testType struct {
- in int
- want string
-}
-
-func TestGenerateTheString(t *testing.T) {
- tests := [...]testType{
- {
- in: 4,
- want: "xxxy",
- },
- {
- in: 2,
- want: "xy",
- },
- {
- in: 7,
- want: "xxxxxxx",
- },
- {
- in: 30,
- want: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxy",
- },
- }
- for _, tt := range tests {
- got := generateTheString(tt.in)
- if got != tt.want {
- t.Fatalf("in: %v, got: %v, want: %v", tt.in, got, tt.want)
- }
- }
-}
diff --git a/problems/generate-parentheses/README.md b/problems/generate-parentheses/README.md
deleted file mode 100644
index 733a36aa0..000000000
--- a/problems/generate-parentheses/README.md
+++ /dev/null
@@ -1,38 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../merge-two-sorted-lists "Merge Two Sorted Lists")
-
-[Next >](../merge-k-sorted-lists "Merge k Sorted Lists")
-
-## [22. Generate Parentheses (Medium)](https://leetcode.com/problems/generate-parentheses "括号生成")
-
-
Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.
-
-
-
Example 1:
-
Input: n = 3
-Output: ["((()))","(()())","(())()","()(())","()()()"]
-
Given the radius and the position of the center of a circle, implement the function randPoint which generates a uniform random point inside the circle.
-
-
Implement the Solution class:
-
-
-
Solution(double radius, double x_center, double y_center) initializes the object with the radius of the circle radius and the position of the center (x_center, y_center).
-
randPoint() returns a random point inside the circle. A point on the circumference of the circle is considered to be in the circle. The answer is returned as an array [x, y].
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
- [[Geometry](../../tag/geometry/README.md)]
- [[Rejection Sampling](../../tag/rejection-sampling/README.md)]
- [[Randomized](../../tag/randomized/README.md)]
-
-### Similar Questions
- 1. [Random Point in Non-overlapping Rectangles](../random-point-in-non-overlapping-rectangles) (Medium)
diff --git a/problems/generate-random-point-in-a-circle/generate_random_point_in_a_circle.go b/problems/generate-random-point-in-a-circle/generate_random_point_in_a_circle.go
deleted file mode 100644
index 489500200..000000000
--- a/problems/generate-random-point-in-a-circle/generate_random_point_in_a_circle.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem478
diff --git a/problems/generate-random-point-in-a-circle/generate_random_point_in_a_circle_test.go b/problems/generate-random-point-in-a-circle/generate_random_point_in_a_circle_test.go
deleted file mode 100644
index 489500200..000000000
--- a/problems/generate-random-point-in-a-circle/generate_random_point_in_a_circle_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem478
diff --git a/problems/get-biggest-three-rhombus-sums-in-a-grid/README.md b/problems/get-biggest-three-rhombus-sums-in-a-grid/README.md
deleted file mode 100644
index 0d8c4cfcf..000000000
--- a/problems/get-biggest-three-rhombus-sums-in-a-grid/README.md
+++ /dev/null
@@ -1,80 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimize-maximum-pair-sum-in-array "Minimize Maximum Pair Sum in Array")
-
-[Next >](../minimum-xor-sum-of-two-arrays "Minimum XOR Sum of Two Arrays")
-
-## [1878. Get Biggest Three Rhombus Sums in a Grid (Medium)](https://leetcode.com/problems/get-biggest-three-rhombus-sums-in-a-grid "矩阵中最大的三个菱形和")
-
-
You are given an m x n integer matrix grid.
-
-
A rhombus sum is the sum of the elements that form theborder of a regular rhombus shape in grid. The rhombus must have the shape of a square rotated 45 degrees with each of the corners centered in a grid cell. Below is an image of four valid rhombus shapes with the corresponding colored cells that should be included in each rhombus sum:
-
-
Note that the rhombus can have an area of 0, which is depicted by the purple rhombus in the bottom right corner.
-
-
Return the biggest three distinct rhombus sums in the grid in descending order. If there are less than three distinct values, return all of them.
-Input: grid = [[1,2,3],[4,5,6],[7,8,9]]
-Output: [20,9,8]
-Explanation: The rhombus shapes for the three biggest distinct rhombus sums are depicted above.
-- Blue: 4 + 2 + 6 + 8 = 20
-- Red: 9 (area 0 rhombus in the bottom right corner)
-- Green: 8 (area 0 rhombus in the bottom middle)
-
-
-
Example 3:
-
-
-Input: grid = [[7,7,7]]
-Output: [7]
-Explanation: All three possible rhombus sums are the same, so return [7].
-
-
-
-
Constraints:
-
-
-
m == grid.length
-
n == grid[i].length
-
1 <= m, n <= 50
-
1 <= grid[i][j] <= 105
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Math](../../tag/math/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
- [[Prefix Sum](../../tag/prefix-sum/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
- [[Heap (Priority Queue)](../../tag/heap-priority-queue/README.md)]
-
-### Hints
-
-Hint 1
-You need to maintain only the biggest 3 distinct sums
-
-
-
-Hint 2
-The limits are small enough for you to iterate over all rhombus sizes then iterate over all possible borders to get the sums
-
diff --git a/problems/get-equal-substrings-within-budget/README.md b/problems/get-equal-substrings-within-budget/README.md
deleted file mode 100644
index 56d17a731..000000000
--- a/problems/get-equal-substrings-within-budget/README.md
+++ /dev/null
@@ -1,70 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../unique-number-of-occurrences "Unique Number of Occurrences")
-
-[Next >](../remove-all-adjacent-duplicates-in-string-ii "Remove All Adjacent Duplicates in String II")
-
-## [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.
-
-
You are also given an integer maxCost.
-
-
Return the maximum length of a substring of s that can be changed to be the same as the corresponding substring of twith a cost less than or equal to maxCost.
-
-
If there is no substring from s that can be changed to its corresponding substring from t, return 0.
-
-
-
Example 1:
-
-
-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", maxCost = 3
-Output: 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", maxCost = 0
-Output: 1
-Explanation: You can't make any change, so the maximum length is 1.
-
-
-
-
Constraints:
-
-
-
1 <= s.length, t.length <= 10^5
-
0 <= maxCost <= 10^6
-
s and t only contain lower case English letters.
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
- [[Prefix Sum](../../tag/prefix-sum/README.md)]
- [[Sliding Window](../../tag/sliding-window/README.md)]
-
-### Hints
-
-Hint 1
-Calculate the differences between a[i] and b[i].
-
-
-
-Hint 2
-Use a sliding window to track the longest valid substring.
-
diff --git a/problems/get-highest-answer-rate-question/README.md b/problems/get-highest-answer-rate-question/README.md
deleted file mode 100644
index fe5999032..000000000
--- a/problems/get-highest-answer-rate-question/README.md
+++ /dev/null
@@ -1,62 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../employee-bonus "Employee Bonus")
-
-[Next >](../find-cumulative-salary-of-an-employee "Find Cumulative Salary of an Employee")
-
-## [578. Get Highest Answer Rate Question (Medium)](https://leetcode.com/problems/get-highest-answer-rate-question "查询回答率最高的问题")
-
-
Get the highest answer rate question from a table survey_log with these columns: uid, action, question_id, answer_id, q_num, timestamp.
-
-
uid means user id; action has these kind of values: "show", "answer", "skip"; answer_id is not null when action column is "answer", while is null for "show" and "skip"; q_num is the numeral order of the question in current session.
-
-
Write a sql query to identify the question which has the highest answer rate.
-Input: n = 2
-Output: 1
-Explanation: According to the given rules, nums = [0,1,1]. The maximum is max(0,1,1) = 1.
-
-
-
Example 3:
-
-
-Input: n = 3
-Output: 2
-Explanation: According to the given rules, nums = [0,1,1,2]. The maximum is max(0,1,1,2) = 2.
-
-
-
-
Constraints:
-
-
-
0 <= n <= 100
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Simulation](../../tag/simulation/README.md)]
-
-### Hints
-
-Hint 1
-Try generating the array.
-
-
-
-Hint 2
-Make sure not to fall in the base case of 0.
-
diff --git a/problems/get-the-maximum-score/README.md b/problems/get-the-maximum-score/README.md
deleted file mode 100644
index 26e258cc6..000000000
--- a/problems/get-the-maximum-score/README.md
+++ /dev/null
@@ -1,76 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-swaps-to-arrange-a-binary-grid "Minimum Swaps to Arrange a Binary Grid")
-
-[Next >](../guess-the-majority-in-a-hidden-array "Guess the Majority in a Hidden Array")
-
-## [1537. Get the Maximum Score (Hard)](https://leetcode.com/problems/get-the-maximum-score "最大得分")
-
-
You are given two sorted arrays of distinct integers nums1 and nums2.
-
-
A validpath is defined as follows:
-
-
-
Choose array nums1 or nums2 to traverse (from index-0).
-
Traverse the current array from left to right.
-
If you are reading any value that is present in nums1 and nums2 you are allowed to change your path to the other array. (Only one repeated value is considered in the valid path).
-
-
-
The score is defined as the sum of uniques values in a valid path.
-
-
Return the maximum score you can obtain of all possible valid paths. Since the answer may be too large, return it modulo 109 + 7.
-
-
-
Example 1:
-
-
-Input: nums1 = [2,4,5,8,10], nums2 = [4,6,8,9]
-Output: 30
-Explanation: Valid paths:
-[2,4,5,8,10], [2,4,5,8,9], [2,4,6,8,9], [2,4,6,8,10], (starting from nums1)
-[4,6,8,9], [4,5,8,10], [4,5,8,9], [4,6,8,10] (starting from nums2)
-The maximum is obtained with the path in green [2,4,6,8,10].
-
-
-
Example 2:
-
-
-Input: nums1 = [1,3,5,7,9], nums2 = [3,5,100]
-Output: 109
-Explanation: Maximum sum is obtained with the path [1,3,5,100].
-
-
-
Example 3:
-
-
-Input: nums1 = [1,2,3,4,5], nums2 = [6,7,8,9,10]
-Output: 40
-Explanation: There are no common elements between nums1 and nums2.
-Maximum sum is obtained with the path [6,7,8,9,10].
-
-
-
-
Constraints:
-
-
-
1 <= nums1.length, nums2.length <= 105
-
1 <= nums1[i], nums2[i] <= 107
-
nums1 and nums2 are strictly increasing.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Two Pointers](../../tag/two-pointers/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Greedy](../../tag/greedy/README.md)]
-
-### Hints
-
-Hint 1
-Partition the array by common integers, and choose the path with larger sum with a DP technique.
-
diff --git a/problems/get-the-second-most-recent-activity/README.md b/problems/get-the-second-most-recent-activity/README.md
deleted file mode 100644
index 60c83d6b0..000000000
--- a/problems/get-the-second-most-recent-activity/README.md
+++ /dev/null
@@ -1,61 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-cost-to-make-at-least-one-valid-path-in-a-grid "Minimum Cost to Make at Least One Valid Path in a Grid")
-
-[Next >](../increasing-decreasing-string "Increasing Decreasing String")
-
-## [1369. Get the Second Most Recent Activity (Hard)](https://leetcode.com/problems/get-the-second-most-recent-activity "获取最近第二次的活动")
-
-SQL Schema
-
Table: UserActivity
-
-+---------------+---------+
-| Column Name | Type |
-+---------------+---------+
-| username | varchar |
-| activity | varchar |
-| startDate | Date |
-| endDate | Date |
-+---------------+---------+
-This table does not contain primary key.
-This table contain information about the activity performed of each user in a period of time.
-A person with username performed a activity from startDate to endDate.
-
-
-Write an SQL query to show the second most recent activity of each user.
-
-If the user only has one activity, return that one.
-
-A user can't perform more than one activity at the same time. Return the result table in any order.
-
-The query result format is in the following example:
-
-UserActivity table:
-+------------+--------------+-------------+-------------+
-| username | activity | startDate | endDate |
-+------------+--------------+-------------+-------------+
-| Alice | Travel | 2020-02-12 | 2020-02-20 |
-| Alice | Dancing | 2020-02-21 | 2020-02-23 |
-| Alice | Travel | 2020-02-24 | 2020-02-28 |
-| Bob | Travel | 2020-02-11 | 2020-02-18 |
-+------------+--------------+-------------+-------------+
-
-Result table:
-+------------+--------------+-------------+-------------+
-| username | activity | startDate | endDate |
-+------------+--------------+-------------+-------------+
-| Alice | Dancing | 2020-02-21 | 2020-02-23 |
-| Bob | Travel | 2020-02-11 | 2020-02-18 |
-+------------+--------------+-------------+-------------+
-
-The most recent activity of Alice is Travel from 2020-02-24 to 2020-02-28, before that she was dancing from 2020-02-21 to 2020-02-23.
-Bob only has one record, we just take that one.
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/get-the-second-most-recent-activity/mysql_schemas.sql b/problems/get-the-second-most-recent-activity/mysql_schemas.sql
deleted file mode 100644
index 880eded3e..000000000
--- a/problems/get-the-second-most-recent-activity/mysql_schemas.sql
+++ /dev/null
@@ -1,6 +0,0 @@
-Create table If Not Exists UserActivity (username varchar(30), activity varchar(30), startDate date, endDate date);
-Truncate table UserActivity;
-insert into UserActivity (username, activity, startDate, endDate) values ('Alice', 'Travel', '2020-02-12', '2020-02-20');
-insert into UserActivity (username, activity, startDate, endDate) values ('Alice', 'Dancing', '2020-02-21', '2020-02-23');
-insert into UserActivity (username, activity, startDate, endDate) values ('Alice', 'Travel', '2020-02-24', '2020-02-28');
-insert into UserActivity (username, activity, startDate, endDate) values ('Bob', 'Travel', '2020-02-11', '2020-02-18');
diff --git a/problems/get-watched-videos-by-your-friends/README.md b/problems/get-watched-videos-by-your-friends/README.md
deleted file mode 100644
index 79c0f3213..000000000
--- a/problems/get-watched-videos-by-your-friends/README.md
+++ /dev/null
@@ -1,76 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../xor-queries-of-a-subarray "XOR Queries of a Subarray")
-
-[Next >](../minimum-insertion-steps-to-make-a-string-palindrome "Minimum Insertion Steps to Make a String Palindrome")
-
-## [1311. Get Watched Videos by Your Friends (Medium)](https://leetcode.com/problems/get-watched-videos-by-your-friends "获取你好友已观看的视频")
-
-
There are n people, each person has a unique id between 0 and n-1. Given the arrays watchedVideos and friends, where watchedVideos[i] and friends[i] contain the list of watched videos and the list of friends respectively for the person with id = i.
-
-
Level 1 of videos are all watched videos by your friends, level 2 of videos are all watched videos by the friends of your friends and so on. In general, the level k of videos are all watched videos by people with the shortest path exactly equal to k with you. Given your id and the level of videos, return the list of videos ordered by their frequencies (increasing). For videos with the same frequency order them alphabetically from least to greatest.
-
-
-
Example 1:
-
-
-
-
-Input: watchedVideos = [["A","B"],["C"],["B","C"],["D"]], friends = [[1,2],[0,3],[0,3],[1,2]], id = 0, level = 1
-Output: ["B","C"]
-Explanation:
-You have id = 0 (green color in the figure) and your friends are (yellow color in the figure):
-Person with id = 1 -> watchedVideos = ["C"]
-Person with id = 2 -> watchedVideos = ["B","C"]
-The frequencies of watchedVideos by your friends are:
-B -> 1
-C -> 2
-
-
-
Example 2:
-
-
-
-
-Input: watchedVideos = [["A","B"],["C"],["B","C"],["D"]], friends = [[1,2],[0,3],[0,3],[1,2]], id = 0, level = 2
-Output: ["D"]
-Explanation:
-You have id = 0 (green color in the figure) and the only friend of your friends is the person with id = 3 (yellow color in the figure).
-
-
-
-
Constraints:
-
-
-
n == watchedVideos.length == friends.length
-
2 <= n <= 100
-
1 <= watchedVideos[i].length <= 100
-
1 <= watchedVideos[i][j].length <= 8
-
0 <= friends[i].length < n
-
0 <= friends[i][j] < n
-
0 <= id < n
-
1 <= level < n
-
if friends[i] contains j, then friends[j] contains i
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Hints
-
-Hint 1
-Do BFS to find the kth level friends.
-
-
-
-Hint 2
-Then collect movies saw by kth level friends and sort them accordingly.
-
diff --git a/problems/global-and-local-inversions/README.md b/problems/global-and-local-inversions/README.md
deleted file mode 100644
index 37e03dcb7..000000000
--- a/problems/global-and-local-inversions/README.md
+++ /dev/null
@@ -1,68 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimize-max-distance-to-gas-station "Minimize Max Distance to Gas Station")
-
-[Next >](../split-bst "Split BST")
-
-## [775. Global and Local Inversions (Medium)](https://leetcode.com/problems/global-and-local-inversions "全局倒置与局部倒置")
-
-
You are given an integer array nums of length n which represents a permutation of all the integers in the range [0, n - 1].
-
-
The number of global inversions is the number of the different pairs (i, j) where:
-
-
-
0 <= i < j < n
-
nums[i] > nums[j]
-
-
-
The number of local inversions is the number of indices i where:
-
-
-
0 <= i < n - 1
-
nums[i] > nums[i + 1]
-
-
-
Return trueif the number of global inversions is equal to the number of local inversions.
-
-
-
Example 1:
-
-
-Input: nums = [1,0,2]
-Output: true
-Explanation: There is 1 global inversion and 1 local inversion.
-
-
-
Example 2:
-
-
-Input: nums = [1,2,0]
-Output: false
-Explanation: There are 2 global inversions and 1 local inversion.
-
-
-
-
Constraints:
-
-
-
n == nums.length
-
1 <= n <= 105
-
0 <= nums[i] < n
-
All the integers of nums are unique.
-
nums is a permutation of all the numbers in the range [0, n - 1].
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Math](../../tag/math/README.md)]
-
-### Hints
-
-Hint 1
-Where can the 0 be placed in an ideal permutation? What about the 1?
-
diff --git a/problems/global-and-local-inversions/global_and_local_inversions.go b/problems/global-and-local-inversions/global_and_local_inversions.go
deleted file mode 100644
index 82fa03e35..000000000
--- a/problems/global-and-local-inversions/global_and_local_inversions.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem775
diff --git a/problems/global-and-local-inversions/global_and_local_inversions_test.go b/problems/global-and-local-inversions/global_and_local_inversions_test.go
deleted file mode 100644
index 82fa03e35..000000000
--- a/problems/global-and-local-inversions/global_and_local_inversions_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem775
diff --git a/problems/goal-parser-interpretation/README.md b/problems/goal-parser-interpretation/README.md
deleted file mode 100644
index bb3dee44a..000000000
--- a/problems/goal-parser-interpretation/README.md
+++ /dev/null
@@ -1,60 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../products-worth-over-invoices "Product's Worth Over Invoices")
-
-[Next >](../max-number-of-k-sum-pairs "Max Number of K-Sum Pairs")
-
-## [1678. Goal Parser Interpretation (Easy)](https://leetcode.com/problems/goal-parser-interpretation "设计 Goal 解析器")
-
-
You own a Goal Parser that can interpret a string command. The command consists of an alphabet of "G", "()" and/or "(al)" in some order. The Goal Parser will interpret "G" as the string "G", "()" as the string "o", and "(al)" as the string "al". The interpreted strings are then concatenated in the original order.
-
-
Given the string command, return the Goal Parser's interpretation of command.
-
-
-
Example 1:
-
-
-Input: command = "G()(al)"
-Output: "Goal"
-Explanation: The Goal Parser interprets the command as follows:
-G -> G
-() -> o
-(al) -> al
-The final concatenated result is "Goal".
-
Input: sentence = "The quick brown fox jumped over the lazy dog"
-Output: "heTmaa uickqmaaa rownbmaaaa oxfmaaaaa umpedjmaaaaaa overmaaaaaaa hetmaaaaaaaa azylmaaaaaaaaa ogdmaaaaaaaaaa"
-
-
-
Constraints:
-
-
-
1 <= sentence.length <= 150
-
sentence consists of English letters and spaces.
-
sentence has no leading or trailing spaces.
-
All the words in sentence are separated by a single space.
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
diff --git a/problems/goat-latin/goat_latin.go b/problems/goat-latin/goat_latin.go
deleted file mode 100644
index 58fd43629..000000000
--- a/problems/goat-latin/goat_latin.go
+++ /dev/null
@@ -1,18 +0,0 @@
-package problem824
-
-import "strings"
-
-func toGoatLatin(S string) string {
- ans := ""
- s := strings.Split(S, " ")
- for i, word := range s {
- switch word[0] {
- case 'a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U':
- ans += " " + word + "ma"
- default:
- ans += " " + word[1:] + word[0:1] + "ma"
- }
- ans += strings.Repeat("a", i+1)
- }
- return ans[1:]
-}
diff --git a/problems/goat-latin/goat_latin_test.go b/problems/goat-latin/goat_latin_test.go
deleted file mode 100644
index 2f0d8b971..000000000
--- a/problems/goat-latin/goat_latin_test.go
+++ /dev/null
@@ -1,27 +0,0 @@
-package problem824
-
-import "testing"
-
-type testType struct {
- in string
- want string
-}
-
-func TestToGoatLatin(t *testing.T) {
- tests := [...]testType{
- {
- in: "I speak Goat Latin",
- want: "Imaa peaksmaaa oatGmaaaa atinLmaaaaa",
- },
- {
- in: "The quick brown fox jumped over the lazy dog",
- want: "heTmaa uickqmaaa rownbmaaaa oxfmaaaaa umpedjmaaaaaa overmaaaaaaa hetmaaaaaaaa azylmaaaaaaaaa ogdmaaaaaaaaaa",
- },
- }
- for _, tt := range tests {
- got := toGoatLatin(tt.in)
- if got != tt.want {
- t.Fatalf("in: %v, got: %v, want: %v", tt.in, got, tt.want)
- }
- }
-}
diff --git a/problems/grand-slam-titles/README.md b/problems/grand-slam-titles/README.md
deleted file mode 100644
index f47024e06..000000000
--- a/problems/grand-slam-titles/README.md
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../count-pairs-of-nodes "Count Pairs Of Nodes")
-
-[Next >](../check-if-binary-string-has-at-most-one-segment-of-ones "Check if Binary String Has at Most One Segment of Ones")
-
-## [1783. Grand Slam Titles (Medium)](https://leetcode.com/problems/grand-slam-titles "大满贯数量")
-
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/grand-slam-titles/mysql_schemas.sql b/problems/grand-slam-titles/mysql_schemas.sql
deleted file mode 100644
index dd19af729..000000000
--- a/problems/grand-slam-titles/mysql_schemas.sql
+++ /dev/null
@@ -1,10 +0,0 @@
-Create table If Not Exists Players (player_id int, player_name varchar(20));
-Create table If Not Exists Championships (year int, Wimbledon int, Fr_open int, US_open int, Au_open int);
-Truncate table Players;
-insert into Players (player_id, player_name) values ('1', 'Nadal');
-insert into Players (player_id, player_name) values ('2', 'Federer');
-insert into Players (player_id, player_name) values ('3', 'Novak');
-Truncate table Championships;
-insert into Championships (year, Wimbledon, Fr_open, US_open, Au_open) values ('2018', '1', '1', '1', '1');
-insert into Championships (year, Wimbledon, Fr_open, US_open, Au_open) values ('2019', '1', '1', '2', '2');
-insert into Championships (year, Wimbledon, Fr_open, US_open, Au_open) values ('2020', '2', '1', '2', '2');
diff --git a/problems/graph-connectivity-with-threshold/README.md b/problems/graph-connectivity-with-threshold/README.md
deleted file mode 100644
index c09292090..000000000
--- a/problems/graph-connectivity-with-threshold/README.md
+++ /dev/null
@@ -1,95 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../best-team-with-no-conflicts "Best Team With No Conflicts")
-
-[Next >](../design-an-expression-tree-with-evaluate-function "Design an Expression Tree With Evaluate Function")
-
-## [1627. Graph Connectivity With Threshold (Hard)](https://leetcode.com/problems/graph-connectivity-with-threshold "带阈值的图连通性")
-
-
We have n cities labeled from 1 to n. Two different cities with labels x and y are directly connected by a bidirectional road if and only if x and y share a common divisor strictly greater than some threshold. More formally, cities with labels x and y have a road between them if there exists an integer z such that all of the following are true:
-
-
-
x % z == 0,
-
y % z == 0, and
-
z > threshold.
-
-
-
Given the two integers, n and threshold, and an array of queries, you must determine for each queries[i] = [ai, bi] if cities ai and bi are connected directly or indirectly. (i.e. there is some path between them).
-
-
Return an array answer, where answer.length == queries.length and answer[i] is true if for the ith query, there is a path between ai and bi, or answer[i] is false if there is no path.
-
-
-
Example 1:
-
-
-Input: n = 6, threshold = 2, queries = [[1,4],[2,5],[3,6]]
-Output: [false,false,true]
-Explanation: The divisors for each number:
-1: 1
-2: 1, 2
-3: 1, 3
-4: 1, 2, 4
-5: 1, 5
-6: 1, 2, 3, 6
-Using the underlined divisors above the threshold, only cities 3 and 6 share a common divisor, so they are the
-only ones directly connected. The result of each query:
-[1,4] 1 is not connected to 4
-[2,5] 2 is not connected to 5
-[3,6] 3 is connected to 6 through path 3--6
-
-
-
Example 2:
-
-
-Input: n = 6, threshold = 0, queries = [[4,5],[3,4],[3,2],[2,6],[1,3]]
-Output: [true,true,true,true,true]
-Explanation: The divisors for each number are the same as the previous example. However, since the threshold is 0,
-all divisors can be used. Since all numbers share 1 as a divisor, all cities are connected.
-
-
-
Example 3:
-
-
-Input: n = 5, threshold = 1, queries = [[4,5],[4,5],[3,2],[2,3],[3,4]]
-Output: [false,false,false,false,false]
-Explanation: Only cities 2 and 4 share a common divisor 2 which is strictly greater than the threshold 1, so they are the only ones directly connected.
-Please notice that there can be multiple queries for the same pair of nodes [x, y], and that the query [x, y] is equivalent to the query [y, x].
-
-
-
-
Constraints:
-
-
-
2 <= n <= 104
-
0 <= threshold <= n
-
1 <= queries.length <= 105
-
queries[i].length == 2
-
1 <= ai, bi <= cities
-
ai != bi
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Math](../../tag/math/README.md)]
- [[Union Find](../../tag/union-find/README.md)]
-
-### Hints
-
-Hint 1
-How to build the graph of the cities?
-
-
-
-Hint 2
-Connect city i with all its multiples 2*i, 3*i, ...
-
-
-
-Hint 3
-Answer the queries using union-find data structure.
-
diff --git a/problems/graph-valid-tree/README.md b/problems/graph-valid-tree/README.md
deleted file mode 100644
index ffb6f3b79..000000000
--- a/problems/graph-valid-tree/README.md
+++ /dev/null
@@ -1,50 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../single-number-iii "Single Number III")
-
-[Next >](../trips-and-users "Trips and Users")
-
-## [261. Graph Valid Tree (Medium)](https://leetcode.com/problems/graph-valid-tree "以图判树")
-
-
Given n nodes labeled from 0 to n-1 and a list of undirected edges (each edge is a pair of nodes), write a function to check whether these edges make up a valid tree.
Note: you can assume that no duplicate edges will appear in edges. Since all edges are undirected, [0,1] is the same as [1,0] and thus will not appear together in edges.
-
-### Related Topics
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Union Find](../../tag/union-find/README.md)]
- [[Graph](../../tag/graph/README.md)]
-
-### Similar Questions
- 1. [Course Schedule](../course-schedule) (Medium)
- 1. [Number of Connected Components in an Undirected Graph](../number-of-connected-components-in-an-undirected-graph) (Medium)
- 1. [Keys and Rooms](../keys-and-rooms) (Medium)
-
-### Hints
-
-Hint 1
-Given n = 5 and edges = [[0, 1], [1, 2], [3, 4]], what should your return? Is this case a valid tree?
-
-
-
-Hint 2
-According to the definition of tree on Wikipedia: “a tree is an undirected graph in which any two vertices are connected by exactly one path. In other words, any connected graph without simple cycles is a tree.”
-
diff --git a/problems/graph-valid-tree/graph_valid_tree.go b/problems/graph-valid-tree/graph_valid_tree.go
deleted file mode 100644
index 21559ad2f..000000000
--- a/problems/graph-valid-tree/graph_valid_tree.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem261
diff --git a/problems/graph-valid-tree/graph_valid_tree_test.go b/problems/graph-valid-tree/graph_valid_tree_test.go
deleted file mode 100644
index 21559ad2f..000000000
--- a/problems/graph-valid-tree/graph_valid_tree_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem261
diff --git a/problems/gray-code/README.md b/problems/gray-code/README.md
deleted file mode 100644
index 31ab2c962..000000000
--- a/problems/gray-code/README.md
+++ /dev/null
@@ -1,65 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../merge-sorted-array "Merge Sorted Array")
-
-[Next >](../subsets-ii "Subsets II")
-
-## [89. Gray Code (Medium)](https://leetcode.com/problems/gray-code "格雷编码")
-
-
An n-bit gray code sequence is a sequence of 2n integers where:
-
-
-
Every integer is in the inclusive range [0, 2n - 1],
-
The first integer is 0,
-
An integer appears no more than once in the sequence,
-
The binary representation of every pair of adjacent integers differs by exactly one bit, and
-
The binary representation of the first and last integers differs by exactly one bit.
-
-
-
Given an integer n, return any valid n-bit gray code sequence.
-
-
-
Example 1:
-
-
-Input: n = 2
-Output: [0,1,3,2]
-Explanation:
-The binary representation of [0,1,3,2] is [00,01,11,10].
-- 00 and 01 differ by one bit
-- 01 and 11 differ by one bit
-- 11 and 10 differ by one bit
-- 10 and 00 differ by one bit
-[0,2,3,1] is also a valid gray code sequence, whose binary representation is [00,10,11,01].
-- 00 and 10 differ by one bit
-- 10 and 11 differ by one bit
-- 11 and 01 differ by one bit
-- 01 and 00 differ by one bit
-
-
-
Example 2:
-
-
-Input: n = 1
-Output: [0,1]
-
-
-
-
Constraints:
-
-
-
1 <= n <= 16
-
-
-### Related Topics
- [[Bit Manipulation](../../tag/bit-manipulation/README.md)]
- [[Math](../../tag/math/README.md)]
- [[Backtracking](../../tag/backtracking/README.md)]
-
-### Similar Questions
- 1. [1-bit and 2-bit Characters](../1-bit-and-2-bit-characters) (Easy)
diff --git a/problems/gray-code/gray_code.go b/problems/gray-code/gray_code.go
deleted file mode 100644
index 4eb823717..000000000
--- a/problems/gray-code/gray_code.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem89
diff --git a/problems/gray-code/gray_code_test.go b/problems/gray-code/gray_code_test.go
deleted file mode 100644
index 4eb823717..000000000
--- a/problems/gray-code/gray_code_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem89
diff --git a/problems/greatest-common-divisor-of-strings/README.md b/problems/greatest-common-divisor-of-strings/README.md
deleted file mode 100644
index fdacf33b8..000000000
--- a/problems/greatest-common-divisor-of-strings/README.md
+++ /dev/null
@@ -1,52 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../product-sales-analysis-iii "Product Sales Analysis III")
-
-[Next >](../flip-columns-for-maximum-number-of-equal-rows "Flip Columns For Maximum Number of Equal Rows")
-
-## [1071. Greatest Common Divisor of Strings (Easy)](https://leetcode.com/problems/greatest-common-divisor-of-strings "字符串的最大公因子")
-
-
For two strings s and t, we say "t divides s" if and only if s = t + ... + t (t concatenated with itself 1 or more times)
-
-
Given two strings str1 and str2, return the largest string x such that x divides both str1 and str2.
str1 and str2 consist of English uppercase letters.
-
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Similar Questions
- 1. [Find Greatest Common Divisor of Array](../find-greatest-common-divisor-of-array) (Easy)
-
-### Hints
-
-Hint 1
-The greatest common divisor must be a prefix of each string, so we can try all prefixes.
-
diff --git a/problems/greatest-common-divisor-of-strings/greatest_common_divisor_of_strings.go b/problems/greatest-common-divisor-of-strings/greatest_common_divisor_of_strings.go
deleted file mode 100644
index f22da6cbd..000000000
--- a/problems/greatest-common-divisor-of-strings/greatest_common_divisor_of_strings.go
+++ /dev/null
@@ -1,17 +0,0 @@
-package problem1071
-
-func gcdOfStrings(str1 string, str2 string) string {
- if str1+str2 != str2+str1 {
- return ""
- }
- return str1[:gcd(len(str1), len(str2))]
-}
-
-// 最大公约数(Greatest Common Divisor)缩写为GCD
-// 辗转相除法
-func gcd(a, b int) int {
- if b == 0 {
- return a
- }
- return gcd(b, a%b)
-}
diff --git a/problems/greatest-common-divisor-of-strings/greatest_common_divisor_of_strings_test.go b/problems/greatest-common-divisor-of-strings/greatest_common_divisor_of_strings_test.go
deleted file mode 100644
index 75fe7869c..000000000
--- a/problems/greatest-common-divisor-of-strings/greatest_common_divisor_of_strings_test.go
+++ /dev/null
@@ -1,35 +0,0 @@
-package problem1071
-
-import "testing"
-
-type testType struct {
- str1 string
- str2 string
- want string
-}
-
-func TestGcdOfStrings(t *testing.T) {
- tests := [...]testType{
- {
- str1: "ABCABC",
- str2: "ABC",
- want: "ABC",
- },
- {
- str1: "ABABAB",
- str2: "ABAB",
- want: "AB",
- },
- {
- str1: "LEET",
- str2: "CODE",
- want: "",
- },
- }
- for _, tt := range tests {
- got := gcdOfStrings(tt.str1, tt.str2)
- if got != tt.want {
- t.Fatalf("in: %v, got: %v, want: %v", tt.str1, got, tt.want)
- }
- }
-}
diff --git a/problems/greatest-sum-divisible-by-three/README.md b/problems/greatest-sum-divisible-by-three/README.md
deleted file mode 100644
index 5e1039e36..000000000
--- a/problems/greatest-sum-divisible-by-three/README.md
+++ /dev/null
@@ -1,60 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../find-elements-in-a-contaminated-binary-tree "Find Elements in a Contaminated Binary Tree")
-
-[Next >](../minimum-moves-to-move-a-box-to-their-target-location "Minimum Moves to Move a Box to Their Target Location")
-
-## [1262. Greatest Sum Divisible by Three (Medium)](https://leetcode.com/problems/greatest-sum-divisible-by-three "可被三整除的最大和")
-
-
Given an array nums of integers, we need to find the maximum possible sum of elements of the array such that it is divisible by three.
-
-
-
-
-
-
Example 1:
-
-
-Input: nums = [3,6,5,1,8]
-Output: 18
-Explanation: Pick numbers 3, 6, 1 and 8 their sum is 18 (maximum sum divisible by 3).
-
-
Example 2:
-
-
-Input: nums = [4]
-Output: 0
-Explanation: Since 4 is not divisible by 3, do not pick any number.
-
-
-
Example 3:
-
-
-Input: nums = [1,2,3,4,4]
-Output: 12
-Explanation: Pick numbers 1, 3, 4 and 4 their sum is 12 (maximum sum divisible by 3).
-
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 4 * 10^4
-
1 <= nums[i] <= 10^4
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Greedy](../../tag/greedy/README.md)]
-
-### Hints
-
-Hint 1
-Represent the state as DP[pos][mod]: maximum possible sum starting in the position "pos" in the array where the current sum modulo 3 is equal to mod.
-
diff --git a/problems/grid-game/README.md b/problems/grid-game/README.md
deleted file mode 100644
index a18819ded..000000000
--- a/problems/grid-game/README.md
+++ /dev/null
@@ -1,77 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-difference-between-increasing-elements "Maximum Difference Between Increasing Elements")
-
-[Next >](../check-if-word-can-be-placed-in-crossword "Check if Word Can Be Placed In Crossword")
-
-## [2017. Grid Game (Medium)](https://leetcode.com/problems/grid-game "网格游戏")
-
-
You are given a 0-indexed 2D array grid of size 2 x n, where grid[r][c] represents the number of points at position (r, c) on the matrix. Two robots are playing a game on this matrix.
-
-
Both robots initially start at (0, 0) and want to reach (1, n-1). Each robot may only move to the right ((r, c) to (r, c + 1)) or down ((r, c) to (r + 1, c)).
-
-
At the start of the game, the first robot moves from (0, 0) to (1, n-1), collecting all the points from the cells on its path. For all cells (r, c) traversed on the path, grid[r][c] is set to 0. Then, the second robot moves from (0, 0) to (1, n-1), collecting the points on its path. Note that their paths may intersect with one another.
-
-
The first robot wants to minimize the number of points collected by the second robot. In contrast, the second robot wants to maximize the number of points it collects. If both robots play optimally, return the number of points collected by the second robot.
-
-
-
Example 1:
-
-
-Input: grid = [[2,5,4],[1,5,1]]
-Output: 4
-Explanation: The optimal path taken by the first robot is shown in red, and the optimal path taken by the second robot is shown in blue.
-The cells visited by the first robot are set to 0.
-The second robot will collect 0 + 0 + 4 + 0 = 4 points.
-
-
-
Example 2:
-
-
-Input: grid = [[3,3,1],[8,5,2]]
-Output: 4
-Explanation: The optimal path taken by the first robot is shown in red, and the optimal path taken by the second robot is shown in blue.
-The cells visited by the first robot are set to 0.
-The second robot will collect 0 + 3 + 1 + 0 = 4 points.
-
-
-
Example 3:
-
-
-Input: grid = [[1,3,1,15],[1,3,3,1]]
-Output: 7
-Explanation: The optimal path taken by the first robot is shown in red, and the optimal path taken by the second robot is shown in blue.
-The cells visited by the first robot are set to 0.
-The second robot will collect 0 + 1 + 3 + 3 + 0 = 7 points.
-
-
-
-
Constraints:
-
-
-
grid.length == 2
-
n == grid[r].length
-
1 <= n <= 5 * 104
-
1 <= grid[r][c] <= 105
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
- [[Prefix Sum](../../tag/prefix-sum/README.md)]
-
-### Hints
-
-Hint 1
-There are n choices for when the first robot moves to the second row.
-
-
-
-Hint 2
-Can we use prefix sums to help solve this problem?
-
diff --git a/problems/grid-illumination/README.md b/problems/grid-illumination/README.md
deleted file mode 100644
index d0d90ef95..000000000
--- a/problems/grid-illumination/README.md
+++ /dev/null
@@ -1,69 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-cost-to-merge-stones "Minimum Cost to Merge Stones")
-
-[Next >](../find-common-characters "Find Common Characters")
-
-## [1001. Grid Illumination (Hard)](https://leetcode.com/problems/grid-illumination "网格照明")
-
-
There is a 2D grid of size n x n where each cell of this grid has a lamp that is initially turned off.
-
-
You are given a 2D array of lamp positions lamps, where lamps[i] = [rowi, coli] indicates that the lamp at grid[rowi][coli] is turned on. Even if the same lamp is listed more than once, it is turned on.
-
-
When a lamp is turned on, it illuminates its cell and all other cells in the same row, column, or diagonal.
-
-
You are also given another 2D array queries, where queries[j] = [rowj, colj]. For the jth query, determine whether grid[rowj][colj] is illuminated or not. After answering the jth query, turn off the lamp at grid[rowj][colj] and its 8 adjacent lamps if they exist. A lamp is adjacent if its cell shares either a side or corner with grid[rowj][colj].
-
-
Return an array of integers ans, where ans[j] should be 1 if the cell in the jth query was illuminated, or 0 if the lamp was not.
-
-
-
Example 1:
-
-
-Input: n = 5, lamps = [[0,0],[4,4]], queries = [[1,1],[1,0]]
-Output: [1,0]
-Explanation: We have the initial grid with all lamps turned off. In the above picture we see the grid after turning on the lamp at grid[0][0] then turning on the lamp at grid[4][4].
-The 0th query asks if the lamp at grid[1][1] is illuminated or not (the blue square). It is illuminated, so set ans[0] = 1. Then, we turn off all lamps in the red square.
-
-The 1st query asks if the lamp at grid[1][0] is illuminated or not (the blue square). It is not illuminated, so set ans[1] = 0. Then, we turn off all lamps in the red rectangle.
-
-
-
-### Related Topics
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Similar Questions
- 1. [Valid Anagram](../valid-anagram) (Easy)
- 1. [Group Shifted Strings](../group-shifted-strings) (Medium)
diff --git a/problems/group-anagrams/group_anagrams.go b/problems/group-anagrams/group_anagrams.go
deleted file mode 100644
index ae0679d48..000000000
--- a/problems/group-anagrams/group_anagrams.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem49
diff --git a/problems/group-anagrams/group_anagrams_test.go b/problems/group-anagrams/group_anagrams_test.go
deleted file mode 100644
index ae0679d48..000000000
--- a/problems/group-anagrams/group_anagrams_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem49
diff --git a/problems/group-employees-of-the-same-salary/README.md b/problems/group-employees-of-the-same-salary/README.md
deleted file mode 100644
index 0b2f7fc0a..000000000
--- a/problems/group-employees-of-the-same-salary/README.md
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimize-product-sum-of-two-arrays "Minimize Product Sum of Two Arrays")
-
-[Next >](../substrings-of-size-three-with-distinct-characters "Substrings of Size Three with Distinct Characters")
-
-## [1875. Group Employees of the Same Salary (Medium)](https://leetcode.com/problems/group-employees-of-the-same-salary "将工资相同的雇员分组")
-
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/group-employees-of-the-same-salary/mysql_schemas.sql b/problems/group-employees-of-the-same-salary/mysql_schemas.sql
deleted file mode 100644
index 9a2f41471..000000000
--- a/problems/group-employees-of-the-same-salary/mysql_schemas.sql
+++ /dev/null
@@ -1,7 +0,0 @@
-Create table If Not Exists Employees (employee_id int, name varchar(30), salary int);
-Truncate table Employees;
-insert into Employees (employee_id, name, salary) values ('2', 'Meir', '3000');
-insert into Employees (employee_id, name, salary) values ('3', 'Michael', '3000');
-insert into Employees (employee_id, name, salary) values ('7', 'Addilyn', '7400');
-insert into Employees (employee_id, name, salary) values ('8', 'Juan', '6100');
-insert into Employees (employee_id, name, salary) values ('9', 'Kannon', '7400');
diff --git a/problems/group-shifted-strings/README.md b/problems/group-shifted-strings/README.md
deleted file mode 100644
index 1c029e1c7..000000000
--- a/problems/group-shifted-strings/README.md
+++ /dev/null
@@ -1,40 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../strobogrammatic-number-iii "Strobogrammatic Number III")
-
-[Next >](../count-univalue-subtrees "Count Univalue Subtrees")
-
-## [249. Group Shifted Strings (Medium)](https://leetcode.com/problems/group-shifted-strings "移位字符串分组")
-
-
Given a string, we can "shift" each of its letter to its successive letter, for example: "abc" -> "bcd". We can keep "shifting" which forms the sequence:
-
-
-"abc" -> "bcd" -> ... -> "xyz"
-
-
Given a list of strings which contains only lowercase alphabets, group all strings that belong to the same shifting sequence.
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Similar Questions
- 1. [Group Anagrams](../group-anagrams) (Medium)
diff --git a/problems/group-shifted-strings/group_shifted_strings.go b/problems/group-shifted-strings/group_shifted_strings.go
deleted file mode 100644
index 9731cd966..000000000
--- a/problems/group-shifted-strings/group_shifted_strings.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem249
diff --git a/problems/group-shifted-strings/group_shifted_strings_test.go b/problems/group-shifted-strings/group_shifted_strings_test.go
deleted file mode 100644
index 9731cd966..000000000
--- a/problems/group-shifted-strings/group_shifted_strings_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem249
diff --git a/problems/group-sold-products-by-the-date/README.md b/problems/group-sold-products-by-the-date/README.md
deleted file mode 100644
index 6722eb2d8..000000000
--- a/problems/group-sold-products-by-the-date/README.md
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../kth-ancestor-of-a-tree-node "Kth Ancestor of a Tree Node")
-
-[Next >](../clone-binary-tree-with-random-pointer "Clone Binary Tree With Random Pointer")
-
-## [1484. Group Sold Products By The Date (Easy)](https://leetcode.com/problems/group-sold-products-by-the-date "按日期分组销售产品")
-
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/group-sold-products-by-the-date/mysql_schemas.sql b/problems/group-sold-products-by-the-date/mysql_schemas.sql
deleted file mode 100644
index bf1f0a1b3..000000000
--- a/problems/group-sold-products-by-the-date/mysql_schemas.sql
+++ /dev/null
@@ -1,9 +0,0 @@
-Create table If Not Exists Activities (sell_date date, product varchar(20));
-Truncate table Activities;
-insert into Activities (sell_date, product) values ('2020-05-30', 'Headphone');
-insert into Activities (sell_date, product) values ('2020-06-01', 'Pencil');
-insert into Activities (sell_date, product) values ('2020-06-02', 'Mask');
-insert into Activities (sell_date, product) values ('2020-05-30', 'Basketball');
-insert into Activities (sell_date, product) values ('2020-06-01', 'Bible');
-insert into Activities (sell_date, product) values ('2020-06-02', 'Mask');
-insert into Activities (sell_date, product) values ('2020-05-30', 'T-Shirt');
diff --git a/problems/group-the-people-given-the-group-size-they-belong-to/README.md b/problems/group-the-people-given-the-group-size-they-belong-to/README.md
deleted file mode 100644
index dba3a9ead..000000000
--- a/problems/group-the-people-given-the-group-size-they-belong-to/README.md
+++ /dev/null
@@ -1,64 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../subtract-the-product-and-sum-of-digits-of-an-integer "Subtract the Product and Sum of Digits of an Integer")
-
-[Next >](../find-the-smallest-divisor-given-a-threshold "Find the Smallest Divisor Given a Threshold")
-
-## [1282. Group the People Given the Group Size They Belong To (Medium)](https://leetcode.com/problems/group-the-people-given-the-group-size-they-belong-to "用户分组")
-
-
There are n people that are split into some unknown number of groups. Each person is labeled with a unique ID from 0 to n - 1.
-
-
You are given an integer array groupSizes, where groupSizes[i] is the size of the group that person i is in. For example, if groupSizes[1] = 3, then person 1 must be in a group of size 3.
-
-
Return a list of groups such that each person i is in a group of size groupSizes[i].
-
-
Each person should appear in exactly one group, and every person must be in a group. If there are multiple answers, return any of them. It is guaranteed that there will be at least one valid solution for the given input.
-
-
-
Example 1:
-
-
-Input: groupSizes = [3,3,3,3,3,1,3]
-Output: [[5],[0,1,2],[3,4,6]]
-Explanation:
-The first group is [5]. The size is 1, and groupSizes[5] = 1.
-The second group is [0,1,2]. The size is 3, and groupSizes[0] = groupSizes[1] = groupSizes[2] = 3.
-The third group is [3,4,6]. The size is 3, and groupSizes[3] = groupSizes[4] = groupSizes[6] = 3.
-Other possible solutions are [[2,1,6],[5],[0,4,3]] and [[5],[0,6,2],[4,3,1]].
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
-
-### Hints
-
-Hint 1
-Put people's IDs with same groupSize into buckets, then split each bucket into groups.
-
-
-
-Hint 2
-Greedy fill until you need a new group.
-
diff --git a/problems/groups-of-special-equivalent-strings/README.md b/problems/groups-of-special-equivalent-strings/README.md
deleted file mode 100644
index e4a7bbf4f..000000000
--- a/problems/groups-of-special-equivalent-strings/README.md
+++ /dev/null
@@ -1,65 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../surface-area-of-3d-shapes "Surface Area of 3D Shapes")
-
-[Next >](../all-possible-full-binary-trees "All Possible Full Binary Trees")
-
-## [893. Groups of Special-Equivalent Strings (Medium)](https://leetcode.com/problems/groups-of-special-equivalent-strings "特殊等价字符串组")
-
-
You are given an array of strings of the same length words.
-
-
In one move, you can swap any two even indexed characters or any two odd indexed characters of a string words[i].
-
-
Two strings words[i] and words[j] are special-equivalent if after any number of moves, words[i] == words[j].
-
-
-
For example, words[i] = "zzxy" and words[j] = "xyzz" are special-equivalent because we may make the moves "zzxy" -> "xzzy" -> "xyzz".
-
-
-
A group of special-equivalent strings from words is a non-empty subset of words such that:
-
-
-
Every pair of strings in the group are special equivalent, and
-
The group is the largest size possible (i.e., there is not a string words[i] not in the group such that words[i] is special-equivalent to every string in the group).
-
-
-
Return the number of groups of special-equivalent strings from words.
-
-
-
Example 1:
-
-
-Input: words = ["abcd","cdab","cbad","xyzz","zzxy","zzyx"]
-Output: 3
-Explanation:
-One group is ["abcd", "cdab", "cbad"], since they are all pairwise special equivalent, and none of the other strings is all pairwise special equivalent to these.
-The other two groups are ["xyzz", "zzxy"] and ["zzyx"].
-Note that in particular, "zzxy" is not special equivalent to "zzyx".
-
-
-
Example 2:
-
-
-Input: words = ["abc","acb","bac","bca","cab","cba"]
-Output: 3
-
-
-
-
Constraints:
-
-
-
1 <= words.length <= 1000
-
1 <= words[i].length <= 20
-
words[i] consist of lowercase English letters.
-
All the strings are of the same length.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
diff --git a/problems/groups-of-special-equivalent-strings/groups_of_special_equivalent_strings.go b/problems/groups-of-special-equivalent-strings/groups_of_special_equivalent_strings.go
deleted file mode 100644
index f047c1d21..000000000
--- a/problems/groups-of-special-equivalent-strings/groups_of_special_equivalent_strings.go
+++ /dev/null
@@ -1,13 +0,0 @@
-package problem893
-
-func numSpecialEquivGroups(A []string) int {
- m := make(map[[52]int]bool)
- for _, s := range A {
- var count [52]int
- for i, char := range s {
- count[int(char)-'a'+26*(i%2)]++
- }
- m[count] = true
- }
- return len(m)
-}
diff --git a/problems/groups-of-special-equivalent-strings/groups_of_special_equivalent_strings_test.go b/problems/groups-of-special-equivalent-strings/groups_of_special_equivalent_strings_test.go
deleted file mode 100644
index be141f771..000000000
--- a/problems/groups-of-special-equivalent-strings/groups_of_special_equivalent_strings_test.go
+++ /dev/null
@@ -1,35 +0,0 @@
-package problem893
-
-import "testing"
-
-type testType struct {
- in []string
- want int
-}
-
-func TestNumSpecialEquivGroups(t *testing.T) {
- tests := [...]testType{
- {
- in: []string{"a", "b", "c", "a", "c", "c"},
- want: 3,
- },
- {
- in: []string{"aa", "bb", "ab", "ba"},
- want: 4,
- },
- {
- in: []string{"abc", "acb", "bac", "bca", "cab", "cba"},
- want: 3,
- },
- {
- in: []string{"abcd", "cdab", "adcb", "cbad"},
- want: 1,
- },
- }
- for _, tt := range tests {
- got := numSpecialEquivGroups(tt.in)
- if got != tt.want {
- t.Fatalf("in: %v, got: %v, want: %v", tt.in, got, tt.want)
- }
- }
-}
diff --git a/problems/groups-of-strings/README.md b/problems/groups-of-strings/README.md
deleted file mode 100644
index 0cc7e7afb..000000000
--- a/problems/groups-of-strings/README.md
+++ /dev/null
@@ -1,96 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../find-substring-with-given-hash-value "Find Substring With Given Hash Value")
-
-[Next >](../amount-of-new-area-painted-each-day "Amount of New Area Painted Each Day")
-
-## [2157. Groups of Strings (Hard)](https://leetcode.com/problems/groups-of-strings "字符串分组")
-
-
You are given a 0-indexed array of strings words. Each string consists of lowercase English letters only. No letter occurs more than once in any string of words.
-
-
Two strings s1 and s2 are said to be connected if the set of letters of s2 can be obtained from the set of letters of s1 by any one of the following operations:
-
-
-
Adding exactly one letter to the set of the letters of s1.
-
Deleting exactly one letter from the set of the letters of s1.
-
Replacing exactly one letter from the set of the letters of s1 with any letter, including itself.
-
-
-
The array words can be divided into one or more non-intersecting groups. A string belongs to a group if any one of the following is true:
-
-
-
It is connected to at least one other string of the group.
-
It is the only string present in the group.
-
-
-
Note that the strings in words should be grouped in such a manner that a string belonging to a group cannot be connected to a string present in any other group. It can be proved that such an arrangement is always unique.
-
-
Return an arrayansof size2where:
-
-
-
ans[0]is the maximum number of groupswordscan be divided into, and
-
ans[1]is the size of the largest group.
-
-
-
-
Example 1:
-
-
-Input: words = ["a","b","ab","cde"]
-Output: [2,3]
-Explanation:
-- words[0] can be used to obtain words[1] (by replacing 'a' with 'b'), and words[2] (by adding 'b'). So words[0] is connected to words[1] and words[2].
-- words[1] can be used to obtain words[0] (by replacing 'b' with 'a'), and words[2] (by adding 'a'). So words[1] is connected to words[0] and words[2].
-- words[2] can be used to obtain words[0] (by deleting 'b'), and words[1] (by deleting 'a'). So words[2] is connected to words[0] and words[1].
-- words[3] is not connected to any string in words.
-Thus, words can be divided into 2 groups ["a","b","ab"] and ["cde"]. The size of the largest group is 3.
-
-
-
Example 2:
-
-
-Input: words = ["a","ab","abc"]
-Output: [1,3]
-Explanation:
-- words[0] is connected to words[1].
-- words[1] is connected to words[0] and words[2].
-- words[2] is connected to words[1].
-Since all strings are connected to each other, they should be grouped together.
-Thus, the size of the largest group is 3.
-
-
-
-
Constraints:
-
-
-
1 <= words.length <= 2 * 104
-
1 <= words[i].length <= 26
-
words[i] consists of lowercase English letters only.
-
No letter occurs more than once in words[i].
-
-
-### Related Topics
- [[Bit Manipulation](../../tag/bit-manipulation/README.md)]
- [[Union Find](../../tag/union-find/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Hints
-
-Hint 1
-Can we build a graph from words, where there exists an edge between nodes i and j if words[i] and words[j] are connected?
-
-
-
-Hint 2
-The problem now boils down to finding the total number of components and the size of the largest component in the graph.
-
-
-
-Hint 3
-How can we use bit masking to reduce the search space while adding edges to node i?
-
diff --git a/problems/grumpy-bookstore-owner/README.md b/problems/grumpy-bookstore-owner/README.md
deleted file mode 100644
index 046dc245c..000000000
--- a/problems/grumpy-bookstore-owner/README.md
+++ /dev/null
@@ -1,59 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../height-checker "Height Checker")
-
-[Next >](../previous-permutation-with-one-swap "Previous Permutation With One Swap")
-
-## [1052. Grumpy Bookstore Owner (Medium)](https://leetcode.com/problems/grumpy-bookstore-owner "爱生气的书店老板")
-
-
There is a bookstore owner that has a store open for n minutes. Every minute, some number of customers enter the store. You are given an integer array customers of length n where customers[i] is the number of the customer that enters the store at the start of the ith minute and all those customers leave after the end of that minute.
-
-
On some minutes, the bookstore owner is grumpy. You are given a binary array grumpy where grumpy[i] is 1 if the bookstore owner is grumpy during the ith minute, and is 0 otherwise.
-
-
When the bookstore owner is grumpy, the customers of that minute are not satisfied, otherwise, they are satisfied.
-
-
The bookstore owner knows a secret technique to keep themselves not grumpy for minutes consecutive minutes, but can only use it once.
-
-
Return the maximum number of customers that can be satisfied throughout the day.
-
-
-
Example 1:
-
-
-Input: customers = [1,0,1,2,1,1,7,5], grumpy = [0,1,0,1,0,1,0,1], minutes = 3
-Output: 16
-Explanation: The bookstore owner keeps themselves not grumpy for the last 3 minutes.
-The maximum number of customers that can be satisfied = 1 + 1 + 1 + 1 + 7 + 5 = 16.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Sliding Window](../../tag/sliding-window/README.md)]
-
-### Hints
-
-Hint 1
-Say the store owner uses their power in minute 1 to X and we have some answer A. If they instead use their power from minute 2 to X+1, we only have to use data from minutes 1, 2, X and X+1 to update our answer A.
-
diff --git a/problems/grumpy-bookstore-owner/grumpy_bookstore_owner.go b/problems/grumpy-bookstore-owner/grumpy_bookstore_owner.go
deleted file mode 100644
index 6e992ad52..000000000
--- a/problems/grumpy-bookstore-owner/grumpy_bookstore_owner.go
+++ /dev/null
@@ -1,25 +0,0 @@
-package problem1052
-
-func maxSatisfied(customers []int, grumpy []int, X int) int {
- n := len(customers)
- satisfied, dis, maxDis := 0, 0, 0
- for i := 0; i < n; i++ {
- satisfied += customers[i] * (1 - grumpy[i])
- dis += customers[i] * grumpy[i]
- if i-X >= 0 {
- // NOTICE: len(A[i-X+1:i+1]) = X
- // for keeping dis's length is X
- // subscrip A[i-X]*grumpy[i-X]
- dis -= customers[i-X] * grumpy[i-X]
- }
- maxDis = max(maxDis, dis)
- }
- return satisfied + maxDis
-}
-
-func max(a, b int) int {
- if a > b {
- return a
- }
- return b
-}
diff --git a/problems/guess-number-higher-or-lower-ii/README.md b/problems/guess-number-higher-or-lower-ii/README.md
deleted file mode 100644
index 26a48172e..000000000
--- a/problems/guess-number-higher-or-lower-ii/README.md
+++ /dev/null
@@ -1,113 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../guess-number-higher-or-lower "Guess Number Higher or Lower")
-
-[Next >](../wiggle-subsequence "Wiggle Subsequence")
-
-## [375. Guess Number Higher or Lower II (Medium)](https://leetcode.com/problems/guess-number-higher-or-lower-ii "猜数字大小 II")
-
-
We are playing the Guessing Game. The game will work as follows:
-
-
-
I pick a number between 1 and n.
-
You guess a number.
-
If you guess the right number, you win the game.
-
If you guess the wrong number, then I will tell you whether the number I picked is higher or lower, and you will continue guessing.
-
Every time you guess a wrong number x, you will pay x dollars. If you run out of money, you lose the game.
-
-
-
Given a particular n, return the minimum amount of money you need to guarantee a win regardless of what number I pick.
-
-
-
Example 1:
-
-
-Input: n = 10
-Output: 16
-Explanation: The winning strategy is as follows:
-- The range is [1,10]. Guess 7.
- - If this is my number, your total is $0. Otherwise, you pay $7.
- - If my number is higher, the range is [8,10]. Guess 9.
- - If this is my number, your total is $7. Otherwise, you pay $9.
- - If my number is higher, it must be 10. Guess 10. Your total is $7 + $9 = $16.
- - If my number is lower, it must be 8. Guess 8. Your total is $7 + $9 = $16.
- - If my number is lower, the range is [1,6]. Guess 3.
- - If this is my number, your total is $7. Otherwise, you pay $3.
- - If my number is higher, the range is [4,6]. Guess 5.
- - If this is my number, your total is $7 + $3 = $10. Otherwise, you pay $5.
- - If my number is higher, it must be 6. Guess 6. Your total is $7 + $3 + $5 = $15.
- - If my number is lower, it must be 4. Guess 4. Your total is $7 + $3 + $5 = $15.
- - If my number is lower, the range is [1,2]. Guess 1.
- - If this is my number, your total is $7 + $3 = $10. Otherwise, you pay $1.
- - If my number is higher, it must be 2. Guess 2. Your total is $7 + $3 + $1 = $11.
-The worst case in all these scenarios is that you pay $16. Hence, you only need $16 to guarantee a win.
-
-
-
Example 2:
-
-
-Input: n = 1
-Output: 0
-Explanation: There is only one possible number, so you can guess 1 and not have to pay anything.
-
-
-
Example 3:
-
-
-Input: n = 2
-Output: 1
-Explanation: There are two possible numbers, 1 and 2.
-- Guess 1.
- - If this is my number, your total is $0. Otherwise, you pay $1.
- - If my number is higher, it must be 2. Guess 2. Your total is $1.
-The worst case is that you pay $1.
-
-
-
-
Constraints:
-
-
-
1 <= n <= 200
-
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Game Theory](../../tag/game-theory/README.md)]
-
-### Similar Questions
- 1. [Flip Game II](../flip-game-ii) (Medium)
- 1. [Guess Number Higher or Lower](../guess-number-higher-or-lower) (Easy)
- 1. [Can I Win](../can-i-win) (Medium)
- 1. [Find K Closest Elements](../find-k-closest-elements) (Medium)
-
-### Hints
-
-Hint 1
-The best strategy to play the game is to minimize the maximum loss you could possibly face. Another strategy is to minimize the expected loss. Here, we are interested in the first scenario.
-
-
-
-Hint 2
-Take a small example (n = 3). What do you end up paying in the worst case?
-
-
-
-Hint 3
-Check out this article if you're still stuck.
-
-
-
-Hint 4
-The purely recursive implementation of minimax would be worthless for even a small n. You MUST use dynamic programming.
-
-
-
-Hint 5
-As a follow-up, how would you modify your code to solve the problem of minimizing the expected loss, instead of the worst-case loss?
-
diff --git a/problems/guess-number-higher-or-lower-ii/guess_number_higher_or_lower_ii.go b/problems/guess-number-higher-or-lower-ii/guess_number_higher_or_lower_ii.go
deleted file mode 100644
index ba6bfd79f..000000000
--- a/problems/guess-number-higher-or-lower-ii/guess_number_higher_or_lower_ii.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem375
diff --git a/problems/guess-number-higher-or-lower-ii/guess_number_higher_or_lower_ii_test.go b/problems/guess-number-higher-or-lower-ii/guess_number_higher_or_lower_ii_test.go
deleted file mode 100644
index ba6bfd79f..000000000
--- a/problems/guess-number-higher-or-lower-ii/guess_number_higher_or_lower_ii_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem375
diff --git a/problems/guess-number-higher-or-lower/README.md b/problems/guess-number-higher-or-lower/README.md
deleted file mode 100644
index 52aa4fcb3..000000000
--- a/problems/guess-number-higher-or-lower/README.md
+++ /dev/null
@@ -1,67 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../find-k-pairs-with-smallest-sums "Find K Pairs with Smallest Sums")
-
-[Next >](../guess-number-higher-or-lower-ii "Guess Number Higher or Lower II")
-
-## [374. Guess Number Higher or Lower (Easy)](https://leetcode.com/problems/guess-number-higher-or-lower "猜数字大小")
-
-
We are playing the Guess Game. The game is as follows:
-
-
I pick a number from 1 to n. You have to guess which number I picked.
-
-
Every time you guess wrong, I will tell you whether the number I picked is higher or lower than your guess.
-
-
You call a pre-defined API int guess(int num), which returns three possible results:
-
-
-
-1: Your guess is higher than the number I picked (i.e. num > pick).
-
1: Your guess is lower than the number I picked (i.e. num < pick).
-
0: your guess is equal to the number I picked (i.e. num == pick).
-
-
-
Return the number that I picked.
-
-
-
Example 1:
-
-
-Input: n = 10, pick = 6
-Output: 6
-
-
-
Example 2:
-
-
-Input: n = 1, pick = 1
-Output: 1
-
-
-
Example 3:
-
-
-Input: n = 2, pick = 1
-Output: 1
-
-
-
-
Constraints:
-
-
-
1 <= n <= 231 - 1
-
1 <= pick <= n
-
-
-### Related Topics
- [[Binary Search](../../tag/binary-search/README.md)]
- [[Interactive](../../tag/interactive/README.md)]
-
-### Similar Questions
- 1. [First Bad Version](../first-bad-version) (Easy)
- 1. [Guess Number Higher or Lower II](../guess-number-higher-or-lower-ii) (Medium)
- 1. [Find K Closest Elements](../find-k-closest-elements) (Medium)
diff --git a/problems/guess-number-higher-or-lower/guess_number_higher_or_lower.go b/problems/guess-number-higher-or-lower/guess_number_higher_or_lower.go
deleted file mode 100644
index 4bed9a8ed..000000000
--- a/problems/guess-number-higher-or-lower/guess_number_higher_or_lower.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem374
diff --git a/problems/guess-number-higher-or-lower/guess_number_higher_or_lower.py b/problems/guess-number-higher-or-lower/guess_number_higher_or_lower.py
deleted file mode 100755
index 11f2af6c6..000000000
--- a/problems/guess-number-higher-or-lower/guess_number_higher_or_lower.py
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/usr/bin/env python
-
-# The guess API is already defined for you.
-# @param num, your guess
-# @return -1 if my number is lower, 1 if my number is higher, otherwise return 0
-# def guess(num):
-
-class Solution(object):
- def guessNumber(self, n):
- """
- :type n: int
- :rtype: int
- """
-
\ No newline at end of file
diff --git a/problems/guess-number-higher-or-lower/guess_number_higher_or_lower_test.go b/problems/guess-number-higher-or-lower/guess_number_higher_or_lower_test.go
deleted file mode 100644
index 4bed9a8ed..000000000
--- a/problems/guess-number-higher-or-lower/guess_number_higher_or_lower_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem374
diff --git a/problems/guess-the-majority-in-a-hidden-array/README.md b/problems/guess-the-majority-in-a-hidden-array/README.md
deleted file mode 100644
index 633b3be7d..000000000
--- a/problems/guess-the-majority-in-a-hidden-array/README.md
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../get-the-maximum-score "Get the Maximum Score")
-
-[Next >](../kth-missing-positive-number "Kth Missing Positive Number")
-
-## [1538. Guess the Majority in a Hidden Array (Medium)](https://leetcode.com/problems/guess-the-majority-in-a-hidden-array "找出隐藏数组中出现次数最多的元素")
-
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Math](../../tag/math/README.md)]
- [[Interactive](../../tag/interactive/README.md)]
-
-### Hints
-
-Hint 1
-If you find that 2 indexes in the array (id1, id2) have the same value (nums [id1] == nums [id2]), you could infer the values of (x, y) based on the results of query (id1, id2, x, y).
-
diff --git a/problems/guess-the-word/README.md b/problems/guess-the-word/README.md
deleted file mode 100644
index 97fb5c1ad..000000000
--- a/problems/guess-the-word/README.md
+++ /dev/null
@@ -1,63 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../split-array-into-fibonacci-sequence "Split Array into Fibonacci Sequence")
-
-[Next >](../backspace-string-compare "Backspace String Compare")
-
-## [843. Guess the Word (Hard)](https://leetcode.com/problems/guess-the-word "猜猜这个单词")
-
-
This is an interactive problem.
-
-
You are given an array of unique strings wordlist where wordlist[i] is 6 letters long, and one word in this list is chosen as secret.
-
-
You may call Master.guess(word) to guess a word. The guessed word should have type string and must be from the original list with 6 lowercase letters.
-
-
This function returns an integer type, representing the number of exact matches (value and position) of your guess to the secret word. Also, if your guess is not in the given wordlist, it will return -1 instead.
-
-
For each test case, you have exactly 10 guesses to guess the word. At the end of any number of calls, if you have made 10 or fewer calls to Master.guess and at least one of these guesses was secret, then you pass the test case.
-
-
-
Example 1:
-
-
-Input: secret = "acckzz", wordlist = ["acckzz","ccbazz","eiowzz","abcczz"], numguesses = 10
-Output: You guessed the secret word correctly.
-Explanation:
-master.guess("aaaaaa") returns -1, because "aaaaaa" is not in wordlist.
-master.guess("acckzz") returns 6, because "acckzz" is secret and has all 6 matches.
-master.guess("ccbazz") returns 3, because "ccbazz" has 3 matches.
-master.guess("eiowzz") returns 2, because "eiowzz" has 2 matches.
-master.guess("abcczz") returns 4, because "abcczz" has 4 matches.
-We made 5 calls to master.guess and one of them was the secret, so we pass the test case.
-
-
-
Example 2:
-
-
-Input: secret = "hamada", wordlist = ["hamada","khaled"], numguesses = 10
-Output: You guessed the secret word correctly.
-
Given an array of integers citations where citations[i] is the number of citations a researcher received for their ith paper and citations is sorted in an ascending order, return compute the researcher's h-index.
-
-
According to the definition of h-index on Wikipedia: A scientist has an index h if h of their n papers have at least h citations each, and the other n − h papers have no more than h citations each.
-
-
If there are several possible values for h, the maximum one is taken as the h-index.
-
-
You must write an algorithm that runs in logarithmic time.
-
-
-
Example 1:
-
-
-Input: citations = [0,1,3,5,6]
-Output: 3
-Explanation: [0,1,3,5,6] means the researcher has 5 papers in total and each of them had received 0, 1, 3, 5, 6 citations respectively.
-Since the researcher has 3 papers with at least 3 citations each and the remaining two with no more than 3 citations each, their h-index is 3.
-
Given an array of integers citations where citations[i] is the number of citations a researcher received for their ith paper, return compute the researcher's h-index.
-
-
According to the definition of h-index on Wikipedia: A scientist has an index h if h of their n papers have at least h citations each, and the other n − h papers have no more than h citations each.
-
-
If there are several possible values for h, the maximum one is taken as the h-index.
-
-
-
Example 1:
-
-
-Input: citations = [3,0,6,1,5]
-Output: 3
-Explanation: [3,0,6,1,5] means the researcher has 5 papers in total and each of them had received 3, 0, 6, 1, 5 citations respectively.
-Since the researcher has 3 papers with at least 3 citations each and the remaining two with no more than 3 citations each, their h-index is 3.
-
-
-
Example 2:
-
-
-Input: citations = [1,3,1]
-Output: 1
-
-
-
-
Constraints:
-
-
-
n == citations.length
-
1 <= n <= 5000
-
0 <= citations[i] <= 1000
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Counting Sort](../../tag/counting-sort/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Similar Questions
- 1. [H-Index II](../h-index-ii) (Medium)
-
-### Hints
-
-Hint 1
-An easy approach is to sort the array first.
-
-
-
-Hint 2
-What are the possible values of h-index?
-
-
-
-Hint 3
-A faster approach is to use extra space.
-
diff --git a/problems/h-index/h_index.go b/problems/h-index/h_index.go
deleted file mode 100644
index cedc17adf..000000000
--- a/problems/h-index/h_index.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem274
diff --git a/problems/h-index/h_index_test.go b/problems/h-index/h_index_test.go
deleted file mode 100644
index cedc17adf..000000000
--- a/problems/h-index/h_index_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem274
diff --git a/problems/hamming-distance/README.md b/problems/hamming-distance/README.md
deleted file mode 100644
index 1e18c1f93..000000000
--- a/problems/hamming-distance/README.md
+++ /dev/null
@@ -1,50 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../lfu-cache "LFU Cache")
-
-[Next >](../minimum-moves-to-equal-array-elements-ii "Minimum Moves to Equal Array Elements II")
-
-## [461. Hamming Distance (Easy)](https://leetcode.com/problems/hamming-distance "汉明距离")
-
-
The Hamming distance between two integers is the number of positions at which the corresponding bits are different.
-
-
Given two integers x and y, return the Hamming distance between them.
-
-
-
Example 1:
-
-
-Input: x = 1, y = 4
-Output: 2
-Explanation:
-1 (0 0 0 1)
-4 (0 1 0 0)
- ↑ ↑
-The above arrows point to positions where the corresponding bits are different.
-
-
-
Example 2:
-
-
-Input: x = 3, y = 1
-Output: 1
-
-
-
-
Constraints:
-
-
-
0 <= x, y <= 231 - 1
-
-
-### Related Topics
- [[Bit Manipulation](../../tag/bit-manipulation/README.md)]
-
-### Similar Questions
- 1. [Number of 1 Bits](../number-of-1-bits) (Easy)
- 1. [Total Hamming Distance](../total-hamming-distance) (Medium)
diff --git a/problems/hamming-distance/hamming_distance.go b/problems/hamming-distance/hamming_distance.go
deleted file mode 100644
index 22b0e3f62..000000000
--- a/problems/hamming-distance/hamming_distance.go
+++ /dev/null
@@ -1,9 +0,0 @@
-package problem461
-
-func hammingDistance(x int, y int) int {
- ans, n := 0, x^y
- for n > 0 {
- ans, n = ans+1, n&(n-1)
- }
- return ans
-}
diff --git a/problems/hamming-distance/hamming_distance_test.go b/problems/hamming-distance/hamming_distance_test.go
deleted file mode 100644
index c932a0c13..000000000
--- a/problems/hamming-distance/hamming_distance_test.go
+++ /dev/null
@@ -1,25 +0,0 @@
-package problem461
-
-import "testing"
-
-type testType struct {
- x int
- y int
- want int
-}
-
-func TestHammingDistance(t *testing.T) {
- tests := [...]testType{
- {
- x: 1,
- y: 4,
- want: 2,
- },
- }
- for _, tt := range tests {
- got := hammingDistance(tt.x, tt.y)
- if got != tt.want {
- t.Fatalf("in: %v %v, got: %v, want: %v", tt.x, tt.y, got, tt.want)
- }
- }
-}
diff --git a/problems/hand-of-straights/README.md b/problems/hand-of-straights/README.md
deleted file mode 100644
index 676fad6b1..000000000
--- a/problems/hand-of-straights/README.md
+++ /dev/null
@@ -1,52 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../longest-mountain-in-array "Longest Mountain in Array")
-
-[Next >](../shortest-path-visiting-all-nodes "Shortest Path Visiting All Nodes")
-
-## [846. Hand of Straights (Medium)](https://leetcode.com/problems/hand-of-straights "一手顺子")
-
-
Alice has some number of cards and she wants to rearrange the cards into groups so that each group is of size groupSize, and consists of groupSize consecutive cards.
-
-
Given an integer array hand where hand[i] is the value written on the ith card and an integer groupSize, return true if she can rearrange the cards, or false otherwise.
-
-
-
Example 1:
-
-
-Input: hand = [1,2,3,6,2,3,4,7,8], groupSize = 3
-Output: true
-Explanation: Alice's hand can be rearranged as [1,2,3],[2,3,4],[6,7,8]
-
-
-
Example 2:
-
-
-Input: hand = [1,2,3,4,5], groupSize = 4
-Output: false
-Explanation: Alice's hand can not be rearranged into groups of 4.
-
-
You are given an even number of people num_people that stand around a circle and each person shakes hands with someone else, so that there are num_people / 2 handshakes total.
-
-
Return the number of ways these handshakes could occur such that none of the handshakes cross.
-
-
Since this number could be very big, return the answer mod 10^9 + 7
-
-
-
Example 1:
-
-
-Input: num_people = 2
-Output: 1
-
-
-
Example 2:
-
-
-
-
-Input: num_people = 4
-Output: 2
-Explanation: There are two ways to do it, the first way is [(1,2),(3,4)] and the second one is [(2,3),(4,1)].
-
-
-
Example 3:
-
-
-
-
-Input: num_people = 6
-Output: 5
-
-
-
Example 4:
-
-
-Input: num_people = 8
-Output: 14
-
-
-
-
Constraints:
-
-
-
2 <= num_people <= 1000
-
num_people % 2 == 0
-
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Hints
-
-Hint 1
-Use dynamic programming.
-
-
-
-Hint 2
-Let dp[n] be the number of ways that n people can handshake.
-
-
-
-Hint 3
-Then fix a person as a pivot and turn for every other person who will have a handshake, the answer is the sum of the products of the new two subproblems.
-
diff --git a/problems/happy-number/README.md b/problems/happy-number/README.md
deleted file mode 100644
index 3f683e060..000000000
--- a/problems/happy-number/README.md
+++ /dev/null
@@ -1,61 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../bitwise-and-of-numbers-range "Bitwise AND of Numbers Range")
-
-[Next >](../remove-linked-list-elements "Remove Linked List Elements")
-
-## [202. Happy Number (Easy)](https://leetcode.com/problems/happy-number "快乐数")
-
-
Write an algorithm to determine if a number n is happy.
-
-
A happy number is a number defined by the following process:
-
-
-
Starting with any positive integer, replace the number by the sum of the squares of its digits.
-
Repeat the process until the number equals 1 (where it will stay), or it loops endlessly in a cycle which does not include 1.
-
Those numbers for which this process ends in 1 are happy.
-
-### Related Topics
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Math](../../tag/math/README.md)]
- [[Two Pointers](../../tag/two-pointers/README.md)]
-
-### Similar Questions
- 1. [Linked List Cycle](../linked-list-cycle) (Easy)
- 1. [Add Digits](../add-digits) (Easy)
- 1. [Ugly Number](../ugly-number) (Easy)
diff --git a/problems/happy-number/happy_number.go b/problems/happy-number/happy_number.go
deleted file mode 100644
index 13d4265f9..000000000
--- a/problems/happy-number/happy_number.go
+++ /dev/null
@@ -1,16 +0,0 @@
-package problem202
-
-func isHappy(n int) bool {
- m := make(map[int]bool)
- for n != 1 && !m[n] {
- m[n] = true
- sum := 0
- for n > 0 {
- x := n % 10
- sum += x * x
- n /= 10
- }
- n = sum
- }
- return n == 1
-}
diff --git a/problems/happy-number/happy_number_test.go b/problems/happy-number/happy_number_test.go
deleted file mode 100644
index 4428de6d1..000000000
--- a/problems/happy-number/happy_number_test.go
+++ /dev/null
@@ -1,31 +0,0 @@
-package problem202
-
-import "testing"
-
-type testType struct {
- in int
- want bool
-}
-
-func TestIsHappy(t *testing.T) {
- tests := [...]testType{
- {
- in: 19,
- want: true,
- },
- {
- in: 1,
- want: true,
- },
- {
- in: 0,
- want: false,
- },
- }
- for _, tt := range tests {
- got := isHappy(tt.in)
- if got != tt.want {
- t.Fatalf("in: %v, got: %v, want: %v", tt.in, got, tt.want)
- }
- }
-}
diff --git a/problems/heaters/README.md b/problems/heaters/README.md
deleted file mode 100644
index ffacf380b..000000000
--- a/problems/heaters/README.md
+++ /dev/null
@@ -1,58 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../ones-and-zeroes "Ones and Zeroes")
-
-[Next >](../number-complement "Number Complement")
-
-## [475. Heaters (Medium)](https://leetcode.com/problems/heaters "供暖器")
-
-
Winter is coming! During the contest, your first job is to design a standard heater with a fixed warm radius to warm all the houses.
-
-
Every house can be warmed, as long as the house is within the heater's warm radius range.
-
-
Given the positions of houses and heaters on a horizontal line, return the minimum radius standard of heaters so that those heaters could cover all houses.
-
-
Notice that all the heaters follow your radius standard, and the warm radius will the same.
-
-
-
Example 1:
-
-
-Input: houses = [1,2,3], heaters = [2]
-Output: 1
-Explanation: The only heater was placed in the position 2, and if we use the radius 1 standard, then all the houses can be warmed.
-
-
-
Example 2:
-
-
-Input: houses = [1,2,3,4], heaters = [1,4]
-Output: 1
-Explanation: The two heater was placed in the position 1 and 4. We need to use radius 1 standard, then all the houses can be warmed.
-
A school is trying to take an annual photo of all the students. The students are asked to stand in a single file line in non-decreasing order by height. Let this ordering be represented by the integer array expected where expected[i] is the expected height of the ith student in line.
-
-
You are given an integer array heights representing the current order that the students are standing in. Each heights[i] is the height of the ith student in line (0-indexed).
-
-
Return the number of indices where heights[i] != expected[i].
-
-
-
Example 1:
-
-
-Input: heights = [1,1,4,2,1,3]
-Output: 3
-Explanation:
-heights: [1,1,4,2,1,3]
-expected: [1,1,1,2,3,4]
-Indices 2, 4, and 5 do not match.
-
-
-
Example 2:
-
-
-Input: heights = [5,1,2,3,4]
-Output: 5
-Explanation:
-heights: [5,1,2,3,4]
-expected: [1,2,3,4,5]
-All indices do not match.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Counting Sort](../../tag/counting-sort/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Hints
-
-Hint 1
-Build the correct order of heights by sorting another array, then compare the two arrays.
-
diff --git a/problems/height-checker/height_checker.go b/problems/height-checker/height_checker.go
deleted file mode 100644
index cb595ce4d..000000000
--- a/problems/height-checker/height_checker.go
+++ /dev/null
@@ -1,15 +0,0 @@
-package problem1051
-
-import "sort"
-
-func heightChecker(heights []int) int {
- ans, dst := 0, make([]int, len(heights))
- copy(dst, heights)
- sort.Ints(dst)
- for i, v := range dst {
- if heights[i] != v {
- ans++
- }
- }
- return ans
-}
diff --git a/problems/height-checker/height_checker_test.go b/problems/height-checker/height_checker_test.go
deleted file mode 100644
index d0461e31f..000000000
--- a/problems/height-checker/height_checker_test.go
+++ /dev/null
@@ -1,23 +0,0 @@
-package problem1051
-
-import "testing"
-
-type testType struct {
- in []int
- want int
-}
-
-func TestHeightChecker(t *testing.T) {
- tests := [...]testType{
- {
- in: []int{1, 1, 4, 2, 1, 3},
- want: 3,
- },
- }
- for _, tt := range tests {
- got := heightChecker(tt.in)
- if got != tt.want {
- t.Fatalf("in: %v, got: %v, want: %v", tt.in, got, tt.want)
- }
- }
-}
diff --git a/problems/hexspeak/README.md b/problems/hexspeak/README.md
deleted file mode 100644
index a1b971d22..000000000
--- a/problems/hexspeak/README.md
+++ /dev/null
@@ -1,61 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../all-people-report-to-the-given-manager "All People Report to the Given Manager")
-
-[Next >](../remove-interval "Remove Interval")
-
-## [1271. Hexspeak (Easy)](https://leetcode.com/problems/hexspeak "十六进制魔术数字")
-
-
A decimal number can be converted to its Hexspeak representation by first converting it to an uppercase hexadecimal string, then replacing all occurrences of the digit 0 with the letter O, and the digit 1 with the letter I. Such a representation is valid if and only if it consists only of the letters in the set {"A", "B", "C", "D", "E", "F", "I", "O"}.
-
-
Given a string num representing a decimal integer N, return the Hexspeak representation of N if it is valid, otherwise return "ERROR".
-
-
-
Example 1:
-
-
-Input: num = "257"
-Output: "IOI"
-Explanation: 257 is 101 in hexadecimal.
-
-
-
Example 2:
-
-
-Input: num = "3"
-Output: "ERROR"
-
-
-
-
Constraints:
-
-
-
1 <= N <= 10^12
-
There are no leading zeros in the given string.
-
All answers must be in uppercase letters.
-
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Hints
-
-Hint 1
-Convert the given number to hexadecimal.
-
-
-
-Hint 2
-Replace all 0 and 1 with 'O' and 'I'.
-
-
-
-Hint 3
-Check if the final string has any numerical digits.
-
diff --git a/problems/hexspeak/hexspeak.go b/problems/hexspeak/hexspeak.go
deleted file mode 100644
index 9f81f7d0d..000000000
--- a/problems/hexspeak/hexspeak.go
+++ /dev/null
@@ -1,19 +0,0 @@
-package problem1271
-
-import (
- "fmt"
- "strconv"
- "strings"
-)
-
-func toHexspeak(num string) string {
- n, _ := strconv.Atoi(num)
- hex := fmt.Sprintf("%X", n)
- hex = strings.NewReplacer("0", "O", "1", "I").Replace(hex)
- for _, v := range hex {
- if v < 'A' {
- return "ERROR"
- }
- }
- return hex
-}
diff --git a/problems/hexspeak/hexspeak_test.go b/problems/hexspeak/hexspeak_test.go
deleted file mode 100644
index 07bf6f44c..000000000
--- a/problems/hexspeak/hexspeak_test.go
+++ /dev/null
@@ -1,27 +0,0 @@
-package problem1271
-
-import "testing"
-
-type testType struct {
- in string
- want string
-}
-
-func TestToHexspeak(t *testing.T) {
- tests := [...]testType{
- {
- in: "257",
- want: "IOI",
- },
- {
- in: "3",
- want: "ERROR",
- },
- }
- for _, tt := range tests {
- got := toHexspeak(tt.in)
- if got != tt.want {
- t.Fatalf("in: %v, got: %v, want: %v", tt.in, got, tt.want)
- }
- }
-}
diff --git a/problems/high-five/README.md b/problems/high-five/README.md
deleted file mode 100644
index 87d79b579..000000000
--- a/problems/high-five/README.md
+++ /dev/null
@@ -1,61 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../sum-of-digits-in-the-minimum-number "Sum of Digits in the Minimum Number")
-
-[Next >](../brace-expansion "Brace Expansion")
-
-## [1086. High Five (Easy)](https://leetcode.com/problems/high-five "前五科的均分")
-
-
Given a list of scores of different students, return the average score of each student's top five scores in the order of each student's id.
-
-
Each entry items[i] has items[i][0] the student's id, and items[i][1] the student's score. The average score is calculated using integer division.
-
-
-
-
Example 1:
-
-
-Input: [[1,91],[1,92],[2,93],[2,97],[1,60],[2,77],[1,65],[1,87],[1,100],[2,100],[2,76]]
-Output: [[1,87],[2,88]]
-Explanation:
-The average of the student with id = 1 is 87.
-The average of the student with id = 2 is 88.6. But with integer division their average converts to 88.
-
-
-
-
-
Note:
-
-
-
1 <= items.length <= 1000
-
items[i].length == 2
-
The IDs of the students is between 1 to 1000
-
The score of the students is between 1 to 100
-
For each student, there are at least 5 scores
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Hints
-
-Hint 1
-How can we solve the problem if we have just one student?
-
-
-
-Hint 2
-Given an student sort their grades and get the top 5 average.
-
-
-
-Hint 3
-Generalize the idea to do it for many students.
-
diff --git a/problems/highest-grade-for-each-student/README.md b/problems/highest-grade-for-each-student/README.md
deleted file mode 100644
index 42134a56f..000000000
--- a/problems/highest-grade-for-each-student/README.md
+++ /dev/null
@@ -1,57 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-nesting-depth-of-two-valid-parentheses-strings "Maximum Nesting Depth of Two Valid Parentheses Strings")
-
-[Next >](../reported-posts "Reported Posts")
-
-## [1112. Highest Grade For Each Student (Medium)](https://leetcode.com/problems/highest-grade-for-each-student "每位学生的最高成绩")
-
-
Table: Enrollments
-
-
-+---------------+---------+
-| Column Name | Type |
-+---------------+---------+
-| student_id | int |
-| course_id | int |
-| grade | int |
-+---------------+---------+
-(student_id, course_id) is the primary key of this table.
-
-
-
-
Write a SQL query to find the highest grade with its corresponding course for each student. In case of a tie, you should find the course with the smallest course_id. The output must be sorted by increasing student_id.
-
-
The query result format is in the following example:
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/highest-grade-for-each-student/highest_grade_for_each_student.sql b/problems/highest-grade-for-each-student/highest_grade_for_each_student.sql
deleted file mode 100644
index bae62cf19..000000000
--- a/problems/highest-grade-for-each-student/highest_grade_for_each_student.sql
+++ /dev/null
@@ -1 +0,0 @@
-# Write your MySQL query statement below
diff --git a/problems/highest-grade-for-each-student/mysql_schemas.sql b/problems/highest-grade-for-each-student/mysql_schemas.sql
deleted file mode 100644
index 8d245e074..000000000
--- a/problems/highest-grade-for-each-student/mysql_schemas.sql
+++ /dev/null
@@ -1,9 +0,0 @@
-Create table If Not Exists Enrollments (student_id int, course_id int, grade int);
-Truncate table Enrollments;
-insert into Enrollments (student_id, course_id, grade) values ('2', '2', '95');
-insert into Enrollments (student_id, course_id, grade) values ('2', '3', '95');
-insert into Enrollments (student_id, course_id, grade) values ('1', '1', '90');
-insert into Enrollments (student_id, course_id, grade) values ('1', '2', '99');
-insert into Enrollments (student_id, course_id, grade) values ('3', '1', '80');
-insert into Enrollments (student_id, course_id, grade) values ('3', '2', '75');
-insert into Enrollments (student_id, course_id, grade) values ('3', '3', '82');
diff --git a/problems/hopper-company-queries-i/README.md b/problems/hopper-company-queries-i/README.md
deleted file mode 100644
index c436e61f3..000000000
--- a/problems/hopper-company-queries-i/README.md
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../add-two-polynomials-represented-as-linked-lists "Add Two Polynomials Represented as Linked Lists")
-
-[Next >](../sort-array-by-increasing-frequency "Sort Array by Increasing Frequency")
-
-## [1635. Hopper Company Queries I (Hard)](https://leetcode.com/problems/hopper-company-queries-i "Hopper 公司查询 I")
-
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/hopper-company-queries-i/mysql_schemas.sql b/problems/hopper-company-queries-i/mysql_schemas.sql
deleted file mode 100644
index f66daff0b..000000000
--- a/problems/hopper-company-queries-i/mysql_schemas.sql
+++ /dev/null
@@ -1,39 +0,0 @@
-Create table If Not Exists Drivers (driver_id int, join_date date);
-Create table If Not Exists Rides (ride_id int, user_id int, requested_at date);
-Create table If Not Exists AcceptedRides (ride_id int, driver_id int, ride_distance int, ride_duration int);
-Truncate table Drivers;
-insert into Drivers (driver_id, join_date) values ('10', '2019-12-10');
-insert into Drivers (driver_id, join_date) values ('8', '2020-1-13');
-insert into Drivers (driver_id, join_date) values ('5', '2020-2-16');
-insert into Drivers (driver_id, join_date) values ('7', '2020-3-8');
-insert into Drivers (driver_id, join_date) values ('4', '2020-5-17');
-insert into Drivers (driver_id, join_date) values ('1', '2020-10-24');
-insert into Drivers (driver_id, join_date) values ('6', '2021-1-5');
-Truncate table Rides;
-insert into Rides (ride_id, user_id, requested_at) values ('6', '75', '2019-12-9');
-insert into Rides (ride_id, user_id, requested_at) values ('1', '54', '2020-2-9');
-insert into Rides (ride_id, user_id, requested_at) values ('10', '63', '2020-3-4');
-insert into Rides (ride_id, user_id, requested_at) values ('19', '39', '2020-4-6');
-insert into Rides (ride_id, user_id, requested_at) values ('3', '41', '2020-6-3');
-insert into Rides (ride_id, user_id, requested_at) values ('13', '52', '2020-6-22');
-insert into Rides (ride_id, user_id, requested_at) values ('7', '69', '2020-7-16');
-insert into Rides (ride_id, user_id, requested_at) values ('17', '70', '2020-8-25');
-insert into Rides (ride_id, user_id, requested_at) values ('20', '81', '2020-11-2');
-insert into Rides (ride_id, user_id, requested_at) values ('5', '57', '2020-11-9');
-insert into Rides (ride_id, user_id, requested_at) values ('2', '42', '2020-12-9');
-insert into Rides (ride_id, user_id, requested_at) values ('11', '68', '2021-1-11');
-insert into Rides (ride_id, user_id, requested_at) values ('15', '32', '2021-1-17');
-insert into Rides (ride_id, user_id, requested_at) values ('12', '11', '2021-1-19');
-insert into Rides (ride_id, user_id, requested_at) values ('14', '18', '2021-1-27');
-Truncate table AcceptedRides;
-insert into AcceptedRides (ride_id, driver_id, ride_distance, ride_duration) values ('10', '10', '63', '38');
-insert into AcceptedRides (ride_id, driver_id, ride_distance, ride_duration) values ('13', '10', '73', '96');
-insert into AcceptedRides (ride_id, driver_id, ride_distance, ride_duration) values ('7', '8', '100', '28');
-insert into AcceptedRides (ride_id, driver_id, ride_distance, ride_duration) values ('17', '7', '119', '68');
-insert into AcceptedRides (ride_id, driver_id, ride_distance, ride_duration) values ('20', '1', '121', '92');
-insert into AcceptedRides (ride_id, driver_id, ride_distance, ride_duration) values ('5', '7', '42', '101');
-insert into AcceptedRides (ride_id, driver_id, ride_distance, ride_duration) values ('2', '4', '6', '38');
-insert into AcceptedRides (ride_id, driver_id, ride_distance, ride_duration) values ('11', '8', '37', '43');
-insert into AcceptedRides (ride_id, driver_id, ride_distance, ride_duration) values ('15', '8', '108', '82');
-insert into AcceptedRides (ride_id, driver_id, ride_distance, ride_duration) values ('12', '8', '38', '34');
-insert into AcceptedRides (ride_id, driver_id, ride_distance, ride_duration) values ('14', '1', '90', '74');
diff --git a/problems/hopper-company-queries-ii/README.md b/problems/hopper-company-queries-ii/README.md
deleted file mode 100644
index 61349c63d..000000000
--- a/problems/hopper-company-queries-ii/README.md
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../lowest-common-ancestor-of-a-binary-tree-ii "Lowest Common Ancestor of a Binary Tree II")
-
-[Next >](../get-maximum-in-generated-array "Get Maximum in Generated Array")
-
-## [1645. Hopper Company Queries II (Hard)](https://leetcode.com/problems/hopper-company-queries-ii "")
-
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/hopper-company-queries-ii/mysql_schemas.sql b/problems/hopper-company-queries-ii/mysql_schemas.sql
deleted file mode 100644
index f66daff0b..000000000
--- a/problems/hopper-company-queries-ii/mysql_schemas.sql
+++ /dev/null
@@ -1,39 +0,0 @@
-Create table If Not Exists Drivers (driver_id int, join_date date);
-Create table If Not Exists Rides (ride_id int, user_id int, requested_at date);
-Create table If Not Exists AcceptedRides (ride_id int, driver_id int, ride_distance int, ride_duration int);
-Truncate table Drivers;
-insert into Drivers (driver_id, join_date) values ('10', '2019-12-10');
-insert into Drivers (driver_id, join_date) values ('8', '2020-1-13');
-insert into Drivers (driver_id, join_date) values ('5', '2020-2-16');
-insert into Drivers (driver_id, join_date) values ('7', '2020-3-8');
-insert into Drivers (driver_id, join_date) values ('4', '2020-5-17');
-insert into Drivers (driver_id, join_date) values ('1', '2020-10-24');
-insert into Drivers (driver_id, join_date) values ('6', '2021-1-5');
-Truncate table Rides;
-insert into Rides (ride_id, user_id, requested_at) values ('6', '75', '2019-12-9');
-insert into Rides (ride_id, user_id, requested_at) values ('1', '54', '2020-2-9');
-insert into Rides (ride_id, user_id, requested_at) values ('10', '63', '2020-3-4');
-insert into Rides (ride_id, user_id, requested_at) values ('19', '39', '2020-4-6');
-insert into Rides (ride_id, user_id, requested_at) values ('3', '41', '2020-6-3');
-insert into Rides (ride_id, user_id, requested_at) values ('13', '52', '2020-6-22');
-insert into Rides (ride_id, user_id, requested_at) values ('7', '69', '2020-7-16');
-insert into Rides (ride_id, user_id, requested_at) values ('17', '70', '2020-8-25');
-insert into Rides (ride_id, user_id, requested_at) values ('20', '81', '2020-11-2');
-insert into Rides (ride_id, user_id, requested_at) values ('5', '57', '2020-11-9');
-insert into Rides (ride_id, user_id, requested_at) values ('2', '42', '2020-12-9');
-insert into Rides (ride_id, user_id, requested_at) values ('11', '68', '2021-1-11');
-insert into Rides (ride_id, user_id, requested_at) values ('15', '32', '2021-1-17');
-insert into Rides (ride_id, user_id, requested_at) values ('12', '11', '2021-1-19');
-insert into Rides (ride_id, user_id, requested_at) values ('14', '18', '2021-1-27');
-Truncate table AcceptedRides;
-insert into AcceptedRides (ride_id, driver_id, ride_distance, ride_duration) values ('10', '10', '63', '38');
-insert into AcceptedRides (ride_id, driver_id, ride_distance, ride_duration) values ('13', '10', '73', '96');
-insert into AcceptedRides (ride_id, driver_id, ride_distance, ride_duration) values ('7', '8', '100', '28');
-insert into AcceptedRides (ride_id, driver_id, ride_distance, ride_duration) values ('17', '7', '119', '68');
-insert into AcceptedRides (ride_id, driver_id, ride_distance, ride_duration) values ('20', '1', '121', '92');
-insert into AcceptedRides (ride_id, driver_id, ride_distance, ride_duration) values ('5', '7', '42', '101');
-insert into AcceptedRides (ride_id, driver_id, ride_distance, ride_duration) values ('2', '4', '6', '38');
-insert into AcceptedRides (ride_id, driver_id, ride_distance, ride_duration) values ('11', '8', '37', '43');
-insert into AcceptedRides (ride_id, driver_id, ride_distance, ride_duration) values ('15', '8', '108', '82');
-insert into AcceptedRides (ride_id, driver_id, ride_distance, ride_duration) values ('12', '8', '38', '34');
-insert into AcceptedRides (ride_id, driver_id, ride_distance, ride_duration) values ('14', '1', '90', '74');
diff --git a/problems/hopper-company-queries-iii/README.md b/problems/hopper-company-queries-iii/README.md
deleted file mode 100644
index 5424cf7fb..000000000
--- a/problems/hopper-company-queries-iii/README.md
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../lowest-common-ancestor-of-a-binary-tree-iii "Lowest Common Ancestor of a Binary Tree III")
-
-[Next >](../defuse-the-bomb "Defuse the Bomb")
-
-## [1651. Hopper Company Queries III (Hard)](https://leetcode.com/problems/hopper-company-queries-iii "")
-
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/hopper-company-queries-iii/mysql_schemas.sql b/problems/hopper-company-queries-iii/mysql_schemas.sql
deleted file mode 100644
index f66daff0b..000000000
--- a/problems/hopper-company-queries-iii/mysql_schemas.sql
+++ /dev/null
@@ -1,39 +0,0 @@
-Create table If Not Exists Drivers (driver_id int, join_date date);
-Create table If Not Exists Rides (ride_id int, user_id int, requested_at date);
-Create table If Not Exists AcceptedRides (ride_id int, driver_id int, ride_distance int, ride_duration int);
-Truncate table Drivers;
-insert into Drivers (driver_id, join_date) values ('10', '2019-12-10');
-insert into Drivers (driver_id, join_date) values ('8', '2020-1-13');
-insert into Drivers (driver_id, join_date) values ('5', '2020-2-16');
-insert into Drivers (driver_id, join_date) values ('7', '2020-3-8');
-insert into Drivers (driver_id, join_date) values ('4', '2020-5-17');
-insert into Drivers (driver_id, join_date) values ('1', '2020-10-24');
-insert into Drivers (driver_id, join_date) values ('6', '2021-1-5');
-Truncate table Rides;
-insert into Rides (ride_id, user_id, requested_at) values ('6', '75', '2019-12-9');
-insert into Rides (ride_id, user_id, requested_at) values ('1', '54', '2020-2-9');
-insert into Rides (ride_id, user_id, requested_at) values ('10', '63', '2020-3-4');
-insert into Rides (ride_id, user_id, requested_at) values ('19', '39', '2020-4-6');
-insert into Rides (ride_id, user_id, requested_at) values ('3', '41', '2020-6-3');
-insert into Rides (ride_id, user_id, requested_at) values ('13', '52', '2020-6-22');
-insert into Rides (ride_id, user_id, requested_at) values ('7', '69', '2020-7-16');
-insert into Rides (ride_id, user_id, requested_at) values ('17', '70', '2020-8-25');
-insert into Rides (ride_id, user_id, requested_at) values ('20', '81', '2020-11-2');
-insert into Rides (ride_id, user_id, requested_at) values ('5', '57', '2020-11-9');
-insert into Rides (ride_id, user_id, requested_at) values ('2', '42', '2020-12-9');
-insert into Rides (ride_id, user_id, requested_at) values ('11', '68', '2021-1-11');
-insert into Rides (ride_id, user_id, requested_at) values ('15', '32', '2021-1-17');
-insert into Rides (ride_id, user_id, requested_at) values ('12', '11', '2021-1-19');
-insert into Rides (ride_id, user_id, requested_at) values ('14', '18', '2021-1-27');
-Truncate table AcceptedRides;
-insert into AcceptedRides (ride_id, driver_id, ride_distance, ride_duration) values ('10', '10', '63', '38');
-insert into AcceptedRides (ride_id, driver_id, ride_distance, ride_duration) values ('13', '10', '73', '96');
-insert into AcceptedRides (ride_id, driver_id, ride_distance, ride_duration) values ('7', '8', '100', '28');
-insert into AcceptedRides (ride_id, driver_id, ride_distance, ride_duration) values ('17', '7', '119', '68');
-insert into AcceptedRides (ride_id, driver_id, ride_distance, ride_duration) values ('20', '1', '121', '92');
-insert into AcceptedRides (ride_id, driver_id, ride_distance, ride_duration) values ('5', '7', '42', '101');
-insert into AcceptedRides (ride_id, driver_id, ride_distance, ride_duration) values ('2', '4', '6', '38');
-insert into AcceptedRides (ride_id, driver_id, ride_distance, ride_duration) values ('11', '8', '37', '43');
-insert into AcceptedRides (ride_id, driver_id, ride_distance, ride_duration) values ('15', '8', '108', '82');
-insert into AcceptedRides (ride_id, driver_id, ride_distance, ride_duration) values ('12', '8', '38', '34');
-insert into AcceptedRides (ride_id, driver_id, ride_distance, ride_duration) values ('14', '1', '90', '74');
diff --git a/problems/house-robber-ii/README.md b/problems/house-robber-ii/README.md
deleted file mode 100644
index 221ff0d5e..000000000
--- a/problems/house-robber-ii/README.md
+++ /dev/null
@@ -1,67 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../word-search-ii "Word Search II")
-
-[Next >](../shortest-palindrome "Shortest Palindrome")
-
-## [213. House Robber II (Medium)](https://leetcode.com/problems/house-robber-ii "打家劫舍 II")
-
-
You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed. All houses at this place are arranged in a circle. That means the first house is the neighbor of the last one. Meanwhile, adjacent houses have a security system connected, and it will automatically contact the police if two adjacent houses were broken into on the same night.
-
-
Given an integer array nums representing the amount of money of each house, return the maximum amount of money you can rob tonight without alerting the police.
-
-
-
Example 1:
-
-
-Input: nums = [2,3,2]
-Output: 3
-Explanation: You cannot rob house 1 (money = 2) and then rob house 3 (money = 2), because they are adjacent houses.
-
-
-
Example 2:
-
-
-Input: nums = [1,2,3,1]
-Output: 4
-Explanation: Rob house 1 (money = 1) and then rob house 3 (money = 3).
-Total amount you can rob = 1 + 3 = 4.
-
-
-
Example 3:
-
-
-Input: nums = [1,2,3]
-Output: 3
-
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 100
-
0 <= nums[i] <= 1000
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Similar Questions
- 1. [House Robber](../house-robber) (Medium)
- 1. [Paint House](../paint-house) (Medium)
- 1. [Paint Fence](../paint-fence) (Medium)
- 1. [House Robber III](../house-robber-iii) (Medium)
- 1. [Non-negative Integers without Consecutive Ones](../non-negative-integers-without-consecutive-ones) (Hard)
- 1. [Coin Path](../coin-path) (Hard)
-
-### Hints
-
-Hint 1
-Since House[1] and House[n] are adjacent, they cannot be robbed together. Therefore, the problem becomes to rob either House[1]-House[n-1] or House[2]-House[n], depending on which choice offers more money. Now the problem has degenerated to the House Robber, which is already been solved.
-
diff --git a/problems/house-robber-ii/house_robber_ii.go b/problems/house-robber-ii/house_robber_ii.go
deleted file mode 100644
index 402d98950..000000000
--- a/problems/house-robber-ii/house_robber_ii.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem213
diff --git a/problems/house-robber-ii/house_robber_ii_test.go b/problems/house-robber-ii/house_robber_ii_test.go
deleted file mode 100644
index 402d98950..000000000
--- a/problems/house-robber-ii/house_robber_ii_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem213
diff --git a/problems/house-robber-iii/README.md b/problems/house-robber-iii/README.md
deleted file mode 100644
index 350409147..000000000
--- a/problems/house-robber-iii/README.md
+++ /dev/null
@@ -1,53 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../palindrome-pairs "Palindrome Pairs")
-
-[Next >](../counting-bits "Counting Bits")
-
-## [337. House Robber III (Medium)](https://leetcode.com/problems/house-robber-iii "打家劫舍 III")
-
-
The thief has found himself a new place for his thievery again. There is only one entrance to this area, called root.
-
-
Besides the root, each house has one and only one parent house. After a tour, the smart thief realized that all houses in this place form a binary tree. It will automatically contact the police if two directly-linked houses were broken into on the same night.
-
-
Given the root of the binary tree, return the maximum amount of money the thief can rob without alerting the police.
-
-
-
Example 1:
-
-
-Input: root = [3,2,3,null,3,null,1]
-Output: 7
-Explanation: Maximum amount of money the thief can rob = 3 + 3 + 1 = 7.
-
-
-
Example 2:
-
-
-Input: root = [3,4,5,1,3,null,1]
-Output: 9
-Explanation: Maximum amount of money the thief can rob = 4 + 5 = 9.
-
-
-
-
Constraints:
-
-
-
The number of nodes in the tree is in the range [1, 104].
You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them is that adjacent houses have security systems connected and it will automatically contact the police if two adjacent houses were broken into on the same night.
-
-
Given an integer array nums representing the amount of money of each house, return the maximum amount of money you can rob tonight without alerting the police.
-
-
-
Example 1:
-
-
-Input: nums = [1,2,3,1]
-Output: 4
-Explanation: Rob house 1 (money = 1) and then rob house 3 (money = 3).
-Total amount you can rob = 1 + 3 = 4.
-
-
-
Example 2:
-
-
-Input: nums = [2,7,9,3,1]
-Output: 12
-Explanation: Rob house 1 (money = 2), rob house 3 (money = 9) and rob house 5 (money = 1).
-Total amount you can rob = 2 + 9 + 1 = 12.
-
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 100
-
0 <= nums[i] <= 400
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Similar Questions
- 1. [Maximum Product Subarray](../maximum-product-subarray) (Medium)
- 1. [House Robber II](../house-robber-ii) (Medium)
- 1. [Paint House](../paint-house) (Medium)
- 1. [Paint Fence](../paint-fence) (Medium)
- 1. [House Robber III](../house-robber-iii) (Medium)
- 1. [Non-negative Integers without Consecutive Ones](../non-negative-integers-without-consecutive-ones) (Hard)
- 1. [Coin Path](../coin-path) (Hard)
- 1. [Delete and Earn](../delete-and-earn) (Medium)
diff --git a/problems/house-robber/house_robber.go b/problems/house-robber/house_robber.go
deleted file mode 100644
index a1da7be55..000000000
--- a/problems/house-robber/house_robber.go
+++ /dev/null
@@ -1,12 +0,0 @@
-package problem198
-
-func rob(nums []int) int {
- pre1, pre2, ans := 0, 0, 0
- for _, v := range nums {
- if ans = pre1 + v; pre2 > ans {
- ans = pre2
- }
- pre1, pre2 = pre2, ans
- }
- return ans
-}
diff --git a/problems/house-robber/house_robber_test.go b/problems/house-robber/house_robber_test.go
deleted file mode 100644
index 680d832b9..000000000
--- a/problems/house-robber/house_robber_test.go
+++ /dev/null
@@ -1,27 +0,0 @@
-package problem198
-
-import "testing"
-
-type testType struct {
- in []int
- want int
-}
-
-func TestRob(t *testing.T) {
- tests := [...]testType{
- {
- in: []int{1, 2, 3, 1},
- want: 4,
- },
- {
- in: []int{2, 7, 9, 3, 1},
- want: 12,
- },
- }
- for _, tt := range tests {
- got := rob(tt.in)
- if got != tt.want {
- t.Fatalf("in: %v, got: %v, want: %v", tt.in, got, tt.want)
- }
- }
-}
diff --git a/problems/how-many-apples-can-you-put-into-the-basket/README.md b/problems/how-many-apples-can-you-put-into-the-basket/README.md
deleted file mode 100644
index b933f4598..000000000
--- a/problems/how-many-apples-can-you-put-into-the-basket/README.md
+++ /dev/null
@@ -1,62 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../fizz-buzz-multithreaded "Fizz Buzz Multithreaded")
-
-[Next >](../minimum-knight-moves "Minimum Knight Moves")
-
-## [1196. How Many Apples Can You Put into the Basket (Easy)](https://leetcode.com/problems/how-many-apples-can-you-put-into-the-basket "最多可以买到的苹果数量")
-
-
You have some apples, where arr[i] is the weight of the i-th apple. You also have a basket that can carry up to 5000 units of weight.
-
-
Return the maximum number of apples you can put in the basket.
-
-
-
Example 1:
-
-
-Input: arr = [100,200,150,1000]
-Output: 4
-Explanation: All 4 apples can be carried by the basket since their sum of weights is 1450.
-
-
-
Example 2:
-
-
-Input: arr = [900,950,800,1000,700,800]
-Output: 5
-Explanation: The sum of weights of the 6 apples exceeds 5000 so we choose any 5 of them.
-
-
-
-
Constraints:
-
-
-
1 <= arr.length <= 10^3
-
1 <= arr[i] <= 10^3
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Greedy](../../tag/greedy/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Hints
-
-Hint 1
-What if you think in a greedy approach?
-
-
-
-Hint 2
-The best apple to take in one step is the one with the smallest weight.
-
-
-
-Hint 3
-Sort the array and take apples with smaller weight first.
-
diff --git a/problems/how-many-numbers-are-smaller-than-the-current-number/README.md b/problems/how-many-numbers-are-smaller-than-the-current-number/README.md
deleted file mode 100644
index 2b291471d..000000000
--- a/problems/how-many-numbers-are-smaller-than-the-current-number/README.md
+++ /dev/null
@@ -1,72 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../number-of-trusted-contacts-of-a-customer "Number of Trusted Contacts of a Customer")
-
-[Next >](../rank-teams-by-votes "Rank Teams by Votes")
-
-## [1365. How Many Numbers Are Smaller Than the Current Number (Easy)](https://leetcode.com/problems/how-many-numbers-are-smaller-than-the-current-number "有多少小于当前数字的数字")
-
-
Given the array nums, for each nums[i] find out how many numbers in the array are smaller than it. That is, for each nums[i] you have to count the number of valid j's such that j != iandnums[j] < nums[i].
-
-
Return the answer in an array.
-
-
-
Example 1:
-
-
-Input: nums = [8,1,2,2,3]
-Output: [4,0,1,1,3]
-Explanation:
-For nums[0]=8 there exist four smaller numbers than it (1, 2, 2 and 3).
-For nums[1]=1 does not exist any smaller number than it.
-For nums[2]=2 there exist one smaller number than it (1).
-For nums[3]=2 there exist one smaller number than it (1).
-For nums[4]=3 there exist three smaller numbers than it (1, 2 and 2).
-
-
-
Example 2:
-
-
-Input: nums = [6,5,4,8]
-Output: [2,1,0,3]
-
-
-
Example 3:
-
-
-Input: nums = [7,7,7,7]
-Output: [0,0,0,0]
-
-
-
-
Constraints:
-
-
-
2 <= nums.length <= 500
-
0 <= nums[i] <= 100
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
- [[Counting](../../tag/counting/README.md)]
-
-### Similar Questions
- 1. [Count of Smaller Numbers After Self](../count-of-smaller-numbers-after-self) (Hard)
-
-### Hints
-
-Hint 1
-Brute force for each array element.
-
-
-
-Hint 2
-In order to improve the time complexity, we can sort the array and get the answer for each array element.
-
diff --git a/problems/html-entity-parser/README.md b/problems/html-entity-parser/README.md
deleted file mode 100644
index 5201de90f..000000000
--- a/problems/html-entity-parser/README.md
+++ /dev/null
@@ -1,68 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../queries-on-a-permutation-with-key "Queries on a Permutation With Key")
-
-[Next >](../number-of-ways-to-paint-n-3-grid "Number of Ways to Paint N × 3 Grid")
-
-## [1410. HTML Entity Parser (Medium)](https://leetcode.com/problems/html-entity-parser "HTML 实体解析器")
-
-
HTML entity parser is the parser that takes HTML code as input and replace all the entities of the special characters by the characters itself.
-
-
The special characters and their entities for HTML are:
-
-
-
Quotation Mark: the entity is " and symbol character is ".
-
Single Quote Mark: the entity is ' and symbol character is '.
-
Ampersand: the entity is & and symbol character is &.
-
Greater Than Sign: the entity is > and symbol character is >.
-
Less Than Sign: the entity is < and symbol character is <.
-
Slash: the entity is ⁄ and symbol character is /.
-
-
-
Given the input text string to the HTML parser, you have to implement the entity parser.
-
-
Return the text after replacing the entities by the special characters.
-
-
-
Example 1:
-
-
-Input: text = "& is an HTML entity but &ambassador; is not."
-Output: "& is an HTML entity but &ambassador; is not."
-Explanation: The parser will replace the & entity by &
-
-
-
Example 2:
-
-
-Input: text = "and I quote: "...""
-Output: "and I quote: \"...\""
-
-
-
-
Constraints:
-
-
-
1 <= text.length <= 105
-
The string may contain any possible characters out of all the 256 ASCII characters.
-
-
-### Related Topics
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Hints
-
-Hint 1
-Search the string for all the occurrences of the character '&'.
-
-
-
-Hint 2
-For every '&' check if it matches an HTML entity by checking the ';' character and if entity found replace it in the answer.
-
diff --git a/problems/human-traffic-of-stadium/README.md b/problems/human-traffic-of-stadium/README.md
deleted file mode 100644
index ffdab638f..000000000
--- a/problems/human-traffic-of-stadium/README.md
+++ /dev/null
@@ -1,70 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../non-negative-integers-without-consecutive-ones "Non-negative Integers without Consecutive Ones")
-
-[Next >](../friend-requests-ii-who-has-the-most-friends "Friend Requests II: Who Has the Most Friends")
-
-## [601. Human Traffic of Stadium (Hard)](https://leetcode.com/problems/human-traffic-of-stadium "体育馆的人流量")
-
-
Table: Stadium
-
-
-+---------------+---------+
-| Column Name | Type |
-+---------------+---------+
-| id | int |
-| visit_date | date |
-| people | int |
-+---------------+---------+
-visit_date is the primary key for this table.
-Each row of this table contains the visit date and visit id to the stadium with the number of people during the visit.
-No two rows will have the same visit_date, and as the id increases, the dates increase as well.
-
-
-
-
-
Write an SQL query to display the records with three or more rows with consecutiveid's, and the number of people is greater than or equal to 100 for each.
-
-
Return the result table ordered by visit_date in ascending order.
-
-
The query result format is in the following example.
-
-
-
Example 1:
-
-
-Input:
-Stadium table:
-+------+------------+-----------+
-| id | visit_date | people |
-+------+------------+-----------+
-| 1 | 2017-01-01 | 10 |
-| 2 | 2017-01-02 | 109 |
-| 3 | 2017-01-03 | 150 |
-| 4 | 2017-01-04 | 99 |
-| 5 | 2017-01-05 | 145 |
-| 6 | 2017-01-06 | 1455 |
-| 7 | 2017-01-07 | 199 |
-| 8 | 2017-01-09 | 188 |
-+------+------------+-----------+
-Output:
-+------+------------+-----------+
-| id | visit_date | people |
-+------+------------+-----------+
-| 5 | 2017-01-05 | 145 |
-| 6 | 2017-01-06 | 1455 |
-| 7 | 2017-01-07 | 199 |
-| 8 | 2017-01-09 | 188 |
-+------+------------+-----------+
-Explanation:
-The four rows with ids 5, 6, 7, and 8 have consecutive ids and each of them has >= 100 people attended. Note that row 8 was included even though the visit_date was not the next day after row 7.
-The rows with ids 2 and 3 are not included because we need at least three consecutive ids.
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/human-traffic-of-stadium/human_traffic_of_stadium.sql b/problems/human-traffic-of-stadium/human_traffic_of_stadium.sql
deleted file mode 100644
index bae62cf19..000000000
--- a/problems/human-traffic-of-stadium/human_traffic_of_stadium.sql
+++ /dev/null
@@ -1 +0,0 @@
-# Write your MySQL query statement below
diff --git a/problems/human-traffic-of-stadium/mysql_schemas.sql b/problems/human-traffic-of-stadium/mysql_schemas.sql
deleted file mode 100644
index b01b95410..000000000
--- a/problems/human-traffic-of-stadium/mysql_schemas.sql
+++ /dev/null
@@ -1,10 +0,0 @@
-Create table If Not Exists Stadium (id int, visit_date DATE NULL, people int);
-Truncate table Stadium;
-insert into Stadium (id, visit_date, people) values ('1', '2017-01-01', '10');
-insert into Stadium (id, visit_date, people) values ('2', '2017-01-02', '109');
-insert into Stadium (id, visit_date, people) values ('3', '2017-01-03', '150');
-insert into Stadium (id, visit_date, people) values ('4', '2017-01-04', '99');
-insert into Stadium (id, visit_date, people) values ('5', '2017-01-05', '145');
-insert into Stadium (id, visit_date, people) values ('6', '2017-01-06', '1455');
-insert into Stadium (id, visit_date, people) values ('7', '2017-01-07', '199');
-insert into Stadium (id, visit_date, people) values ('8', '2017-01-09', '188');
diff --git a/problems/image-overlap/README.md b/problems/image-overlap/README.md
deleted file mode 100644
index 808a96906..000000000
--- a/problems/image-overlap/README.md
+++ /dev/null
@@ -1,61 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../sum-of-distances-in-tree "Sum of Distances in Tree")
-
-[Next >](../rectangle-overlap "Rectangle Overlap")
-
-## [835. Image Overlap (Medium)](https://leetcode.com/problems/image-overlap "图像重叠")
-
-
You are given two images, img1 and img2, represented as binary, square matrices of size n x n. A binary matrix has only 0s and 1s as values.
-
-
We translate one image however we choose by sliding all the 1 bits left, right, up, and/or down any number of units. We then place it on top of the other image. We can then calculate the overlap by counting the number of positions that have a 1 in both images.
-
-
Note also that a translation does not include any kind of rotation. Any 1 bits that are translated outside of the matrix borders are erased.
-
-
Return the largest possible overlap.
-
-
-
Example 1:
-
-
-Input: img1 = [[1,1,0],[0,1,0],[0,1,0]], img2 = [[0,0,0],[0,1,1],[0,0,1]]
-Output: 3
-Explanation: We translate img1 to right by 1 unit and down by 1 unit.
-
-The number of positions that have a 1 in both images is 3 (shown in red).
-
-
An image smoother is a filter of the size 3 x 3 that can be applied to each cell of an image by rounding down the average of the cell and the eight surrounding cells (i.e., the average of the nine cells in the blue smoother). If one or more of the surrounding cells of a cell is not present, we do not consider it in the average (i.e., the average of the four cells in the red smoother).
-
-
Given an m x n integer matrix img representing the grayscale of an image, return the image after applying the smoother on each cell of it.
-+-----------------------------+---------+
-| Column Name | Type |
-+-----------------------------+---------+
-| delivery_id | int |
-| customer_id | int |
-| order_date | date |
-| customer_pref_delivery_date | date |
-+-----------------------------+---------+
-delivery_id is the primary key of this table.
-The table holds information about food delivery to customers that make orders at some date and specify a preferred delivery date (on the same order date or after it).
-
-
-
-
-
If the preferred delivery date of the customer is the same as the order date then the order is called immediate otherwise it's called scheduled.
-
-
Write an SQL query to find the percentage of immediate orders in the table, rounded to 2 decimal places.
-
-
The query result format is in the following example:
-+-----------------------------+---------+
-| Column Name | Type |
-+-----------------------------+---------+
-| delivery_id | int |
-| customer_id | int |
-| order_date | date |
-| customer_pref_delivery_date | date |
-+-----------------------------+---------+
-delivery_id is the primary key of this table.
-The table holds information about food delivery to customers that make orders at some date and specify a preferred delivery date (on the same order date or after it).
-
-
-
-
-
If the preferred delivery date of the customer is the same as the order date then the order is called immediate otherwise it's called scheduled.
-
-
The first order of a customer is the order with the earliest order date that customer made. It is guaranteed that a customer has exactly one first order.
-
-
Write an SQL query to find the percentage of immediate orders in the first orders of all customers, rounded to 2 decimal places.
-
-
The query result format is in the following example:
-
-
-Delivery table:
-+-------------+-------------+------------+-----------------------------+
-| delivery_id | customer_id | order_date | customer_pref_delivery_date |
-+-------------+-------------+------------+-----------------------------+
-| 1 | 1 | 2019-08-01 | 2019-08-02 |
-| 2 | 2 | 2019-08-02 | 2019-08-02 |
-| 3 | 1 | 2019-08-11 | 2019-08-12 |
-| 4 | 3 | 2019-08-24 | 2019-08-24 |
-| 5 | 3 | 2019-08-21 | 2019-08-22 |
-| 6 | 2 | 2019-08-11 | 2019-08-13 |
-| 7 | 4 | 2019-08-09 | 2019-08-09 |
-+-------------+-------------+------------+-----------------------------+
-
-Result table:
-+----------------------+
-| immediate_percentage |
-+----------------------+
-| 50.00 |
-+----------------------+
-The customer id 1 has a first order with delivery id 1 and it is scheduled.
-The customer id 2 has a first order with delivery id 2 and it is immediate.
-The customer id 3 has a first order with delivery id 5 and it is scheduled.
-The customer id 4 has a first order with delivery id 7 and it is immediate.
-Hence, half the customers have immediate first orders.
-
Design a data structure that is initialized with a list of different words. Provided a string, you should determine if you can change exactly one character in this string to match any word in the data structure.
-
-
Implement the MagicDictionary class:
-
-
-
MagicDictionary() Initializes the object.
-
void buildDict(String[] dictionary) Sets the data structure with an array of distinct strings dictionary.
-
bool search(String searchWord) Returns true if you can change exactly one character in searchWord to match any string in the data structure, otherwise returns false.
-
-
-
-
Example 1:
-
-
-Input
-["MagicDictionary", "buildDict", "search", "search", "search", "search"]
-[[], [["hello", "leetcode"]], ["hello"], ["hhllo"], ["hell"], ["leetcoded"]]
-Output
-[null, null, false, true, false, false]
-
-Explanation
-MagicDictionary magicDictionary = new MagicDictionary();
-magicDictionary.buildDict(["hello", "leetcode"]);
-magicDictionary.search("hello"); // return False
-magicDictionary.search("hhllo"); // We can change the second 'h' to 'e' to match "hello" so we return True
-magicDictionary.search("hell"); // return False
-magicDictionary.search("leetcoded"); // return False
-
-
-
-
Constraints:
-
-
-
1 <= dictionary.length <= 100
-
1 <= dictionary[i].length <= 100
-
dictionary[i] consists of only lower-case English letters.
-
All the strings in dictionary are distinct.
-
1 <= searchWord.length <= 100
-
searchWord consists of only lower-case English letters.
Implement a first in first out (FIFO) queue using only two stacks. The implemented queue should support all the functions of a normal queue (push, peek, pop, and empty).
-
-
Implement the MyQueue class:
-
-
-
void push(int x) Pushes element x to the back of the queue.
-
int pop() Removes the element from the front of the queue and returns it.
-
int peek() Returns the element at the front of the queue.
-
boolean empty() Returns true if the queue is empty, false otherwise.
-
-
-
Notes:
-
-
-
You must use only standard operations of a stack, which means only push to top, peek/pop from top, size, and is empty operations are valid.
-
Depending on your language, the stack may not be supported natively. You may simulate a stack using a list or deque (double-ended queue) as long as you use only a stack's standard operations.
-
-
-
-
Example 1:
-
-
-Input
-["MyQueue", "push", "push", "peek", "pop", "empty"]
-[[], [1], [2], [], [], []]
-Output
-[null, null, null, 1, 1, false]
-
-Explanation
-MyQueue myQueue = new MyQueue();
-myQueue.push(1); // queue is: [1]
-myQueue.push(2); // queue is: [1, 2] (leftmost is front of the queue)
-myQueue.peek(); // return 1
-myQueue.pop(); // return 1, queue is [2]
-myQueue.empty(); // return false
-
-
-
-
Constraints:
-
-
-
1 <= x <= 9
-
At most 100 calls will be made to push, pop, peek, and empty.
-
All the calls to pop and peek are valid.
-
-
-
-
Follow-up: Can you implement the queue such that each operation is amortizedO(1) time complexity? In other words, performing n operations will take overall O(n) time even if one of those operations may take longer.
Given the APIrand7() that generates a uniform random integer in the range [1, 7], write a function rand10() that generates a uniform random integer in the range [1, 10]. You can only call the API rand7(), and you shouldn't call any other API. Please do not use a language's built-in random API.
-
-
Each test case will have one internal argument n, the number of times that your implemented function rand10() will be called while testing. Note that this is not an argument passed to rand10().
-
-
-
Example 1:
-
Input: n = 1
-Output: [2]
-
Example 2:
-
Input: n = 2
-Output: [2,8]
-
Example 3:
-
Input: n = 3
-Output: [3,8,10]
-
-
-
Constraints:
-
-
-
1 <= n <= 105
-
-
-
-
Follow up:
-
-
-
What is the expected value for the number of calls to rand7() function?
-
Could you minimize the number of calls to rand7()?
Implement a last-in-first-out (LIFO) stack using only two queues. The implemented stack should support all the functions of a normal stack (push, top, pop, and empty).
-
-
Implement the MyStack class:
-
-
-
void push(int x) Pushes element x to the top of the stack.
-
int pop() Removes the element on the top of the stack and returns it.
-
int top() Returns the element on the top of the stack.
-
boolean empty() Returns true if the stack is empty, false otherwise.
-
-
-
Notes:
-
-
-
You must use only standard operations of a queue, which means that only push to back, peek/pop from front, size and is empty operations are valid.
-
Depending on your language, the queue may not be supported natively. You may simulate a queue using a list or deque (double-ended queue) as long as you use only a queue's standard operations.
haystack and needle consist of only lower-case English characters.
-
-
-### Related Topics
- [[Two Pointers](../../tag/two-pointers/README.md)]
- [[String](../../tag/string/README.md)]
- [[String Matching](../../tag/string-matching/README.md)]
-
-### Similar Questions
- 1. [Shortest Palindrome](../shortest-palindrome) (Hard)
- 1. [Repeated Substring Pattern](../repeated-substring-pattern) (Easy)
diff --git a/problems/implement-strstr/implement_strstr.go b/problems/implement-strstr/implement_strstr.go
deleted file mode 100644
index 2f50cfbec..000000000
--- a/problems/implement-strstr/implement_strstr.go
+++ /dev/null
@@ -1,7 +0,0 @@
-package problem28
-
-import "strings"
-
-func strStr(haystack string, needle string) int {
- return strings.Index(haystack, needle)
-}
diff --git a/problems/implement-strstr/implement_strstr_test.go b/problems/implement-strstr/implement_strstr_test.go
deleted file mode 100644
index 9cc25a1d9..000000000
--- a/problems/implement-strstr/implement_strstr_test.go
+++ /dev/null
@@ -1,30 +0,0 @@
-package problem28
-
-import "testing"
-
-type testType struct {
- haystack string
- needle string
- want int
-}
-
-func TestStrStr(t *testing.T) {
- tests := [...]testType{
- {
- haystack: "hello",
- needle: "ll",
- want: 2,
- }, {
- haystack: "this is test string",
- needle: "a",
- want: -1,
- },
- }
-
- for _, tt := range tests {
- got := strStr(tt.haystack, tt.needle)
- if got != tt.want {
- t.Fatalf("in: %v %v, got: %v, want: %v", tt.haystack, tt.needle, got, tt.want)
- }
- }
-}
diff --git a/problems/implement-trie-ii-prefix-tree/README.md b/problems/implement-trie-ii-prefix-tree/README.md
deleted file mode 100644
index f7c7d2d56..000000000
--- a/problems/implement-trie-ii-prefix-tree/README.md
+++ /dev/null
@@ -1,36 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../count-pairs-with-xor-in-a-range "Count Pairs With XOR in a Range")
-
-[Next >](../number-of-different-integers-in-a-string "Number of Different Integers in a String")
-
-## [1804. Implement Trie II (Prefix Tree) (Medium)](https://leetcode.com/problems/implement-trie-ii-prefix-tree "实现 Trie (前缀树) II")
-
-
-
-### Related Topics
- [[Design](../../tag/design/README.md)]
- [[Trie](../../tag/trie/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Hints
-
-Hint 1
-Try to solve the first version first and reuse your code.
-
-
-
-Hint 2
-To implement the delete function, you should delete the trie nodes of the word if they are not shared with other words.
-
-
-
-Hint 3
-You should keep for each trie node a counter of how many words share this node.
-
diff --git a/problems/implement-trie-prefix-tree/README.md b/problems/implement-trie-prefix-tree/README.md
deleted file mode 100644
index 50d2495c9..000000000
--- a/problems/implement-trie-prefix-tree/README.md
+++ /dev/null
@@ -1,64 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../course-schedule "Course Schedule")
-
-[Next >](../minimum-size-subarray-sum "Minimum Size Subarray Sum")
-
-## [208. Implement Trie (Prefix Tree) (Medium)](https://leetcode.com/problems/implement-trie-prefix-tree "实现 Trie (前缀树)")
-
-
A trie (pronounced as "try") or prefix tree is a tree data structure used to efficiently store and retrieve keys in a dataset of strings. There are various applications of this data structure, such as autocomplete and spellchecker.
-
-
Implement the Trie class:
-
-
-
Trie() Initializes the trie object.
-
void insert(String word) Inserts the string word into the trie.
-
boolean search(String word) Returns true if the string word is in the trie (i.e., was inserted before), and false otherwise.
-
boolean startsWith(String prefix) Returns true if there is a previously inserted string word that has the prefix prefix, and false otherwise.
word and prefix consist only of lowercase English letters.
-
At most 3 * 104 calls in total will be made to insert, search, and startsWith.
-
-
-### Related Topics
- [[Design](../../tag/design/README.md)]
- [[Trie](../../tag/trie/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Similar Questions
- 1. [Design Add and Search Words Data Structure](../design-add-and-search-words-data-structure) (Medium)
- 1. [Design Search Autocomplete System](../design-search-autocomplete-system) (Hard)
- 1. [Replace Words](../replace-words) (Medium)
- 1. [Implement Magic Dictionary](../implement-magic-dictionary) (Medium)
diff --git a/problems/implement-trie-prefix-tree/implement_trie_prefix_tree.go b/problems/implement-trie-prefix-tree/implement_trie_prefix_tree.go
deleted file mode 100644
index 610752147..000000000
--- a/problems/implement-trie-prefix-tree/implement_trie_prefix_tree.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem208
diff --git a/problems/implement-trie-prefix-tree/implement_trie_prefix_tree_test.go b/problems/implement-trie-prefix-tree/implement_trie_prefix_tree_test.go
deleted file mode 100644
index 610752147..000000000
--- a/problems/implement-trie-prefix-tree/implement_trie_prefix_tree_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem208
diff --git a/problems/increasing-decreasing-string/README.md b/problems/increasing-decreasing-string/README.md
deleted file mode 100644
index 8a62e65a2..000000000
--- a/problems/increasing-decreasing-string/README.md
+++ /dev/null
@@ -1,78 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../get-the-second-most-recent-activity "Get the Second Most Recent Activity")
-
-[Next >](../find-the-longest-substring-containing-vowels-in-even-counts "Find the Longest Substring Containing Vowels in Even Counts")
-
-## [1370. Increasing Decreasing String (Easy)](https://leetcode.com/problems/increasing-decreasing-string "上升下降字符串")
-
-
You are given a string s. Reorder the string using the following algorithm:
-
-
-
Pick the smallest character from s and append it to the result.
-
Pick the smallest character from s which is greater than the last appended character to the result and append it.
-
Repeat step 2 until you cannot pick more characters.
-
Pick the largest character from s and append it to the result.
-
Pick the largest character from s which is smaller than the last appended character to the result and append it.
-
Repeat step 5 until you cannot pick more characters.
-
Repeat the steps from 1 to 6 until you pick all characters from s.
-
-
-
In each step, If the smallest or the largest character appears more than once you can choose any occurrence and append it to the result.
-
-
Return the result string after sorting s with this algorithm.
-
-
-
Example 1:
-
-
-Input: s = "aaaabbbbcccc"
-Output: "abccbaabccba"
-Explanation: After steps 1, 2 and 3 of the first iteration, result = "abc"
-After steps 4, 5 and 6 of the first iteration, result = "abccba"
-First iteration is done. Now s = "aabbcc" and we go back to step 1
-After steps 1, 2 and 3 of the second iteration, result = "abccbaabc"
-After steps 4, 5 and 6 of the second iteration, result = "abccbaabccba"
-
-
-
Example 2:
-
-
-Input: s = "rat"
-Output: "art"
-Explanation: The word "rat" becomes "art" after re-ordering it with the mentioned algorithm.
-
-
-
-
Constraints:
-
-
-
1 <= s.length <= 500
-
s consists of only lowercase English letters.
-
-
-### Related Topics
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
- [[Counting](../../tag/counting/README.md)]
-
-### Hints
-
-Hint 1
-Count the frequency of each character.
-
-
-
-Hint 2
-Loop over all character from 'a' to 'z' and append the character if it exists and decrease frequency by 1. Do the same from 'z' to 'a'.
-
-
-
-Hint 3
-Keep repeating until the frequency of all characters is zero.
-
diff --git a/problems/increasing-decreasing-string/increasing_decreasing_string.go b/problems/increasing-decreasing-string/increasing_decreasing_string.go
deleted file mode 100644
index 9d939beb1..000000000
--- a/problems/increasing-decreasing-string/increasing_decreasing_string.go
+++ /dev/null
@@ -1,26 +0,0 @@
-package problem1370
-
-func sortString(s string) string {
- var m [26]int
- for _, c := range s {
- m[c-'a']++
- }
- l := len(s)
- ans := make([]byte, 0, l)
- appendChar := func(c int) {
- if m[c] > 0 {
- m[c]--
- l--
- ans = append(ans, byte(c+'a'))
- }
- }
- for l > 0 {
- for i := 0; i <= 25; i++ {
- appendChar(i)
- }
- for i := 25; i >= 0; i-- {
- appendChar(i)
- }
- }
- return string(ans)
-}
diff --git a/problems/increasing-decreasing-string/increasing_decreasing_string_test.go b/problems/increasing-decreasing-string/increasing_decreasing_string_test.go
deleted file mode 100644
index 562fd3e14..000000000
--- a/problems/increasing-decreasing-string/increasing_decreasing_string_test.go
+++ /dev/null
@@ -1,39 +0,0 @@
-package problem1370
-
-import "testing"
-
-type testType struct {
- in string
- want string
-}
-
-func TestSortString(t *testing.T) {
- tests := [...]testType{
- {
- in: "aaaabbbbcccc",
- want: "abccbaabccba",
- },
- {
- in: "rat",
- want: "art",
- },
- {
- in: "leetcode",
- want: "cdelotee",
- },
- {
- in: "ggggggg",
- want: "ggggggg",
- },
- {
- in: "spo",
- want: "ops",
- },
- }
- for _, tt := range tests {
- got := sortString(tt.in)
- if got != tt.want {
- t.Fatalf("in: %v, got: %v, want: %v", tt.in, got, tt.want)
- }
- }
-}
diff --git a/problems/increasing-order-search-tree/README.md b/problems/increasing-order-search-tree/README.md
deleted file mode 100644
index 0d79507af..000000000
--- a/problems/increasing-order-search-tree/README.md
+++ /dev/null
@@ -1,44 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../monotonic-array "Monotonic Array")
-
-[Next >](../bitwise-ors-of-subarrays "Bitwise ORs of Subarrays")
-
-## [897. Increasing Order Search Tree (Easy)](https://leetcode.com/problems/increasing-order-search-tree "递增顺序搜索树")
-
-
Given the root of a binary search tree, rearrange the tree in in-order so that the leftmost node in the tree is now the root of the tree, and every node has no left child and only one right child.
Given an integer array nums, return all the different possible increasing subsequences of the given array with at least two elements. You may return the answer in any order.
-
-
The given array may contain duplicates, and two equal integers should also be considered a special case of increasing sequence.
Given an integer array nums, return true if there exists a triple of indices (i, j, k) such that i < j < k and nums[i] < nums[j] < nums[k]. If no such indices exists, return false.
-
-
-
Example 1:
-
-
-Input: nums = [1,2,3,4,5]
-Output: true
-Explanation: Any triplet where i < j < k is valid.
-
-Input: nums = [2,1,5,0,4,6]
-Output: true
-Explanation: The triplet (3, 4, 5) is valid because nums[3] == 0 < nums[4] == 4 < nums[5] == 6.
-
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 5 * 105
-
-231 <= nums[i] <= 231 - 1
-
-
-
-Follow up: Could you implement a solution that runs in O(n) time complexity and O(1) space complexity?
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[Array](../../tag/array/README.md)]
-
-### Similar Questions
- 1. [Longest Increasing Subsequence](../longest-increasing-subsequence) (Medium)
diff --git a/problems/increasing-triplet-subsequence/increasing_triplet_subsequence.go b/problems/increasing-triplet-subsequence/increasing_triplet_subsequence.go
deleted file mode 100644
index 08e8a16b7..000000000
--- a/problems/increasing-triplet-subsequence/increasing_triplet_subsequence.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem334
diff --git a/problems/increasing-triplet-subsequence/increasing_triplet_subsequence_test.go b/problems/increasing-triplet-subsequence/increasing_triplet_subsequence_test.go
deleted file mode 100644
index 08e8a16b7..000000000
--- a/problems/increasing-triplet-subsequence/increasing_triplet_subsequence_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem334
diff --git a/problems/incremental-memory-leak/README.md b/problems/incremental-memory-leak/README.md
deleted file mode 100644
index 17c716d16..000000000
--- a/problems/incremental-memory-leak/README.md
+++ /dev/null
@@ -1,65 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../sorting-the-sentence "Sorting the Sentence")
-
-[Next >](../rotating-the-box "Rotating the Box")
-
-## [1860. Incremental Memory Leak (Medium)](https://leetcode.com/problems/incremental-memory-leak "增长的内存泄露")
-
-
You are given two integers memory1 and memory2 representing the available memory in bits on two memory sticks. There is currently a faulty program running that consumes an increasing amount of memory every second.
-
-
At the ith second (starting from 1), i bits of memory are allocated to the stick with more available memory (or from the first memory stick if both have the same available memory). If neither stick has at least i bits of available memory, the program crashes.
-
-
Return an array containing [crashTime, memory1crash, memory2crash], where crashTime is the time (in seconds) when the program crashed and memory1crash and memory2crash are the available bits of memory in the first and second sticks respectively.
-
-
-
Example 1:
-
-
-Input: memory1 = 2, memory2 = 2
-Output: [3,1,0]
-Explanation: The memory is allocated as follows:
-- At the 1st second, 1 bit of memory is allocated to stick 1. The first stick now has 1 bit of available memory.
-- At the 2nd second, 2 bits of memory are allocated to stick 2. The second stick now has 0 bits of available memory.
-- At the 3rd second, the program crashes. The sticks have 1 and 0 bits available respectively.
-
-
-
Example 2:
-
-
-Input: memory1 = 8, memory2 = 11
-Output: [6,0,4]
-Explanation: The memory is allocated as follows:
-- At the 1st second, 1 bit of memory is allocated to stick 2. The second stick now has 10 bit of available memory.
-- At the 2nd second, 2 bits of memory are allocated to stick 2. The second stick now has 8 bits of available memory.
-- At the 3rd second, 3 bits of memory are allocated to stick 1. The first stick now has 5 bits of available memory.
-- At the 4th second, 4 bits of memory are allocated to stick 2. The second stick now has 4 bits of available memory.
-- At the 5th second, 5 bits of memory are allocated to stick 1. The first stick now has 0 bits of available memory.
-- At the 6th second, the program crashes. The sticks have 0 and 4 bits available respectively.
-
-
-
-
Constraints:
-
-
-
0 <= memory1, memory2 <= 231 - 1
-
-
-### Related Topics
- [[Simulation](../../tag/simulation/README.md)]
-
-### Hints
-
-Hint 1
-What is the upper bound for the number of seconds?
-
-
-
-Hint 2
-Simulate the process of allocating memory.
-
diff --git a/problems/index-pairs-of-a-string/README.md b/problems/index-pairs-of-a-string/README.md
deleted file mode 100644
index 69275ff74..000000000
--- a/problems/index-pairs-of-a-string/README.md
+++ /dev/null
@@ -1,57 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../fixed-point "Fixed Point")
-
-[Next >](../campus-bikes-ii "Campus Bikes II")
-
-## [1065. Index Pairs of a String (Easy)](https://leetcode.com/problems/index-pairs-of-a-string "字符串的索引对")
-
-
Given a text string and words (a list of strings), return all index pairs [i, j] so that the substring text[i]...text[j] is in the list of words.
-
-
-
-
Example 1:
-
-
-Input: text = "thestoryofleetcodeandme", words = ["story","fleet","leetcode"]
-Output: [[3,7],[9,13],[10,17]]
-
-
-
Example 2:
-
-
-Input: text = "ababa", words = ["aba","ab"]
-Output: [[0,1],[0,2],[2,3],[2,4]]
-Explanation:
-Notice that matches can overlap, see "aba" is found in [0,2] and [2,4].
-
-
-
-
-
Note:
-
-
-
All strings contains only lowercase English letters.
-
It's guaranteed that all strings in words are different.
-
1 <= text.length <= 100
-
1 <= words.length <= 20
-
1 <= words[i].length <= 50
-
Return the pairs [i,j] in sorted order (i.e. sort them by their first coordinate in case of ties sort them by their second coordinate).
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[String](../../tag/string/README.md)]
- [[Trie](../../tag/trie/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Hints
-
-Hint 1
-For each string of the set, look for matches and store those matches indices.
-
diff --git a/problems/inorder-successor-in-bst-ii/README.md b/problems/inorder-successor-in-bst-ii/README.md
deleted file mode 100644
index 296fe42ec..000000000
--- a/problems/inorder-successor-in-bst-ii/README.md
+++ /dev/null
@@ -1,82 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../fibonacci-number "Fibonacci Number")
-
-[Next >](../game-play-analysis-i "Game Play Analysis I")
-
-## [510. Inorder Successor in BST II (Medium)](https://leetcode.com/problems/inorder-successor-in-bst-ii "二叉搜索树中的中序后继 II")
-
-
Given a binary search tree and a node in it, find the in-order successor of that node in the BST.
-
-
The successor of a node p is the node with the smallest key greater than p.val.
-
-
You will have direct access to the node but not to the root of the tree. Each node will have a reference to its parent node.
-
-
-
-
Example 1:
-
-
-Input:
-root = {"$id":"1","left":{"$id":"2","left":null,"parent":{"$ref":"1"},"right":null,"val":1},"parent":null,"right":{"$id":"3","left":null,"parent":{"$ref":"1"},"right":null,"val":3},"val":2}
-p = 1
-Output: 2
-Explanation: 1's in-order successor node is 2. Note that both p and the return value is of Node type.
-
-
-
Example 2:
-
-
-Input:
-root = {"$id":"1","left":{"$id":"2","left":{"$id":"3","left":{"$id":"4","left":null,"parent":{"$ref":"3"},"right":null,"val":1},"parent":{"$ref":"2"},"right":null,"val":2},"parent":{"$ref":"1"},"right":{"$id":"5","left":null,"parent":{"$ref":"2"},"right":null,"val":4},"val":3},"parent":null,"right":{"$id":"6","left":null,"parent":{"$ref":"1"},"right":null,"val":6},"val":5}
-p = 6
-Output: null
-Explanation: There is no in-order successor of the current node, so the answer is null.
-
RandomizedCollection() Initializes the RandomizedCollection object.
-
bool insert(int val) Inserts an item val into the multiset if not present. Returns true if the item was not present, false otherwise.
-
bool remove(int val) Removes an item val from the multiset if present. Returns true if the item was present, false otherwise. Note that if val has multiple occurrences in the multiset, we only remove one of them.
-
int getRandom() Returns a random element from the current multiset of elements (it's guaranteed that at least one element exists when this method is called). The probability of each element being returned is linearly related to the number of same values the multiset contains.
-
-
-
You must implement the functions of the class such that each function works in averageO(1) time complexity.
-
-
-
Example 1:
-
-
-Input
-["RandomizedCollection", "insert", "insert", "insert", "getRandom", "remove", "getRandom"]
-[[], [1], [1], [2], [], [1], []]
-Output
-[null, true, false, true, 2, true, 1]
-
-Explanation
-RandomizedCollection randomizedCollection = new RandomizedCollection();
-randomizedCollection.insert(1); // return True. Inserts 1 to the collection. Returns true as the collection did not contain 1.
-randomizedCollection.insert(1); // return False. Inserts another 1 to the collection. Returns false as the collection contained 1. Collection now contains [1,1].
-randomizedCollection.insert(2); // return True. Inserts 2 to the collection, returns true. Collection now contains [1,1,2].
-randomizedCollection.getRandom(); // getRandom should return 1 with the probability 2/3, and returns 2 with the probability 1/3.
-randomizedCollection.remove(1); // return True. Removes 1 from the collection, returns true. Collection now contains [1,2].
-randomizedCollection.getRandom(); // getRandom should return 1 and 2 both equally likely.
-
-
-
-
Constraints:
-
-
-
-231 <= val <= 231 - 1
-
At most 2 * 105 calls will be made to insert, remove, and getRandom.
-
There will be at least one element in the data structure when getRandom is called.
RandomizedSet() Initializes the RandomizedSet object.
-
bool insert(int val) Inserts an item val into the set if not present. Returns true if the item was not present, false otherwise.
-
bool remove(int val) Removes an item val from the set if present. Returns true if the item was present, false otherwise.
-
int getRandom() Returns a random element from the current set of elements (it's guaranteed that at least one element exists when this method is called). Each element must have the same probability of being returned.
-
-
-
You must implement the functions of the class such that each function works in averageO(1) time complexity.
-
-
-
Example 1:
-
-
-Input
-["RandomizedSet", "insert", "remove", "insert", "getRandom", "remove", "insert", "getRandom"]
-[[], [1], [2], [2], [], [1], [2], []]
-Output
-[null, true, false, true, 2, true, false, 2]
-
-Explanation
-RandomizedSet randomizedSet = new RandomizedSet();
-randomizedSet.insert(1); // Inserts 1 to the set. Returns true as 1 was inserted successfully.
-randomizedSet.remove(2); // Returns false as 2 does not exist in the set.
-randomizedSet.insert(2); // Inserts 2 to the set, returns true. Set now contains [1,2].
-randomizedSet.getRandom(); // getRandom() should return either 1 or 2 randomly.
-randomizedSet.remove(1); // Removes 1 from the set, returns true. Set now contains [2].
-randomizedSet.insert(2); // 2 was already in the set, so return false.
-randomizedSet.getRandom(); // Since 2 is the only number in the set, getRandom() will always return 2.
-
-
-
-
Constraints:
-
-
-
-231 <= val <= 231 - 1
-
At most 2 * 105 calls will be made to insert, remove, and getRandom.
-
There will be at least one element in the data structure when getRandom is called.
You are given an array of non-overlapping intervals intervals where intervals[i] = [starti, endi] represent the start and the end of the ith interval and intervals is sorted in ascending order by starti. You are also given an interval newInterval = [start, end] that represents the start and end of another interval.
-
-
Insert newInterval into intervals such that intervals is still sorted in ascending order by starti and intervals still does not have any overlapping intervals (merge overlapping intervals if necessary).
-Input: intervals = [[1,2],[3,5],[6,7],[8,10],[12,16]], newInterval = [4,8]
-Output: [[1,2],[3,10],[12,16]]
-Explanation: Because the new interval [4,8] overlaps with [3,5],[6,7],[8,10].
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
-
-### Similar Questions
- 1. [Merge Intervals](../merge-intervals) (Medium)
- 1. [Range Module](../range-module) (Hard)
diff --git a/problems/insert-interval/insert_interval.go b/problems/insert-interval/insert_interval.go
deleted file mode 100644
index 021f8e212..000000000
--- a/problems/insert-interval/insert_interval.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem57
diff --git a/problems/insert-interval/insert_interval_test.go b/problems/insert-interval/insert_interval_test.go
deleted file mode 100644
index 021f8e212..000000000
--- a/problems/insert-interval/insert_interval_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem57
diff --git a/problems/insert-into-a-binary-search-tree/README.md b/problems/insert-into-a-binary-search-tree/README.md
deleted file mode 100644
index c502641dd..000000000
--- a/problems/insert-into-a-binary-search-tree/README.md
+++ /dev/null
@@ -1,59 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../search-in-a-binary-search-tree "Search in a Binary Search Tree")
-
-[Next >](../search-in-a-sorted-array-of-unknown-size "Search in a Sorted Array of Unknown Size")
-
-## [701. Insert into a Binary Search Tree (Medium)](https://leetcode.com/problems/insert-into-a-binary-search-tree "二叉搜索树中的插入操作")
-
-
You are given the root node of a binary search tree (BST) and a value to insert into the tree. Return the root node of the BST after the insertion. It is guaranteed that the new value does not exist in the original BST.
-
-
Notice that there may exist multiple valid ways for the insertion, as long as the tree remains a BST after insertion. You can return any of them.
-
-
-
Example 1:
-
-
-Input: root = [4,2,7,1,3], val = 5
-Output: [4,2,7,1,3,5]
-Explanation: Another accepted tree is:
-
-
-
-
Example 2:
-
-
-Input: root = [40,20,60,10,30,50,70], val = 25
-Output: [40,20,60,10,30,50,70,null,null,25]
-
-
-
Example 3:
-
-
-Input: root = [4,2,7,1,3,null,null,null,null,null,null], val = 5
-Output: [4,2,7,1,3,5]
-
-
-
-
Constraints:
-
-
-
The number of nodes in the tree will be in the range [0, 104].
-
-108 <= Node.val <= 108
-
All the values Node.val are unique.
-
-108 <= val <= 108
-
It's guaranteed that val does not exist in the original BST.
Given a node from a cyclic linked list which is sorted in ascending order, write a function to insert a value into the list such that it remains a cyclic sorted list. The given node can be a reference to any single node in the list, and may not be necessarily the smallest value in the cyclic list.
-
-
If there are multiple suitable places for insertion, you may choose any place to insert the new value. After the insertion, the cyclic list should remain sorted.
-
-
If the list is empty (i.e., given node is null), you should create a new single cyclic list and return the reference to that single node. Otherwise, you should return the original given node.
-
-
The following example may help you understand the problem better:
-
-
-
-
-
-In the figure above, there is a cyclic sorted list of three elements. You are given a reference to the node with value 3, and we need to insert 2 into the list.
-
-
-
-
-
-The new node should insert between node 1 and node 3. After the insertion, the list should look like this, and we should still return node 3.
Given the head of a singly linked list, sort the list using insertion sort, and return the sorted list's head.
-
-
The steps of the insertion sort algorithm:
-
-
-
Insertion sort iterates, consuming one input element each repetition and growing a sorted output list.
-
At each iteration, insertion sort removes one element from the input data, finds the location it belongs within the sorted list and inserts it there.
-
It repeats until no input elements remain.
-
-
-
The following is a graphical example of the insertion sort algorithm. The partially sorted list (black) initially contains only the first element in the list. One element (red) is removed from the input data and inserted in-place into the sorted list with each iteration.
-
-
-
Example 1:
-
-
-Input: head = [4,2,1,3]
-Output: [1,2,3,4]
-
-
-
Example 2:
-
-
-Input: head = [-1,5,3,4,0]
-Output: [-1,0,3,4,5]
-
-
-
-
Constraints:
-
-
-
The number of nodes in the list is in the range [1, 5000].
Given the root of a binary tree and an integer limit, delete all insufficient nodes in the tree simultaneously, and return the root of the resulting binary tree.
-
-
A node is insufficient if every root to leaf path intersecting this node has a sum strictly less than limit.
The number of nodes in the tree is in the range [1, 5000].
-
-105 <= Node.val <= 105
-
-109 <= limit <= 109
-
-
-### Related Topics
- [[Tree](../../tag/tree/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Binary Tree](../../tag/binary-tree/README.md)]
-
-### Hints
-
-Hint 1
-Consider a DFS traversal of the tree. You can keep track of the current path sum from root to this node, and you can also use DFS to return the minimum value of any path from this node to the leaf. This will tell you if this node is insufficient.
-
diff --git a/problems/integer-break/README.md b/problems/integer-break/README.md
deleted file mode 100644
index 0975fcec2..000000000
--- a/problems/integer-break/README.md
+++ /dev/null
@@ -1,58 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../power-of-four "Power of Four")
-
-[Next >](../reverse-string "Reverse String")
-
-## [343. Integer Break (Medium)](https://leetcode.com/problems/integer-break "整数拆分")
-
-
Given an integer n, break it into the sum of kpositive integers, where k >= 2, and maximize the product of those integers.
Convert a non-negative integer num to its English words representation.
-
-
-
Example 1:
-
-
-Input: num = 123
-Output: "One Hundred Twenty Three"
-
-
-
Example 2:
-
-
-Input: num = 12345
-Output: "Twelve Thousand Three Hundred Forty Five"
-
-
-
Example 3:
-
-
-Input: num = 1234567
-Output: "One Million Two Hundred Thirty Four Thousand Five Hundred Sixty Seven"
-
-
-
-
Constraints:
-
-
-
0 <= num <= 231 - 1
-
-
-### Related Topics
- [[Recursion](../../tag/recursion/README.md)]
- [[Math](../../tag/math/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Similar Questions
- 1. [Integer to Roman](../integer-to-roman) (Medium)
-
-### Hints
-
-Hint 1
-Did you see a pattern in dividing the number into chunk of words? For example, 123 and 123000.
-
-
-
-Hint 2
-Group the number by thousands (3 digits). You can write a helper function that takes a number less than 1000 and convert just that chunk to words.
-
-
-
-Hint 3
-There are many edge cases. What are some good test cases? Does your code work with input such as 0? Or 1000010? (middle chunk is zero and should not be printed out)
-
diff --git a/problems/integer-to-english-words/integer_to_english_words.go b/problems/integer-to-english-words/integer_to_english_words.go
deleted file mode 100644
index 87c82e1e8..000000000
--- a/problems/integer-to-english-words/integer_to_english_words.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem273
diff --git a/problems/integer-to-english-words/integer_to_english_words_test.go b/problems/integer-to-english-words/integer_to_english_words_test.go
deleted file mode 100644
index 87c82e1e8..000000000
--- a/problems/integer-to-english-words/integer_to_english_words_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem273
diff --git a/problems/integer-to-roman/README.md b/problems/integer-to-roman/README.md
deleted file mode 100644
index e923416cd..000000000
--- a/problems/integer-to-roman/README.md
+++ /dev/null
@@ -1,90 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../container-with-most-water "Container With Most Water")
-
-[Next >](../roman-to-integer "Roman to Integer")
-
-## [12. Integer to Roman (Medium)](https://leetcode.com/problems/integer-to-roman "整数转罗马数字")
-
-
Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M.
For example, 2 is written as II in Roman numeral, just two one's added together. 12 is written as XII, which is simply X + II. The number 27 is written as XXVII, which is XX + V + II.
-
-
Roman numerals are usually written largest to smallest from left to right. However, the numeral for four is not IIII. Instead, the number four is written as IV. Because the one is before the five we subtract it making four. The same principle applies to the number nine, which is written as IX. There are six instances where subtraction is used:
-
-
-
I can be placed before V (5) and X (10) to make 4 and 9.
-
X can be placed before L (50) and C (100) to make 40 and 90.
-
C can be placed before D (500) and M (1000) to make 400 and 900.
-
-
-
Given an integer, convert it to a roman numeral.
-
-
-
Example 1:
-
-
-Input: num = 3
-Output: "III"
-
-
-
Example 2:
-
-
-Input: num = 4
-Output: "IV"
-
-
-
Example 3:
-
-
-Input: num = 9
-Output: "IX"
-
-
-
Example 4:
-
-
-Input: num = 58
-Output: "LVIII"
-Explanation: L = 50, V = 5, III = 3.
-
-
-
Example 5:
-
-
-Input: num = 1994
-Output: "MCMXCIV"
-Explanation: M = 1000, CM = 900, XC = 90 and IV = 4.
-
Given three integer arrays arr1, arr2 and arr3sorted in strictly increasing order, return a sorted array of only the integers that appeared in all three arrays.
-
-
-
Example 1:
-
-
-Input: arr1 = [1,2,3,4,5], arr2 = [1,2,5,7,9], arr3 = [1,3,4,5,8]
-Output: [1,5]
-Explanation: Only 1 and 5 appeared in the three arrays.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
- [[Counting](../../tag/counting/README.md)]
-
-### Similar Questions
- 1. [Intersection of Two Arrays](../intersection-of-two-arrays) (Easy)
-
-### Hints
-
-Hint 1
-Count the frequency of all elements in the three arrays.
-
-
-
-Hint 2
-The elements that appeared in all the arrays would have a frequency of 3.
-
diff --git a/problems/intersection-of-two-arrays-ii/README.md b/problems/intersection-of-two-arrays-ii/README.md
deleted file mode 100644
index d20f01b10..000000000
--- a/problems/intersection-of-two-arrays-ii/README.md
+++ /dev/null
@@ -1,58 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../intersection-of-two-arrays "Intersection of Two Arrays")
-
-[Next >](../android-unlock-patterns "Android Unlock Patterns")
-
-## [350. Intersection of Two Arrays II (Easy)](https://leetcode.com/problems/intersection-of-two-arrays-ii "两个数组的交集 II")
-
-
Given two integer arrays nums1 and nums2, return an array of their intersection. Each element in the result must appear as many times as it shows in both arrays and you may return the result in any order.
Given two integer arrays nums1 and nums2, return an array of their intersection. Each element in the result must be unique and you may return the result in any order.
-Input: nums1 = [4,9,5], nums2 = [9,4,9,8,4]
-Output: [9,4]
-Explanation: [4,9] is also accepted.
-
-
-
-
Constraints:
-
-
-
1 <= nums1.length, nums2.length <= 1000
-
0 <= nums1[i], nums2[i] <= 1000
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Two Pointers](../../tag/two-pointers/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Similar Questions
- 1. [Intersection of Two Arrays II](../intersection-of-two-arrays-ii) (Easy)
- 1. [Intersection of Three Sorted Arrays](../intersection-of-three-sorted-arrays) (Easy)
diff --git a/problems/intersection-of-two-arrays/intersection_of_two_arrays.go b/problems/intersection-of-two-arrays/intersection_of_two_arrays.go
deleted file mode 100644
index 5daf2f65c..000000000
--- a/problems/intersection-of-two-arrays/intersection_of_two_arrays.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem349
diff --git a/problems/intersection-of-two-arrays/intersection_of_two_arrays_test.go b/problems/intersection-of-two-arrays/intersection_of_two_arrays_test.go
deleted file mode 100644
index 5daf2f65c..000000000
--- a/problems/intersection-of-two-arrays/intersection_of_two_arrays_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem349
diff --git a/problems/intersection-of-two-linked-lists/README.md b/problems/intersection-of-two-linked-lists/README.md
deleted file mode 100644
index 94fff5675..000000000
--- a/problems/intersection-of-two-linked-lists/README.md
+++ /dev/null
@@ -1,87 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../longest-substring-with-at-most-two-distinct-characters "Longest Substring with At Most Two Distinct Characters")
-
-[Next >](../one-edit-distance "One Edit Distance")
-
-## [160. Intersection of Two Linked Lists (Easy)](https://leetcode.com/problems/intersection-of-two-linked-lists "相交链表")
-
-
Given the heads of two singly linked-lists headA and headB, return the node at which the two lists intersect. If the two linked lists have no intersection at all, return null.
-
-
For example, the following two linked lists begin to intersect at node c1:
-
-
The test cases are generated such that there are no cycles anywhere in the entire linked structure.
-
-
Note that the linked lists must retain their original structure after the function returns.
-
-
Custom Judge:
-
-
The inputs to the judge are given as follows (your program is not given these inputs):
-
-
-
intersectVal - The value of the node where the intersection occurs. This is 0 if there is no intersected node.
-
listA - The first linked list.
-
listB - The second linked list.
-
skipA - The number of nodes to skip ahead in listA (starting from the head) to get to the intersected node.
-
skipB - The number of nodes to skip ahead in listB (starting from the head) to get to the intersected node.
-
-
-
The judge will then create the linked structure based on these inputs and pass the two heads, headA and headB to your program. If you correctly return the intersected node, then your solution will be accepted.
-
-
-
Example 1:
-
-
-Input: intersectVal = 8, listA = [4,1,8,4,5], listB = [5,6,1,8,4,5], skipA = 2, skipB = 3
-Output: Intersected at '8'
-Explanation: The intersected node's value is 8 (note that this must not be 0 if the two lists intersect).
-From the head of A, it reads as [4,1,8,4,5]. From the head of B, it reads as [5,6,1,8,4,5]. There are 2 nodes before the intersected node in A; There are 3 nodes before the intersected node in B.
-
-
-
Example 2:
-
-
-Input: intersectVal = 2, listA = [1,9,1,2,4], listB = [3,2,4], skipA = 3, skipB = 1
-Output: Intersected at '2'
-Explanation: The intersected node's value is 2 (note that this must not be 0 if the two lists intersect).
-From the head of A, it reads as [1,9,1,2,4]. From the head of B, it reads as [3,2,4]. There are 3 nodes before the intersected node in A; There are 1 node before the intersected node in B.
-
-
-
Example 3:
-
-
-Input: intersectVal = 0, listA = [2,6,4], listB = [1,5], skipA = 3, skipB = 2
-Output: No intersection
-Explanation: From the head of A, it reads as [2,6,4]. From the head of B, it reads as [1,5]. Since the two lists do not intersect, intersectVal must be 0, while skipA and skipB can be arbitrary values.
-Explanation: The two lists do not intersect, so return null.
-
-
-
-
Constraints:
-
-
-
The number of nodes of listA is in the m.
-
The number of nodes of listB is in the n.
-
0 <= m, n <= 3 * 104
-
1 <= Node.val <= 105
-
0 <= skipA <= m
-
0 <= skipB <= n
-
intersectVal is 0 if listA and listB do not intersect.
-
intersectVal == listA[skipA] == listB[skipB] if listA and listB intersect.
-
-
-
-Follow up: Could you write a solution that runs in O(n) time and use only O(1) memory?
-
-### Related Topics
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Linked List](../../tag/linked-list/README.md)]
- [[Two Pointers](../../tag/two-pointers/README.md)]
-
-### Similar Questions
- 1. [Minimum Index Sum of Two Lists](../minimum-index-sum-of-two-lists) (Easy)
diff --git a/problems/intersection-of-two-linked-lists/intersection_of_two_linked_lists.go b/problems/intersection-of-two-linked-lists/intersection_of_two_linked_lists.go
deleted file mode 100644
index eb7ef2aba..000000000
--- a/problems/intersection-of-two-linked-lists/intersection_of_two_linked_lists.go
+++ /dev/null
@@ -1,30 +0,0 @@
-package problem160
-
-import "github.com/awesee/leetcode/internal/kit"
-
-// ListNode - Definition for singly-linked list.
-type ListNode = kit.ListNode
-
-/**
- * Definition for singly-linked list.
- * type ListNode struct {
- * Val int
- * Next *ListNode
- * }
- */
-func getIntersectionNode(headA, headB *ListNode) *ListNode {
- pA, pB := headA, headB
- for pA != pB {
- if pA == nil {
- pA = headB
- } else {
- pA = pA.Next
- }
- if pB == nil {
- pB = headA
- } else {
- pB = pB.Next
- }
- }
- return pA
-}
diff --git a/problems/intersection-of-two-linked-lists/intersection_of_two_linked_lists_test.go b/problems/intersection-of-two-linked-lists/intersection_of_two_linked_lists_test.go
deleted file mode 100644
index b1f4b2d5b..000000000
--- a/problems/intersection-of-two-linked-lists/intersection_of_two_linked_lists_test.go
+++ /dev/null
@@ -1,59 +0,0 @@
-package problem160
-
-import (
- "testing"
-
- "github.com/awesee/leetcode/internal/kit"
-)
-
-type testType struct {
- headA []int
- headB []int
- intersection []int
-}
-
-func TestGetIntersectionNode(t *testing.T) {
- tests := [...]testType{
- {
- headA: []int{4, 1},
- headB: []int{5, 0, 1},
- intersection: []int{8, 4, 5},
- },
- {
- headA: []int{0, 9, 1, 2},
- headB: []int{3},
- intersection: []int{2, 4},
- },
- {
- headA: []int{2, 4, 6},
- headB: []int{1, 5},
- intersection: []int{},
- },
- {
- headA: []int{1},
- headB: []int{},
- intersection: []int{},
- },
- }
- for _, tt := range tests {
- intersection := kit.SliceInt2ListNode(tt.intersection)
- headA := kit.SliceInt2ListNode(tt.headA)
- headB := kit.SliceInt2ListNode(tt.headB)
- for n := headA; n != nil; n = n.Next {
- if n.Next == nil {
- n.Next = intersection
- break
- }
- }
- for n := headB; n != nil; n = n.Next {
- if n.Next == nil {
- n.Next = intersection
- break
- }
- }
- got := getIntersectionNode(headA, headB)
- if got != intersection {
- t.Fatalf("in: %v, got: %v %v, want: %v", tt.headA, tt.headB, got, tt.intersection)
- }
- }
-}
diff --git a/problems/interval-list-intersections/README.md b/problems/interval-list-intersections/README.md
deleted file mode 100644
index b7251fd39..000000000
--- a/problems/interval-list-intersections/README.md
+++ /dev/null
@@ -1,70 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../sum-of-even-numbers-after-queries "Sum of Even Numbers After Queries")
-
-[Next >](../vertical-order-traversal-of-a-binary-tree "Vertical Order Traversal of a Binary Tree")
-
-## [986. Interval List Intersections (Medium)](https://leetcode.com/problems/interval-list-intersections "区间列表的交集")
-
-
You are given two lists of closed intervals, firstList and secondList, where firstList[i] = [starti, endi] and secondList[j] = [startj, endj]. Each list of intervals is pairwise disjoint and in sorted order.
-
-
Return the intersection of these two interval lists.
-
-
A closed interval[a, b] (with a <= b) denotes the set of real numbers x with a <= x <= b.
-
-
The intersection of two closed intervals is a set of real numbers that are either empty or represented as a closed interval. For example, the intersection of [1, 3] and [2, 4] is [2, 3].
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Two Pointers](../../tag/two-pointers/README.md)]
-
-### Similar Questions
- 1. [Merge Intervals](../merge-intervals) (Medium)
- 1. [Merge Sorted Array](../merge-sorted-array) (Easy)
- 1. [Employee Free Time](../employee-free-time) (Hard)
diff --git a/problems/interval-list-intersections/interval_list_intersections.go b/problems/interval-list-intersections/interval_list_intersections.go
deleted file mode 100644
index 48d65b265..000000000
--- a/problems/interval-list-intersections/interval_list_intersections.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem986
diff --git a/problems/intervals-between-identical-elements/README.md b/problems/intervals-between-identical-elements/README.md
deleted file mode 100644
index 8b689aeac..000000000
--- a/problems/intervals-between-identical-elements/README.md
+++ /dev/null
@@ -1,83 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../execution-of-all-suffix-instructions-staying-in-a-grid "Execution of All Suffix Instructions Staying in a Grid")
-
-[Next >](../recover-the-original-array "Recover the Original Array")
-
-## [2121. Intervals Between Identical Elements (Medium)](https://leetcode.com/problems/intervals-between-identical-elements "相同元素的间隔之和")
-
-
You are given a 0-indexed array of n integers arr.
-
-
The interval between two elements in arr is defined as the absolute difference between their indices. More formally, the interval between arr[i] and arr[j] is |i - j|.
-
-
Return an arrayintervalsof lengthnwhereintervals[i]is the sum of intervals between arr[i] and each element in arr with the same value as arr[i].
-
-
Note:|x| is the absolute value of x.
-
-
-
Example 1:
-
-
-Input: arr = [2,1,3,1,2,3,3]
-Output: [4,2,7,2,4,4,5]
-Explanation:
-- Index 0: Another 2 is found at index 4. |0 - 4| = 4
-- Index 1: Another 1 is found at index 3. |1 - 3| = 2
-- Index 2: Two more 3s are found at indices 5 and 6. |2 - 5| + |2 - 6| = 7
-- Index 3: Another 1 is found at index 1. |3 - 1| = 2
-- Index 4: Another 2 is found at index 0. |4 - 0| = 4
-- Index 5: Two more 3s are found at indices 2 and 6. |5 - 2| + |5 - 6| = 4
-- Index 6: Two more 3s are found at indices 2 and 5. |6 - 2| + |6 - 5| = 5
-
-
-
Example 2:
-
-
-Input: arr = [10,5,10,10]
-Output: [5,0,3,4]
-Explanation:
-- Index 0: Two more 10s are found at indices 2 and 3. |0 - 2| + |0 - 3| = 5
-- Index 1: There is only one 5 in the array, so its sum of intervals to identical elements is 0.
-- Index 2: Two more 10s are found at indices 0 and 3. |2 - 0| + |2 - 3| = 3
-- Index 3: Two more 10s are found at indices 0 and 2. |3 - 0| + |3 - 2| = 4
-
-
-
-
Constraints:
-
-
-
n == arr.length
-
1 <= n <= 105
-
1 <= arr[i] <= 105
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Prefix Sum](../../tag/prefix-sum/README.md)]
-
-### Hints
-
-Hint 1
-For each unique value found in the array, store a sorted list of indices of elements that have this value in the array.
-
-
-
-Hint 2
-One way of doing this is to use a HashMap that maps the values to their list of indices. Update this mapping as you iterate through the array.
-
-
-
-Hint 3
-Process each list of indices separately and get the sum of intervals for the elements of that value by utilizing prefix sums.
-
-
-
-Hint 4
-For each element, keep track of the sum of indices of the identical elements that have come before and that will come after respectively. Use this to calculate the sum of intervals for that element to the rest of the elements with identical values.
-
diff --git a/problems/invalid-transactions/README.md b/problems/invalid-transactions/README.md
deleted file mode 100644
index f8165e7ad..000000000
--- a/problems/invalid-transactions/README.md
+++ /dev/null
@@ -1,78 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../optimize-water-distribution-in-a-village "Optimize Water Distribution in a Village")
-
-[Next >](../compare-strings-by-frequency-of-the-smallest-character "Compare Strings by Frequency of the Smallest Character")
-
-## [1169. Invalid Transactions (Medium)](https://leetcode.com/problems/invalid-transactions "查询无效交易")
-
-
A transaction is possibly invalid if:
-
-
-
the amount exceeds $1000, or;
-
if it occurs within (and including) 60 minutes of another transaction with the same name in a different city.
-
-
-
You are given an array of strings transaction where transactions[i] consists of comma-separated values representing the name, time (in minutes), amount, and city of the transaction.
-
-
Return a list of transactions that are possibly invalid. You may return the answer in any order.
-
-
-
Example 1:
-
-
-Input: transactions = ["alice,20,800,mtv","alice,50,100,beijing"]
-Output: ["alice,20,800,mtv","alice,50,100,beijing"]
-Explanation: The first transaction is invalid because the second transaction occurs within a difference of 60 minutes, have the same name and is in a different city. Similarly the second one is invalid too.
Write a query to print the sum of all total investment values in 2016 (TIV_2016), to a scale of 2 decimal places, for all policy holders who meet the following criteria:
-
-
-
Have the same TIV_2015 value as one or more other policyholders.
-
Are not located in the same city as any other policyholder (i.e.: the (latitude, longitude) attribute pairs must be unique).
-
-
-
Input Format:
-The insurance table is described as follows:
where PID is the policyholder's policy ID, TIV_2015 is the total investment value in 2015, TIV_2016 is the total investment value in 2016, LAT is the latitude of the policy holder's city, and LON is the longitude of the policy holder's city.
-The first record in the table, like the last record, meets both of the two criteria.
-The TIV_2015 value '10' is as the same as the third and forth record, and its location unique.
-
-The second record does not meet any of the two criteria. Its TIV_2015 is not like any other policyholders.
-
-And its location is the same with the third record, which makes the third record fail, too.
-
-So, the result is the sum of TIV_2016 of the first and last record, which is 45.
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
-
-### Hints
-
-Hint 1
-Make the (LAT, LON) a pair to represent the location information
-
diff --git a/problems/investments-in-2016/investments_in_2016.sql b/problems/investments-in-2016/investments_in_2016.sql
deleted file mode 100644
index bae62cf19..000000000
--- a/problems/investments-in-2016/investments_in_2016.sql
+++ /dev/null
@@ -1 +0,0 @@
-# Write your MySQL query statement below
diff --git a/problems/investments-in-2016/mysql_schemas.sql b/problems/investments-in-2016/mysql_schemas.sql
deleted file mode 100644
index 7541fd98a..000000000
--- a/problems/investments-in-2016/mysql_schemas.sql
+++ /dev/null
@@ -1,6 +0,0 @@
-Create Table If Not Exists Insurance (pid int, tiv_2015 float, tiv_2016 float, lat float, lon float);
-Truncate table Insurance;
-insert into Insurance (pid, tiv_2015, tiv_2016, lat, lon) values ('1', '10', '5', '10', '10');
-insert into Insurance (pid, tiv_2015, tiv_2016, lat, lon) values ('2', '20', '20', '20', '20');
-insert into Insurance (pid, tiv_2015, tiv_2016, lat, lon) values ('3', '10', '30', '20', '20');
-insert into Insurance (pid, tiv_2015, tiv_2016, lat, lon) values ('4', '10', '40', '40', '40');
diff --git a/problems/ip-to-cidr/README.md b/problems/ip-to-cidr/README.md
deleted file mode 100644
index be63e0887..000000000
--- a/problems/ip-to-cidr/README.md
+++ /dev/null
@@ -1,77 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../number-of-corner-rectangles "Number Of Corner Rectangles")
-
-[Next >](../open-the-lock "Open the Lock")
-
-## [751. IP to CIDR (Medium)](https://leetcode.com/problems/ip-to-cidr "IP 到 CIDR")
-
-
-Given a start IP address ip and a number of ips we need to cover n, return a representation of the range as a list (of smallest possible length) of CIDR blocks.
-
-A CIDR block is a string consisting of an IP, followed by a slash, and then the prefix length. For example: "123.45.67.89/20". That prefix length "20" represents the number of common prefix bits in the specified range.
-
-
-
Example 1:
-
-Input: ip = "255.0.0.7", n = 10
-Output: ["255.0.0.7/32","255.0.0.8/29","255.0.0.16/32"]
-Explanation:
-The initial ip address, when converted to binary, looks like this (spaces added for clarity):
-255.0.0.7 -> 11111111 00000000 00000000 00000111
-The address "255.0.0.7/32" specifies all addresses with a common prefix of 32 bits to the given address,
-ie. just this one address.
-
-The address "255.0.0.8/29" specifies all addresses with a common prefix of 29 bits to the given address:
-255.0.0.8 -> 11111111 00000000 00000000 00001000
-Addresses with common prefix of 29 bits are:
-11111111 00000000 00000000 00001000
-11111111 00000000 00000000 00001001
-11111111 00000000 00000000 00001010
-11111111 00000000 00000000 00001011
-11111111 00000000 00000000 00001100
-11111111 00000000 00000000 00001101
-11111111 00000000 00000000 00001110
-11111111 00000000 00000000 00001111
-
-The address "255.0.0.16/32" specifies all addresses with a common prefix of 32 bits to the given address,
-ie. just 11111111 00000000 00000000 00010000.
-
-In total, the answer specifies the range of 10 ips starting with the address 255.0.0.7 .
-
-There were other representations, such as:
-["255.0.0.7/32","255.0.0.8/30", "255.0.0.12/30", "255.0.0.16/32"],
-but our answer was the shortest possible.
-
-Also note that a representation beginning with say, "255.0.0.7/30" would be incorrect,
-because it includes addresses like 255.0.0.4 = 11111111 00000000 00000000 00000100
-that are outside the specified range.
-
-
-
-
Note:
-
-
ip will be a valid IPv4 address.
-
Every implied address ip + x (for x < n) will be a valid IPv4 address.
-
n will be an integer in the range [1, 1000].
-
-
-
-### Related Topics
- [[Bit Manipulation](../../tag/bit-manipulation/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Similar Questions
- 1. [Restore IP Addresses](../restore-ip-addresses) (Medium)
- 1. [Validate IP Address](../validate-ip-address) (Medium)
-
-### Hints
-
-Hint 1
-Convert the ip addresses to and from (long) integers. You want to know what is the most addresses you can put in this block starting from the "start" ip, up to n. It is the smallest between the lowest bit of start and the highest bit of n. Then, repeat this process with a new start and n.
-
diff --git a/problems/ip-to-cidr/ip_to_cidr.go b/problems/ip-to-cidr/ip_to_cidr.go
deleted file mode 100644
index 7e87b7abf..000000000
--- a/problems/ip-to-cidr/ip_to_cidr.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem751
diff --git a/problems/ip-to-cidr/ip_to_cidr_test.go b/problems/ip-to-cidr/ip_to_cidr_test.go
deleted file mode 100644
index 7e87b7abf..000000000
--- a/problems/ip-to-cidr/ip_to_cidr_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem751
diff --git a/problems/ipo/README.md b/problems/ipo/README.md
deleted file mode 100644
index 902487817..000000000
--- a/problems/ipo/README.md
+++ /dev/null
@@ -1,61 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../find-mode-in-binary-search-tree "Find Mode in Binary Search Tree")
-
-[Next >](../next-greater-element-ii "Next Greater Element II")
-
-## [502. IPO (Hard)](https://leetcode.com/problems/ipo "IPO")
-
-
Suppose LeetCode will start its IPO soon. In order to sell a good price of its shares to Venture Capital, LeetCode would like to work on some projects to increase its capital before the IPO. Since it has limited resources, it can only finish at most k distinct projects before the IPO. Help LeetCode design the best way to maximize its total capital after finishing at most k distinct projects.
-
-
You are given n projects where the ith project has a pure profit profits[i] and a minimum capital of capital[i] is needed to start it.
-
-
Initially, you have w capital. When you finish a project, you will obtain its pure profit and the profit will be added to your total capital.
-
-
Pick a list of at mostk distinct projects from given projects to maximize your final capital, and return the final maximized capital.
-
-
The answer is guaranteed to fit in a 32-bit signed integer.
-
-
-
Example 1:
-
-
-Input: k = 2, w = 0, profits = [1,2,3], capital = [0,1,1]
-Output: 4
-Explanation: Since your initial capital is 0, you can only start the project indexed 0.
-After finishing it you will obtain profit 1 and your capital becomes 1.
-With capital 1, you can either start the project indexed 1 or the project indexed 2.
-Since you can choose at most 2 projects, you need to finish the project indexed 2 to get the maximum capital.
-Therefore, output the final maximized capital, which is 0 + 1 + 3 = 4.
-
-
-
Example 2:
-
-
-Input: k = 3, w = 0, profits = [1,2,3], capital = [0,1,2]
-Output: 6
-
There is an undirected graph with n nodes, where each node is numbered between 0 and n - 1. You are given a 2D array graph, where graph[u] is an array of nodes that node u is adjacent to. More formally, for each v in graph[u], there is an undirected edge between node u and node v. The graph has the following properties:
-
-
-
There are no self-edges (graph[u] does not contain u).
-
There are no parallel edges (graph[u] does not contain duplicate values).
-
If v is in graph[u], then u is in graph[v] (the graph is undirected).
-
The graph may not be connected, meaning there may be two nodes u and v such that there is no path between them.
-
-
-
A graph is bipartite if the nodes can be partitioned into two independent sets A and B such that every edge in the graph connects a node in set A and a node in set B.
-
-
Return true if and only if it is bipartite.
-
-
-
Example 1:
-
-
-Input: graph = [[1,2,3],[0,2],[0,1,3],[0,2]]
-Output: false
-Explanation: There is no way to partition the nodes into two independent sets such that every edge connects a node in one and a node in the other.
-
-
Example 2:
-
-
-Input: graph = [[1,3],[0,2],[1,3],[0,2]]
-Output: true
-Explanation: We can partition the nodes into two sets: {0, 2} and {1, 3}.
Given two strings s and t, return true if s is a subsequence of t, or false otherwise.
-
-
A subsequence of a string is a new string that is formed from the original string by deleting some (can be none) of the characters without disturbing the relative positions of the remaining characters. (i.e., "ace" is a subsequence of "abcde" while "aec" is not).
-
-
-
Example 1:
-
Input: s = "abc", t = "ahbgdc"
-Output: true
-
Example 2:
-
Input: s = "axc", t = "ahbgdc"
-Output: false
-
-
-
Constraints:
-
-
-
0 <= s.length <= 100
-
0 <= t.length <= 104
-
s and t consist only of lowercase English letters.
-
-
-
-Follow up: Suppose there are lots of incoming s, say s1, s2, ..., sk where k >= 109, and you want to check one by one to see if t has its subsequence. In this scenario, how would you change your code?
-
-### Related Topics
- [[Two Pointers](../../tag/two-pointers/README.md)]
- [[String](../../tag/string/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Similar Questions
- 1. [Number of Matching Subsequences](../number-of-matching-subsequences) (Medium)
- 1. [Shortest Way to Form String](../shortest-way-to-form-string) (Medium)
diff --git a/problems/is-subsequence/is_subsequence.go b/problems/is-subsequence/is_subsequence.go
deleted file mode 100644
index 27d18f7cf..000000000
--- a/problems/is-subsequence/is_subsequence.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem392
diff --git a/problems/is-subsequence/is_subsequence_test.go b/problems/is-subsequence/is_subsequence_test.go
deleted file mode 100644
index 27d18f7cf..000000000
--- a/problems/is-subsequence/is_subsequence_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem392
diff --git a/problems/island-perimeter/README.md b/problems/island-perimeter/README.md
deleted file mode 100644
index 4bf38e2a2..000000000
--- a/problems/island-perimeter/README.md
+++ /dev/null
@@ -1,63 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-moves-to-equal-array-elements-ii "Minimum Moves to Equal Array Elements II")
-
-[Next >](../can-i-win "Can I Win")
-
-## [463. Island Perimeter (Easy)](https://leetcode.com/problems/island-perimeter "岛屿的周长")
-
-
You are given row x colgrid representing a map where grid[i][j] = 1 represents land and grid[i][j] = 0 represents water.
-
-
Grid cells are connected horizontally/vertically (not diagonally). The grid is completely surrounded by water, and there is exactly one island (i.e., one or more connected land cells).
-
-
The island doesn't have "lakes", meaning the water inside isn't connected to the water around the island. One cell is a square with side length 1. The grid is rectangular, width and height don't exceed 100. Determine the perimeter of the island.
-
-
-
Example 1:
-
-
-Input: grid = [[0,1,0,0],[1,1,1,0],[0,1,0,0],[1,1,0,0]]
-Output: 16
-Explanation: The perimeter is the 16 yellow stripes in the image above.
-
Given two strings s and t, determine if they are isomorphic.
-
-
Two strings s and t are isomorphic if the characters in s can be replaced to get t.
-
-
All occurrences of a character must be replaced with another character while preserving the order of characters. No two characters may map to the same character, but a character may map to itself.
-
-
-
Example 1:
-
Input: s = "egg", t = "add"
-Output: true
-
Example 2:
-
Input: s = "foo", t = "bar"
-Output: false
-
Example 3:
-
Input: s = "paper", t = "title"
-Output: true
-
-
-
Constraints:
-
-
-
1 <= s.length <= 5 * 104
-
t.length == s.length
-
s and t consist of any valid ascii character.
-
-
-### Related Topics
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Similar Questions
- 1. [Word Pattern](../word-pattern) (Easy)
diff --git a/problems/isomorphic-strings/isomorphic_strings.go b/problems/isomorphic-strings/isomorphic_strings.go
deleted file mode 100644
index 3dccd4793..000000000
--- a/problems/isomorphic-strings/isomorphic_strings.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem205
diff --git a/problems/isomorphic-strings/isomorphic_strings_test.go b/problems/isomorphic-strings/isomorphic_strings_test.go
deleted file mode 100644
index 3dccd4793..000000000
--- a/problems/isomorphic-strings/isomorphic_strings_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem205
diff --git a/problems/iterator-for-combination/README.md b/problems/iterator-for-combination/README.md
deleted file mode 100644
index 193a09a29..000000000
--- a/problems/iterator-for-combination/README.md
+++ /dev/null
@@ -1,67 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../find-the-start-and-end-number-of-continuous-ranges "Find the Start and End Number of Continuous Ranges")
-
-[Next >](../element-appearing-more-than-25-in-sorted-array "Element Appearing More Than 25% In Sorted Array")
-
-## [1286. Iterator for Combination (Medium)](https://leetcode.com/problems/iterator-for-combination "字母组合迭代器")
-
-
Design the CombinationIterator class:
-
-
-
CombinationIterator(string characters, int combinationLength) Initializes the object with a string characters of sorted distinct lowercase English letters and a number combinationLength as arguments.
-
next() Returns the next combination of length combinationLength in lexicographical order.
-
hasNext() Returns true if and only if there exists a next combination.
At most 104 calls will be made to next and hasNext.
-
It is guaranteed that all calls of the function next are valid.
-
-
-### Related Topics
- [[Design](../../tag/design/README.md)]
- [[String](../../tag/string/README.md)]
- [[Backtracking](../../tag/backtracking/README.md)]
- [[Iterator](../../tag/iterator/README.md)]
-
-### Hints
-
-Hint 1
-Generate all combinations as a preprocessing.
-
-
-
-Hint 2
-Use bit masking to generate all the combinations.
-
diff --git a/problems/jewels-and-stones/README.md b/problems/jewels-and-stones/README.md
deleted file mode 100644
index 03f1ca5a9..000000000
--- a/problems/jewels-and-stones/README.md
+++ /dev/null
@@ -1,43 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../basic-calculator-iv "Basic Calculator IV")
-
-[Next >](../basic-calculator-iii "Basic Calculator III")
-
-## [771. Jewels and Stones (Easy)](https://leetcode.com/problems/jewels-and-stones "宝石与石头")
-
-
You're given strings jewels representing the types of stones that are jewels, and stones representing the stones you have. Each character in stones is a type of stone you have. You want to know how many of the stones you have are also jewels.
-
-
Letters are case sensitive, so "a" is considered a different type of stone from "A".
Given an array of non-negative integers nums, you are initially positioned at the first index of the array.
-
-
Each element in the array represents your maximum jump length at that position.
-
-
Your goal is to reach the last index in the minimum number of jumps.
-
-
You can assume that you can always reach the last index.
-
-
-
Example 1:
-
-
-Input: nums = [2,3,1,1,4]
-Output: 2
-Explanation: The minimum number of jumps to reach the last index is 2. Jump 1 step from index 0 to 1, then 3 steps to the last index.
-
-
-
Example 2:
-
-
-Input: nums = [2,3,0,1,4]
-Output: 2
-
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 104
-
0 <= nums[i] <= 1000
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Greedy](../../tag/greedy/README.md)]
-
-### Similar Questions
- 1. [Jump Game](../jump-game) (Medium)
- 1. [Jump Game III](../jump-game-iii) (Medium)
- 1. [Jump Game VII](../jump-game-vii) (Medium)
diff --git a/problems/jump-game-ii/jump_game_ii.go b/problems/jump-game-ii/jump_game_ii.go
deleted file mode 100644
index a326b299c..000000000
--- a/problems/jump-game-ii/jump_game_ii.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem45
diff --git a/problems/jump-game-ii/jump_game_ii_test.go b/problems/jump-game-ii/jump_game_ii_test.go
deleted file mode 100644
index a326b299c..000000000
--- a/problems/jump-game-ii/jump_game_ii_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem45
diff --git a/problems/jump-game-iii/README.md b/problems/jump-game-iii/README.md
deleted file mode 100644
index 876cb75b2..000000000
--- a/problems/jump-game-iii/README.md
+++ /dev/null
@@ -1,76 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../all-elements-in-two-binary-search-trees "All Elements in Two Binary Search Trees")
-
-[Next >](../verbal-arithmetic-puzzle "Verbal Arithmetic Puzzle")
-
-## [1306. Jump Game III (Medium)](https://leetcode.com/problems/jump-game-iii "跳跃游戏 III")
-
-
Given an array of non-negative integers arr, you are initially positioned at start index of the array. When you are at index i, you can jump to i + arr[i] or i - arr[i], check if you can reach to any index with value 0.
-
-
Notice that you can not jump outside of the array at any time.
-
-
-
Example 1:
-
-
-Input: arr = [4,2,3,0,3,1,2], start = 5
-Output: true
-Explanation:
-All possible ways to reach at index 3 with value 0 are:
-index 5 -> index 4 -> index 1 -> index 3
-index 5 -> index 6 -> index 4 -> index 1 -> index 3
-
-
-
Example 2:
-
-
-Input: arr = [4,2,3,0,3,1,2], start = 0
-Output: true
-Explanation:
-One possible way to reach at index 3 with value 0 is:
-index 0 -> index 4 -> index 1 -> index 3
-
-
-
Example 3:
-
-
-Input: arr = [3,0,2,1,2], start = 2
-Output: false
-Explanation: There is no way to reach at index 1 with value 0.
-
-
-
-
Constraints:
-
-
-
1 <= arr.length <= 5 * 104
-
0 <= arr[i] < arr.length
-
0 <= start < arr.length
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
-
-### Similar Questions
- 1. [Jump Game II](../jump-game-ii) (Medium)
- 1. [Jump Game](../jump-game) (Medium)
- 1. [Jump Game VII](../jump-game-vii) (Medium)
-
-### Hints
-
-Hint 1
-Think of BFS to solve the problem.
-
-
-
-Hint 2
-When you reach a position with a value = 0 then return true.
-
diff --git a/problems/jump-game-iv/README.md b/problems/jump-game-iv/README.md
deleted file mode 100644
index 3c3ba13a3..000000000
--- a/problems/jump-game-iv/README.md
+++ /dev/null
@@ -1,92 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../angle-between-hands-of-a-clock "Angle Between Hands of a Clock")
-
-[Next >](../check-if-n-and-its-double-exist "Check If N and Its Double Exist")
-
-## [1345. Jump Game IV (Hard)](https://leetcode.com/problems/jump-game-iv "跳跃游戏 IV")
-
-
Given an array of integers arr, you are initially positioned at the first index of the array.
-
-
In one step you can jump from index i to index:
-
-
-
i + 1 where: i + 1 < arr.length.
-
i - 1 where: i - 1 >= 0.
-
j where: arr[i] == arr[j] and i != j.
-
-
-
Return the minimum number of steps to reach the last index of the array.
-
-
Notice that you can not jump outside of the array at any time.
-
-
-
Example 1:
-
-
-Input: arr = [100,-23,-23,404,100,23,23,23,3,404]
-Output: 3
-Explanation: You need three jumps from index 0 --> 4 --> 3 --> 9. Note that index 9 is the last index of the array.
-
-
-
Example 2:
-
-
-Input: arr = [7]
-Output: 0
-Explanation: Start index is the last index. You don't need to jump.
-
-
-
Example 3:
-
-
-Input: arr = [7,6,9,6,9,6,9,7]
-Output: 1
-Explanation: You can jump directly from index 0 to index 7 which is last index of the array.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
-
-### Similar Questions
- 1. [Jump Game VII](../jump-game-vii) (Medium)
-
-### Hints
-
-Hint 1
-Build a graph of n nodes where nodes are the indices of the array and edges for node i are nodes i+1, i-1, j where arr[i] == arr[j].
-
-
-
-Hint 2
-Start bfs from node 0 and keep distance, answer is the distance when you reach onode n-1.
-
diff --git a/problems/jump-game-v/README.md b/problems/jump-game-v/README.md
deleted file mode 100644
index 5c5e3730c..000000000
--- a/problems/jump-game-v/README.md
+++ /dev/null
@@ -1,77 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-product-of-splitted-binary-tree "Maximum Product of Splitted Binary Tree")
-
-[Next >](../movie-rating "Movie Rating")
-
-## [1340. Jump Game V (Hard)](https://leetcode.com/problems/jump-game-v "跳跃游戏 V")
-
-
Given an array of integers arr and an integer d. In one step you can jump from index i to index:
-
-
-
i + x where: i + x < arr.length and 0 < x <= d.
-
i - x where: i - x >= 0 and 0 < x <= d.
-
-
-
In addition, you can only jump from index i to index j if arr[i] > arr[j] and arr[i] > arr[k] for all indices k between i and j (More formally min(i, j) < k < max(i, j)).
-
-
You can choose any index of the array and start jumping. Return the maximum number of indices you can visit.
-
-
Notice that you can not jump outside of the array at any time.
-
-
-
Example 1:
-
-
-Input: arr = [6,4,14,6,8,13,9,7,10,6,12], d = 2
-Output: 4
-Explanation: You can start at index 10. You can jump 10 --> 8 --> 6 --> 7 as shown.
-Note that if you start at index 6 you can only jump to index 7. You cannot jump to index 5 because 13 > 9. You cannot jump to index 4 because index 5 is between index 4 and 6 and 13 > 9.
-Similarly You cannot jump from index 3 to index 2 or index 1.
-
-
-
Example 2:
-
-
-Input: arr = [3,3,3,3,3], d = 3
-Output: 1
-Explanation: You can start at any index. You always cannot jump to any index.
-
-
-
Example 3:
-
-
-Input: arr = [7,6,5,4,3,2,1], d = 1
-Output: 7
-Explanation: Start at index 0. You can visit all the indicies.
-
-
-
-
Constraints:
-
-
-
1 <= arr.length <= 1000
-
1 <= arr[i] <= 105
-
1 <= d <= arr.length
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Hints
-
-Hint 1
-Use dynamic programming. dp[i] is max jumps you can do starting from index i. Answer is max(dp[i]).
-
-
-
-Hint 2
-dp[i] = 1 + max (dp[j]) where j is all indices you can reach from i.
-
diff --git a/problems/jump-game-vi/README.md b/problems/jump-game-vi/README.md
deleted file mode 100644
index 80cd600af..000000000
--- a/problems/jump-game-vi/README.md
+++ /dev/null
@@ -1,71 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-erasure-value "Maximum Erasure Value")
-
-[Next >](../checking-existence-of-edge-length-limited-paths "Checking Existence of Edge Length Limited Paths")
-
-## [1696. Jump Game VI (Medium)](https://leetcode.com/problems/jump-game-vi "跳跃游戏 VI")
-
-
You are given a 0-indexed integer array nums and an integer k.
-
-
You are initially standing at index 0. In one move, you can jump at most k steps forward without going outside the boundaries of the array. That is, you can jump from index i to any index in the range [i + 1, min(n - 1, i + k)]inclusive.
-
-
You want to reach the last index of the array (index n - 1). Your score is the sum of all nums[j] for each index j you visited in the array.
-
-
Return the maximum score you can get.
-
-
-
Example 1:
-
-
-Input: nums = [1,-1,-2,4,-7,3], k = 2
-Output: 7
-Explanation: You can choose your jumps forming the subsequence [1,-1,4,3] (underlined above). The sum is 7.
-
-
-
Example 2:
-
-
-Input: nums = [10,-5,-2,4,0,3], k = 3
-Output: 17
-Explanation: You can choose your jumps forming the subsequence [10,4,3] (underlined above). The sum is 17.
-
-
-
Example 3:
-
-
-Input: nums = [1,-5,-20,4,-1,3,-6,-3], k = 2
-Output: 0
-
-
-
-
Constraints:
-
-
-
1 <= nums.length, k <= 105
-
-104 <= nums[i] <= 104
-
-
-### Related Topics
- [[Queue](../../tag/queue/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Sliding Window](../../tag/sliding-window/README.md)]
- [[Monotonic Queue](../../tag/monotonic-queue/README.md)]
- [[Heap (Priority Queue)](../../tag/heap-priority-queue/README.md)]
-
-### Hints
-
-Hint 1
-Let dp[i] be "the maximum score to reach the end starting at index i". The answer for dp[i] is nums[i] + max{dp[i+j]} for 1 <= j <= k. That gives an O(n*k) solution.
-
-
-
-Hint 2
-Instead of checking every j for every i, keep track of the largest dp[i] values in a heap and calculate dp[i] from right to left. When the largest value in the heap is out of bounds of the current index, remove it and keep checking.
-
diff --git a/problems/jump-game-vii/README.md b/problems/jump-game-vii/README.md
deleted file mode 100644
index b8df8c8f6..000000000
--- a/problems/jump-game-vii/README.md
+++ /dev/null
@@ -1,65 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-speed-to-arrive-on-time "Minimum Speed to Arrive on Time")
-
-[Next >](../stone-game-viii "Stone Game VIII")
-
-## [1871. Jump Game VII (Medium)](https://leetcode.com/problems/jump-game-vii "跳跃游戏 VII")
-
-
You are given a 0-indexed binary string s and two integers minJump and maxJump. In the beginning, you are standing at index 0, which is equal to '0'. You can move from index i to index j if the following conditions are fulfilled:
-
-
-
i + minJump <= j <= min(i + maxJump, s.length - 1), and
-
s[j] == '0'.
-
-
-
Return true if you can reach index s.length - 1 in s, or false otherwise.
-
-
-
Example 1:
-
-
-Input: s = "011010", minJump = 2, maxJump = 3
-Output: true
-Explanation:
-In the first step, move from index 0 to index 3.
-In the second step, move from index 3 to index 5.
-
-
-### Related Topics
- [[Two Pointers](../../tag/two-pointers/README.md)]
- [[String](../../tag/string/README.md)]
- [[Prefix Sum](../../tag/prefix-sum/README.md)]
-
-### Hints
-
-Hint 1
-Consider for each reachable index i the interval [i + a, i + b].
-
-
-
-Hint 2
-Use partial sums to mark the intervals as reachable.
-
diff --git a/problems/jump-game/README.md b/problems/jump-game/README.md
deleted file mode 100644
index 161f004dd..000000000
--- a/problems/jump-game/README.md
+++ /dev/null
@@ -1,49 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../spiral-matrix "Spiral Matrix")
-
-[Next >](../merge-intervals "Merge Intervals")
-
-## [55. Jump Game (Medium)](https://leetcode.com/problems/jump-game "跳跃游戏")
-
-
You are given an integer array nums. You are initially positioned at the array's first index, and each element in the array represents your maximum jump length at that position.
-
-
Return true if you can reach the last index, or false otherwise.
-
-
-
Example 1:
-
-
-Input: nums = [2,3,1,1,4]
-Output: true
-Explanation: Jump 1 step from index 0 to 1, then 3 steps to the last index.
-
-
-
Example 2:
-
-
-Input: nums = [3,2,1,0,4]
-Output: false
-Explanation: You will always arrive at index 3 no matter what. Its maximum jump length is 0, which makes it impossible to reach the last index.
-
Given an array of points where points[i] = [xi, yi] represents a point on the X-Y plane and an integer k, return the k closest points to the origin (0, 0).
-
-
The distance between two points on the X-Y plane is the Euclidean distance (i.e., √(x1 - x2)2 + (y1 - y2)2).
-
-
You may return the answer in any order. The answer is guaranteed to be unique (except for the order that it is in).
-
-
-
Example 1:
-
-
-Input: points = [[1,3],[-2,2]], k = 1
-Output: [[-2,2]]
-Explanation:
-The distance between (1, 3) and the origin is sqrt(10).
-The distance between (-2, 2) and the origin is sqrt(8).
-Since sqrt(8) < sqrt(10), (-2, 2) is closer to the origin.
-We only want the closest k = 1 points from the origin, so the answer is just [[-2,2]].
-
-
-
Example 2:
-
-
-Input: points = [[3,3],[5,-1],[-2,4]], k = 2
-Output: [[3,3],[-2,4]]
-Explanation: The answer [[-2,4],[3,3]] would also be accepted.
-
Given an integer array arr and an integer k, modify the array by repeating it k times.
-
-
For example, if arr = [1, 2] and k = 3 then the modified array will be [1, 2, 1, 2, 1, 2].
-
-
Return the maximum sub-array sum in the modified array. Note that the length of the sub-array can be 0 and its sum in that case is 0.
-
-
As the answer can be very large, return the answer modulo109 + 7.
-
-
-
Example 1:
-
-
-Input: arr = [1,2], k = 3
-Output: 9
-
-
-
Example 2:
-
-
-Input: arr = [1,-2,1], k = 5
-Output: 2
-
-
-
Example 3:
-
-
-Input: arr = [-1,-2], k = 7
-Output: 0
-
-
-
-
Constraints:
-
-
-
1 <= arr.length <= 105
-
1 <= k <= 105
-
-104 <= arr[i] <= 104
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Hints
-
-Hint 1
-How to solve the problem for k=1 ?
-
-
-
-Hint 2
-Use Kadane's algorithm for k=1.
-
-
-
-Hint 3
-What are the possible cases for the answer ?
-
-
-
-Hint 4
-The answer is the maximum between, the answer for k=1, the sum of the whole array multiplied by k, or the maximum suffix sum plus the maximum prefix sum plus (k-2) multiplied by the whole array sum for k > 1.
-
diff --git a/problems/k-diff-pairs-in-an-array/README.md b/problems/k-diff-pairs-in-an-array/README.md
deleted file mode 100644
index a78983e37..000000000
--- a/problems/k-diff-pairs-in-an-array/README.md
+++ /dev/null
@@ -1,84 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../lonely-pixel-i "Lonely Pixel I")
-
-[Next >](../lonely-pixel-ii "Lonely Pixel II")
-
-## [532. K-diff Pairs in an Array (Medium)](https://leetcode.com/problems/k-diff-pairs-in-an-array "数组中的 k-diff 数对")
-
-
Given an array of integers nums and an integer k, return the number of unique k-diff pairs in the array.
-
-
A k-diff pair is an integer pair (nums[i], nums[j]), where the following are true:
-
-
-
0 <= i < j < nums.length
-
|nums[i] - nums[j]| == k
-
-
-
Notice that |val| denotes the absolute value of val.
-
-
-
Example 1:
-
-
-Input: nums = [3,1,4,1,5], k = 2
-Output: 2
-Explanation: There are two 2-diff pairs in the array, (1, 3) and (3, 5).
-Although we have two 1s in the input, we should only return the number of unique pairs.
-
-
-
Example 2:
-
-
-Input: nums = [1,2,3,4,5], k = 1
-Output: 4
-Explanation: There are four 1-diff pairs in the array, (1, 2), (2, 3), (3, 4) and (4, 5).
-
-
-
Example 3:
-
-
-Input: nums = [1,3,1,5,4], k = 0
-Output: 1
-Explanation: There is one 0-diff pair in the array, (1, 1).
-
-
-
Example 4:
-
-
-Input: nums = [1,2,4,4,3,3,0,9,2,3], k = 3
-Output: 2
-
-
-
Example 5:
-
-
-Input: nums = [-1,-2,-3], k = 1
-Output: 2
-
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 104
-
-107 <= nums[i] <= 107
-
0 <= k <= 107
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Two Pointers](../../tag/two-pointers/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Similar Questions
- 1. [Minimum Absolute Difference in BST](../minimum-absolute-difference-in-bst) (Easy)
- 1. [Count Number of Pairs With Absolute Difference K](../count-number-of-pairs-with-absolute-difference-k) (Easy)
- 1. [Kth Smallest Product of Two Sorted Arrays](../kth-smallest-product-of-two-sorted-arrays) (Hard)
diff --git a/problems/k-diff-pairs-in-an-array/k_diff_pairs_in_an_array.go b/problems/k-diff-pairs-in-an-array/k_diff_pairs_in_an_array.go
deleted file mode 100644
index 0ba26919e..000000000
--- a/problems/k-diff-pairs-in-an-array/k_diff_pairs_in_an_array.go
+++ /dev/null
@@ -1,18 +0,0 @@
-package problem532
-
-func findPairs(nums []int, k int) int {
- ans, m := 0, make(map[int]int)
- for _, v := range nums {
- m[v]++
- }
- for n, v := range m {
- if k < 0 {
- return ans
- } else if k == 0 && v >= 2 {
- ans++
- } else if k > 0 && m[n+k] > 0 {
- ans++
- }
- }
- return ans
-}
diff --git a/problems/k-diff-pairs-in-an-array/k_diff_pairs_in_an_array_test.go b/problems/k-diff-pairs-in-an-array/k_diff_pairs_in_an_array_test.go
deleted file mode 100644
index 6fe5b4a3a..000000000
--- a/problems/k-diff-pairs-in-an-array/k_diff_pairs_in_an_array_test.go
+++ /dev/null
@@ -1,40 +0,0 @@
-package problem532
-
-import "testing"
-
-type testType struct {
- nums []int
- k int
- want int
-}
-
-func TestFindPairs(t *testing.T) {
- tests := [...]testType{
- {
- nums: []int{1, 3, 1, 5, 4},
- k: 0,
- want: 1,
- },
- {
- nums: []int{3, 1, 4, 1, 5},
- k: 2,
- want: 2,
- },
- {
- nums: []int{1, 2, 3, 4, 5},
- k: 1,
- want: 4,
- },
- {
- nums: []int{1, 2, 3, 4, 5},
- k: -1,
- want: 0,
- },
- }
- for _, tt := range tests {
- got := findPairs(tt.nums, tt.k)
- if got != tt.want {
- t.Fatalf("in: %v %v, got: %v, want: %v", tt.nums, tt.k, got, tt.want)
- }
- }
-}
diff --git a/problems/k-empty-slots/README.md b/problems/k-empty-slots/README.md
deleted file mode 100644
index 52e3d2d3e..000000000
--- a/problems/k-empty-slots/README.md
+++ /dev/null
@@ -1,62 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../baseball-game "Baseball Game")
-
-[Next >](../redundant-connection "Redundant Connection")
-
-## [683. K Empty Slots (Hard)](https://leetcode.com/problems/k-empty-slots "K 个关闭的灯泡")
-
-
You have N bulbs in a row numbered from 1 to N. Initially, all the bulbs are turned off. We turn on exactly one bulb everyday until all bulbs are on after N days.
-
-
You are given an array bulbs of length N where bulbs[i] = x means that on the (i+1)th day, we will turn on the bulb at position x where i is 0-indexed and x is 1-indexed.
-
-
Given an integer K, find out the minimum day number such that there exists two turned on bulbs that have exactlyK bulbs between them that are all turned off.
-
-
If there isn't such day, return -1.
-
-
-
-
Example 1:
-
-
-Input:
-bulbs: [1,3,2]
-K: 1
-Output: 2
-Explanation:
-On the first day: bulbs[0] = 1, first bulb is turned on: [1,0,0]
-On the second day: bulbs[1] = 3, third bulb is turned on: [1,0,1]
-On the third day: bulbs[2] = 2, second bulb is turned on: [1,1,1]
-We return 2 because on the second day, there were two on bulbs with one off bulb between them.
-
-
-
Example 2:
-
-
-Input:
-bulbs: [1,2,3]
-K: 1
-Output: -1
-
-
-
-
-
Note:
-
-
-
1 <= N <= 20000
-
1 <= bulbs[i] <= N
-
bulbs is a permutation of numbers from 1 to N.
-
0 <= K <= 20000
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Binary Indexed Tree](../../tag/binary-indexed-tree/README.md)]
- [[Sliding Window](../../tag/sliding-window/README.md)]
- [[Ordered Set](../../tag/ordered-set/README.md)]
diff --git a/problems/k-empty-slots/k_empty_slots.go b/problems/k-empty-slots/k_empty_slots.go
deleted file mode 100644
index 6f1b06a49..000000000
--- a/problems/k-empty-slots/k_empty_slots.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem683
diff --git a/problems/k-empty-slots/k_empty_slots_test.go b/problems/k-empty-slots/k_empty_slots_test.go
deleted file mode 100644
index 6f1b06a49..000000000
--- a/problems/k-empty-slots/k_empty_slots_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem683
diff --git a/problems/k-highest-ranked-items-within-a-price-range/README.md b/problems/k-highest-ranked-items-within-a-price-range/README.md
deleted file mode 100644
index 85a214e2c..000000000
--- a/problems/k-highest-ranked-items-within-a-price-range/README.md
+++ /dev/null
@@ -1,121 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../count-the-hidden-sequences "Count the Hidden Sequences")
-
-[Next >](../number-of-ways-to-divide-a-long-corridor "Number of Ways to Divide a Long Corridor")
-
-## [2146. K Highest Ranked Items Within a Price Range (Medium)](https://leetcode.com/problems/k-highest-ranked-items-within-a-price-range "价格范围内最高排名的 K 样物品")
-
-
You are given a 0-indexed 2D integer array grid of size m x n that represents a map of the items in a shop. The integers in the grid represent the following:
-
-
-
0 represents a wall that you cannot pass through.
-
1 represents an empty cell that you can freely move to and from.
-
All other positive integers represent the price of an item in that cell. You may also freely move to and from these item cells.
-
-
-
It takes 1 step to travel between adjacent grid cells.
-
-
You are also given integer arrays pricing and start where pricing = [low, high] and start = [row, col] indicates that you start at the position (row, col) and are interested only in items with a price in the range of [low, high] (inclusive). You are further given an integer k.
-
-
You are interested in the positions of the khighest-ranked items whose prices are within the given price range. The rank is determined by the first of these criteria that is different:
-
-
-
Distance, defined as the length of the shortest path from the start (shorter distance has a higher rank).
-
Price (lower price has a higher rank, but it must be in the price range).
-
The row number (smaller row number has a higher rank).
-
The column number (smaller column number has a higher rank).
-
-
-
Return the k highest-ranked items within the price range sorted by their rank (highest to lowest). If there are fewer than k reachable items within the price range, return all of them.
-
-
-
Example 1:
-
-
-Input: grid = [[1,2,0,1],[1,3,0,1],[0,2,5,1]], pricing = [2,5], start = [0,0], k = 3
-Output: [[0,1],[1,1],[2,1]]
-Explanation: You start at (0,0).
-With a price range of [2,5], we can take items from (0,1), (1,1), (2,1) and (2,2).
-The ranks of these items are:
-- (0,1) with distance 1
-- (1,1) with distance 2
-- (2,1) with distance 3
-- (2,2) with distance 4
-Thus, the 3 highest ranked items in the price range are (0,1), (1,1), and (2,1).
-
-
-
Example 2:
-
-
-Input: grid = [[1,2,0,1],[1,3,3,1],[0,2,5,1]], pricing = [2,3], start = [2,3], k = 2
-Output: [[2,1],[1,2]]
-Explanation: You start at (2,3).
-With a price range of [2,3], we can take items from (0,1), (1,1), (1,2) and (2,1).
-The ranks of these items are:
-- (2,1) with distance 2, price 2
-- (1,2) with distance 2, price 3
-- (1,1) with distance 3
-- (0,1) with distance 4
-Thus, the 2 highest ranked items in the price range are (2,1) and (1,2).
-
-
-
Example 3:
-
-
-Input: grid = [[1,1,1],[0,0,1],[2,3,4]], pricing = [2,3], start = [0,0], k = 3
-Output: [[2,1],[2,0]]
-Explanation: You start at (0,0).
-With a price range of [2,3], we can take items from (2,0) and (2,1).
-The ranks of these items are:
-- (2,1) with distance 5
-- (2,0) with distance 6
-Thus, the 2 highest ranked items in the price range are (2,1) and (2,0).
-Note that k = 3 but there are only 2 reachable items within the price range.
-
-
-
-
Constraints:
-
-
-
m == grid.length
-
n == grid[i].length
-
1 <= m, n <= 105
-
1 <= m * n <= 105
-
0 <= grid[i][j] <= 105
-
pricing.length == 2
-
2 <= low <= high <= 105
-
start.length == 2
-
0 <= row <= m - 1
-
0 <= col <= n - 1
-
grid[row][col] > 0
-
1 <= k <= m * n
-
-
-### Related Topics
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
- [[Heap (Priority Queue)](../../tag/heap-priority-queue/README.md)]
-
-### Hints
-
-Hint 1
-Could you determine the rank of every item efficiently?
-
-
-
-Hint 2
-We can perform a breadth-first search from the starting position and know the length of the shortest path from start to every item.
-
-
-
-Hint 3
-Sort all the items according to the conditions listed in the problem, and return the first k (or all if less than k exist) items as the answer.
-
diff --git a/problems/k-inverse-pairs-array/README.md b/problems/k-inverse-pairs-array/README.md
deleted file mode 100644
index 965cf20b2..000000000
--- a/problems/k-inverse-pairs-array/README.md
+++ /dev/null
@@ -1,44 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-product-of-three-numbers "Maximum Product of Three Numbers")
-
-[Next >](../course-schedule-iii "Course Schedule III")
-
-## [629. K Inverse Pairs Array (Hard)](https://leetcode.com/problems/k-inverse-pairs-array "K个逆序对数组")
-
-
For an integer array nums, an inverse pair is a pair of integers [i, j] where 0 <= i < j < nums.length and nums[i] > nums[j].
-
-
Given two integers n and k, return the number of different arrays consist of numbers from 1 to n such that there are exactly kinverse pairs. Since the answer can be huge, return it modulo109 + 7.
-
-
-
Example 1:
-
-
-Input: n = 3, k = 0
-Output: 1
-Explanation: Only the array [1,2,3] which consists of numbers from 1 to 3 has exactly 0 inverse pairs.
-
-
-
Example 2:
-
-
-Input: n = 3, k = 1
-Output: 2
-Explanation: The array [1,3,2] and [2,1,3] have exactly 1 inverse pair.
-
-
-
-
Constraints:
-
-
-
1 <= n <= 1000
-
0 <= k <= 1000
-
-
-### Related Topics
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
diff --git a/problems/k-inverse-pairs-array/k_inverse_pairs_array.go b/problems/k-inverse-pairs-array/k_inverse_pairs_array.go
deleted file mode 100644
index 36318233e..000000000
--- a/problems/k-inverse-pairs-array/k_inverse_pairs_array.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem629
diff --git a/problems/k-inverse-pairs-array/k_inverse_pairs_array_test.go b/problems/k-inverse-pairs-array/k_inverse_pairs_array_test.go
deleted file mode 100644
index 36318233e..000000000
--- a/problems/k-inverse-pairs-array/k_inverse_pairs_array_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem629
diff --git a/problems/k-radius-subarray-averages/README.md b/problems/k-radius-subarray-averages/README.md
deleted file mode 100644
index f062f0a12..000000000
--- a/problems/k-radius-subarray-averages/README.md
+++ /dev/null
@@ -1,87 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../find-target-indices-after-sorting-array "Find Target Indices After Sorting Array")
-
-[Next >](../removing-minimum-and-maximum-from-array "Removing Minimum and Maximum From Array")
-
-## [2090. K Radius Subarray Averages (Medium)](https://leetcode.com/problems/k-radius-subarray-averages "半径为 k 的子数组平均值")
-
-
You are given a 0-indexed array nums of n integers, and an integer k.
-
-
The k-radius average for a subarray of numscentered at some index i with the radiusk is the average of all elements in nums between the indices i - k and i + k (inclusive). If there are less than k elements before or after the index i, then the k-radius average is -1.
-
-
Build and return an array avgs of length n where avgs[i] is the k-radius average for the subarray centered at index i.
-
-
The average of x elements is the sum of the x elements divided by x, using integer division. The integer division truncates toward zero, which means losing its fractional part.
-
-
-
For example, the average of four elements 2, 3, 1, and 5 is (2 + 3 + 1 + 5) / 4 = 11 / 4 = 2.75, which truncates to 2.
-
-
-
-
Example 1:
-
-
-Input: nums = [7,4,3,9,1,8,5,2,6], k = 3
-Output: [-1,-1,-1,5,4,4,-1,-1,-1]
-Explanation:
-- avg[0], avg[1], and avg[2] are -1 because there are less than k elements before each index.
-- The sum of the subarray centered at index 3 with radius 3 is: 7 + 4 + 3 + 9 + 1 + 8 + 5 = 37.
- Using integer division, avg[3] = 37 / 7 = 5.
-- For the subarray centered at index 4, avg[4] = (4 + 3 + 9 + 1 + 8 + 5 + 2) / 7 = 4.
-- For the subarray centered at index 5, avg[5] = (3 + 9 + 1 + 8 + 5 + 2 + 6) / 7 = 4.
-- avg[6], avg[7], and avg[8] are -1 because there are less than k elements after each index.
-
-
-
Example 2:
-
-
-Input: nums = [100000], k = 0
-Output: [100000]
-Explanation:
-- The sum of the subarray centered at index 0 with radius 0 is: 100000.
- avg[0] = 100000 / 1 = 100000.
-
-
-
Example 3:
-
-
-Input: nums = [8], k = 100000
-Output: [-1]
-Explanation:
-- avg[0] is -1 because there are less than k elements before and after index 0.
-
-
-
-
Constraints:
-
-
-
n == nums.length
-
1 <= n <= 105
-
0 <= nums[i], k <= 105
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Sliding Window](../../tag/sliding-window/README.md)]
-
-### Hints
-
-Hint 1
-To calculate the average of a subarray, you need the sum and the K. K is already given. How could you quickly calculate the sum of a subarray?
-
-
-
-Hint 2
-Use the Prefix Sums method to calculate the subarray sums.
-
-
-
-Hint 3
-It is possible that the sum of all the elements does not fit in a 32-bit integer type. Be sure to use a 64-bit integer type for the prefix sum array.
-
diff --git a/problems/k-similar-strings/README.md b/problems/k-similar-strings/README.md
deleted file mode 100644
index 75314f709..000000000
--- a/problems/k-similar-strings/README.md
+++ /dev/null
@@ -1,47 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../car-fleet "Car Fleet")
-
-[Next >](../exam-room "Exam Room")
-
-## [854. K-Similar Strings (Hard)](https://leetcode.com/problems/k-similar-strings "相似度为 K 的字符串")
-
-
Strings s1 and s2 are k-similar (for some non-negative integer k) if we can swap the positions of two letters in s1 exactly k times so that the resulting string equals s2.
-
-
Given two anagrams s1 and s2, return the smallest k for which s1 and s2 are k-similar.
-
-
-
Example 1:
-
Input: s1 = "ab", s2 = "ba"
-Output: 1
-
Example 2:
-
Input: s1 = "abc", s2 = "bca"
-Output: 2
-
Example 3:
-
Input: s1 = "abac", s2 = "baca"
-Output: 2
-
Example 4:
-
Input: s1 = "aabc", s2 = "abca"
-Output: 2
-
-
-
Constraints:
-
-
-
1 <= s1.length <= 20
-
s2.length == s1.length
-
s1 and s2 contain only lowercase letters from the set {'a', 'b', 'c', 'd', 'e', 'f'}.
Given two integers n and k, return thekthlexicographically smallest integer in the range[1, n].
-
-
-
Example 1:
-
-
-Input: n = 13, k = 2
-Output: 10
-Explanation: The lexicographical order is [1, 10, 11, 12, 13, 2, 3, 4, 5, 6, 7, 8, 9], so the second smallest number is 10.
-
You are given a sorted integer array arr containing 1 and prime numbers, where all the integers of arr are unique. You are also given an integer k.
-
-
For every i and j where 0 <= i < j < arr.length, we consider the fraction arr[i] / arr[j].
-
-
Return thekthsmallest fraction considered. Return your answer as an array of integers of size 2, where answer[0] == arr[i] and answer[1] == arr[j].
-
-
-
Example 1:
-
-
-Input: arr = [1,2,3,5], k = 3
-Output: [2,5]
-Explanation: The fractions to be considered in sorted order are:
-1/5, 1/3, 2/5, 1/2, 3/5, and 2/3.
-The third fraction is 2/5.
-
-
-
Example 2:
-
-
-Input: arr = [1,7], k = 1
-Output: [1,7]
-
-
-
-
Constraints:
-
-
-
2 <= arr.length <= 1000
-
1 <= arr[i] <= 3 * 104
-
arr[0] == 1
-
arr[i] is a prime number for i > 0.
-
All the numbers of arr are unique and sorted in strictly increasing order.
We build a table of n rows (1-indexed). We start by writing 0 in the 1st row. Now in every subsequent row, we look at the previous row and replace each occurrence of 0 with 01, and each occurrence of 1 with 10.
-
-
-
For example, for n = 3, the 1st row is 0, the 2nd row is 01, and the 3rd row is 0110.
-
-
-
Given two integer n and k, return the kth (1-indexed) symbol in the nth row of a table of n rows.
-
-
-
Example 1:
-
-
-Input: n = 1, k = 1
-Output: 0
-Explanation: row 1: 0
-
-
-
Example 2:
-
-
-Input: n = 2, k = 1
-Output: 0
-Explanation:
-row 1: 0
-row 2: 01
-
-
-
Example 3:
-
-
-Input: n = 2, k = 2
-Output: 1
-Explanation:
-row 1: 0
-row 2: 01
-
-
-
Example 4:
-
-
-Input: n = 3, k = 1
-Output: 0
-Explanation:
-row 1: 0
-row 2: 01
-row 3: 0110
-
-
-
-
Constraints:
-
-
-
1 <= n <= 30
-
1 <= k <= 2n - 1
-
-
-### Related Topics
- [[Bit Manipulation](../../tag/bit-manipulation/README.md)]
- [[Recursion](../../tag/recursion/README.md)]
- [[Math](../../tag/math/README.md)]
-
-### Hints
-
-Hint 1
-Try to represent the current (N, K) in terms of some (N-1, prevK). What is prevK ?
-
diff --git a/problems/k-th-symbol-in-grammar/k_th_symbol_in_grammar.go b/problems/k-th-symbol-in-grammar/k_th_symbol_in_grammar.go
deleted file mode 100644
index 5b757475a..000000000
--- a/problems/k-th-symbol-in-grammar/k_th_symbol_in_grammar.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem779
diff --git a/problems/k-th-symbol-in-grammar/k_th_symbol_in_grammar_test.go b/problems/k-th-symbol-in-grammar/k_th_symbol_in_grammar_test.go
deleted file mode 100644
index 5b757475a..000000000
--- a/problems/k-th-symbol-in-grammar/k_th_symbol_in_grammar_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem779
diff --git a/problems/keep-multiplying-found-values-by-two/README.md b/problems/keep-multiplying-found-values-by-two/README.md
deleted file mode 100644
index bb4be6ff6..000000000
--- a/problems/keep-multiplying-found-values-by-two/README.md
+++ /dev/null
@@ -1,81 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../the-number-of-passengers-in-each-bus-ii "The Number of Passengers in Each Bus II")
-
-[Next >](../all-divisions-with-the-highest-score-of-a-binary-array "All Divisions With the Highest Score of a Binary Array")
-
-## [2154. Keep Multiplying Found Values by Two (Easy)](https://leetcode.com/problems/keep-multiplying-found-values-by-two "将找到的值乘以 2")
-
-
You are given an array of integers nums. You are also given an integer original which is the first number that needs to be searched for in nums.
-
-
You then do the following steps:
-
-
-
If original is found in nums, multiply it by two (i.e., set original = 2 * original).
-
Otherwise, stop the process.
-
Repeat this process with the new number as long as you keep finding the number.
-
-
-
Return the final value of original.
-
-
-
Example 1:
-
-
-Input: nums = [5,3,6,1,12], original = 3
-Output: 24
-Explanation:
-- 3 is found in nums. 3 is multiplied by 2 to obtain 6.
-- 6 is found in nums. 6 is multiplied by 2 to obtain 12.
-- 12 is found in nums. 12 is multiplied by 2 to obtain 24.
-- 24 is not found in nums. Thus, 24 is returned.
-
-
-
Example 2:
-
-
-Input: nums = [2,7,9], original = 4
-Output: 4
-Explanation:
-- 4 is not found in nums. Thus, 4 is returned.
-
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 1000
-
1 <= nums[i], original <= 1000
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
- [[Simulation](../../tag/simulation/README.md)]
-
-### Hints
-
-Hint 1
-Repeatedly iterate through the array and check if the current value of original is in the array.
-
-
-
-Hint 2
-If original is not found, stop and return its current value.
-
-
-
-Hint 3
-Otherwise, multiply original by 2 and repeat the process.
-
-
-
-Hint 4
-Use set data structure to check the existence faster.
-
diff --git a/problems/keyboard-row/README.md b/problems/keyboard-row/README.md
deleted file mode 100644
index eb993a5b6..000000000
--- a/problems/keyboard-row/README.md
+++ /dev/null
@@ -1,58 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../the-maze-iii "The Maze III")
-
-[Next >](../find-mode-in-binary-search-tree "Find Mode in Binary Search Tree")
-
-## [500. Keyboard Row (Easy)](https://leetcode.com/problems/keyboard-row "键盘行")
-
-
Given an array of strings words, return the words that can be typed using letters of the alphabet on only one row of American keyboard like the image below.
-
-
In the American keyboard:
-
-
-
the first row consists of the characters "qwertyuiop",
-
the second row consists of the characters "asdfghjkl", and
-
the third row consists of the characters "zxcvbnm".
-
-
-
-
Example 1:
-
-
-Input: words = ["Hello","Alaska","Dad","Peace"]
-Output: ["Alaska","Dad"]
-
-
-
Example 2:
-
-
-Input: words = ["omk"]
-Output: []
-
-
-
Example 3:
-
-
-Input: words = ["adsdf","sfd"]
-Output: ["adsdf","sfd"]
-
-
-
-
Constraints:
-
-
-
1 <= words.length <= 20
-
1 <= words[i].length <= 100
-
words[i] consists of English letters (both lowercase and uppercase).
There are n rooms labeled from 0 to n - 1 and all the rooms are locked except for room 0. Your goal is to visit all the rooms. However, you cannot enter a locked room without having its key.
-
-
When you visit a room, you may find a set of distinct keys in it. Each key has a number on it, denoting which room it unlocks, and you can take all of them with you to unlock the other rooms.
-
-
Given an array rooms where rooms[i] is the set of keys that you can obtain if you visited room i, return trueif you can visit all the rooms, orfalseotherwise.
-
-
-
Example 1:
-
-
-Input: rooms = [[1],[2],[3],[]]
-Output: true
-Explanation:
-We visit room 0 and pick up key 1.
-We then visit room 1 and pick up key 2.
-We then visit room 2 and pick up key 3.
-We then visit room 3.
-Since we were able to visit every room, we return true.
-
-
-
Example 2:
-
-
-Input: rooms = [[1,3],[3,0,1],[2],[0]]
-Output: false
-Explanation: We can not enter room number 2 since the only key that unlocks it is in that room.
-
-
-
-
Constraints:
-
-
-
n == rooms.length
-
2 <= n <= 1000
-
0 <= rooms[i].length <= 1000
-
1 <= sum(rooms[i].length) <= 3000
-
0 <= rooms[i][j] < n
-
All the values of rooms[i] are unique.
-
-
-### Related Topics
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Graph](../../tag/graph/README.md)]
-
-### Similar Questions
- 1. [Graph Valid Tree](../graph-valid-tree) (Medium)
diff --git a/problems/keys-and-rooms/keys_and_rooms.go b/problems/keys-and-rooms/keys_and_rooms.go
deleted file mode 100644
index e97d946ae..000000000
--- a/problems/keys-and-rooms/keys_and_rooms.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem841
diff --git a/problems/keys-and-rooms/keys_and_rooms_test.go b/problems/keys-and-rooms/keys_and_rooms_test.go
deleted file mode 100644
index e97d946ae..000000000
--- a/problems/keys-and-rooms/keys_and_rooms_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem841
diff --git a/problems/kids-with-the-greatest-number-of-candies/README.md b/problems/kids-with-the-greatest-number-of-candies/README.md
deleted file mode 100644
index 248845bf8..000000000
--- a/problems/kids-with-the-greatest-number-of-candies/README.md
+++ /dev/null
@@ -1,67 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../check-if-a-string-is-a-valid-sequence-from-root-to-leaves-path-in-a-binary-tree "Check If a String Is a Valid Sequence from Root to Leaves Path in a Binary Tree")
-
-[Next >](../max-difference-you-can-get-from-changing-an-integer "Max Difference You Can Get From Changing an Integer")
-
-## [1431. Kids With the Greatest Number of Candies (Easy)](https://leetcode.com/problems/kids-with-the-greatest-number-of-candies "拥有最多糖果的孩子")
-
-
There are n kids with candies. You are given an integer array candies, where each candies[i] represents the number of candies the ith kid has, and an integer extraCandies, denoting the number of extra candies that you have.
-
-
Return a boolean array result of length n, where result[i] is true if, after giving the ith kid all the extraCandies, they will have the greatest number of candies among all the kids, or false otherwise.
-
-
Note that multiple kids can have the greatest number of candies.
-
-
-
Example 1:
-
-
-Input: candies = [2,3,5,1,3], extraCandies = 3
-Output: [true,true,true,false,true]
-Explanation: If you give all extraCandies to:
-- Kid 1, they will have 2 + 3 = 5 candies, which is the greatest among the kids.
-- Kid 2, they will have 3 + 3 = 6 candies, which is the greatest among the kids.
-- Kid 3, they will have 5 + 3 = 8 candies, which is the greatest among the kids.
-- Kid 4, they will have 1 + 3 = 4 candies, which is not the greatest among the kids.
-- Kid 5, they will have 3 + 3 = 6 candies, which is the greatest among the kids.
-
-
-
Example 2:
-
-
-Input: candies = [4,2,1,1,2], extraCandies = 1
-Output: [true,false,false,false,false]
-Explanation: There is only 1 extra candy.
-Kid 1 will always have the greatest number of candies, even if a different kid is given the extra candy.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
-
-### Hints
-
-Hint 1
-Use greedy approach. For each kid check if candies[i] + extraCandies ≥ maximum in Candies[i].
-
diff --git a/problems/kill-process/README.md b/problems/kill-process/README.md
deleted file mode 100644
index bd317f457..000000000
--- a/problems/kill-process/README.md
+++ /dev/null
@@ -1,50 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../shortest-unsorted-continuous-subarray "Shortest Unsorted Continuous Subarray")
-
-[Next >](../delete-operation-for-two-strings "Delete Operation for Two Strings")
-
-## [582. Kill Process (Medium)](https://leetcode.com/problems/kill-process "杀掉进程")
-
-
Given n processes, each process has a unique PID (process id) and its PPID (parent process id).
-
-
Each process only has one parent process, but may have one or more children processes. This is just like a tree structure. Only one process has PPID that is 0, which means this process has no parent process. All the PIDs will be distinct positive integers.
-
-
We use two list of integers to represent a list of processes, where the first list contains PID for each process and the second list contains the corresponding PPID.
-
-
Now given the two lists, and a PID representing a process you want to kill, return a list of PIDs of processes that will be killed in the end. You should assume that when a process is killed, all its children processes will be killed. No order is required for the final answer.
The chess knight has a unique movement, it may move two squares vertically and one square horizontally, or two squares horizontally and one square vertically (with both forming the shape of an L). The possible movements of chess knight are shown in this diagaram:
-
-
A chess knight can move as indicated in the chess diagram below:
-
-
We have a chess knight and a phone pad as shown below, the knight can only stand on a numeric cell (i.e. blue cell).
-
-
Given an integer n, return how many distinct phone numbers of length n we can dial.
-
-
You are allowed to place the knight on any numeric cell initially and then you should perform n - 1 jumps to dial a number of length n. All jumps should be valid knight jumps.
-
-
As the answer may be very large, return the answer modulo109 + 7.
-
-
-
Example 1:
-
-
-Input: n = 1
-Output: 10
-Explanation: We need to dial a number of length 1, so placing the knight over any numeric cell of the 10 cells is sufficient.
-
-
-
Example 2:
-
-
-Input: n = 2
-Output: 20
-Explanation: All the valid number we can dial are [04, 06, 16, 18, 27, 29, 34, 38, 40, 43, 49, 60, 61, 67, 72, 76, 81, 83, 92, 94]
-
-
-
Example 3:
-
-
-Input: n = 3
-Output: 46
-
-
-
Example 4:
-
-
-Input: n = 4
-Output: 104
-
-
-
Example 5:
-
-
-Input: n = 3131
-Output: 136006598
-Explanation: Please take care of the mod.
-
On an n x n chessboard, a knight starts at the cell (row, column) and attempts to make exactly k moves. The rows and columns are 0-indexed, so the top-left cell is (0, 0), and the bottom-right cell is (n - 1, n - 1).
-
-
A chess knight has eight possible moves it can make, as illustrated below. Each move is two cells in a cardinal direction, then one cell in an orthogonal direction.
-
-
Each time the knight is to move, it chooses one of eight possible moves uniformly at random (even if the piece would go off the chessboard) and moves there.
-
-
The knight continues moving until it has made exactly k moves or has moved off the chessboard.
-
-
Return the probability that the knight remains on the board after it has stopped moving.
-
-
-
Example 1:
-
-
-Input: n = 3, k = 2, row = 0, column = 0
-Output: 0.06250
-Explanation: There are two moves (to (1,2), (2,1)) that will keep the knight on the board.
-From each of those positions, there are also two moves that will keep the knight on the board.
-The total probability the knight stays on the board is 0.0625.
-
-
-
Example 2:
-
-
-Input: n = 1, k = 0, row = 0, column = 0
-Output: 1.00000
-
Koko loves to eat bananas. There are n piles of bananas, the ith pile has piles[i] bananas. The guards have gone and will come back in h hours.
-
-
Koko can decide her bananas-per-hour eating speed of k. Each hour, she chooses some pile of bananas and eats k bananas from that pile. If the pile has less than k bananas, she eats all of them instead and will not eat any more bananas during this hour.
-
-
Koko likes to eat slowly but still wants to finish eating all the bananas before the guards return.
-
-
Return the minimum integerksuch that she can eat all the bananas withinhhours.
-
-
-
Example 1:
-
-
-Input: piles = [3,6,7,11], h = 8
-Output: 4
-
-
-
Example 2:
-
-
-Input: piles = [30,11,23,4,20], h = 5
-Output: 30
-
-
-
Example 3:
-
-
-Input: piles = [30,11,23,4,20], h = 6
-Output: 23
-
-
-
-
Constraints:
-
-
-
1 <= piles.length <= 104
-
piles.length <= h <= 109
-
1 <= piles[i] <= 109
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
-
-### Similar Questions
- 1. [Minimize Max Distance to Gas Station](../minimize-max-distance-to-gas-station) (Hard)
- 1. [Minimized Maximum of Products Distributed to Any Store](../minimized-maximum-of-products-distributed-to-any-store) (Medium)
diff --git a/problems/koko-eating-bananas/koko_eating_bananas.go b/problems/koko-eating-bananas/koko_eating_bananas.go
deleted file mode 100644
index f60cb1950..000000000
--- a/problems/koko-eating-bananas/koko_eating_bananas.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem875
diff --git a/problems/koko-eating-bananas/koko_eating_bananas_test.go b/problems/koko-eating-bananas/koko_eating_bananas_test.go
deleted file mode 100644
index f60cb1950..000000000
--- a/problems/koko-eating-bananas/koko_eating_bananas_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem875
diff --git a/problems/kth-ancestor-of-a-tree-node/README.md b/problems/kth-ancestor-of-a-tree-node/README.md
deleted file mode 100644
index b453b8438..000000000
--- a/problems/kth-ancestor-of-a-tree-node/README.md
+++ /dev/null
@@ -1,70 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-number-of-days-to-make-m-bouquets "Minimum Number of Days to Make m Bouquets")
-
-[Next >](../group-sold-products-by-the-date "Group Sold Products By The Date")
-
-## [1483. Kth Ancestor of a Tree Node (Hard)](https://leetcode.com/problems/kth-ancestor-of-a-tree-node "树节点的第 K 个祖先")
-
-
You are given a tree with n nodes numbered from 0 to n - 1 in the form of a parent array parent where parent[i] is the parent of ith node. The root of the tree is node 0. Find the kth ancestor of a given node.
-
-
The kth ancestor of a tree node is the kth node in the path from that node to the root node.
-
-
Implement the TreeAncestor class:
-
-
-
TreeAncestor(int n, int[] parent) Initializes the object with the number of nodes in the tree and the parent array.
-
int getKthAncestor(int node, int k) return the kth ancestor of the given node node. If there is no such ancestor, return -1.
-
-
-
-
Example 1:
-
-
-Input
-["TreeAncestor", "getKthAncestor", "getKthAncestor", "getKthAncestor"]
-[[7, [-1, 0, 0, 1, 1, 2, 2]], [3, 1], [5, 2], [6, 3]]
-Output
-[null, 1, 0, -1]
-
-Explanation
-TreeAncestor treeAncestor = new TreeAncestor(7, [-1, 0, 0, 1, 1, 2, 2]);
-treeAncestor.getKthAncestor(3, 1); // returns 1 which is the parent of 3
-treeAncestor.getKthAncestor(5, 2); // returns 0 which is the grandparent of 5
-treeAncestor.getKthAncestor(6, 3); // returns -1 because there is no such ancestor
-
-
-
Constraints:
-
-
-
1 <= k <= n <= 5 * 104
-
parent.length == n
-
parent[0] == -1
-
0 <= parent[i] < n for all 0 < i < n
-
0 <= node < n
-
There will be at most 5 * 104 queries.
-
-
-### Related Topics
- [[Binary Search](../../tag/binary-search/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Tree](../../tag/tree/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Design](../../tag/design/README.md)]
-
-### Hints
-
-Hint 1
-The queries must be answered efficiently to avoid time limit exceeded verdict.
-
-
-
-Hint 2
-Use sparse table (dynamic programming application) to travel the tree upwards in a fast way.
-
diff --git a/problems/kth-distinct-string-in-an-array/README.md b/problems/kth-distinct-string-in-an-array/README.md
deleted file mode 100644
index ecdafd738..000000000
--- a/problems/kth-distinct-string-in-an-array/README.md
+++ /dev/null
@@ -1,70 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-cost-to-separate-sentence-into-rows "Minimum Cost to Separate Sentence Into Rows")
-
-[Next >](../two-best-non-overlapping-events "Two Best Non-Overlapping Events")
-
-## [2053. Kth Distinct String in an Array (Easy)](https://leetcode.com/problems/kth-distinct-string-in-an-array "数组中第 K 个独一无二的字符串")
-
-
A distinct string is a string that is present only once in an array.
-
-
Given an array of strings arr, and an integer k, return the kthdistinct string present in arr. If there are fewer than k distinct strings, return an empty string "".
-
-
Note that the strings are considered in the order in which they appear in the array.
-
-
-
Example 1:
-
-
-Input: arr = ["d","b","c","b","c","a"], k = 2
-Output: "a"
-Explanation:
-The only distinct strings in arr are "d" and "a".
-"d" appears 1st, so it is the 1st distinct string.
-"a" appears 2nd, so it is the 2nd distinct string.
-Since k == 2, "a" is returned.
-
-
-
Example 2:
-
-
-Input: arr = ["aaa","aa","a"], k = 1
-Output: "aaa"
-Explanation:
-All strings in arr are distinct, so the 1st string "aaa" is returned.
-
-
-
Example 3:
-
-
-Input: arr = ["a","b","a"], k = 3
-Output: ""
-Explanation:
-The only distinct string is "b". Since there are fewer than 3 distinct strings, we return an empty string "".
-
-
-
-
Constraints:
-
-
-
1 <= k <= arr.length <= 1000
-
1 <= arr[i].length <= 5
-
arr[i] consists of lowercase English letters.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
- [[Counting](../../tag/counting/README.md)]
-
-### Hints
-
-Hint 1
-Try 'mapping' the strings to check if they are unique or not.
-
diff --git a/problems/kth-largest-element-in-a-stream/README.md b/problems/kth-largest-element-in-a-stream/README.md
deleted file mode 100644
index 5c9061b41..000000000
--- a/problems/kth-largest-element-in-a-stream/README.md
+++ /dev/null
@@ -1,63 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../search-in-a-sorted-array-of-unknown-size "Search in a Sorted Array of Unknown Size")
-
-[Next >](../binary-search "Binary Search")
-
-## [703. Kth Largest Element in a Stream (Easy)](https://leetcode.com/problems/kth-largest-element-in-a-stream "数据流中的第 K 大元素")
-
-
Design a class to find the kth largest element in a stream. Note that it is the kth largest element in the sorted order, not the kth distinct element.
-
-
Implement KthLargest class:
-
-
-
KthLargest(int k, int[] nums) Initializes the object with the integer k and the stream of integers nums.
-
int add(int val) Appends the integer val to the stream and returns the element representing the kth largest element in the stream.
It is guaranteed that there will be at least k elements in the array when you search for the kth element.
-
-
-### Related Topics
- [[Tree](../../tag/tree/README.md)]
- [[Design](../../tag/design/README.md)]
- [[Binary Search Tree](../../tag/binary-search-tree/README.md)]
- [[Binary Tree](../../tag/binary-tree/README.md)]
- [[Data Stream](../../tag/data-stream/README.md)]
- [[Heap (Priority Queue)](../../tag/heap-priority-queue/README.md)]
-
-### Similar Questions
- 1. [Kth Largest Element in an Array](../kth-largest-element-in-an-array) (Medium)
diff --git a/problems/kth-largest-element-in-a-stream/kth_largest_element_in_a_stream.go b/problems/kth-largest-element-in-a-stream/kth_largest_element_in_a_stream.go
deleted file mode 100644
index 1064eb8b0..000000000
--- a/problems/kth-largest-element-in-a-stream/kth_largest_element_in_a_stream.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem703
diff --git a/problems/kth-largest-element-in-a-stream/kth_largest_element_in_a_stream_test.go b/problems/kth-largest-element-in-a-stream/kth_largest_element_in_a_stream_test.go
deleted file mode 100644
index 1064eb8b0..000000000
--- a/problems/kth-largest-element-in-a-stream/kth_largest_element_in_a_stream_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem703
diff --git a/problems/kth-largest-element-in-an-array/README.md b/problems/kth-largest-element-in-an-array/README.md
deleted file mode 100644
index d96cba83e..000000000
--- a/problems/kth-largest-element-in-an-array/README.md
+++ /dev/null
@@ -1,46 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../shortest-palindrome "Shortest Palindrome")
-
-[Next >](../combination-sum-iii "Combination Sum III")
-
-## [215. Kth Largest Element in an Array (Medium)](https://leetcode.com/problems/kth-largest-element-in-an-array "数组中的第K个最大元素")
-
-
Given an integer array nums and an integer k, return thekthlargest element in the array.
-
-
Note that it is the kth largest element in the sorted order, not the kth distinct element.
-
-
-
Example 1:
-
Input: nums = [3,2,1,5,6,4], k = 2
-Output: 5
-
Example 2:
-
Input: nums = [3,2,3,1,2,4,5,5,6], k = 4
-Output: 4
-
-
-
Constraints:
-
-
-
1 <= k <= nums.length <= 104
-
-104 <= nums[i] <= 104
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Divide and Conquer](../../tag/divide-and-conquer/README.md)]
- [[Quickselect](../../tag/quickselect/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
- [[Heap (Priority Queue)](../../tag/heap-priority-queue/README.md)]
-
-### Similar Questions
- 1. [Wiggle Sort II](../wiggle-sort-ii) (Medium)
- 1. [Top K Frequent Elements](../top-k-frequent-elements) (Medium)
- 1. [Third Maximum Number](../third-maximum-number) (Easy)
- 1. [Kth Largest Element in a Stream](../kth-largest-element-in-a-stream) (Easy)
- 1. [K Closest Points to Origin](../k-closest-points-to-origin) (Medium)
diff --git a/problems/kth-largest-element-in-an-array/kth_largest_element_in_an_array.go b/problems/kth-largest-element-in-an-array/kth_largest_element_in_an_array.go
deleted file mode 100644
index 3d77d00b9..000000000
--- a/problems/kth-largest-element-in-an-array/kth_largest_element_in_an_array.go
+++ /dev/null
@@ -1,8 +0,0 @@
-package problem215
-
-import "sort"
-
-func findKthLargest(nums []int, k int) int {
- sort.Ints(nums)
- return nums[len(nums)-k]
-}
diff --git a/problems/kth-largest-element-in-an-array/kth_largest_element_in_an_array_test.go b/problems/kth-largest-element-in-an-array/kth_largest_element_in_an_array_test.go
deleted file mode 100644
index 0f9840280..000000000
--- a/problems/kth-largest-element-in-an-array/kth_largest_element_in_an_array_test.go
+++ /dev/null
@@ -1,29 +0,0 @@
-package problem215
-
-import "testing"
-
-type testType struct {
- in []int
- k int
- want int
-}
-
-func TestFindKthLargest(t *testing.T) {
- tests := [...]testType{
- {
- in: []int{3, 2, 1, 5, 6, 4},
- k: 2,
- want: 5,
- }, {
- in: []int{3, 2, 3, 1, 2, 4, 5, 5, 6},
- k: 4,
- want: 4,
- },
- }
- for _, tt := range tests {
- got := findKthLargest(tt.in, tt.k)
- if got != tt.want {
- t.Fatalf("in: %v, got: %v, want: %v", tt.in, got, tt.want)
- }
- }
-}
diff --git a/problems/kth-missing-positive-number/README.md b/problems/kth-missing-positive-number/README.md
deleted file mode 100644
index 243391cfb..000000000
--- a/problems/kth-missing-positive-number/README.md
+++ /dev/null
@@ -1,53 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../guess-the-majority-in-a-hidden-array "Guess the Majority in a Hidden Array")
-
-[Next >](../can-convert-string-in-k-moves "Can Convert String in K Moves")
-
-## [1539. Kth Missing Positive Number (Easy)](https://leetcode.com/problems/kth-missing-positive-number "第 k 个缺失的正整数")
-
-
Given an array arr of positive integers sorted in a strictly increasing order, and an integer k.
-
-
Find the kth positive integer that is missing from this array.
-
-
-
Example 1:
-
-
-Input: arr = [2,3,4,7,11], k = 5
-Output: 9
-Explanation: The missing positive integers are [1,5,6,8,9,10,12,13,...]. The 5th missing positive integer is 9.
-
-
-
Example 2:
-
-
-Input: arr = [1,2,3,4], k = 2
-Output: 6
-Explanation: The missing positive integers are [5,6,7,...]. The 2nd missing positive integer is 6.
-
-
-
-
Constraints:
-
-
-
1 <= arr.length <= 1000
-
1 <= arr[i] <= 1000
-
1 <= k <= 1000
-
arr[i] < arr[j] for 1 <= i < j <= arr.length
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
-
-### Hints
-
-Hint 1
-Keep track of how many positive numbers are missing as you scan the array.
-
diff --git a/problems/kth-smallest-element-in-a-bst/README.md b/problems/kth-smallest-element-in-a-bst/README.md
deleted file mode 100644
index baf52bc92..000000000
--- a/problems/kth-smallest-element-in-a-bst/README.md
+++ /dev/null
@@ -1,72 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../majority-element-ii "Majority Element II")
-
-[Next >](../power-of-two "Power of Two")
-
-## [230. Kth Smallest Element in a BST (Medium)](https://leetcode.com/problems/kth-smallest-element-in-a-bst "二叉搜索树中第K小的元素")
-
-
Given the root of a binary search tree, and an integer k, return thekthsmallest value (1-indexed) of all the values of the nodes in the tree.
-
-
-
Example 1:
-
-
-Input: root = [3,1,4,null,2], k = 1
-Output: 1
-
-
-
Example 2:
-
-
-Input: root = [5,3,6,2,4,null,null,1], k = 3
-Output: 3
-
-
-
-
Constraints:
-
-
-
The number of nodes in the tree is n.
-
1 <= k <= n <= 104
-
0 <= Node.val <= 104
-
-
-
-
Follow up: If the BST is modified often (i.e., we can do insert and delete operations) and you need to find the kth smallest frequently, how would you optimize?
-
-### Related Topics
- [[Tree](../../tag/tree/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Binary Search Tree](../../tag/binary-search-tree/README.md)]
- [[Binary Tree](../../tag/binary-tree/README.md)]
-
-### Similar Questions
- 1. [Binary Tree Inorder Traversal](../binary-tree-inorder-traversal) (Easy)
- 1. [Second Minimum Node In a Binary Tree](../second-minimum-node-in-a-binary-tree) (Easy)
-
-### Hints
-
-Hint 1
-Try to utilize the property of a BST.
-
-
-
-Hint 2
-Try in-order traversal. (Credits to @chan13)
-
-
-
-Hint 3
-What if you could modify the BST node's structure?
-
-
-
-Hint 4
-The optimal runtime complexity is O(height of BST).
-
diff --git a/problems/kth-smallest-element-in-a-bst/kth_smallest_element_in_a_bst.go b/problems/kth-smallest-element-in-a-bst/kth_smallest_element_in_a_bst.go
deleted file mode 100644
index f9034309f..000000000
--- a/problems/kth-smallest-element-in-a-bst/kth_smallest_element_in_a_bst.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem230
diff --git a/problems/kth-smallest-element-in-a-bst/kth_smallest_element_in_a_bst_test.go b/problems/kth-smallest-element-in-a-bst/kth_smallest_element_in_a_bst_test.go
deleted file mode 100644
index f9034309f..000000000
--- a/problems/kth-smallest-element-in-a-bst/kth_smallest_element_in_a_bst_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem230
diff --git a/problems/kth-smallest-element-in-a-sorted-matrix/README.md b/problems/kth-smallest-element-in-a-sorted-matrix/README.md
deleted file mode 100644
index acc313d66..000000000
--- a/problems/kth-smallest-element-in-a-sorted-matrix/README.md
+++ /dev/null
@@ -1,57 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../combination-sum-iv "Combination Sum IV")
-
-[Next >](../design-phone-directory "Design Phone Directory")
-
-## [378. Kth Smallest Element in a Sorted Matrix (Medium)](https://leetcode.com/problems/kth-smallest-element-in-a-sorted-matrix "有序矩阵中第 K 小的元素")
-
-
Given an n x nmatrix where each of the rows and columns are sorted in ascending order, return thekthsmallest element in the matrix.
-
-
Note that it is the kth smallest element in the sorted order, not the kthdistinct element.
-
-
-
Example 1:
-
-
-Input: matrix = [[1,5,9],[10,11,13],[12,13,15]], k = 8
-Output: 13
-Explanation: The elements in the matrix are [1,5,9,10,11,12,13,13,15], and the 8th smallest number is 13
-
-
-
Example 2:
-
-
-Input: matrix = [[-5]], k = 1
-Output: -5
-
-
-
-
Constraints:
-
-
-
n == matrix.length
-
n == matrix[i].length
-
1 <= n <= 300
-
-109 <= matrix[i][j] <= 109
-
All the rows and columns of matrix are guaranteed to be sorted in non-decreasing order.
-
1 <= k <= n2
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
- [[Heap (Priority Queue)](../../tag/heap-priority-queue/README.md)]
-
-### Similar Questions
- 1. [Find K Pairs with Smallest Sums](../find-k-pairs-with-smallest-sums) (Medium)
- 1. [Kth Smallest Number in Multiplication Table](../kth-smallest-number-in-multiplication-table) (Hard)
- 1. [Find K-th Smallest Pair Distance](../find-k-th-smallest-pair-distance) (Hard)
- 1. [K-th Smallest Prime Fraction](../k-th-smallest-prime-fraction) (Hard)
diff --git a/problems/kth-smallest-element-in-a-sorted-matrix/kth_smallest_element_in_a_sorted_matrix.go b/problems/kth-smallest-element-in-a-sorted-matrix/kth_smallest_element_in_a_sorted_matrix.go
deleted file mode 100644
index cc986d4a2..000000000
--- a/problems/kth-smallest-element-in-a-sorted-matrix/kth_smallest_element_in_a_sorted_matrix.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem378
diff --git a/problems/kth-smallest-element-in-a-sorted-matrix/kth_smallest_element_in_a_sorted_matrix_test.go b/problems/kth-smallest-element-in-a-sorted-matrix/kth_smallest_element_in_a_sorted_matrix_test.go
deleted file mode 100644
index cc986d4a2..000000000
--- a/problems/kth-smallest-element-in-a-sorted-matrix/kth_smallest_element_in_a_sorted_matrix_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem378
diff --git a/problems/kth-smallest-instructions/README.md b/problems/kth-smallest-instructions/README.md
deleted file mode 100644
index 5820b7981..000000000
--- a/problems/kth-smallest-instructions/README.md
+++ /dev/null
@@ -1,83 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../furthest-building-you-can-reach "Furthest Building You Can Reach")
-
-[Next >](../lowest-common-ancestor-of-a-binary-tree-ii "Lowest Common Ancestor of a Binary Tree II")
-
-## [1643. Kth Smallest Instructions (Hard)](https://leetcode.com/problems/kth-smallest-instructions "第 K 条最小指令")
-
-
Bob is standing at cell (0, 0), and he wants to reach destination: (row, column). He can only travel right and down. You are going to help Bob by providing instructions for him to reach destination.
-
-
The instructions are represented as a string, where each character is either:
-
-
-
'H', meaning move horizontally (go right), or
-
'V', meaning move vertically (go down).
-
-
-
Multiple instructions will lead Bob to destination. For example, if destination is (2, 3), both "HHHVV" and "HVHVH" are valid instructions.
-
-
However, Bob is very picky. Bob has a lucky number k, and he wants the kthlexicographically smallest instructions that will lead him to destination. k is 1-indexed.
-
-
Given an integer array destination and an integer k, return the kthlexicographically smallest instructions that will take Bob to destination.
-
-
-
Example 1:
-
-
-
-
-Input: destination = [2,3], k = 1
-Output: "HHHVV"
-Explanation: All the instructions that reach (2, 3) in lexicographic order are as follows:
-["HHHVV", "HHVHV", "HHVVH", "HVHHV", "HVHVH", "HVVHH", "VHHHV", "VHHVH", "VHVHH", "VVHHH"].
-
-
-
Example 2:
-
-
-
-
-Input: destination = [2,3], k = 2
-Output: "HHVHV"
-
-
-
Example 3:
-
-
-
-
-Input: destination = [2,3], k = 3
-Output: "HHVVH"
-
-
-
-
Constraints:
-
-
-
destination.length == 2
-
1 <= row, column <= 15
-
1 <= k <= nCr(row + column, row), where nCr(a, b) denotes a choose b.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Math](../../tag/math/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Combinatorics](../../tag/combinatorics/README.md)]
-
-### Hints
-
-Hint 1
-There are nCr(row + column, row) possible instructions to reach (row, column).
-
-
-
-Hint 2
-Try building the instructions one step at a time. How many instructions start with "H", and how does this compare with k?
-
diff --git a/problems/kth-smallest-number-in-multiplication-table/README.md b/problems/kth-smallest-number-in-multiplication-table/README.md
deleted file mode 100644
index 92bfa7196..000000000
--- a/problems/kth-smallest-number-in-multiplication-table/README.md
+++ /dev/null
@@ -1,49 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../beautiful-arrangement-ii "Beautiful Arrangement II")
-
-[Next >](../trim-a-binary-search-tree "Trim a Binary Search Tree")
-
-## [668. Kth Smallest Number in Multiplication Table (Hard)](https://leetcode.com/problems/kth-smallest-number-in-multiplication-table "乘法表中第k小的数")
-
-
Nearly everyone has used the Multiplication Table. The multiplication table of size m x n is an integer matrix mat where mat[i][j] == i * j (1-indexed).
-
-
Given three integers m, n, and k, return the kth smallest element in the m x n multiplication table.
-
-
-
Example 1:
-
-
-Input: m = 3, n = 3, k = 5
-Output: 3
-Explanation: The 5th smallest number is 3.
-
-
-
Example 2:
-
-
-Input: m = 2, n = 3, k = 6
-Output: 6
-Explanation: The 6th smallest number is 6.
-
-
-
-
Constraints:
-
-
-
1 <= m, n <= 3 * 104
-
1 <= k <= m * n
-
-
-### Related Topics
- [[Binary Search](../../tag/binary-search/README.md)]
-
-### Similar Questions
- 1. [Kth Smallest Element in a Sorted Matrix](../kth-smallest-element-in-a-sorted-matrix) (Medium)
- 1. [Find K-th Smallest Pair Distance](../find-k-th-smallest-pair-distance) (Hard)
- 1. [K-th Smallest Prime Fraction](../k-th-smallest-prime-fraction) (Hard)
diff --git a/problems/kth-smallest-number-in-multiplication-table/kth_smallest_number_in_multiplication_table.go b/problems/kth-smallest-number-in-multiplication-table/kth_smallest_number_in_multiplication_table.go
deleted file mode 100644
index 4e79be994..000000000
--- a/problems/kth-smallest-number-in-multiplication-table/kth_smallest_number_in_multiplication_table.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem668
diff --git a/problems/kth-smallest-number-in-multiplication-table/kth_smallest_number_in_multiplication_table_test.go b/problems/kth-smallest-number-in-multiplication-table/kth_smallest_number_in_multiplication_table_test.go
deleted file mode 100644
index 4e79be994..000000000
--- a/problems/kth-smallest-number-in-multiplication-table/kth_smallest_number_in_multiplication_table_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem668
diff --git a/problems/kth-smallest-product-of-two-sorted-arrays/README.md b/problems/kth-smallest-product-of-two-sorted-arrays/README.md
deleted file mode 100644
index a603687f3..000000000
--- a/problems/kth-smallest-product-of-two-sorted-arrays/README.md
+++ /dev/null
@@ -1,77 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../the-time-when-the-network-becomes-idle "The Time When the Network Becomes Idle")
-
-[Next >](../accepted-candidates-from-the-interviews "Accepted Candidates From the Interviews")
-
-## [2040. Kth Smallest Product of Two Sorted Arrays (Hard)](https://leetcode.com/problems/kth-smallest-product-of-two-sorted-arrays "两个有序数组的第 K 小乘积")
-
-Given two sorted 0-indexed integer arrays nums1 and nums2 as well as an integer k, return the kth (1-based) smallest product of nums1[i] * nums2[j] where 0 <= i < nums1.length and 0 <= j < nums2.length.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
-
-### Hints
-
-Hint 1
-Can we split this problem into four cases depending on the sign of the numbers?
-
-
-
-Hint 2
-Can we binary search the value?
-
diff --git a/problems/kth-smallest-subarray-sum/README.md b/problems/kth-smallest-subarray-sum/README.md
deleted file mode 100644
index e58ecad9f..000000000
--- a/problems/kth-smallest-subarray-sum/README.md
+++ /dev/null
@@ -1,30 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../leetcodify-friends-recommendations "Leetcodify Friends Recommendations")
-
-[Next >](../leetcodify-similar-friends "Leetcodify Similar Friends")
-
-## [1918. Kth Smallest Subarray Sum (Medium)](https://leetcode.com/problems/kth-smallest-subarray-sum "第 K 小的子数组和·")
-
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
- [[Sliding Window](../../tag/sliding-window/README.md)]
-
-### Hints
-
-Hint 1
-How can you compute the number of subarrays with a sum less than a given value?
-
-
-
-Hint 2
-Can we use binary search to help find the answer?
-
diff --git a/problems/largest-1-bordered-square/README.md b/problems/largest-1-bordered-square/README.md
deleted file mode 100644
index b2e11e036..000000000
--- a/problems/largest-1-bordered-square/README.md
+++ /dev/null
@@ -1,54 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../alphabet-board-path "Alphabet Board Path")
-
-[Next >](../stone-game-ii "Stone Game II")
-
-## [1139. Largest 1-Bordered Square (Medium)](https://leetcode.com/problems/largest-1-bordered-square "最大的以 1 为边界的正方形")
-
-
Given a 2D grid of 0s and 1s, return the number of elements in the largest square subgrid that has all 1s on its border, or 0 if such a subgrid doesn't exist in the grid.
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Matrix](../../tag/matrix/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/largest-bst-subtree/README.md b/problems/largest-bst-subtree/README.md
deleted file mode 100644
index 69c9b4513..000000000
--- a/problems/largest-bst-subtree/README.md
+++ /dev/null
@@ -1,49 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../reconstruct-itinerary "Reconstruct Itinerary")
-
-[Next >](../increasing-triplet-subsequence "Increasing Triplet Subsequence")
-
-## [333. Largest BST Subtree (Medium)](https://leetcode.com/problems/largest-bst-subtree "最大 BST 子树")
-
-
Given a binary tree, find the largest subtree which is a Binary Search Tree (BST), where largest means subtree with largest number of nodes in it.
-
-
Note:
-A subtree must include all of its descendants.
-
-
Example:
-
-
-Input: [10,5,15,1,8,null,7]
-
- 10
- / \
- 5 15
- / \ \
-1 8 7
-
-Output: 3
-Explanation: The Largest BST Subtree in this case is the highlighted one.
- The return value is the subtree's size, which is 3.
-
-
-
Follow up:
-Can you figure out ways to solve it with O(n) time complexity?
-
-### Related Topics
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Tree](../../tag/tree/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Binary Search Tree](../../tag/binary-search-tree/README.md)]
- [[Binary Tree](../../tag/binary-tree/README.md)]
-
-### Hints
-
-Hint 1
-You can recursively use algorithm similar to 98. Validate Binary Search Tree at each node of the tree, which will result in O(nlogn) time complexity.
-
diff --git a/problems/largest-bst-subtree/largest_bst_subtree.go b/problems/largest-bst-subtree/largest_bst_subtree.go
deleted file mode 100644
index 4cba35b94..000000000
--- a/problems/largest-bst-subtree/largest_bst_subtree.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem333
diff --git a/problems/largest-bst-subtree/largest_bst_subtree_test.go b/problems/largest-bst-subtree/largest_bst_subtree_test.go
deleted file mode 100644
index 4cba35b94..000000000
--- a/problems/largest-bst-subtree/largest_bst_subtree_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem333
diff --git a/problems/largest-color-value-in-a-directed-graph/README.md b/problems/largest-color-value-in-a-directed-graph/README.md
deleted file mode 100644
index 9ca2b2ad1..000000000
--- a/problems/largest-color-value-in-a-directed-graph/README.md
+++ /dev/null
@@ -1,72 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-subarray-min-product "Maximum Subarray Min-Product")
-
-[Next >](../longest-word-with-all-prefixes "Longest Word With All Prefixes")
-
-## [1857. Largest Color Value in a Directed Graph (Hard)](https://leetcode.com/problems/largest-color-value-in-a-directed-graph "有向图中最大颜色值")
-
-
There is a directed graph of n colored nodes and m edges. The nodes are numbered from 0 to n - 1.
-
-
You are given a string colors where colors[i] is a lowercase English letter representing the color of the ith node in this graph (0-indexed). You are also given a 2D array edges where edges[j] = [aj, bj] indicates that there is a directed edge from node aj to node bj.
-
-
A valid path in the graph is a sequence of nodes x1 -> x2 -> x3 -> ... -> xk such that there is a directed edge from xi to xi+1 for every 1 <= i < k. The color value of the path is the number of nodes that are colored the most frequently occurring color along that path.
-
-
Return the largest color value of any valid path in the given graph, or -1 if the graph contains a cycle.
-
-
-
Example 1:
-
-
-
-
-Input: colors = "abaca", edges = [[0,1],[0,2],[2,3],[3,4]]
-Output: 3
-Explanation: The path 0 -> 2 -> 3 -> 4 contains 3 nodes that are colored "a" (red in the above image).
-
-
-
Example 2:
-
-
-
-
-Input: colors = "a", edges = [[0,0]]
-Output: -1
-Explanation: There is a cycle from 0 to 0.
-
-
-
-
Constraints:
-
-
-
n == colors.length
-
m == edges.length
-
1 <= n <= 105
-
0 <= m <= 105
-
colors consists of lowercase English letters.
-
0 <= aj, bj < n
-
-
-### Related Topics
- [[Graph](../../tag/graph/README.md)]
- [[Topological Sort](../../tag/topological-sort/README.md)]
- [[Memoization](../../tag/memoization/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Counting](../../tag/counting/README.md)]
-
-### Hints
-
-Hint 1
-Use topological sort.
-
-
-
-Hint 2
-let dp[u][c] := the maximum count of vertices with color c of any path starting from vertex u. (by JerryJin2905)
-
diff --git a/problems/largest-component-size-by-common-factor/README.md b/problems/largest-component-size-by-common-factor/README.md
deleted file mode 100644
index a9303e864..000000000
--- a/problems/largest-component-size-by-common-factor/README.md
+++ /dev/null
@@ -1,57 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../flip-equivalent-binary-trees "Flip Equivalent Binary Trees")
-
-[Next >](../verifying-an-alien-dictionary "Verifying an Alien Dictionary")
-
-## [952. Largest Component Size by Common Factor (Hard)](https://leetcode.com/problems/largest-component-size-by-common-factor "按公因数计算最大组件大小")
-
-
You are given an integer array of unique positive integers nums. Consider the following graph:
-
-
-
There are nums.length nodes, labeled nums[0] to nums[nums.length - 1],
-
There is an undirected edge between nums[i] and nums[j] if nums[i] and nums[j] share a common factor greater than 1.
-
-
-
Return the size of the largest connected component in the graph.
Given a set of distinct positive integers nums, return the largest subset answer such that every pair (answer[i], answer[j]) of elements in this subset satisfies:
-
-
-
answer[i] % answer[j] == 0, or
-
answer[j] % answer[i] == 0
-
-
-
If there are multiple solutions, return any of them.
-
-
-
Example 1:
-
-
-Input: nums = [1,2,3]
-Output: [1,2]
-Explanation: [1,3] is also accepted.
-
-
-
Example 2:
-
-
-Input: nums = [1,2,4,8]
-Output: [1,2,4,8]
-
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 1000
-
1 <= nums[i] <= 2 * 109
-
All the integers in nums are unique.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Math](../../tag/math/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
diff --git a/problems/largest-divisible-subset/largest_divisible_subset.go b/problems/largest-divisible-subset/largest_divisible_subset.go
deleted file mode 100644
index ec2517d3b..000000000
--- a/problems/largest-divisible-subset/largest_divisible_subset.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem368
diff --git a/problems/largest-divisible-subset/largest_divisible_subset_test.go b/problems/largest-divisible-subset/largest_divisible_subset_test.go
deleted file mode 100644
index ec2517d3b..000000000
--- a/problems/largest-divisible-subset/largest_divisible_subset_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem368
diff --git a/problems/largest-magic-square/README.md b/problems/largest-magic-square/README.md
deleted file mode 100644
index c13ed708f..000000000
--- a/problems/largest-magic-square/README.md
+++ /dev/null
@@ -1,57 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../find-the-student-that-will-replace-the-chalk "Find the Student that Will Replace the Chalk")
-
-[Next >](../minimum-cost-to-change-the-final-value-of-expression "Minimum Cost to Change the Final Value of Expression")
-
-## [1895. Largest Magic Square (Medium)](https://leetcode.com/problems/largest-magic-square "最大的幻方")
-
-
A k x kmagic square is a k x k grid filled with integers such that every row sum, every column sum, and both diagonal sums are all equal. The integers in the magic square do not have to be distinct. Every 1 x 1 grid is trivially a magic square.
-
-
Given an m x n integer grid, return the size (i.e., the side length k) of the largest magic square that can be found within this grid.
-
-
-
Example 1:
-
-
-Input: grid = [[7,1,4,5,6],[2,5,1,6,4],[1,5,4,3,2],[1,2,7,3,4]]
-Output: 3
-Explanation: The largest magic square has a size of 3.
-Every row sum, column sum, and diagonal sum of this magic square is equal to 12.
-- Row sums: 5+1+6 = 5+4+3 = 2+7+3 = 12
-- Column sums: 5+5+2 = 1+4+7 = 6+3+3 = 12
-- Diagonal sums: 5+4+3 = 6+4+2 = 12
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
- [[Prefix Sum](../../tag/prefix-sum/README.md)]
-
-### Hints
-
-Hint 1
-Check all squares in the matrix and find the largest one.
-
diff --git a/problems/largest-merge-of-two-strings/README.md b/problems/largest-merge-of-two-strings/README.md
deleted file mode 100644
index 35fd263b1..000000000
--- a/problems/largest-merge-of-two-strings/README.md
+++ /dev/null
@@ -1,87 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-score-from-removing-stones "Maximum Score From Removing Stones")
-
-[Next >](../closest-subsequence-sum "Closest Subsequence Sum")
-
-## [1754. Largest Merge Of Two Strings (Medium)](https://leetcode.com/problems/largest-merge-of-two-strings "构造字典序最大的合并字符串")
-
-
You are given two strings word1 and word2. You want to construct a string merge in the following way: while either word1 or word2 are non-empty, choose one of the following options:
-
-
-
If word1 is non-empty, append the first character in word1 to merge and delete it from word1.
-
-
For example, if word1 = "abc" and merge = "dv", then after choosing this operation, word1 = "bc" and merge = "dva".
-
-
-
If word2 is non-empty, append the first character in word2 to merge and delete it from word2.
-
-
For example, if word2 = "abc" and merge = "", then after choosing this operation, word2 = "bc" and merge = "a".
-
-
-
-
-
Return the lexicographically largestmerge you can construct.
-
-
A string a is lexicographically larger than a string b (of the same length) if in the first position where a and b differ, a has a character strictly larger than the corresponding character in b. For example, "abcd" is lexicographically larger than "abcc" because the first position they differ is at the fourth character, and d is greater than c.
-
-
-
Example 1:
-
-
-Input: word1 = "cabaa", word2 = "bcaaa"
-Output: "cbcabaaaaa"
-Explanation: One way to get the lexicographically largest merge is:
-- Take from word1: merge = "c", word1 = "abaa", word2 = "bcaaa"
-- Take from word2: merge = "cb", word1 = "abaa", word2 = "caaa"
-- Take from word2: merge = "cbc", word1 = "abaa", word2 = "aaa"
-- Take from word1: merge = "cbca", word1 = "baa", word2 = "aaa"
-- Take from word1: merge = "cbcab", word1 = "aa", word2 = "aaa"
-- Append the remaining 5 a's from word1 and word2 at the end of merge.
-
word1 and word2 consist only of lowercase English letters.
-
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[Two Pointers](../../tag/two-pointers/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Hints
-
-Hint 1
-Build the result character by character. At each step, you choose a character from one of the two strings.
-
-
-
-Hint 2
-If the next character of the first string is larger than that of the second string, or vice versa, it's optimal to use the larger one.
-
-
-
-Hint 3
-If both are equal, think of a criteria that lets you decide which string to consume the next character from.
-
-
-
-Hint 4
-You should choose the next character from the larger string.
-
diff --git a/problems/largest-multiple-of-three/README.md b/problems/largest-multiple-of-three/README.md
deleted file mode 100644
index 91ce76469..000000000
--- a/problems/largest-multiple-of-three/README.md
+++ /dev/null
@@ -1,72 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../closest-divisors "Closest Divisors")
-
-[Next >](../number-of-trusted-contacts-of-a-customer "Number of Trusted Contacts of a Customer")
-
-## [1363. Largest Multiple of Three (Hard)](https://leetcode.com/problems/largest-multiple-of-three "形成三的最大倍数")
-
-
Given an array of digits digits, return the largest multiple of three that can be formed by concatenating some of the given digits in any order. If there is no answer return an empty string.
-
-
Since the answer may not fit in an integer data type, return the answer as a string. Note that the returning answer must not contain unnecessary leading zeros.
-
-
-
Example 1:
-
-
-Input: digits = [8,1,9]
-Output: "981"
-
-
-
Example 2:
-
-
-Input: digits = [8,6,7,1,0]
-Output: "8760"
-
-
-
Example 3:
-
-
-Input: digits = [1]
-Output: ""
-
-
-
-
Constraints:
-
-
-
1 <= digits.length <= 104
-
0 <= digits[i] <= 9
-
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Hints
-
-Hint 1
-A number is a multiple of three if and only if its sum of digits is a multiple of three.
-
-
-
-Hint 2
-Use dynamic programming.
-
-
-
-Hint 3
-To find the maximum number, try to maximize the number of digits of the number.
-
-
-
-Hint 4
-Sort the digits in descending order to find the maximum number.
-
diff --git a/problems/largest-number-after-mutating-substring/README.md b/problems/largest-number-after-mutating-substring/README.md
deleted file mode 100644
index 4dd0ddd4a..000000000
--- a/problems/largest-number-after-mutating-substring/README.md
+++ /dev/null
@@ -1,84 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../sum-of-digits-of-string-after-convert "Sum of Digits of String After Convert")
-
-[Next >](../maximum-compatibility-score-sum "Maximum Compatibility Score Sum")
-
-## [1946. Largest Number After Mutating Substring (Medium)](https://leetcode.com/problems/largest-number-after-mutating-substring "子字符串突变后可能得到的最大整数")
-
-
You are given a string num, which represents a large integer. You are also given a 0-indexed integer array change of length 10 that maps each digit 0-9 to another digit. More formally, digit d maps to digit change[d].
-
-
You may choose to mutate a single substring of num. To mutate a substring, replace each digit num[i] with the digit it maps to in change (i.e. replace num[i] with change[num[i]]).
-
-
Return a string representing the largest possible integer after mutating (or choosing not to) a single substring of num.
-
-
A substring is a contiguous sequence of characters within the string.
-
-
-
Example 1:
-
-
-Input: num = "132", change = [9,8,5,0,3,6,4,2,6,8]
-Output: "832"
-Explanation: Replace the substring "1":
-- 1 maps to change[1] = 8.
-Thus, "132" becomes "832".
-"832" is the largest number that can be created, so return it.
-
-
-
Example 2:
-
-
-Input: num = "021", change = [9,4,3,5,7,2,1,9,0,6]
-Output: "934"
-Explanation: Replace the substring "021":
-- 0 maps to change[0] = 9.
-- 2 maps to change[2] = 3.
-- 1 maps to change[1] = 4.
-Thus, "021" becomes "934".
-"934" is the largest number that can be created, so return it.
-
-
-
Example 3:
-
-
-Input: num = "5", change = [1,4,7,5,3,2,5,6,9,4]
-Output: "5"
-Explanation: "5" is already the largest number that can be created, so return it.
-
-
-
-
Constraints:
-
-
-
1 <= num.length <= 105
-
num consists of only digits 0-9.
-
change.length == 10
-
0 <= change[d] <= 9
-
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[Array](../../tag/array/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Hints
-
-Hint 1
-Should you change a digit if the new digit is smaller than the original?
-
-
-
-Hint 2
-If changing the first digit and the last digit both make the number bigger, but you can only change one of them; which one should you change?
-
-
-
-Hint 3
-Changing numbers closer to the front is always better
-
diff --git a/problems/largest-number-at-least-twice-of-others/README.md b/problems/largest-number-at-least-twice-of-others/README.md
deleted file mode 100644
index 3c2ffe674..000000000
--- a/problems/largest-number-at-least-twice-of-others/README.md
+++ /dev/null
@@ -1,65 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../min-cost-climbing-stairs "Min Cost Climbing Stairs")
-
-[Next >](../shortest-completing-word "Shortest Completing Word")
-
-## [747. Largest Number At Least Twice of Others (Easy)](https://leetcode.com/problems/largest-number-at-least-twice-of-others "至少是其他数字两倍的最大数")
-
-
You are given an integer array nums where the largest integer is unique.
-
-
Determine whether the largest element in the array is at least twice as much as every other number in the array. If it is, return the index of the largest element, or return -1 otherwise.
-
-
-
Example 1:
-
-
-Input: nums = [3,6,1,0]
-Output: 1
-Explanation: 6 is the largest integer.
-For every other number in the array x, 6 is at least twice as big as x.
-The index of value 6 is 1, so we return 1.
-
-
-
Example 2:
-
-
-Input: nums = [1,2,3,4]
-Output: -1
-Explanation: 4 is less than twice the value of 3, so we return -1.
-
-
Example 3:
-
-
-Input: nums = [1]
-Output: 0
-Explanation: 1 is trivially at least twice the value as any other number because there are no other numbers.
-
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 50
-
0 <= nums[i] <= 100
-
The largest element in nums is unique.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Hints
-
-Hint 1
-Scan through the array to find the unique largest element `m`, keeping track of it's index `maxIndex`.
-
-Scan through the array again. If we find some `x != m` with `m < 2*x`, we should return `-1`.
-
-Otherwise, we should return `maxIndex`.
-
diff --git a/problems/largest-number-at-least-twice-of-others/largest_number_at_least_twice_of_others.go b/problems/largest-number-at-least-twice-of-others/largest_number_at_least_twice_of_others.go
deleted file mode 100644
index 32ad1431e..000000000
--- a/problems/largest-number-at-least-twice-of-others/largest_number_at_least_twice_of_others.go
+++ /dev/null
@@ -1,16 +0,0 @@
-package problem747
-
-func dominantIndex(nums []int) int {
- ans, sec := 0, 0
- for i, v := range nums {
- if v > nums[ans] {
- ans, sec = i, nums[ans]
- } else if v > sec && i != ans {
- sec = v
- }
- }
- if nums[ans] >= 2*sec {
- return ans
- }
- return -1
-}
diff --git a/problems/largest-number-at-least-twice-of-others/largest_number_at_least_twice_of_others_test.go b/problems/largest-number-at-least-twice-of-others/largest_number_at_least_twice_of_others_test.go
deleted file mode 100644
index babf59dd5..000000000
--- a/problems/largest-number-at-least-twice-of-others/largest_number_at_least_twice_of_others_test.go
+++ /dev/null
@@ -1,39 +0,0 @@
-package problem747
-
-import "testing"
-
-type testType struct {
- in []int
- want int
-}
-
-func TestDominantIndex(t *testing.T) {
- tests := [...]testType{
- {
- in: []int{3, 6, 1, 0},
- want: 1,
- },
- {
- in: []int{1, 2, 3, 4},
- want: -1,
- },
- {
- in: []int{1},
- want: 0,
- },
- {
- in: []int{0, 0, 3, 2},
- want: -1,
- },
- {
- in: []int{3, 0, 0, 2},
- want: -1,
- },
- }
- for _, tt := range tests {
- got := dominantIndex(tt.in)
- if got != tt.want {
- t.Fatalf("in: %v, got: %v, want: %v", tt.in, got, tt.want)
- }
- }
-}
diff --git a/problems/largest-number/README.md b/problems/largest-number/README.md
deleted file mode 100644
index 308b5ad2c..000000000
--- a/problems/largest-number/README.md
+++ /dev/null
@@ -1,44 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../rank-scores "Rank Scores")
-
-[Next >](../consecutive-numbers "Consecutive Numbers")
-
-## [179. Largest Number (Medium)](https://leetcode.com/problems/largest-number "最大数")
-
-
Given a list of non-negative integers nums, arrange them such that they form the largest number and return it.
-
-
Since the result may be very large, so you need to return a string instead of an integer.
-
-
-
Example 1:
-
-
-Input: nums = [10,2]
-Output: "210"
-
-
-
Example 2:
-
-
-Input: nums = [3,30,34,5,9]
-Output: "9534330"
-
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 100
-
0 <= nums[i] <= 109
-
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[String](../../tag/string/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
diff --git a/problems/largest-number/largest_number.go b/problems/largest-number/largest_number.go
deleted file mode 100644
index d27db607f..000000000
--- a/problems/largest-number/largest_number.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem179
diff --git a/problems/largest-number/largest_number_test.go b/problems/largest-number/largest_number_test.go
deleted file mode 100644
index d27db607f..000000000
--- a/problems/largest-number/largest_number_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem179
diff --git a/problems/largest-odd-number-in-string/README.md b/problems/largest-odd-number-in-string/README.md
deleted file mode 100644
index 433ce9589..000000000
--- a/problems/largest-odd-number-in-string/README.md
+++ /dev/null
@@ -1,65 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../depth-of-bst-given-insertion-order "Depth of BST Given Insertion Order")
-
-[Next >](../the-number-of-full-rounds-you-have-played "The Number of Full Rounds You Have Played")
-
-## [1903. Largest Odd Number in String (Easy)](https://leetcode.com/problems/largest-odd-number-in-string "字符串中的最大奇数")
-
-
You are given a string num, representing a large integer. Return the largest-valued odd integer (as a string) that is a non-empty substring of num, or an empty string "" if no odd integer exists.
-
-
A substring is a contiguous sequence of characters within a string.
-
-
-
Example 1:
-
-
-Input: num = "52"
-Output: "5"
-Explanation: The only non-empty substrings are "5", "2", and "52". "5" is the only odd number.
-
-
-
Example 2:
-
-
-Input: num = "4206"
-Output: ""
-Explanation: There are no odd numbers in "4206".
-
-
-
Example 3:
-
-
-Input: num = "35427"
-Output: "35427"
-Explanation: "35427" is already an odd number.
-
-
-
-
Constraints:
-
-
-
1 <= num.length <= 105
-
num only consists of digits and does not contain any leading zeros.
-
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
- [[String](../../tag/string/README.md)]
- [[Greedy](../../tag/greedy/README.md)]
-
-### Hints
-
-Hint 1
-In what order should you iterate through the digits?
-
-
-
-Hint 2
-If an odd number exists, where must the number start from?
-
diff --git a/problems/largest-palindrome-product/README.md b/problems/largest-palindrome-product/README.md
deleted file mode 100644
index 0dd3baf0d..000000000
--- a/problems/largest-palindrome-product/README.md
+++ /dev/null
@@ -1,40 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../generate-random-point-in-a-circle "Generate Random Point in a Circle")
-
-[Next >](../sliding-window-median "Sliding Window Median")
-
-## [479. Largest Palindrome Product (Hard)](https://leetcode.com/problems/largest-palindrome-product "最大回文数乘积")
-
-
Given an integer n, return the largest palindromic integer that can be represented as the product of two n-digits integers. Since the answer can be very large, return it modulo1337.
-
-
-
Example 1:
-
-
-Input: n = 2
-Output: 987
-Explanation: 99 x 91 = 9009, 9009 % 1337 = 987
-
Given an integer array nums, return the largest perimeter of a triangle with a non-zero area, formed from three of these lengths. If it is impossible to form any triangle of a non-zero area, return 0.
You are given an integer n. You have an n x n binary grid grid with all values initially 1's except for some indices given in the array mines. The ith element of the array mines is defined as mines[i] = [xi, yi] where grid[xi][yi] == 0.
-
-
Return the order of the largest axis-aligned plus sign of 1's contained in grid. If there is none, return 0.
-
-
An axis-aligned plus sign of 1's of order k has some center grid[r][c] == 1 along with four arms of length k - 1 going up, down, left, and right, and made of 1's. Note that there could be 0's or 1's beyond the arms of the plus sign, only the relevant area of the plus sign is checked for 1's.
-
-
-
Example 1:
-
-
-Input: n = 5, mines = [[4,2]]
-Output: 2
-Explanation: In the above grid, the largest plus sign can only be of order 2. One of them is shown.
-
-
-
Example 2:
-
-
-Input: n = 1, mines = [[0,0]]
-Output: 0
-Explanation: There is no plus sign, so return 0.
-
-
-
-
Constraints:
-
-
-
1 <= n <= 500
-
1 <= mines.length <= 5000
-
0 <= xi, yi < n
-
All the pairs (xi, yi) are unique.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Similar Questions
- 1. [Maximal Square](../maximal-square) (Medium)
-
-### Hints
-
-Hint 1
-For each direction such as "left", find left[r][c] = the number of 1s you will see before a zero starting at r, c and walking left. You can find this in N^2 time with a dp. The largest plus sign at r, c is just the minimum of left[r][c], up[r][c] etc.
-
diff --git a/problems/largest-plus-sign/largest_plus_sign.go b/problems/largest-plus-sign/largest_plus_sign.go
deleted file mode 100644
index 715bcb4c4..000000000
--- a/problems/largest-plus-sign/largest_plus_sign.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem764
diff --git a/problems/largest-plus-sign/largest_plus_sign_test.go b/problems/largest-plus-sign/largest_plus_sign_test.go
deleted file mode 100644
index 715bcb4c4..000000000
--- a/problems/largest-plus-sign/largest_plus_sign_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem764
diff --git a/problems/largest-rectangle-in-histogram/README.md b/problems/largest-rectangle-in-histogram/README.md
deleted file mode 100644
index 9257981d2..000000000
--- a/problems/largest-rectangle-in-histogram/README.md
+++ /dev/null
@@ -1,47 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../remove-duplicates-from-sorted-list "Remove Duplicates from Sorted List")
-
-[Next >](../maximal-rectangle "Maximal Rectangle")
-
-## [84. Largest Rectangle in Histogram (Hard)](https://leetcode.com/problems/largest-rectangle-in-histogram "柱状图中最大的矩形")
-
-
Given an array of integers heights representing the histogram's bar height where the width of each bar is 1, return the area of the largest rectangle in the histogram.
-
-
-
Example 1:
-
-
-Input: heights = [2,1,5,6,2,3]
-Output: 10
-Explanation: The above is a histogram where width of each bar is 1.
-The largest rectangle is shown in the red area, which has an area = 10 units.
-
-
-
Example 2:
-
-
-Input: heights = [2,4]
-Output: 4
-
-
-
-
Constraints:
-
-
-
1 <= heights.length <= 105
-
0 <= heights[i] <= 104
-
-
-### Related Topics
- [[Stack](../../tag/stack/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Monotonic Stack](../../tag/monotonic-stack/README.md)]
-
-### Similar Questions
- 1. [Maximal Rectangle](../maximal-rectangle) (Hard)
diff --git a/problems/largest-rectangle-in-histogram/largest_rectangle_in_histogram.go b/problems/largest-rectangle-in-histogram/largest_rectangle_in_histogram.go
deleted file mode 100644
index 2b367347a..000000000
--- a/problems/largest-rectangle-in-histogram/largest_rectangle_in_histogram.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem84
diff --git a/problems/largest-rectangle-in-histogram/largest_rectangle_in_histogram_test.go b/problems/largest-rectangle-in-histogram/largest_rectangle_in_histogram_test.go
deleted file mode 100644
index 2b367347a..000000000
--- a/problems/largest-rectangle-in-histogram/largest_rectangle_in_histogram_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem84
diff --git a/problems/largest-subarray-length-k/README.md b/problems/largest-subarray-length-k/README.md
deleted file mode 100644
index 29371e2c9..000000000
--- a/problems/largest-subarray-length-k/README.md
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-xor-with-an-element-from-array "Maximum XOR With an Element From Array")
-
-[Next >](../biggest-window-between-visits "Biggest Window Between Visits")
-
-## [1708. Largest Subarray Length K (Easy)](https://leetcode.com/problems/largest-subarray-length-k "长度为 K 的最大子数组")
-
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Greedy](../../tag/greedy/README.md)]
-
-### Hints
-
-Hint 1
-Search for the largest integer in the range [0, n - k]
-
-
-
-Hint 2
-This integer is the first element in the subarray. You should take it with the k - 1 elements after it.
-
diff --git a/problems/largest-submatrix-with-rearrangements/README.md b/problems/largest-submatrix-with-rearrangements/README.md
deleted file mode 100644
index fd5ac277b..000000000
--- a/problems/largest-submatrix-with-rearrangements/README.md
+++ /dev/null
@@ -1,70 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../tuple-with-same-product "Tuple with Same Product")
-
-[Next >](../cat-and-mouse-ii "Cat and Mouse II")
-
-## [1727. Largest Submatrix With Rearrangements (Medium)](https://leetcode.com/problems/largest-submatrix-with-rearrangements "重新排列后的最大子矩阵")
-
-
You are given a binary matrix matrix of size m x n, and you are allowed to rearrange the columns of the matrix in any order.
-
-
Return the area of the largest submatrix within matrix where every element of the submatrix is 1 after reordering the columns optimally.
-
-
-
Example 1:
-
-
-Input: matrix = [[0,0,1],[1,1,1],[1,0,1]]
-Output: 4
-Explanation: You can rearrange the columns as shown above.
-The largest submatrix of 1s, in bold, has an area of 4.
-
-
-
Example 2:
-
-
-Input: matrix = [[1,0,1,0,1]]
-Output: 3
-Explanation: You can rearrange the columns as shown above.
-The largest submatrix of 1s, in bold, has an area of 3.
-
-
-
Example 3:
-
-
-Input: matrix = [[1,1,0],[1,0,1]]
-Output: 2
-Explanation: Notice that you must rearrange entire columns, and there is no way to make a submatrix of 1s larger than an area of 2.
-
-
-
-
Constraints:
-
-
-
m == matrix.length
-
n == matrix[i].length
-
1 <= m * n <= 105
-
matrix[i][j] is either 0 or 1.
-
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Hints
-
-Hint 1
-For each column, find the number of consecutive ones ending at each position.
-
-
-
-Hint 2
-For each row, sort the cumulative ones in non-increasing order and "fit" the largest submatrix.
-
diff --git a/problems/largest-substring-between-two-equal-characters/README.md b/problems/largest-substring-between-two-equal-characters/README.md
deleted file mode 100644
index 46a160a10..000000000
--- a/problems/largest-substring-between-two-equal-characters/README.md
+++ /dev/null
@@ -1,63 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../all-valid-triplets-that-can-represent-a-country "All Valid Triplets That Can Represent a Country")
-
-[Next >](../lexicographically-smallest-string-after-applying-operations "Lexicographically Smallest String After Applying Operations")
-
-## [1624. Largest Substring Between Two Equal Characters (Easy)](https://leetcode.com/problems/largest-substring-between-two-equal-characters "两个相同字符之间的最长子字符串")
-
-
Given a string s, return the length of the longest substring between two equal characters, excluding the two characters. If there is no such substring return -1.
-
-
A substring is a contiguous sequence of characters within a string.
-
-
-
Example 1:
-
-
-Input: s = "aa"
-Output: 0
-Explanation: The optimal substring here is an empty substring between the two 'a's.
-
-
Example 2:
-
-
-Input: s = "abca"
-Output: 2
-Explanation: The optimal substring here is "bc".
-
-
-
Example 3:
-
-
-Input: s = "cbzxy"
-Output: -1
-Explanation: There are no characters that appear twice in s.
-
-
-
-
Constraints:
-
-
-
1 <= s.length <= 300
-
s contains only lowercase English letters.
-
-
-### Related Topics
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Hints
-
-Hint 1
-Try saving the first and last position of each character
-
-
-
-Hint 2
-Try finding every pair of indexes with equal characters
-
diff --git a/problems/largest-sum-of-averages/README.md b/problems/largest-sum-of-averages/README.md
deleted file mode 100644
index a53338cfd..000000000
--- a/problems/largest-sum-of-averages/README.md
+++ /dev/null
@@ -1,50 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../largest-triangle-area "Largest Triangle Area")
-
-[Next >](../binary-tree-pruning "Binary Tree Pruning")
-
-## [813. Largest Sum of Averages (Medium)](https://leetcode.com/problems/largest-sum-of-averages "最大平均值和的分组")
-
-
You are given an integer array nums and an integer k. You can partition the array into at mostk non-empty adjacent subarrays. The score of a partition is the sum of the averages of each subarray.
-
-
Note that the partition must use every integer in nums, and that the score is not necessarily an integer.
-
-
Return the maximum score you can achieve of all the possible partitions. Answers within 10-6 of the actual answer will be accepted.
-
-
-
Example 1:
-
-
-Input: nums = [9,1,2,3,9], k = 3
-Output: 20.00000
-Explanation:
-The best choice is to partition nums into [9], [1, 2, 3], [9]. The answer is 9 + (1 + 2 + 3) / 3 + 9 = 20.
-We could have also partitioned nums into [9, 1], [2], [3, 9], for example.
-That partition would lead to a score of 5 + 2 + 6 = 13, which is worse.
-
-
-
Example 2:
-
-
-Input: nums = [1,2,3,4,5,6,7], k = 4
-Output: 20.50000
-
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 100
-
1 <= nums[i] <= 104
-
1 <= k <= nums.length
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
diff --git a/problems/largest-sum-of-averages/largest_sum_of_averages.go b/problems/largest-sum-of-averages/largest_sum_of_averages.go
deleted file mode 100644
index a4cf7d686..000000000
--- a/problems/largest-sum-of-averages/largest_sum_of_averages.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem813
diff --git a/problems/largest-sum-of-averages/largest_sum_of_averages_test.go b/problems/largest-sum-of-averages/largest_sum_of_averages_test.go
deleted file mode 100644
index a4cf7d686..000000000
--- a/problems/largest-sum-of-averages/largest_sum_of_averages_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem813
diff --git a/problems/largest-time-for-given-digits/README.md b/problems/largest-time-for-given-digits/README.md
deleted file mode 100644
index 73adf0242..000000000
--- a/problems/largest-time-for-given-digits/README.md
+++ /dev/null
@@ -1,61 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../bag-of-tokens "Bag of Tokens")
-
-[Next >](../reveal-cards-in-increasing-order "Reveal Cards In Increasing Order")
-
-## [949. Largest Time for Given Digits (Medium)](https://leetcode.com/problems/largest-time-for-given-digits "给定数字能组成的最大时间")
-
-
Given an array arr of 4 digits, find the latest 24-hour time that can be made using each digit exactly once.
-
-
24-hour times are formatted as "HH:MM", where HH is between 00 and 23, and MM is between 00 and 59. The earliest 24-hour time is 00:00, and the latest is 23:59.
-
-
Return the latest 24-hour time in "HH:MM" format. If no valid time can be made, return an empty string.
-
-
-
Example 1:
-
-
-Input: arr = [1,2,3,4]
-Output: "23:41"
-Explanation: The valid 24-hour times are "12:34", "12:43", "13:24", "13:42", "14:23", "14:32", "21:34", "21:43", "23:14", and "23:41". Of these times, "23:41" is the latest.
-
-
-
Example 2:
-
-
-Input: arr = [5,5,5,5]
-Output: ""
-Explanation: There are no valid 24-hour times as "55:55" is not valid.
-
Given an array of points on the X-Y plane points where points[i] = [xi, yi], return the area of the largest triangle that can be formed by any three different points. Answers within 10-5 of the actual answer will be accepted.
-
-
-
Example 1:
-
-
-Input: points = [[0,0],[0,1],[1,0],[0,2],[2,0]]
-Output: 2.00000
-Explanation: The five points are shown in the above figure. The red triangle is the largest.
-
Given an array of integers A, return the largest integer that only occurs once.
-
-
If no integer occurs once, return -1.
-
-
-
-
Example 1:
-
-
-Input: [5,7,3,9,4,9,8,3,1]
-Output: 8
-Explanation:
-The maximum integer in the array is 9 but it is repeated. The number 8 occurs only once, so it's the answer.
-
-
-
Example 2:
-
-
-Input: [9,9,8,8]
-Output: -1
-Explanation:
-There is no number that occurs only once.
-
-
-
-
-
Note:
-
-
-
1 <= A.length <= 2000
-
0 <= A[i] <= 1000
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Hints
-
-Hint 1
-Find the number of occurrences of each value.
-
-
-
-Hint 2
-Use an array or a hash table to do that.
-
-
-
-Hint 3
-Look for the largest value with number of occurrences = 1.
-
diff --git a/problems/largest-values-from-labels/README.md b/problems/largest-values-from-labels/README.md
deleted file mode 100644
index b29a41655..000000000
--- a/problems/largest-values-from-labels/README.md
+++ /dev/null
@@ -1,81 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../duplicate-zeros "Duplicate Zeros")
-
-[Next >](../shortest-path-in-binary-matrix "Shortest Path in Binary Matrix")
-
-## [1090. Largest Values From Labels (Medium)](https://leetcode.com/problems/largest-values-from-labels "受标签影响的最大值")
-
-
There is a set of n items. You are given two integer arrays values and labels where the value and the label of the ith element are values[i] and labels[i] respectively. You are also given two integers numWanted and useLimit.
-
-
Choose a subset s of the n elements such that:
-
-
-
The size of the subset s is less than or equal tonumWanted.
-
There are at mostuseLimit items with the same label in s.
-
-
-
The score of a subset is the sum of the values in the subset.
-
-
Return the maximum score of a subset s.
-
-
-
Example 1:
-
-
-Input: values = [5,4,3,2,1], labels = [1,1,2,2,3], numWanted = 3, useLimit = 1
-Output: 9
-Explanation: The subset chosen is the first, third, and fifth items.
-
-
-
Example 2:
-
-
-Input: values = [5,4,3,2,1], labels = [1,3,3,3,2], numWanted = 3, useLimit = 2
-Output: 12
-Explanation: The subset chosen is the first, second, and third items.
-
-
-
Example 3:
-
-
-Input: values = [9,8,8,7,6], labels = [0,0,0,1,1], numWanted = 3, useLimit = 1
-Output: 16
-Explanation: The subset chosen is the first and fourth items.
-
-
-
Example 4:
-
-
-Input: values = [9,8,8,7,6], labels = [0,0,0,1,1], numWanted = 3, useLimit = 2
-Output: 24
-Explanation: The subset chosen is the first, second, and fourth items.
-
-
-
-
Constraints:
-
-
-
n == values.length == labels.length
-
1 <= n <= 2 * 104
-
0 <= values[i], labels[i] <= 2 * 104
-
1 <= numWanted, useLimit <= n
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Greedy](../../tag/greedy/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
- [[Counting](../../tag/counting/README.md)]
-
-### Hints
-
-Hint 1
-Consider the items in order from largest to smallest value, and greedily take the items if they fall under the use_limit. We can keep track of how many items of each label are used by using a hash table.
-
diff --git a/problems/largest-values-from-labels/largest_values_from_labels.go b/problems/largest-values-from-labels/largest_values_from_labels.go
deleted file mode 100644
index 01d937a95..000000000
--- a/problems/largest-values-from-labels/largest_values_from_labels.go
+++ /dev/null
@@ -1,29 +0,0 @@
-package problem1090
-
-import "sort"
-
-func largestValsFromLabels(values []int, labels []int, num_wanted int, use_limit int) int {
- for i, v := range values {
- values[i] = v<<16 + labels[i]
- }
-
- sort.Slice(values, func(i int, j int) bool {
- return values[i] > values[j]
- })
-
- count := [20001]int{}
- res := 0
- for _, v := range values {
- if count[v&0xFFFF] == use_limit {
- continue
- }
- res += v >> 16
- count[v&0xFFFF]++
- num_wanted--
- if num_wanted == 0 {
- break
- }
- }
-
- return res
-}
diff --git a/problems/last-day-where-you-can-still-cross/README.md b/problems/last-day-where-you-can-still-cross/README.md
deleted file mode 100644
index fbaecbd9f..000000000
--- a/problems/last-day-where-you-can-still-cross/README.md
+++ /dev/null
@@ -1,79 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-non-zero-product-of-the-array-elements "Minimum Non-Zero Product of the Array Elements")
-
-[Next >](../find-if-path-exists-in-graph "Find if Path Exists in Graph")
-
-## [1970. Last Day Where You Can Still Cross (Hard)](https://leetcode.com/problems/last-day-where-you-can-still-cross "你能穿过矩阵的最后一天")
-
-
There is a 1-based binary matrix where 0 represents land and 1 represents water. You are given integers row and col representing the number of rows and columns in the matrix, respectively.
-
-
Initially on day 0, the entire matrix is land. However, each day a new cell becomes flooded with water. You are given a 1-based 2D array cells, where cells[i] = [ri, ci] represents that on the ith day, the cell on the rith row and cith column (1-based coordinates) will be covered with water (i.e., changed to 1).
-
-
You want to find the last day that it is possible to walk from the top to the bottom by only walking on land cells. You can start from any cell in the top row and end at any cell in the bottom row. You can only travel in the four cardinal directions (left, right, up, and down).
-
-
Return the last day where it is possible to walk from the top to the bottom by only walking on land cells.
-
-
-
Example 1:
-
-
-Input: row = 2, col = 2, cells = [[1,1],[2,1],[1,2],[2,2]]
-Output: 2
-Explanation: The above image depicts how the matrix changes each day starting from day 0.
-The last day where it is possible to cross from top to bottom is on day 2.
-
-
-
Example 2:
-
-
-Input: row = 2, col = 2, cells = [[1,1],[1,2],[2,1],[2,2]]
-Output: 1
-Explanation: The above image depicts how the matrix changes each day starting from day 0.
-The last day where it is possible to cross from top to bottom is on day 1.
-
-
-
Example 3:
-
-
-Input: row = 3, col = 3, cells = [[1,2],[2,1],[3,3],[2,2],[1,1],[1,3],[2,3],[3,2],[3,1]]
-Output: 3
-Explanation: The above image depicts how the matrix changes each day starting from day 0.
-The last day where it is possible to cross from top to bottom is on day 3.
-
-
-
-
Constraints:
-
-
-
2 <= row, col <= 2 * 104
-
4 <= row * col <= 2 * 104
-
cells.length == row * col
-
1 <= ri <= row
-
1 <= ci <= col
-
All the values of cells are unique.
-
-
-### Related Topics
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Union Find](../../tag/union-find/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
-
-### Hints
-
-Hint 1
-What graph algorithm allows us to find whether a path exists?
-
-
-
-Hint 2
-Can we use binary search to help us solve the problem?
-
diff --git a/problems/last-moment-before-all-ants-fall-out-of-a-plank/README.md b/problems/last-moment-before-all-ants-fall-out-of-a-plank/README.md
deleted file mode 100644
index 4c259e38a..000000000
--- a/problems/last-moment-before-all-ants-fall-out-of-a-plank/README.md
+++ /dev/null
@@ -1,79 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../can-make-arithmetic-progression-from-sequence "Can Make Arithmetic Progression From Sequence")
-
-[Next >](../count-submatrices-with-all-ones "Count Submatrices With All Ones")
-
-## [1503. Last Moment Before All Ants Fall Out of a Plank (Medium)](https://leetcode.com/problems/last-moment-before-all-ants-fall-out-of-a-plank "所有蚂蚁掉下来前的最后一刻")
-
-
We have a wooden plank of the length nunits. Some ants are walking on the plank, each ant moves with a speed of 1 unit per second. Some of the ants move to the left, the other move to the right.
-
-
When two ants moving in two different directions meet at some point, they change their directions and continue moving again. Assume changing directions does not take any additional time.
-
-
When an ant reaches one end of the plank at a time t, it falls out of the plank immediately.
-
-
Given an integer n and two integer arrays left and right, the positions of the ants moving to the left and the right, return the moment when the last ant(s) fall out of the plank.
-
-
-
Example 1:
-
-
-Input: n = 4, left = [4,3], right = [0,1]
-Output: 4
-Explanation: In the image above:
--The ant at index 0 is named A and going to the right.
--The ant at index 1 is named B and going to the right.
--The ant at index 3 is named C and going to the left.
--The ant at index 4 is named D and going to the left.
-The last moment when an ant was on the plank is t = 4 seconds. After that, it falls immediately out of the plank. (i.e., We can say that at t = 4.0000000001, there are no ants on the plank).
-
-
-
Example 2:
-
-
-Input: n = 7, left = [], right = [0,1,2,3,4,5,6,7]
-Output: 7
-Explanation: All ants are going to the right, the ant at index 0 needs 7 seconds to fall.
-
-
-
Example 3:
-
-
-Input: n = 7, left = [0,1,2,3,4,5,6,7], right = []
-Output: 7
-Explanation: All ants are going to the left, the ant at index 7 needs 7 seconds to fall.
-
-
-
-
Constraints:
-
-
-
1 <= n <= 104
-
0 <= left.length <= n + 1
-
0 <= left[i] <= n
-
0 <= right.length <= n + 1
-
0 <= right[i] <= n
-
1 <= left.length + right.length <= n + 1
-
All values of left and right are unique, and each value can appear only in one of the two arrays.
-
-
-### Related Topics
- [[Brainteaser](../../tag/brainteaser/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Simulation](../../tag/simulation/README.md)]
-
-### Hints
-
-Hint 1
-The ants change their way when they meet is equivalent to continue moving without changing their direction.
-
-
-
-Hint 2
-Answer is the max distance for one ant to reach the end of the plank in the facing direction.
-
diff --git a/problems/last-person-to-fit-in-the-bus/README.md b/problems/last-person-to-fit-in-the-bus/README.md
deleted file mode 100644
index 68645ff52..000000000
--- a/problems/last-person-to-fit-in-the-bus/README.md
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../sort-items-by-groups-respecting-dependencies "Sort Items by Groups Respecting Dependencies")
-
-[Next >](../monthly-transactions-ii "Monthly Transactions II")
-
-## [1204. Last Person to Fit in the Bus (Medium)](https://leetcode.com/problems/last-person-to-fit-in-the-bus "最后一个能进入电梯的人")
-
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/last-person-to-fit-in-the-bus/mysql_schemas.sql b/problems/last-person-to-fit-in-the-bus/mysql_schemas.sql
deleted file mode 100644
index fe75f3b5b..000000000
--- a/problems/last-person-to-fit-in-the-bus/mysql_schemas.sql
+++ /dev/null
@@ -1,8 +0,0 @@
-Create table If Not Exists Queue (person_id int, person_name varchar(30), weight int, turn int);
-Truncate table Queue;
-insert into Queue (person_id, person_name, weight, turn) values ('5', 'Alice', '250', '1');
-insert into Queue (person_id, person_name, weight, turn) values ('4', 'Bob', '175', '5');
-insert into Queue (person_id, person_name, weight, turn) values ('3', 'Alex', '350', '2');
-insert into Queue (person_id, person_name, weight, turn) values ('6', 'John Cena', '400', '3');
-insert into Queue (person_id, person_name, weight, turn) values ('1', 'Winston', '500', '6');
-insert into Queue (person_id, person_name, weight, turn) values ('2', 'Marie', '200', '4');
diff --git a/problems/last-person-to-fit-in-the-elevator/README.md b/problems/last-person-to-fit-in-the-elevator/README.md
deleted file mode 100644
index 0d8f8558c..000000000
--- a/problems/last-person-to-fit-in-the-elevator/README.md
+++ /dev/null
@@ -1,61 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../sort-items-by-groups-respecting-dependencies "Sort Items by Groups Respecting Dependencies")
-
-[Next >](../monthly-transactions-ii "Monthly Transactions II")
-
-## [1204. Last Person to Fit in the Elevator (Medium)](https://leetcode.com/problems/last-person-to-fit-in-the-elevator "最后一个能进入电梯的人")
-
-
Table: Queue
-
-
-+-------------+---------+
-| Column Name | Type |
-+-------------+---------+
-| person_id | int |
-| person_name | varchar |
-| weight | int |
-| turn | int |
-+-------------+---------+
-person_id is the primary key column for this table.
-This table has the information about all people waiting for an elevator.
-The person_id and turn columns will contain all numbers from 1 to n, where n is the number of rows in the table.
-
-
-
-
-
The maximum weight the elevator can hold is 1000.
-
-
Write an SQL query to find the person_name of the last person who will fit in the elevator without exceeding the weight limit. It is guaranteed that the person who is first in the queue can fit in the elevator.
-
-
The query result format is in the following example:
-
-
-Queue table
-+-----------+-------------------+--------+------+
-| person_id | person_name | weight | turn |
-+-----------+-------------------+--------+------+
-| 5 | George Washington | 250 | 1 |
-| 3 | John Adams | 350 | 2 |
-| 6 | Thomas Jefferson | 400 | 3 |
-| 2 | Will Johnliams | 200 | 4 |
-| 4 | Thomas Jefferson | 175 | 5 |
-| 1 | James Elephant | 500 | 6 |
-+-----------+-------------------+--------+------+
-
-Result table
-+-------------------+
-| person_name |
-+-------------------+
-| Thomas Jefferson |
-+-------------------+
-
-Queue table is ordered by turn in the example for simplicity.
-In the example George Washington(id 5), John Adams(id 3) and Thomas Jefferson(id 6) will enter the elevator as their weight sum is 250 + 350 + 400 = 1000.
-Thomas Jefferson(id 6) is the last person to fit in the elevator because he has the last turn in these three people.
-
diff --git a/problems/last-person-to-fit-in-the-elevator/mysql_schemas.sql b/problems/last-person-to-fit-in-the-elevator/mysql_schemas.sql
deleted file mode 100644
index b7a7492a1..000000000
--- a/problems/last-person-to-fit-in-the-elevator/mysql_schemas.sql
+++ /dev/null
@@ -1,8 +0,0 @@
-Create table If Not Exists Queue (person_id int, person_name varchar(30), weight int, turn int);
-Truncate table Queue;
-insert into Queue (person_id, person_name, weight, turn) values ('5', 'George Washington', '250', '1');
-insert into Queue (person_id, person_name, weight, turn) values ('4', 'Thomas Jefferson', '175', '5');
-insert into Queue (person_id, person_name, weight, turn) values ('3', 'John Adams', '350', '2');
-insert into Queue (person_id, person_name, weight, turn) values ('6', 'Thomas Jefferson', '400', '3');
-insert into Queue (person_id, person_name, weight, turn) values ('1', 'James Elephant', '500', '6');
-insert into Queue (person_id, person_name, weight, turn) values ('2', 'Will Johnliams', '200', '4');
diff --git a/problems/last-stone-weight-ii/README.md b/problems/last-stone-weight-ii/README.md
deleted file mode 100644
index 6a41ec950..000000000
--- a/problems/last-stone-weight-ii/README.md
+++ /dev/null
@@ -1,75 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../longest-string-chain "Longest String Chain")
-
-[Next >](../actors-and-directors-who-cooperated-at-least-three-times "Actors and Directors Who Cooperated At Least Three Times")
-
-## [1049. Last Stone Weight II (Medium)](https://leetcode.com/problems/last-stone-weight-ii "最后一块石头的重量 II")
-
-
You are given an array of integers stones where stones[i] is the weight of the ith stone.
-
-
We are playing a game with the stones. On each turn, we choose any two stones and smash them together. Suppose the stones have weights x and y with x <= y. The result of this smash is:
-
-
-
If x == y, both stones are destroyed, and
-
If x != y, the stone of weight x is destroyed, and the stone of weight y has new weight y - x.
-
-
-
At the end of the game, there is at most one stone left.
-
-
Return the smallest possible weight of the left stone. If there are no stones left, return 0.
-
-
-
Example 1:
-
-
-Input: stones = [2,7,4,1,8,1]
-Output: 1
-Explanation:
-We can combine 2 and 4 to get 2, so the array converts to [2,7,1,8,1] then,
-we can combine 7 and 8 to get 1, so the array converts to [2,1,1,1] then,
-we can combine 2 and 1 to get 1, so the array converts to [1,1,1] then,
-we can combine 1 and 1 to get 0, so the array converts to [1], then that's the optimal value.
-
-
-
Example 2:
-
-
-Input: stones = [31,26,33,21,40]
-Output: 5
-
-
-
Example 3:
-
-
-Input: stones = [1,2]
-Output: 1
-
-
-
-
Constraints:
-
-
-
1 <= stones.length <= 30
-
1 <= stones[i] <= 100
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Hints
-
-Hint 1
-Think of the final answer as a sum of weights with + or - sign symbols infront of each weight. Actually, all sums with 1 of each sign symbol are possible.
-
-
-
-Hint 2
-Use dynamic programming: for every possible sum with N stones, those sums +x or -x is possible with N+1 stones, where x is the value of the newest stone. (This overcounts sums that are all positive or all negative, but those don't matter.)
-
diff --git a/problems/last-stone-weight-ii/last_stone_weight_ii.go b/problems/last-stone-weight-ii/last_stone_weight_ii.go
deleted file mode 100644
index 483039d37..000000000
--- a/problems/last-stone-weight-ii/last_stone_weight_ii.go
+++ /dev/null
@@ -1,25 +0,0 @@
-package problem1049
-
-func lastStoneWeightII(stones []int) int {
- hasSum := [3001]bool{}
- hasSum[0] = true
- sum := 0
- for _, s := range stones {
- sum += s
- for i := sum; i >= s; i-- {
- // record all sum of any choose form stones
- hasSum[i] = hasSum[i] || hasSum[i-s]
- }
- }
- // now, sum is sum(stones)
- // take stones to two group,weights are part and sum-part
- // result is sum-part - part
- // best is part = sum/2
- // if not, check part--
- // until part = 0
- part := sum / 2
- for part >= 0 && !hasSum[part] {
- part--
- }
- return sum - part - part
-}
diff --git a/problems/last-stone-weight/README.md b/problems/last-stone-weight/README.md
deleted file mode 100644
index 781736daf..000000000
--- a/problems/last-stone-weight/README.md
+++ /dev/null
@@ -1,63 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../customers-who-bought-all-products "Customers Who Bought All Products")
-
-[Next >](../remove-all-adjacent-duplicates-in-string "Remove All Adjacent Duplicates In String")
-
-## [1046. Last Stone Weight (Easy)](https://leetcode.com/problems/last-stone-weight "最后一块石头的重量")
-
-
You are given an array of integers stones where stones[i] is the weight of the ith stone.
-
-
We are playing a game with the stones. On each turn, we choose the heaviest two stones and smash them together. Suppose the heaviest two stones have weights x and y with x <= y. The result of this smash is:
-
-
-
If x == y, both stones are destroyed, and
-
If x != y, the stone of weight x is destroyed, and the stone of weight y has new weight y - x.
-
-
-
At the end of the game, there is at most one stone left.
-
-
Return the smallest possible weight of the left stone. If there are no stones left, return 0.
-
-
-
Example 1:
-
-
-Input: stones = [2,7,4,1,8,1]
-Output: 1
-Explanation:
-We combine 7 and 8 to get 1 so the array converts to [2,4,1,1,1] then,
-we combine 2 and 4 to get 2 so the array converts to [2,1,1,1] then,
-we combine 2 and 1 to get 1 so the array converts to [1,1,1] then,
-we combine 1 and 1 to get 0 so the array converts to [1] then that's the value of the last stone.
-
-
-
Example 2:
-
-
-Input: stones = [1]
-Output: 1
-
-
-
-
Constraints:
-
-
-
1 <= stones.length <= 30
-
1 <= stones[i] <= 1000
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Heap (Priority Queue)](../../tag/heap-priority-queue/README.md)]
-
-### Hints
-
-Hint 1
-Simulate the process. We can do it with a heap, or by sorting some list of stones every time we take a turn.
-
diff --git a/problems/last-stone-weight/last_stone_weight.go b/problems/last-stone-weight/last_stone_weight.go
deleted file mode 100644
index b063ccc4a..000000000
--- a/problems/last-stone-weight/last_stone_weight.go
+++ /dev/null
@@ -1,19 +0,0 @@
-package problem1046
-
-import "sort"
-
-func lastStoneWeight(stones []int) int {
- for len(stones) >= 2 {
- n := len(stones) - 1
- sort.Ints(stones)
- v := stones[n] - stones[n-1]
- if v > 0 {
- stones[n-1] = v
- } else {
- n--
- }
- stones = stones[:n]
- }
- stones = append(stones, 0)
- return stones[0]
-}
diff --git a/problems/last-stone-weight/last_stone_weight_test.go b/problems/last-stone-weight/last_stone_weight_test.go
deleted file mode 100644
index 413f1d538..000000000
--- a/problems/last-stone-weight/last_stone_weight_test.go
+++ /dev/null
@@ -1,31 +0,0 @@
-package problem1046
-
-import "testing"
-
-type testType struct {
- in []int
- want int
-}
-
-func TestLastStoneWeight(t *testing.T) {
- tests := [...]testType{
- {
- in: []int{2, 7, 4, 1, 8, 1},
- want: 1,
- },
- {
- in: []int{2, 7, 4, 1, 8, 1, 5},
- want: 0,
- },
- {
- in: []int{316, 157, 73, 106, 771, 828},
- want: 37,
- },
- }
- for _, tt := range tests {
- got := lastStoneWeight(tt.in)
- if got != tt.want {
- t.Fatalf("in: %v, got: %v, want: %v", tt.in, got, tt.want)
- }
- }
-}
diff --git a/problems/last-substring-in-lexicographical-order/README.md b/problems/last-substring-in-lexicographical-order/README.md
deleted file mode 100644
index a0a54cd2d..000000000
--- a/problems/last-substring-in-lexicographical-order/README.md
+++ /dev/null
@@ -1,63 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../as-far-from-land-as-possible "As Far from Land as Possible")
-
-[Next >](../product-price-at-a-given-date "Product Price at a Given Date")
-
-## [1163. Last Substring in Lexicographical Order (Hard)](https://leetcode.com/problems/last-substring-in-lexicographical-order "按字典序排在最后的子串")
-
-
Given a string s, return the last substring ofsin lexicographical order.
-
-
-
Example 1:
-
-
-Input: s = "abab"
-Output: "bab"
-Explanation: The substrings are ["a", "ab", "aba", "abab", "b", "ba", "bab"]. The lexicographically maximum substring is "bab".
-
-
-
Example 2:
-
-
-Input: s = "leetcode"
-Output: "tcode"
-
-
-
-
Constraints:
-
-
-
1 <= s.length <= 4 * 105
-
s contains only lowercase English letters.
-
-
-### Related Topics
- [[Two Pointers](../../tag/two-pointers/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Hints
-
-Hint 1
-Assume that the answer is a sub-string from index i to j. If you add the character at index j+1 you get a better answer.
-
-
-
-Hint 2
-The answer is always a suffix of the given string.
-
-
-
-Hint 3
-Since the limits are high, we need an efficient data structure.
-
-
-
-Hint 4
-Use suffix array.
-
diff --git a/problems/last-substring-in-lexicographical-order/last_substring_in_lexicographical_order.go b/problems/last-substring-in-lexicographical-order/last_substring_in_lexicographical_order.go
deleted file mode 100644
index e20879500..000000000
--- a/problems/last-substring-in-lexicographical-order/last_substring_in_lexicographical_order.go
+++ /dev/null
@@ -1,31 +0,0 @@
-package problem1163
-
-func lastSubstring(s string) string {
- last, n := 0, len(s)
- for i := 1; i < n; i++ {
- if s[i-1] == s[i] {
- // all of s[last:i+1] are the same letter.
- // 'i' has no chance to be the new 'last'
- // the reason is
- // 1. s[i+1] > s[i], 'i+1' is the new 'last'
- // 2. s[i+1] < s[i], 'last' is still 'last'
- // 3. s[i+1] = s[i], 'i+1' is the new 'i'
- // like above, need a different letter to make decision
- continue
- }
- for l := 0; i+l < n; l++ {
- if s[last+l] < s[i+l] {
- // s[i:] is bigger than s[last:]
- // new begin is here
- last = i
- break
- }
- if s[last+l] > s[i+l] {
- // s[last:] is bigger than s[i:]
- // no need to compare continue
- break
- }
- }
- }
- return s[last:]
-}
diff --git a/problems/last-substring-in-lexicographical-order/last_substring_in_lexicographical_order_test.go b/problems/last-substring-in-lexicographical-order/last_substring_in_lexicographical_order_test.go
deleted file mode 100644
index 1e78a9171..000000000
--- a/problems/last-substring-in-lexicographical-order/last_substring_in_lexicographical_order_test.go
+++ /dev/null
@@ -1,35 +0,0 @@
-package problem1163
-
-import "testing"
-
-type testType struct {
- in string
- want string
-}
-
-func TestLastSubstring(t *testing.T) {
- tests := [...]testType{
- {
- in: "abab",
- want: "bab",
- },
- {
- in: "abcdabc",
- want: "dabc",
- },
- {
- in: "ffbcdfeda",
- want: "ffbcdfeda",
- },
- {
- in: "hksljkjsfjv",
- want: "v",
- },
- }
- for _, tt := range tests {
- got := lastSubstring(tt.in)
- if got != tt.want {
- t.Fatalf("in: %v, got: %v, want: %v", tt.in, got, tt.want)
- }
- }
-}
diff --git a/problems/latest-time-by-replacing-hidden-digits/README.md b/problems/latest-time-by-replacing-hidden-digits/README.md
deleted file mode 100644
index 1410e84f9..000000000
--- a/problems/latest-time-by-replacing-hidden-digits/README.md
+++ /dev/null
@@ -1,64 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../count-ways-to-make-array-with-product "Count Ways to Make Array With Product")
-
-[Next >](../change-minimum-characters-to-satisfy-one-of-three-conditions "Change Minimum Characters to Satisfy One of Three Conditions")
-
-## [1736. Latest Time by Replacing Hidden Digits (Easy)](https://leetcode.com/problems/latest-time-by-replacing-hidden-digits "替换隐藏数字得到的最晚时间")
-
-
You are given a string time in the form of hh:mm, where some of the digits in the string are hidden (represented by ?).
-
-
The valid times are those inclusively between 00:00 and 23:59.
-
-
Return the latest valid time you can get fromtime by replacing the hiddendigits.
-
-
-
Example 1:
-
-
-Input: time = "2?:?0"
-Output: "23:50"
-Explanation: The latest hour beginning with the digit '2' is 23 and the latest minute ending with the digit '0' is 50.
-
-
-
Example 2:
-
-
-Input: time = "0?:3?"
-Output: "09:39"
-
-
-
Example 3:
-
-
-Input: time = "1?:22"
-Output: "19:22"
-
-
-
-
Constraints:
-
-
-
time is in the format hh:mm.
-
It is guaranteed that you can produce a valid time from the given string.
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
- [[Greedy](../../tag/greedy/README.md)]
-
-### Hints
-
-Hint 1
-Trying out all possible solutions from biggest to smallest would fit in the time limit.
-
-
-
-Hint 2
-To check if the solution is okay, you need to find out if it's valid and matches every character
-
diff --git a/problems/leaf-similar-trees/README.md b/problems/leaf-similar-trees/README.md
deleted file mode 100644
index 38ce2a321..000000000
--- a/problems/leaf-similar-trees/README.md
+++ /dev/null
@@ -1,71 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-number-of-refueling-stops "Minimum Number of Refueling Stops")
-
-[Next >](../length-of-longest-fibonacci-subsequence "Length of Longest Fibonacci Subsequence")
-
-## [872. Leaf-Similar Trees (Easy)](https://leetcode.com/problems/leaf-similar-trees "叶子相似的树")
-
-
Consider all the leaves of a binary tree, from left to right order, the values of those leaves form a leaf value sequence.
-
-
-
-
For example, in the given tree above, the leaf value sequence is (6, 7, 4, 9, 8).
-
-
Two binary trees are considered leaf-similar if their leaf value sequence is the same.
-
-
Return true if and only if the two given trees with head nodes root1 and root2 are leaf-similar.
The number of nodes in each tree will be in the range [1, 200].
-
Both of the given trees will have values in the range [0, 200].
-
-
-### Related Topics
- [[Tree](../../tag/tree/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Binary Tree](../../tag/binary-tree/README.md)]
diff --git a/problems/leaf-similar-trees/leaf_similar_trees.go b/problems/leaf-similar-trees/leaf_similar_trees.go
deleted file mode 100644
index 1857971cf..000000000
--- a/problems/leaf-similar-trees/leaf_similar_trees.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem872
diff --git a/problems/leaf-similar-trees/leaf_similar_trees_test.go b/problems/leaf-similar-trees/leaf_similar_trees_test.go
deleted file mode 100644
index 1857971cf..000000000
--- a/problems/leaf-similar-trees/leaf_similar_trees_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem872
diff --git a/problems/league-statistics/README.md b/problems/league-statistics/README.md
deleted file mode 100644
index 30c677001..000000000
--- a/problems/league-statistics/README.md
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-building-height "Maximum Building Height")
-
-[Next >](../next-palindrome-using-same-digits "Next Palindrome Using Same Digits")
-
-## [1841. League Statistics (Medium)](https://leetcode.com/problems/league-statistics "联赛信息统计")
-
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/league-statistics/mysql_schemas.sql b/problems/league-statistics/mysql_schemas.sql
deleted file mode 100644
index 0f6c35b2b..000000000
--- a/problems/league-statistics/mysql_schemas.sql
+++ /dev/null
@@ -1,11 +0,0 @@
-Create table If Not Exists Teams (team_id int, team_name varchar(20));
-Create table If Not Exists Matches (home_team_id int, away_team_id int, home_team_goals int, away_team_goals int);
-Truncate table Teams;
-insert into Teams (team_id, team_name) values ('1', 'Ajax');
-insert into Teams (team_id, team_name) values ('4', 'Dortmund');
-insert into Teams (team_id, team_name) values ('6', 'Arsenal');
-Truncate table Matches;
-insert into Matches (home_team_id, away_team_id, home_team_goals, away_team_goals) values ('1', '4', '0', '1');
-insert into Matches (home_team_id, away_team_id, home_team_goals, away_team_goals) values ('1', '6', '3', '3');
-insert into Matches (home_team_id, away_team_id, home_team_goals, away_team_goals) values ('4', '1', '5', '2');
-insert into Matches (home_team_id, away_team_id, home_team_goals, away_team_goals) values ('6', '1', '0', '0');
diff --git a/problems/least-number-of-unique-integers-after-k-removals/README.md b/problems/least-number-of-unique-integers-after-k-removals/README.md
deleted file mode 100644
index 07b4b71a6..000000000
--- a/problems/least-number-of-unique-integers-after-k-removals/README.md
+++ /dev/null
@@ -1,59 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../running-sum-of-1d-array "Running Sum of 1d Array")
-
-[Next >](../minimum-number-of-days-to-make-m-bouquets "Minimum Number of Days to Make m Bouquets")
-
-## [1481. Least Number of Unique Integers after K Removals (Medium)](https://leetcode.com/problems/least-number-of-unique-integers-after-k-removals "不同整数的最少数目")
-
-
Given an array of integers arr and an integer k. Find the least number of unique integers after removing exactlyk elements.
-
-
-
-
-
-
Example 1:
-
-
-Input: arr = [5,5,4], k = 1
-Output: 1
-Explanation: Remove the single 4, only 5 is left.
-
-Example 2:
-
-
-Input: arr = [4,3,1,1,3,3,2], k = 3
-Output: 2
-Explanation: Remove 4, 2 and either one of the two 1s or three 3s. 1 and 3 will be left.
-
-
-
Constraints:
-
-
-
1 <= arr.length <= 10^5
-
1 <= arr[i] <= 10^9
-
0 <= k <= arr.length
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Greedy](../../tag/greedy/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
- [[Counting](../../tag/counting/README.md)]
-
-### Hints
-
-Hint 1
-Use a map to count the frequencies of the numbers in the array.
-
-
-
-Hint 2
-An optimal strategy is to remove the numbers with the smallest count first.
-
diff --git a/problems/least-operators-to-express-number/README.md b/problems/least-operators-to-express-number/README.md
deleted file mode 100644
index b66220e68..000000000
--- a/problems/least-operators-to-express-number/README.md
+++ /dev/null
@@ -1,65 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-area-rectangle-ii "Minimum Area Rectangle II")
-
-[Next >](../univalued-binary-tree "Univalued Binary Tree")
-
-## [964. Least Operators to Express Number (Hard)](https://leetcode.com/problems/least-operators-to-express-number "表示数字的最少运算符")
-
-
Given a single positive integer x, we will write an expression of the form x (op1) x (op2) x (op3) x ... where each operator op1, op2, etc. is either addition, subtraction, multiplication, or division (+, -, *, or /). For example, with x = 3, we might write 3 * 3 / 3 + 3 - 3 which is a value of 3.
-
-
When writing such an expression, we adhere to the following conventions:
-
-
-
The division operator (/) returns rational numbers.
-
There are no parentheses placed anywhere.
-
We use the usual order of operations: multiplication and division happen before addition and subtraction.
-
It is not allowed to use the unary negation operator (-). For example, "x - x" is a valid expression as it only uses subtraction, but "-x + x" is not because it uses negation.
-
-
-
We would like to write an expression with the least number of operators such that the expression equals the given target. Return the least number of operators used.
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
diff --git a/problems/least-operators-to-express-number/least_operators_to_express_number.go b/problems/least-operators-to-express-number/least_operators_to_express_number.go
deleted file mode 100644
index 47932d06d..000000000
--- a/problems/least-operators-to-express-number/least_operators_to_express_number.go
+++ /dev/null
@@ -1,5 +0,0 @@
-package problem964
-
-func leastOpsExpressTarget(x int, target int) int {
- return 0
-}
diff --git a/problems/leetcodify-friends-recommendations/README.md b/problems/leetcodify-friends-recommendations/README.md
deleted file mode 100644
index dcc682953..000000000
--- a/problems/leetcodify-friends-recommendations/README.md
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../count-ways-to-build-rooms-in-an-ant-colony "Count Ways to Build Rooms in an Ant Colony")
-
-[Next >](../kth-smallest-subarray-sum "Kth Smallest Subarray Sum")
-
-## [1917. Leetcodify Friends Recommendations (Hard)](https://leetcode.com/problems/leetcodify-friends-recommendations "Leetcodify 好友推荐")
-
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/leetcodify-friends-recommendations/mysql_schemas.sql b/problems/leetcodify-friends-recommendations/mysql_schemas.sql
deleted file mode 100644
index d991fe675..000000000
--- a/problems/leetcodify-friends-recommendations/mysql_schemas.sql
+++ /dev/null
@@ -1,20 +0,0 @@
-Create table If Not Exists Listens (user_id int, song_id int, day date);
-Create table If Not Exists Friendship (user1_id int, user2_id int);
-Truncate table Listens;
-insert into Listens (user_id, song_id, day) values ('1', '10', '2021-03-15');
-insert into Listens (user_id, song_id, day) values ('1', '11', '2021-03-15');
-insert into Listens (user_id, song_id, day) values ('1', '12', '2021-03-15');
-insert into Listens (user_id, song_id, day) values ('2', '10', '2021-03-15');
-insert into Listens (user_id, song_id, day) values ('2', '11', '2021-03-15');
-insert into Listens (user_id, song_id, day) values ('2', '12', '2021-03-15');
-insert into Listens (user_id, song_id, day) values ('3', '10', '2021-03-15');
-insert into Listens (user_id, song_id, day) values ('3', '11', '2021-03-15');
-insert into Listens (user_id, song_id, day) values ('3', '12', '2021-03-15');
-insert into Listens (user_id, song_id, day) values ('4', '10', '2021-03-15');
-insert into Listens (user_id, song_id, day) values ('4', '11', '2021-03-15');
-insert into Listens (user_id, song_id, day) values ('4', '13', '2021-03-15');
-insert into Listens (user_id, song_id, day) values ('5', '10', '2021-03-16');
-insert into Listens (user_id, song_id, day) values ('5', '11', '2021-03-16');
-insert into Listens (user_id, song_id, day) values ('5', '12', '2021-03-16');
-Truncate table Friendship;
-insert into Friendship (user1_id, user2_id) values ('1', '2');
diff --git a/problems/leetcodify-similar-friends/README.md b/problems/leetcodify-similar-friends/README.md
deleted file mode 100644
index 3d20773a3..000000000
--- a/problems/leetcodify-similar-friends/README.md
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../kth-smallest-subarray-sum "Kth Smallest Subarray Sum")
-
-[Next >](../build-array-from-permutation "Build Array from Permutation")
-
-## [1919. Leetcodify Similar Friends (Hard)](https://leetcode.com/problems/leetcodify-similar-friends "兴趣相同的朋友")
-
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
-
-### Similar Questions
- 1. [Leetcodify Friends Recommendations](../leetcodify-friends-recommendations) (Hard)
diff --git a/problems/leetcodify-similar-friends/mysql_schemas.sql b/problems/leetcodify-similar-friends/mysql_schemas.sql
deleted file mode 100644
index a1c1de591..000000000
--- a/problems/leetcodify-similar-friends/mysql_schemas.sql
+++ /dev/null
@@ -1,22 +0,0 @@
-Create table If Not Exists Listens (user_id int, song_id int, day date);
-Create table If Not Exists Friendship (user1_id int, user2_id int);
-Truncate table Listens;
-insert into Listens (user_id, song_id, day) values ('1', '10', '2021-03-15');
-insert into Listens (user_id, song_id, day) values ('1', '11', '2021-03-15');
-insert into Listens (user_id, song_id, day) values ('1', '12', '2021-03-15');
-insert into Listens (user_id, song_id, day) values ('2', '10', '2021-03-15');
-insert into Listens (user_id, song_id, day) values ('2', '11', '2021-03-15');
-insert into Listens (user_id, song_id, day) values ('2', '12', '2021-03-15');
-insert into Listens (user_id, song_id, day) values ('3', '10', '2021-03-15');
-insert into Listens (user_id, song_id, day) values ('3', '11', '2021-03-15');
-insert into Listens (user_id, song_id, day) values ('3', '12', '2021-03-15');
-insert into Listens (user_id, song_id, day) values ('4', '10', '2021-03-15');
-insert into Listens (user_id, song_id, day) values ('4', '11', '2021-03-15');
-insert into Listens (user_id, song_id, day) values ('4', '13', '2021-03-15');
-insert into Listens (user_id, song_id, day) values ('5', '10', '2021-03-16');
-insert into Listens (user_id, song_id, day) values ('5', '11', '2021-03-16');
-insert into Listens (user_id, song_id, day) values ('5', '12', '2021-03-16');
-Truncate table Friendship;
-insert into Friendship (user1_id, user2_id) values ('1', '2');
-insert into Friendship (user1_id, user2_id) values ('2', '4');
-insert into Friendship (user1_id, user2_id) values ('2', '5');
diff --git a/problems/leetflex-banned-accounts/README.md b/problems/leetflex-banned-accounts/README.md
deleted file mode 100644
index b6c7f5d38..000000000
--- a/problems/leetflex-banned-accounts/README.md
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-subarray-sum-after-one-operation "Maximum Subarray Sum After One Operation")
-
-[Next >](../sum-of-unique-elements "Sum of Unique Elements")
-
-## [1747. Leetflex Banned Accounts (Medium)](https://leetcode.com/problems/leetflex-banned-accounts "应该被禁止的Leetflex账户")
-
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/leetflex-banned-accounts/mysql_schemas.sql b/problems/leetflex-banned-accounts/mysql_schemas.sql
deleted file mode 100644
index d9f5775c4..000000000
--- a/problems/leetflex-banned-accounts/mysql_schemas.sql
+++ /dev/null
@@ -1,10 +0,0 @@
-Create table If Not Exists LogInfo (account_id int, ip_address int, login datetime, logout datetime);
-Truncate table LogInfo;
-insert into LogInfo (account_id, ip_address, login, logout) values ('1', '1', '2021-02-01 09:00:00', '2021-02-01 09:30:00');
-insert into LogInfo (account_id, ip_address, login, logout) values ('1', '2', '2021-02-01 08:00:00', '2021-02-01 11:30:00');
-insert into LogInfo (account_id, ip_address, login, logout) values ('2', '6', '2021-02-01 20:30:00', '2021-02-01 22:00:00');
-insert into LogInfo (account_id, ip_address, login, logout) values ('2', '7', '2021-02-02 20:30:00', '2021-02-02 22:00:00');
-insert into LogInfo (account_id, ip_address, login, logout) values ('3', '9', '2021-02-01 16:00:00', '2021-02-01 16:59:59');
-insert into LogInfo (account_id, ip_address, login, logout) values ('3', '13', '2021-02-01 17:00:00', '2021-02-01 17:59:59');
-insert into LogInfo (account_id, ip_address, login, logout) values ('4', '10', '2021-02-01 16:00:00', '2021-02-01 17:00:00');
-insert into LogInfo (account_id, ip_address, login, logout) values ('4', '11', '2021-02-01 17:00:00', '2021-02-01 17:59:59');
diff --git a/problems/leftmost-column-with-at-least-a-one/README.md b/problems/leftmost-column-with-at-least-a-one/README.md
deleted file mode 100644
index da3d04af4..000000000
--- a/problems/leftmost-column-with-at-least-a-one/README.md
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../perform-string-shifts "Perform String Shifts")
-
-[Next >](../first-unique-number "First Unique Number")
-
-## [1428. Leftmost Column with at Least a One (Medium)](https://leetcode.com/problems/leftmost-column-with-at-least-a-one "至少有一个 1 的最左端列")
-
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
- [[Interactive](../../tag/interactive/README.md)]
-
-### Hints
-
-Hint 1
-1. (Binary Search) For each row do a binary search to find the leftmost one on that row and update the answer.
-
-
-
-Hint 2
-2. (Optimal Approach) Imagine there is a pointer p(x, y) starting from top right corner. p can only move left or down. If the value at p is 0, move down. If the value at p is 1, move left. Try to figure out the correctness and time complexity of this algorithm.
-
diff --git a/problems/lemonade-change/README.md b/problems/lemonade-change/README.md
deleted file mode 100644
index 1eb2c1502..000000000
--- a/problems/lemonade-change/README.md
+++ /dev/null
@@ -1,69 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../buddy-strings "Buddy Strings")
-
-[Next >](../score-after-flipping-matrix "Score After Flipping Matrix")
-
-## [860. Lemonade Change (Easy)](https://leetcode.com/problems/lemonade-change "柠檬水找零")
-
-
At a lemonade stand, each lemonade costs $5. Customers are standing in a queue to buy from you, and order one at a time (in the order specified by bills). Each customer will only buy one lemonade and pay with either a $5, $10, or $20 bill. You must provide the correct change to each customer so that the net transaction is that the customer pays $5.
-
-
Note that you don't have any change in hand at first.
-
-
Given an integer array bills where bills[i] is the bill the ith customer pays, return trueif you can provide every customer with correct change, orfalseotherwise.
-
-
-
Example 1:
-
-
-Input: bills = [5,5,5,10,20]
-Output: true
-Explanation:
-From the first 3 customers, we collect three $5 bills in order.
-From the fourth customer, we collect a $10 bill and give back a $5.
-From the fifth customer, we give a $10 bill and a $5 bill.
-Since all customers got correct change, we output true.
-
-
-
Example 2:
-
-
-Input: bills = [5,5,10,10,20]
-Output: false
-Explanation:
-From the first two customers in order, we collect two $5 bills.
-For the next two customers in order, we collect a $10 bill and give back a $5 bill.
-For the last customer, we can not give change of $15 back because we only have two $10 bills.
-Since not every customer received correct change, the answer is false.
-
Given a strictly increasing array arr of positive integers forming a sequence, return the length of the longest Fibonacci-like subsequence ofarr. If one does not exist, return 0.
-
-
A subsequence is derived from another sequence arr by deleting any number of elements (including none) from arr, without changing the order of the remaining elements. For example, [3, 5, 8] is a subsequence of [3, 4, 5, 6, 7, 8].
-
-
-
Example 1:
-
-
-Input: arr = [1,2,3,4,5,6,7,8]
-Output: 5
-Explanation: The longest subsequence that is fibonacci-like: [1,2,3,5,8].
-
-
Example 2:
-
-
-Input: arr = [1,3,7,11,12,14,18]
-Output: 3
-Explanation:The longest subsequence that is fibonacci-like: [1,11,12], [3,11,14] or [7,11,18].
Given a string containing digits from 2-9 inclusive, return all possible letter combinations that the number could represent. Return the answer in any order.
-
-
A mapping of digit to letters (just like on the telephone buttons) is given below. Note that 1 does not map to any letters.
Given strings A and B of the same length, we say A[i] and B[i] are equivalent characters. For example, if A = "abc" and B = "cde", then we have 'a' == 'c', 'b' == 'd', 'c' == 'e'.
-
-
Equivalent characters follow the usual rules of any equivalence relation:
For example, given the equivalency information from A and B above, S = "eed", "acd", and "aab" are equivalent strings, and "aab" is the lexicographically smallest equivalent string of S.
-
-
Return the lexicographically smallest equivalent string of S by using the equivalency information from A and B.
-
-
-
-
Example 1:
-
-
-Input: A = "parker", B = "morris", S = "parser"
-Output: "makkek"
-Explanation: Based on the equivalency information in A and B, we can group their characters as [m,p], [a,o], [k,r,s], [e,i]. The characters in each group are equivalent and sorted in lexicographical order. So the answer is "makkek".
-
-
-
Example 2:
-
-
-Input: A = "hello", B = "world", S = "hold"
-Output: "hdld"
-Explanation: Based on the equivalency information in A and B, we can group their characters as [h,w], [d,e,o], [l,r]. So only the second letter 'o' in S is changed to 'd', the answer is "hdld".
-
-
-
Example 3:
-
-
-Input: A = "leetcode", B = "programs", S = "sourcecode"
-Output: "aauaaaaada"
-Explanation: We group the equivalent characters in A and B as [a,o,e,r,s,c], [l,p], [g,t] and [d,m], thus all letters in S except 'u' and 'd' are transformed to 'a', the answer is "aauaaaaada".
-
-
-
-
-
Note:
-
-
-
String A, B and S consist of only lowercase English letters from 'a' - 'z'.
-
The lengths of string A, B and S are between 1 and 1000.
-
String A and B are of the same length.
-
-
-### Related Topics
- [[Union Find](../../tag/union-find/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Hints
-
-Hint 1
-Model these equalities as edges of a graph.
-
-
-
-Hint 2
-Group each connected component of the graph and assign each node of this component to the node with the lowest lexicographically character.
-
-
-
-Hint 3
-Finally convert the string with the precalculated information.
-
diff --git a/problems/lexicographically-smallest-string-after-applying-operations/README.md b/problems/lexicographically-smallest-string-after-applying-operations/README.md
deleted file mode 100644
index 09ea81db8..000000000
--- a/problems/lexicographically-smallest-string-after-applying-operations/README.md
+++ /dev/null
@@ -1,96 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../largest-substring-between-two-equal-characters "Largest Substring Between Two Equal Characters")
-
-[Next >](../best-team-with-no-conflicts "Best Team With No Conflicts")
-
-## [1625. Lexicographically Smallest String After Applying Operations (Medium)](https://leetcode.com/problems/lexicographically-smallest-string-after-applying-operations "执行操作后字典序最小的字符串")
-
-
You are given a string s of even length consisting of digits from 0 to 9, and two integers a and b.
-
-
You can apply either of the following two operations any number of times and in any order on s:
-
-
-
Add a to all odd indices of s(0-indexed). Digits post 9 are cycled back to 0. For example, if s = "3456" and a = 5, s becomes "3951".
-
Rotate s to the right by b positions. For example, if s = "3456" and b = 1, s becomes "6345".
-
-
-
Return the lexicographically smallest string you can obtain by applying the above operations any number of times ons.
-
-
A string a is lexicographically smaller than a string b (of the same length) if in the first position where a and b differ, string a has a letter that appears earlier in the alphabet than the corresponding letter in b. For example, "0158" is lexicographically smaller than "0190" because the first position they differ is at the third letter, and '5' comes before '9'.
-
-
-
Example 1:
-
-
-Input: s = "5525", a = 9, b = 2
-Output: "2050"
-Explanation: We can apply the following operations:
-Start: "5525"
-Rotate: "2555"
-Add: "2454"
-Add: "2353"
-Rotate: "5323"
-Add: "5222"
-Add: "5121"
-Rotate: "2151"
-Add: "2050"
-There is no way to obtain a string that is lexicographically smaller then "2050".
-
-
-
Example 2:
-
-
-Input: s = "74", a = 5, b = 1
-Output: "24"
-Explanation: We can apply the following operations:
-Start: "74"
-Rotate: "47"
-Add: "42"
-Rotate: "24"
-There is no way to obtain a string that is lexicographically smaller then "24".
-
-
-
Example 3:
-
-
-Input: s = "0011", a = 4, b = 2
-Output: "0011"
-Explanation: There are no sequence of operations that will give us a lexicographically smaller string than "0011".
-
-
-
-
Constraints:
-
-
-
2 <= s.length <= 100
-
s.length is even.
-
s consists of digits from 0 to 9 only.
-
1 <= a <= 9
-
1 <= b <= s.length - 1
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
-
-### Hints
-
-Hint 1
-Since the length of s is even, the total number of possible sequences is at most 10 * 10 * s.length.
-
-
-
-Hint 2
-You can generate all possible sequences and take their minimum.
-
-
-
-Hint 3
-Keep track of already generated sequences so they are not processed again.
-
diff --git a/problems/lfu-cache/README.md b/problems/lfu-cache/README.md
deleted file mode 100644
index 2f18a3838..000000000
--- a/problems/lfu-cache/README.md
+++ /dev/null
@@ -1,83 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../repeated-substring-pattern "Repeated Substring Pattern")
-
-[Next >](../hamming-distance "Hamming Distance")
-
-## [460. LFU Cache (Hard)](https://leetcode.com/problems/lfu-cache "LFU 缓存")
-
-
LFUCache(int capacity) Initializes the object with the capacity of the data structure.
-
int get(int key) Gets the value of the key if the key exists in the cache. Otherwise, returns -1.
-
void put(int key, int value) Update the value of the key if present, or inserts the key if not already present. When the cache reaches its capacity, it should invalidate and remove the least frequently used key before inserting a new item. For this problem, when there is a tie (i.e., two or more keys with the same frequency), the least recently usedkey would be invalidated.
-
-
-
To determine the least frequently used key, a use counter is maintained for each key in the cache. The key with the smallest use counter is the least frequently used key.
-
-
When a key is first inserted into the cache, its use counter is set to 1 (due to the put operation). The use counter for a key in the cache is incremented either a get or put operation is called on it.
-
-
The functions get and put must each run in O(1) average time complexity.
-
-
-
Example 1:
-
-
-Input
-["LFUCache", "put", "put", "get", "put", "get", "get", "put", "get", "get", "get"]
-[[2], [1, 1], [2, 2], [1], [3, 3], [2], [3], [4, 4], [1], [3], [4]]
-Output
-[null, null, null, 1, null, -1, 3, null, -1, 3, 4]
-
-Explanation
-// cnt(x) = the use counter for key x
-// cache=[] will show the last used order for tiebreakers (leftmost element is most recent)
-LFUCache lfu = new LFUCache(2);
-lfu.put(1, 1); // cache=[1,_], cnt(1)=1
-lfu.put(2, 2); // cache=[2,1], cnt(2)=1, cnt(1)=1
-lfu.get(1); // return 1
- // cache=[1,2], cnt(2)=1, cnt(1)=2
-lfu.put(3, 3); // 2 is the LFU key because cnt(2)=1 is the smallest, invalidate 2.
- // cache=[3,1], cnt(3)=1, cnt(1)=2
-lfu.get(2); // return -1 (not found)
-lfu.get(3); // return 3
- // cache=[3,1], cnt(3)=2, cnt(1)=2
-lfu.put(4, 4); // Both 1 and 3 have the same cnt, but 1 is LRU, invalidate 1.
- // cache=[4,3], cnt(4)=1, cnt(3)=2
-lfu.get(1); // return -1 (not found)
-lfu.get(3); // return 3
- // cache=[3,4], cnt(4)=1, cnt(3)=3
-lfu.get(4); // return 4
- // cache=[3,4], cnt(4)=2, cnt(3)=3
-
-
-
-
Constraints:
-
-
-
0 <= capacity <= 104
-
0 <= key <= 105
-
0 <= value <= 109
-
At most 2 * 105 calls will be made to get and put.
You are given a license key represented as a string s that consists of only alphanumeric characters and dashes. The string is separated into n + 1 groups by n dashes. You are also given an integer k.
-
-
We want to reformat the string s such that each group contains exactly k characters, except for the first group, which could be shorter than k but still must contain at least one character. Furthermore, there must be a dash inserted between two groups, and you should convert all lowercase letters to uppercase.
-
-
Return the reformatted license key.
-
-
-
Example 1:
-
-
-Input: s = "5F3Z-2e-9-w", k = 4
-Output: "5F3Z-2E9W"
-Explanation: The string s has been split into two parts, each part has 4 characters.
-Note that the two extra dashes are not needed and can be removed.
-
-
-
Example 2:
-
-
-Input: s = "2-5g-3-J", k = 2
-Output: "2-5G-3J"
-Explanation: The string s has been split into three parts, each part has 2 characters except the first part as it could be shorter as mentioned above.
-
-
-
-
Constraints:
-
-
-
1 <= s.length <= 105
-
s consists of English letters, digits, and dashes '-'.
Given n points on a 2D plane, find if there is such a line parallel to y-axis that reflect the given points.
-
-
Example 1:
-
-
-Input: [[1,1],[-1,1]]
-Output: true
-
-
-
-
Example 2:
-
-
-Input: [[1,1],[-1,-1]]
-Output: false
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Math](../../tag/math/README.md)]
-
-### Similar Questions
- 1. [Max Points on a Line](../max-points-on-a-line) (Hard)
- 1. [Number of Boomerangs](../number-of-boomerangs) (Medium)
-
-### Hints
-
-Hint 1
-Find the smallest and largest x-value for all points.
-
-
-
-Hint 2
-If there is a line then it should be at y = (minX + maxX) / 2.
-
-
-
-Hint 3
-For each point, make sure that it has a reflected point in the opposite side.
-
diff --git a/problems/line-reflection/line_reflection.go b/problems/line-reflection/line_reflection.go
deleted file mode 100644
index 08682d969..000000000
--- a/problems/line-reflection/line_reflection.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem356
diff --git a/problems/line-reflection/line_reflection_test.go b/problems/line-reflection/line_reflection_test.go
deleted file mode 100644
index 08682d969..000000000
--- a/problems/line-reflection/line_reflection_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem356
diff --git a/problems/linked-list-components/README.md b/problems/linked-list-components/README.md
deleted file mode 100644
index ec94414ff..000000000
--- a/problems/linked-list-components/README.md
+++ /dev/null
@@ -1,50 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../ambiguous-coordinates "Ambiguous Coordinates")
-
-[Next >](../race-car "Race Car")
-
-## [817. Linked List Components (Medium)](https://leetcode.com/problems/linked-list-components "链表组件")
-
-
You are given the head of a linked list containing unique integer values and an integer array nums that is a subset of the linked list values.
-
-
Return the number of connected components in nums where two values are connected if they appear consecutively in the linked list.
-
-
-
Example 1:
-
-
-Input: head = [0,1,2,3], nums = [0,1,3]
-Output: 2
-Explanation: 0 and 1 are connected, so [0, 1] and [3] are the two connected components.
-
-
-
Example 2:
-
-
-Input: head = [0,1,2,3,4], nums = [0,3,1,4]
-Output: 2
-Explanation: 0 and 1 are connected, 3 and 4 are connected, so [0, 1] and [3, 4] are the two connected components.
-
Given the head of a linked list, return the node where the cycle begins. If there is no cycle, return null.
-
-
There is a cycle in a linked list if there is some node in the list that can be reached again by continuously following the next pointer. Internally, pos is used to denote the index of the node that tail's next pointer is connected to (0-indexed). It is -1 if there is no cycle. Note thatposis not passed as a parameter.
-
-
Do not modify the linked list.
-
-
-
Example 1:
-
-
-Input: head = [3,2,0,-4], pos = 1
-Output: tail connects to node index 1
-Explanation: There is a cycle in the linked list, where tail connects to the second node.
-
-
-
Example 2:
-
-
-Input: head = [1,2], pos = 0
-Output: tail connects to node index 0
-Explanation: There is a cycle in the linked list, where tail connects to the first node.
-
-
-
Example 3:
-
-
-Input: head = [1], pos = -1
-Output: no cycle
-Explanation: There is no cycle in the linked list.
-
-
-
-
Constraints:
-
-
-
The number of the nodes in the list is in the range [0, 104].
-
-105 <= Node.val <= 105
-
pos is -1 or a valid index in the linked-list.
-
-
-
-
Follow up: Can you solve it using O(1) (i.e. constant) memory?
Given head, the head of a linked list, determine if the linked list has a cycle in it.
-
-
There is a cycle in a linked list if there is some node in the list that can be reached again by continuously following the next pointer. Internally, pos is used to denote the index of the node that tail's next pointer is connected to. Note that pos is not passed as a parameter.
-
-
Return true if there is a cycle in the linked list. Otherwise, return false.
-
-
-
Example 1:
-
-
-Input: head = [3,2,0,-4], pos = 1
-Output: true
-Explanation: There is a cycle in the linked list, where the tail connects to the 1st node (0-indexed).
-
-
-
Example 2:
-
-
-Input: head = [1,2], pos = 0
-Output: true
-Explanation: There is a cycle in the linked list, where the tail connects to the 0th node.
-
-
-
Example 3:
-
-
-Input: head = [1], pos = -1
-Output: false
-Explanation: There is no cycle in the linked list.
-
-
-
-
Constraints:
-
-
-
The number of the nodes in the list is in the range [0, 104].
-
-105 <= Node.val <= 105
-
pos is -1 or a valid index in the linked-list.
-
-
-
-
Follow up: Can you solve it using O(1) (i.e. constant) memory?
-
-### Related Topics
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Linked List](../../tag/linked-list/README.md)]
- [[Two Pointers](../../tag/two-pointers/README.md)]
-
-### Similar Questions
- 1. [Linked List Cycle II](../linked-list-cycle-ii) (Medium)
- 1. [Happy Number](../happy-number) (Easy)
diff --git a/problems/linked-list-cycle/linked_list_cycle.go b/problems/linked-list-cycle/linked_list_cycle.go
deleted file mode 100644
index cdc748858..000000000
--- a/problems/linked-list-cycle/linked_list_cycle.go
+++ /dev/null
@@ -1,24 +0,0 @@
-package problem141
-
-import "github.com/awesee/leetcode/internal/kit"
-
-// ListNode - Definition for singly-linked list.
-type ListNode = kit.ListNode
-
-/**
- * Definition for singly-linked list.
- * type ListNode struct {
- * Val int
- * Next *ListNode
- * }
- */
-func hasCycle(head *ListNode) bool {
- for p1, p2 := head, head; p1 != nil && p2 != nil; p1 = p1.Next {
- if p2 = p2.Next; p2 != nil {
- if p2 = p2.Next; p1 == p2 {
- return true
- }
- }
- }
- return false
-}
diff --git a/problems/linked-list-cycle/linked_list_cycle_test.go b/problems/linked-list-cycle/linked_list_cycle_test.go
deleted file mode 100644
index 7581d1cd5..000000000
--- a/problems/linked-list-cycle/linked_list_cycle_test.go
+++ /dev/null
@@ -1,55 +0,0 @@
-package problem141
-
-import (
- "testing"
-
- "github.com/awesee/leetcode/internal/kit"
-)
-
-type testType struct {
- in []int
- pos int
- want bool
-}
-
-func TestHasCycle(t *testing.T) {
- tests := [...]testType{
- {
- in: []int{3, 2, 0, -4},
- pos: 1,
- want: true,
- },
- {
- in: []int{1, 2},
- pos: 0,
- want: true,
- },
- {
- in: []int{1, 2, 3, 4, 5},
- pos: -1,
- want: false,
- },
- {
- in: []int{1},
- pos: -1,
- want: false,
- },
- }
- for _, tt := range tests {
- in := kit.SliceInt2ListNode(tt.in)
- p, curr := in, in
- for i := 0; curr != nil && tt.pos >= 0; i, curr = i+1, curr.Next {
- if i == tt.pos {
- p = curr
- }
- if curr.Next == nil {
- curr.Next = p
- break
- }
- }
- got := hasCycle(in)
- if got != tt.want {
- t.Fatalf("in: %v, got: %v, want: %v", tt.in, got, tt.want)
- }
- }
-}
diff --git a/problems/linked-list-in-binary-tree/README.md b/problems/linked-list-in-binary-tree/README.md
deleted file mode 100644
index 9b1a71dfe..000000000
--- a/problems/linked-list-in-binary-tree/README.md
+++ /dev/null
@@ -1,68 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../rank-teams-by-votes "Rank Teams by Votes")
-
-[Next >](../minimum-cost-to-make-at-least-one-valid-path-in-a-grid "Minimum Cost to Make at Least One Valid Path in a Grid")
-
-## [1367. Linked List in Binary Tree (Medium)](https://leetcode.com/problems/linked-list-in-binary-tree "二叉树中的列表")
-
-
Given a binary tree root and a linked list with head as the first node.
-
-
Return True if all the elements in the linked list starting from the head correspond to some downward path connected in the binary tree otherwise return False.
-
-
In this context downward path means a path that starts at some node and goes downwards.
-
-
-
Example 1:
-
-
-
-
-Input: head = [4,2,8], root = [1,4,4,null,2,2,null,1,null,6,8,null,null,null,null,1,3]
-Output: true
-Explanation: Nodes in blue form a subpath in the binary Tree.
-
-
-
Example 2:
-
-
-
-
-Input: head = [1,4,2,6], root = [1,4,4,null,2,2,null,1,null,6,8,null,null,null,null,1,3]
-Output: true
-
-
-
Example 3:
-
-
-Input: head = [1,4,2,6,8], root = [1,4,4,null,2,2,null,1,null,6,8,null,null,null,null,1,3]
-Output: false
-Explanation: There is no path in the binary tree that contains all the elements of the linked list from head.
-
-
-
-
Constraints:
-
-
-
The number of nodes in the tree will be in the range [1, 2500].
-
The number of nodes in the list will be in the range [1, 100].
-
1 <= Node.val <= 100 for each node in the linked list and binary tree.
-
-
-### Related Topics
- [[Linked List](../../tag/linked-list/README.md)]
- [[Tree](../../tag/tree/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Binary Tree](../../tag/binary-tree/README.md)]
-
-### Hints
-
-Hint 1
-Create recursive function, given a pointer in a Linked List and any node in the Binary Tree. Check if all the elements in the linked list starting from the head correspond to some downward path in the binary tree.
-
diff --git a/problems/linked-list-random-node/README.md b/problems/linked-list-random-node/README.md
deleted file mode 100644
index d977549d8..000000000
--- a/problems/linked-list-random-node/README.md
+++ /dev/null
@@ -1,67 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../insert-delete-getrandom-o1-duplicates-allowed "Insert Delete GetRandom O(1) - Duplicates allowed")
-
-[Next >](../ransom-note "Ransom Note")
-
-## [382. Linked List Random Node (Medium)](https://leetcode.com/problems/linked-list-random-node "链表随机节点")
-
-
Given a singly linked list, return a random node's value from the linked list. Each node must have the same probability of being chosen.
-
-
Implement the Solution class:
-
-
-
Solution(ListNode head) Initializes the object with the integer array nums.
-
int getRandom() Chooses a node randomly from the list and returns its value. All the nodes of the list should be equally likely to be choosen.
-
-
-
-
Example 1:
-
-
-Input
-["Solution", "getRandom", "getRandom", "getRandom", "getRandom", "getRandom"]
-[[[1, 2, 3]], [], [], [], [], []]
-Output
-[null, 1, 3, 2, 2, 3]
-
-Explanation
-Solution solution = new Solution([1, 2, 3]);
-solution.getRandom(); // return 1
-solution.getRandom(); // return 3
-solution.getRandom(); // return 2
-solution.getRandom(); // return 2
-solution.getRandom(); // return 3
-// getRandom() should return either 1, 2, or 3 randomly. Each element should have equal probability of returning.
-
-
-
-
Constraints:
-
-
-
The number of nodes in the linked list will be in the range [1, 104].
-
-104 <= Node.val <= 104
-
At most 104 calls will be made to getRandom.
-
-
-
-
Follow up:
-
-
-
What if the linked list is extremely large and its length is unknown to you?
-
Could you solve this efficiently without using extra space?
-
-
-### Related Topics
- [[Reservoir Sampling](../../tag/reservoir-sampling/README.md)]
- [[Linked List](../../tag/linked-list/README.md)]
- [[Math](../../tag/math/README.md)]
- [[Randomized](../../tag/randomized/README.md)]
-
-### Similar Questions
- 1. [Random Pick Index](../random-pick-index) (Medium)
diff --git a/problems/linked-list-random-node/linked_list_random_node.go b/problems/linked-list-random-node/linked_list_random_node.go
deleted file mode 100644
index ad717ba7a..000000000
--- a/problems/linked-list-random-node/linked_list_random_node.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem382
diff --git a/problems/linked-list-random-node/linked_list_random_node_test.go b/problems/linked-list-random-node/linked_list_random_node_test.go
deleted file mode 100644
index ad717ba7a..000000000
--- a/problems/linked-list-random-node/linked_list_random_node_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem382
diff --git a/problems/list-the-products-ordered-in-a-period/README.md b/problems/list-the-products-ordered-in-a-period/README.md
deleted file mode 100644
index d05f83a48..000000000
--- a/problems/list-the-products-ordered-in-a-period/README.md
+++ /dev/null
@@ -1,93 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-number-of-taps-to-open-to-water-a-garden "Minimum Number of Taps to Open to Water a Garden")
-
-[Next >](../break-a-palindrome "Break a Palindrome")
-
-## [1327. List the Products Ordered in a Period (Easy)](https://leetcode.com/problems/list-the-products-ordered-in-a-period "列出指定时间段内所有的下单产品")
-
-SQL Schema
-
Table: Products
-
-+------------------+---------+
-| Column Name | Type |
-+------------------+---------+
-| product_id | int |
-| product_name | varchar |
-| product_category | varchar |
-+------------------+---------+
-product_id is the primary key for this table.
-This table contains data about the company's products.
-
-
-
Table: Orders
-
-+---------------+---------+
-| Column Name | Type |
-+---------------+---------+
-| product_id | int |
-| order_date | date |
-| unit | int |
-+---------------+---------+
-There is no primary key for this table. It may have duplicate rows.
-product_id is a foreign key to Products table.
-unit is the number of products ordered in order_date.
-
-
-Write an SQL query to get the names of products with greater than or equal to 100 units ordered in February 2020 and their amount.
-
-Return result table in any order.
-
-The query result format is in the following example:
-
-Products table:
-+-------------+-----------------------+------------------+
-| product_id | product_name | product_category |
-+-------------+-----------------------+------------------+
-| 1 | Leetcode Solutions | Book |
-| 2 | Jewels of Stringology | Book |
-| 3 | HP | Laptop |
-| 4 | Lenovo | Laptop |
-| 5 | Leetcode Kit | T-shirt |
-+-------------+-----------------------+------------------+
-
-Orders table:
-+--------------+--------------+----------+
-| product_id | order_date | unit |
-+--------------+--------------+----------+
-| 1 | 2020-02-05 | 60 |
-| 1 | 2020-02-10 | 70 |
-| 2 | 2020-01-18 | 30 |
-| 2 | 2020-02-11 | 80 |
-| 3 | 2020-02-17 | 2 |
-| 3 | 2020-02-24 | 3 |
-| 4 | 2020-03-01 | 20 |
-| 4 | 2020-03-04 | 30 |
-| 4 | 2020-03-04 | 60 |
-| 5 | 2020-02-25 | 50 |
-| 5 | 2020-02-27 | 50 |
-| 5 | 2020-03-01 | 50 |
-+--------------+--------------+----------+
-
-Result table:
-+--------------------+---------+
-| product_name | unit |
-+--------------------+---------+
-| Leetcode Solutions | 130 |
-| Leetcode Kit | 100 |
-+--------------------+---------+
-
-Products with product_id = 1 is ordered in February a total of (60 + 70) = 130.
-Products with product_id = 2 is ordered in February a total of 80.
-Products with product_id = 3 is ordered in February a total of (2 + 3) = 5.
-Products with product_id = 4 was not ordered in February 2020.
-Products with product_id = 5 is ordered in February a total of (50 + 50) = 100.
-
Design a logger system that receive stream of messages along with its timestamps, each message should be printed if and only if it is not printed in the last 10 seconds.
-
-
Given a message and a timestamp (in seconds granularity), return true if the message should be printed in the given timestamp, otherwise returns false.
-
-
It is possible that several messages arrive roughly at the same time.
-
-### Related Topics
- [[Design](../../tag/design/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
-
-### Similar Questions
- 1. [Design Hit Counter](../design-hit-counter) (Medium)
diff --git a/problems/logger-rate-limiter/logger_rate_limiter.go b/problems/logger-rate-limiter/logger_rate_limiter.go
deleted file mode 100644
index e670b8717..000000000
--- a/problems/logger-rate-limiter/logger_rate_limiter.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem359
diff --git a/problems/logger-rate-limiter/logger_rate_limiter_test.go b/problems/logger-rate-limiter/logger_rate_limiter_test.go
deleted file mode 100644
index e670b8717..000000000
--- a/problems/logger-rate-limiter/logger_rate_limiter_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem359
diff --git a/problems/logical-or-of-two-binary-grids-represented-as-quad-trees/README.md b/problems/logical-or-of-two-binary-grids-represented-as-quad-trees/README.md
deleted file mode 100644
index 2cae6fc92..000000000
--- a/problems/logical-or-of-two-binary-grids-represented-as-quad-trees/README.md
+++ /dev/null
@@ -1,114 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../reverse-words-in-a-string-iii "Reverse Words in a String III")
-
-[Next >](../maximum-depth-of-n-ary-tree "Maximum Depth of N-ary Tree")
-
-## [558. Logical OR of Two Binary Grids Represented as Quad-Trees (Medium)](https://leetcode.com/problems/logical-or-of-two-binary-grids-represented-as-quad-trees "四叉树交集")
-
-
A Binary Matrix is a matrix in which all the elements are either 0 or 1.
-
-
Given quadTree1 and quadTree2. quadTree1 represents a n * n binary matrix and quadTree2 represents another n * n binary matrix.
-
-
Return a Quad-Tree representing the n * n binary matrix which is the result of logical bitwise OR of the two binary matrixes represented by quadTree1 and quadTree2.
-
-
Notice that you can assign the value of a node to True or False when isLeaf is False, and both are accepted in the answer.
-
-
A Quad-Tree is a tree data structure in which each internal node has exactly four children. Besides, each node has two attributes:
-
-
-
val: True if the node represents a grid of 1's or False if the node represents a grid of 0's.
-
isLeaf: True if the node is leaf node on the tree or False if the node has the four children.
-
-
-
-class Node {
- public boolean val;
- public boolean isLeaf;
- public Node topLeft;
- public Node topRight;
- public Node bottomLeft;
- public Node bottomRight;
-}
-
-
We can construct a Quad-Tree from a two-dimensional area using the following steps:
-
-
-
If the current grid has the same value (i.e all 1's or all 0's) set isLeaf True and set val to the value of the grid and set the four children to Null and stop.
-
If the current grid has different values, set isLeaf to False and set val to any value and divide the current grid into four sub-grids as shown in the photo.
-
Recurse for each of the children with the proper sub-grid.
-
-
-
If you want to know more about the Quad-Tree, you can refer to the wiki.
-
-
Quad-Tree format:
-
-
The input/output represents the serialized format of a Quad-Tree using level order traversal, where null signifies a path terminator where no node exists below.
-
-
It is very similar to the serialization of the binary tree. The only difference is that the node is represented as a list [isLeaf, val].
-
-
If the value of isLeaf or val is True we represent it as 1 in the list [isLeaf, val] and if the value of isLeaf or val is False we represent it as 0.
-
-
-
Example 1:
-
-
-Input: quadTree1 = [[0,1],[1,1],[1,1],[1,0],[1,0]]
-, quadTree2 = [[0,1],[1,1],[0,1],[1,1],[1,0],null,null,null,null,[1,0],[1,0],[1,1],[1,1]]
-Output: [[0,0],[1,1],[1,1],[1,1],[1,0]]
-Explanation: quadTree1 and quadTree2 are shown above. You can see the binary matrix which is represented by each Quad-Tree.
-If we apply logical bitwise OR on the two binary matrices we get the binary matrix below which is represented by the result Quad-Tree.
-Notice that the binary matrices shown are only for illustration, you don't have to construct the binary matrix to get the result tree.
-
-
-
-
Example 2:
-
-
-Input: quadTree1 = [[1,0]]
-, quadTree2 = [[1,0]]
-Output: [[1,0]]
-Explanation: Each tree represents a binary matrix of size 1*1. Each matrix contains only zero.
-The resulting matrix is of size 1*1 with also zero.
-
Given a picture consisting of black and white pixels, and a positive integer N, find the number of black pixels located at some specific row R and column C that align with all the following rules:
-
-
-
Row R and column C both contain exactly N black pixels.
-
For all rows that have a black pixel at column C, they should be exactly the same as row R
-
-
-
The picture is represented by a 2D char array consisting of 'B' and 'W', which means black and white pixels respectively.
-
-
Example:
-
-Input:
-[['W', 'B', 'W', 'B', 'B', 'W'],
- ['W', 'B', 'W', 'B', 'B', 'W'],
- ['W', 'B', 'W', 'B', 'B', 'W'],
- ['W', 'W', 'B', 'W', 'B', 'W']]
-
-N = 3
-Output: 6
-Explanation: All the bold 'B' are the black pixels we need (all 'B's at column 1 and 3).
- 0 1 2 3 4 5 column index
-0 [['W', 'B', 'W', 'B', 'B', 'W'],
-1 ['W', 'B', 'W', 'B', 'B', 'W'],
-2 ['W', 'B', 'W', 'B', 'B', 'W'],
-3 ['W', 'W', 'B', 'W', 'B', 'W']]
-row index
-
-Take 'B' at row R = 0 and column C = 1 as an example:
-Rule 1, row R = 0 and column C = 1 both have exactly N = 3 black pixels.
-Rule 2, the rows have black pixel at column C = 1 are row 0, row 1 and row 2. They are exactly the same as row R = 0.
-
-
-
-
-
Note:
-
-
The range of width and height of the input 2D array is [1,200].
Your friend is typing his name into a keyboard. Sometimes, when typing a character c, the key might get long pressed, and the character will be typed 1 or more times.
-
-
You examine the typed characters of the keyboard. Return True if it is possible that it was your friends name, with some characters (possibly none) being long pressed.
-
-
-
Example 1:
-
-
-Input: name = "alex", typed = "aaleex"
-Output: true
-Explanation: 'a' and 'e' in 'alex' were long pressed.
-
-
-
Example 2:
-
-
-Input: name = "saeed", typed = "ssaaedd"
-Output: false
-Explanation: 'e' must have been pressed twice, but it wasn't in the typed output.
-
-
-
Example 3:
-
-
-Input: name = "leelee", typed = "lleeelee"
-Output: true
-
-
-
Example 4:
-
-
-Input: name = "laiden", typed = "laiden"
-Output: true
-Explanation: It's not necessary to long press any character.
-
-
-
-
Constraints:
-
-
-
1 <= name.length <= 1000
-
1 <= typed.length <= 1000
-
name and typed contain only lowercase English letters.
Given a binary string s, return true if the longest contiguous segment of 1's is strictly longer than the longest contiguous segment of 0's in s, or return false otherwise.
-
-
-
For example, in s = "110100010" the longest continuous segment of 1s has length 2, and the longest continuous segment of 0s has length 3.
-
-
-
Note that if there are no 0's, then the longest continuous segment of 0's is considered to have a length 0. The same applies if there is no 1's.
-
-
-
Example 1:
-
-
-Input: s = "1101"
-Output: true
-Explanation:
-The longest contiguous segment of 1s has length 2: "1101"
-The longest contiguous segment of 0s has length 1: "1101"
-The segment of 1s is longer, so return true.
-
-
-
Example 2:
-
-
-Input: s = "111000"
-Output: false
-Explanation:
-The longest contiguous segment of 1s has length 3: "111000"
-The longest contiguous segment of 0s has length 3: "111000"
-The segment of 1s is not longer, so return false.
-
-
-
Example 3:
-
-
-Input: s = "110100010"
-Output: false
-Explanation:
-The longest contiguous segment of 1s has length 2: "110100010"
-The longest contiguous segment of 0s has length 3: "110100010"
-The segment of 1s is not longer, so return false.
-
-
-
-
Constraints:
-
-
-
1 <= s.length <= 100
-
s[i] is either '0' or '1'.
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
-
-### Similar Questions
- 1. [Max Consecutive Ones](../max-consecutive-ones) (Easy)
- 1. [Count Subarrays With More Ones Than Zeros](../count-subarrays-with-more-ones-than-zeros) (Medium)
- 1. [Check if Binary String Has at Most One Segment of Ones](../check-if-binary-string-has-at-most-one-segment-of-ones) (Easy)
-
-### Hints
-
-Hint 1
-Check every possible segment of 0s and 1s.
-
-
-
-Hint 2
-Is there a way to iterate through the string to keep track of the current character and its count?
-
diff --git a/problems/longest-absolute-file-path/README.md b/problems/longest-absolute-file-path/README.md
deleted file mode 100644
index 12ed18bb9..000000000
--- a/problems/longest-absolute-file-path/README.md
+++ /dev/null
@@ -1,86 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../first-unique-character-in-a-string "First Unique Character in a String")
-
-[Next >](../find-the-difference "Find the Difference")
-
-## [388. Longest Absolute File Path (Medium)](https://leetcode.com/problems/longest-absolute-file-path "文件的最长绝对路径")
-
-
Suppose we have a file system that stores both files and directories. An example of one system is represented in the following picture:
-
-
-
-
Here, we have dir as the only directory in the root. dir contains two subdirectories, subdir1 and subdir2. subdir1 contains a file file1.ext and subdirectory subsubdir1. subdir2 contains a subdirectory subsubdir2, which contains a file file2.ext.
-
-
In text form, it looks like this (with ⟶ representing the tab character):
If we were to write this representation in code, it will look like this: "dir\n\tsubdir1\n\t\tfile1.ext\n\t\tsubsubdir1\n\tsubdir2\n\t\tsubsubdir2\n\t\t\tfile2.ext". Note that the '\n' and '\t' are the new-line and tab characters.
-
-
Every file and directory has a unique absolute path in the file system, which is the order of directories that must be opened to reach the file/directory itself, all concatenated by '/'s. Using the above example, the absolute path to file2.ext is "dir/subdir2/subsubdir2/file2.ext". Each directory name consists of letters, digits, and/or spaces. Each file name is of the form name.extension, where name and extension consist of letters, digits, and/or spaces.
-
-
Given a string input representing the file system in the explained format, return the length of the longest absolute path to a file in the abstracted file system. If there is no file in the system, return 0.
-
-
-
Example 1:
-
-
-Input: input = "dir\n\tsubdir1\n\tsubdir2\n\t\tfile.ext"
-Output: 20
-Explanation: We have only one file, and the absolute path is "dir/subdir2/file.ext" of length 20.
-
-
-
Example 2:
-
-
-Input: input = "dir\n\tsubdir1\n\t\tfile1.ext\n\t\tsubsubdir1\n\tsubdir2\n\t\tsubsubdir2\n\t\t\tfile2.ext"
-Output: 32
-Explanation: We have two files:
-"dir/subdir1/file1.ext" of length 21
-"dir/subdir2/subsubdir2/file2.ext" of length 32.
-We return 32 since it is the longest absolute path to a file.
-
-
-
Example 3:
-
-
-Input: input = "a"
-Output: 0
-Explanation: We do not have any files, just a single directory named "a".
-
-
-
Example 4:
-
-
-Input: input = "file1.txt\nfile2.txt\nlongfile.txt"
-Output: 12
-Explanation: There are 3 files at the root directory.
-Since the absolute path for anything at the root directory is just the name itself, the answer is "longfile.txt" with length 12.
-
-
-
-
Constraints:
-
-
-
1 <= input.length <= 104
-
input may contain lowercase or uppercase English letters, a new line character '\n', a tab character '\t', a dot '.', a space ' ', and digits.
Given an array A of integers, return the length of the longest arithmetic subsequence in A.
-
-
Recall that a subsequence of A is a list A[i_1], A[i_2], ..., A[i_k] with 0 <= i_1 < i_2 < ... < i_k <= A.length - 1, and that a sequence B is arithmetic if B[i+1] - B[i] are all the same value (for 0 <= i < B.length - 1).
-
-
-
-
Example 1:
-
-
-Input: [3,6,9,12]
-Output: 4
-Explanation:
-The whole array is an arithmetic sequence with steps of length = 3.
-
-
-### Related Topics
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
diff --git a/problems/longest-arithmetic-sequence/longest_arithmetic_sequence.go b/problems/longest-arithmetic-sequence/longest_arithmetic_sequence.go
deleted file mode 100644
index 36fde551a..000000000
--- a/problems/longest-arithmetic-sequence/longest_arithmetic_sequence.go
+++ /dev/null
@@ -1,41 +0,0 @@
-package problem1027
-
-func longestArithSeqLength(A []int) int {
- n := len(A)
-
- indexes := [10001][]int{}
- for i := 0; i < n; i++ {
- indexes[A[i]] = append(indexes[A[i]], i)
- }
-
- var dfs func(int, int) int
- dfs = func(j, diff int) int {
- next := A[j] + diff
- if next < 0 || 10000 < next {
- return 0
- }
- for _, k := range indexes[next] {
- if j < k {
- return 1 + dfs(k, diff)
- }
- }
- return 0
- }
-
- res := 0
- for i := 0; i < n; i++ {
- for j := i + 1; j < n; j++ {
- diff := A[j] - A[i]
- res = max(res, 2+dfs(j, diff))
- }
- }
-
- return res
-}
-
-func max(a, b int) int {
- if a > b {
- return a
- }
- return b
-}
diff --git a/problems/longest-arithmetic-subsequence-of-given-difference/README.md b/problems/longest-arithmetic-subsequence-of-given-difference/README.md
deleted file mode 100644
index dc350155e..000000000
--- a/problems/longest-arithmetic-subsequence-of-given-difference/README.md
+++ /dev/null
@@ -1,69 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-cost-to-move-chips-to-the-same-position "Minimum Cost to Move Chips to The Same Position")
-
-[Next >](../path-with-maximum-gold "Path with Maximum Gold")
-
-## [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 subsequence in arr which is an arithmetic sequence such that the difference between adjacent elements in the subsequence equals difference.
-
-
A subsequence is a sequence that can be derived from arr by deleting some or no elements without changing the order of the remaining elements.
-
-
-
Example 1:
-
-
-Input: arr = [1,2,3,4], difference = 1
-Output: 4
-Explanation: The longest arithmetic subsequence is [1,2,3,4].
-
-
Example 2:
-
-
-Input: arr = [1,3,5,7], difference = 1
-Output: 1
-Explanation: The longest arithmetic subsequence is any single element.
-
-
-
Example 3:
-
-
-Input: arr = [1,5,7,8,5,3,4,2,1], difference = -2
-Output: 4
-Explanation: The longest arithmetic subsequence is [7,5,3,1].
-
-
-
-
Constraints:
-
-
-
1 <= arr.length <= 105
-
-104 <= arr[i], difference <= 104
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Dynamic Programming](../../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-arithmetic-subsequence/README.md b/problems/longest-arithmetic-subsequence/README.md
deleted file mode 100644
index 33b7de800..000000000
--- a/problems/longest-arithmetic-subsequence/README.md
+++ /dev/null
@@ -1,58 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-difference-between-node-and-ancestor "Maximum Difference Between Node and Ancestor")
-
-[Next >](../recover-a-tree-from-preorder-traversal "Recover a Tree From Preorder Traversal")
-
-## [1027. Longest Arithmetic Subsequence (Medium)](https://leetcode.com/problems/longest-arithmetic-subsequence "最长等差数列")
-
-
Given an array nums of integers, return the length of the longest arithmetic subsequence in nums.
-
-
Recall that a subsequence of an array nums is a list nums[i1], nums[i2], ..., nums[ik] with 0 <= i1 < i2 < ... < ik <= nums.length - 1, and that a sequence seq is arithmetic if seq[i+1] - seq[i] are all the same value (for 0 <= i < seq.length - 1).
-
-
-
Example 1:
-
-
-Input: nums = [3,6,9,12]
-Output: 4
-Explanation:
-The whole array is an arithmetic sequence with steps of length = 3.
-
You are given a string text. You should split it to k substrings (subtext1, subtext2, ..., subtextk) such that:
-
-
-
subtexti is a non-empty string.
-
The concatenation of all the substrings is equal to text (i.e., subtext1 + subtext2 + ... + subtextk == text).
-
subtexti == subtextk - i + 1 for all valid values of i (i.e., 1 <= i <= k).
-
-
-
Return the largest possible value of k.
-
-
-
Example 1:
-
-
-Input: text = "ghiabcdefhelloadamhelloabcdefghi"
-Output: 7
-Explanation: We can split the string on "(ghi)(abcdef)(hello)(adam)(hello)(abcdef)(ghi)".
-
-
-
Example 2:
-
-
-Input: text = "merchant"
-Output: 1
-Explanation: We can split the string on "(merchant)".
-
-
-
Example 3:
-
-
-Input: text = "antaprezatepzapreanta"
-Output: 11
-Explanation: We can split the string on "(a)(nt)(a)(pre)(za)(tpe)(za)(pre)(a)(nt)(a)".
-
-
-
-
Constraints:
-
-
-
1 <= text.length <= 1000
-
text consists only of lowercase English characters.
-
-
-### Related Topics
- [[Two Pointers](../../tag/two-pointers/README.md)]
- [[String](../../tag/string/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Greedy](../../tag/greedy/README.md)]
- [[Rolling Hash](../../tag/rolling-hash/README.md)]
- [[Hash Function](../../tag/hash-function/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-prefix/README.md b/problems/longest-common-prefix/README.md
deleted file mode 100644
index 9663521b4..000000000
--- a/problems/longest-common-prefix/README.md
+++ /dev/null
@@ -1,44 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../roman-to-integer "Roman to Integer")
-
-[Next >](../3sum "3Sum")
-
-## [14. Longest Common Prefix (Easy)](https://leetcode.com/problems/longest-common-prefix "最长公共前缀")
-
-
Write a function to find the longest common prefix string amongst an array of strings.
-
-
If there is no common prefix, return an empty string "".
There is a country of n cities numbered from 0 to n - 1. In this country, there is a road connecting every pair of cities.
-
-
There are m friends numbered from 0 to m - 1 who are traveling through the country. Each one of them will take a path consisting of some cities. Each path is represented by an integer array that contains the visited cities in order. The path may contain a city more than once, but the same city will not be listed consecutively.
-
-
Given an integer n and a 2D integer array paths where paths[i] is an integer array representing the path of the ith friend, return the length of the longest common subpath that is shared by every friend's path, or 0 if there is no common subpath at all.
-
-
A subpath of a path is a contiguous sequence of cities within that path.
-
-
-
Example 1:
-
-
-Input: n = 5, paths = [[0,1,2,3,4],
- [2,3,4],
- [4,0,1,2,3]]
-Output: 2
-Explanation: The longest common subpath is [2,3].
-
-
-
Example 2:
-
-
-Input: n = 3, paths = [[0],[1],[2]]
-Output: 0
-Explanation: There is no common subpath shared by the three paths.
-
-
-
Example 3:
-
-
-Input: n = 5, paths = [[0,1,2,3,4],
- [4,3,2,1,0]]
-Output: 1
-Explanation: The possible longest common subpaths are [0], [1], [2], [3], and [4]. All have a length of 1.
-
-
-
Constraints:
-
-
-
1 <= n <= 105
-
m == paths.length
-
2 <= m <= 105
-
sum(paths[i].length) <= 105
-
0 <= paths[i][j] < n
-
The same city is not listed multiple times consecutively in paths[i].
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
- [[Suffix Array](../../tag/suffix-array/README.md)]
- [[Hash Function](../../tag/hash-function/README.md)]
- [[Rolling Hash](../../tag/rolling-hash/README.md)]
-
-### Hints
-
-Hint 1
-If there is a common path with length x, there is for sure a common path of length y where y < x.
-
-
-
-Hint 2
-We can use binary search over the answer with the range [0, min(path[i].length)].
-
-
-
-Hint 3
-Using binary search, we want to verify if we have a common path of length m. We can achieve this using hashing.
-
diff --git a/problems/longest-common-subsequence-between-sorted-arrays/README.md b/problems/longest-common-subsequence-between-sorted-arrays/README.md
deleted file mode 100644
index 1477353b8..000000000
--- a/problems/longest-common-subsequence-between-sorted-arrays/README.md
+++ /dev/null
@@ -1,38 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../users-that-actively-request-confirmation-messages "Users That Actively Request Confirmation Messages")
-
-[Next >](../check-if-all-characters-have-equal-number-of-occurrences "Check if All Characters Have Equal Number of Occurrences")
-
-## [1940. Longest Common Subsequence Between Sorted Arrays (Medium)](https://leetcode.com/problems/longest-common-subsequence-between-sorted-arrays "排序数组之间的最长公共子序列")
-
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Counting](../../tag/counting/README.md)]
-
-### Similar Questions
- 1. [Merge Two Sorted Lists](../merge-two-sorted-lists) (Easy)
-
-### Hints
-
-Hint 1
-Fix one array.
-
-
-
-Hint 2
-Choose the next array and get the common elements.
-
-
-
-Hint 3
-Use the common elements as the new fixed array and keep merging with the rest of the arrays.
-
diff --git a/problems/longest-common-subsequence/README.md b/problems/longest-common-subsequence/README.md
deleted file mode 100644
index 25057631a..000000000
--- a/problems/longest-common-subsequence/README.md
+++ /dev/null
@@ -1,72 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../user-activity-for-the-past-30-days-ii "User Activity for the Past 30 Days II")
-
-[Next >](../decrease-elements-to-make-array-zigzag "Decrease Elements To Make Array Zigzag")
-
-## [1143. Longest Common Subsequence (Medium)](https://leetcode.com/problems/longest-common-subsequence "最长公共子序列")
-
-
Given two strings text1 and text2, return the length of their longest common subsequence. If there is no common subsequence, return 0.
-
-
A subsequence of a string is a new string generated from the original string with some characters (can be none) deleted without changing the relative order of the remaining characters.
-
-
-
For example, "ace" is a subsequence of "abcde".
-
-
-
A common subsequence of two strings is a subsequence that is common to both strings.
-
-
-
Example 1:
-
-
-Input: text1 = "abcde", text2 = "ace"
-Output: 3
-Explanation: The longest common subsequence is "ace" and its length is 3.
-
-
-
Example 2:
-
-
-Input: text1 = "abc", text2 = "abc"
-Output: 3
-Explanation: The longest common subsequence is "abc" and its length is 3.
-
-
-
Example 3:
-
-
-Input: text1 = "abc", text2 = "def"
-Output: 0
-Explanation: There is no such common subsequence, so the result is 0.
-
-
-
-
Constraints:
-
-
-
1 <= text1.length, text2.length <= 1000
-
text1 and text2 consist of only lowercase English characters.
Given an unsorted array of integers nums, return the length of the longest continuous increasing subsequence (i.e. subarray). The subsequence must be strictly increasing.
-
-
A continuous increasing subsequence is defined by two indices l and r (l < r) such that it is [nums[l], nums[l + 1], ..., nums[r - 1], nums[r]] and for each l <= i < r, nums[i] < nums[i + 1].
-
-
-
Example 1:
-
-
-Input: nums = [1,3,5,4,7]
-Output: 3
-Explanation: The longest continuous increasing subsequence is [1,3,5] with length 3.
-Even though [1,3,5,7] is an increasing subsequence, it is not continuous as elements 5 and 7 are separated by element
-4.
-
-
-
Example 2:
-
-
-Input: nums = [2,2,2,2,2]
-Output: 1
-Explanation: The longest continuous increasing subsequence is [2] with length 1. Note that it must be strictly
-increasing.
-
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 104
-
-109 <= nums[i] <= 109
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
-
-### Similar Questions
- 1. [Number of Longest Increasing Subsequence](../number-of-longest-increasing-subsequence) (Medium)
- 1. [Minimum Window Subsequence](../minimum-window-subsequence) (Hard)
diff --git a/problems/longest-continuous-increasing-subsequence/longest_continuous_increasing_subsequence.go b/problems/longest-continuous-increasing-subsequence/longest_continuous_increasing_subsequence.go
deleted file mode 100644
index edecffe10..000000000
--- a/problems/longest-continuous-increasing-subsequence/longest_continuous_increasing_subsequence.go
+++ /dev/null
@@ -1,16 +0,0 @@
-package problem674
-
-func findLengthOfLCIS(nums []int) int {
- max, cur := 0, 1
- for i, v := range nums {
- if i >= 1 && v > nums[i-1] {
- cur++
- } else {
- cur = 1
- }
- if cur > max {
- max = cur
- }
- }
- return max
-}
diff --git a/problems/longest-continuous-increasing-subsequence/longest_continuous_increasing_subsequence_test.go b/problems/longest-continuous-increasing-subsequence/longest_continuous_increasing_subsequence_test.go
deleted file mode 100644
index fb0f01746..000000000
--- a/problems/longest-continuous-increasing-subsequence/longest_continuous_increasing_subsequence_test.go
+++ /dev/null
@@ -1,35 +0,0 @@
-package problem674
-
-import "testing"
-
-type testType struct {
- in []int
- want int
-}
-
-func TestFindLengthOfLCIS(t *testing.T) {
- tests := [...]testType{
- {
- in: []int{1, 3, 5, 4, 7},
- want: 3,
- },
- {
- in: []int{2, 2, 2, 2, 2},
- want: 1,
- },
- {
- in: []int{},
- want: 0,
- },
- {
- in: []int{1, 3, 5, 7},
- want: 4,
- },
- }
- for _, tt := range tests {
- got := findLengthOfLCIS(tt.in)
- if got != tt.want {
- t.Fatalf("in: %v, got: %v, want: %v", tt.in, got, tt.want)
- }
- }
-}
diff --git a/problems/longest-continuous-subarray-with-absolute-diff-less-than-or-equal-to-limit/README.md b/problems/longest-continuous-subarray-with-absolute-diff-less-than-or-equal-to-limit/README.md
deleted file mode 100644
index ae7344147..000000000
--- a/problems/longest-continuous-subarray-with-absolute-diff-less-than-or-equal-to-limit/README.md
+++ /dev/null
@@ -1,77 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../check-if-all-1s-are-at-least-length-k-places-away "Check If All 1's Are at Least Length K Places Away")
-
-[Next >](../find-the-kth-smallest-sum-of-a-matrix-with-sorted-rows "Find the Kth Smallest Sum of a Matrix With Sorted Rows")
-
-## [1438. Longest Continuous Subarray With Absolute Diff Less Than or Equal to Limit (Medium)](https://leetcode.com/problems/longest-continuous-subarray-with-absolute-diff-less-than-or-equal-to-limit "绝对差不超过限制的最长连续子数组")
-
-
Given an array of integers nums and an integer limit, return the size of the longest non-empty subarray such that the absolute difference between any two elements of this subarray is less than or equal to limit.
-
-
-
Example 1:
-
-
-Input: nums = [8,2,4,7], limit = 4
-Output: 2
-Explanation: All subarrays are:
-[8] with maximum absolute diff |8-8| = 0 <= 4.
-[8,2] with maximum absolute diff |8-2| = 6 > 4.
-[8,2,4] with maximum absolute diff |8-2| = 6 > 4.
-[8,2,4,7] with maximum absolute diff |8-2| = 6 > 4.
-[2] with maximum absolute diff |2-2| = 0 <= 4.
-[2,4] with maximum absolute diff |2-4| = 2 <= 4.
-[2,4,7] with maximum absolute diff |2-7| = 5 > 4.
-[4] with maximum absolute diff |4-4| = 0 <= 4.
-[4,7] with maximum absolute diff |4-7| = 3 <= 4.
-[7] with maximum absolute diff |7-7| = 0 <= 4.
-Therefore, the size of the longest subarray is 2.
-
-
-
Example 2:
-
-
-Input: nums = [10,1,2,4,7,2], limit = 5
-Output: 4
-Explanation: The subarray [2,4,7,2] is the longest since the maximum absolute diff is |2-7| = 5 <= 5.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Queue](../../tag/queue/README.md)]
- [[Sliding Window](../../tag/sliding-window/README.md)]
- [[Heap (Priority Queue)](../../tag/heap-priority-queue/README.md)]
- [[Ordered Set](../../tag/ordered-set/README.md)]
- [[Monotonic Queue](../../tag/monotonic-queue/README.md)]
-
-### Hints
-
-Hint 1
-Use a sliding window approach keeping the maximum and minimum value using a data structure like a multiset from STL in C++.
-
-
-
-Hint 2
-More specifically, use the two pointer technique, moving the right pointer as far as possible to the right until the subarray is not valid (maxValue - minValue > limit), then moving the left pointer until the subarray is valid again (maxValue - minValue <= limit). Keep repeating this process.
-
diff --git a/problems/longest-duplicate-substring/README.md b/problems/longest-duplicate-substring/README.md
deleted file mode 100644
index e3a41f9d7..000000000
--- a/problems/longest-duplicate-substring/README.md
+++ /dev/null
@@ -1,51 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../partition-array-for-maximum-sum "Partition Array for Maximum Sum")
-
-[Next >](../customers-who-bought-all-products "Customers Who Bought All Products")
-
-## [1044. Longest Duplicate Substring (Hard)](https://leetcode.com/problems/longest-duplicate-substring "最长重复子串")
-
-
Given a string s, consider all duplicated substrings: (contiguous) substrings of s that occur 2 or more times. The occurrences may overlap.
-
-
Return any duplicated substring that has the longest possible length. If s does not have a duplicated substring, the answer is "".
-
-
-
Example 1:
-
Input: s = "banana"
-Output: "ana"
-
Example 2:
-
Input: s = "abcd"
-Output: ""
-
-
-
Constraints:
-
-
-
2 <= s.length <= 3 * 104
-
s consists of lowercase English letters.
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
- [[Sliding Window](../../tag/sliding-window/README.md)]
- [[Rolling Hash](../../tag/rolling-hash/README.md)]
- [[Suffix Array](../../tag/suffix-array/README.md)]
- [[Hash Function](../../tag/hash-function/README.md)]
-
-### Hints
-
-Hint 1
-Binary search for the length of the answer. (If there's an answer of length 10, then there are answers of length 9, 8, 7, ...)
-
-
-
-Hint 2
-To check whether an answer of length K exists, we can use Rabin-Karp 's algorithm.
-
diff --git a/problems/longest-duplicate-substring/longest_duplicate_substring.go b/problems/longest-duplicate-substring/longest_duplicate_substring.go
deleted file mode 100644
index c35d6f111..000000000
--- a/problems/longest-duplicate-substring/longest_duplicate_substring.go
+++ /dev/null
@@ -1,30 +0,0 @@
-package problem1044
-
-func longestDupSubstring(S string) string {
- res := ""
-
- isExist := func(L int) bool {
- seen := make(map[string]bool, len(S)-L+2)
- for i := 0; i+L <= len(S); i++ {
- sub := S[i : i+L]
- if seen[sub] {
- res = sub
- return true
- }
- seen[sub] = true
- }
- return false
- }
-
- lo, hi := 0, len(S)
- for lo < hi {
- mi := (lo + hi + 1) / 2
- if isExist(mi) {
- lo = mi
- } else {
- hi = mi - 1
- }
- }
-
- return res
-}
diff --git a/problems/longest-happy-prefix/README.md b/problems/longest-happy-prefix/README.md
deleted file mode 100644
index 7fa67f4df..000000000
--- a/problems/longest-happy-prefix/README.md
+++ /dev/null
@@ -1,53 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../check-if-there-is-a-valid-path-in-a-grid "Check if There is a Valid Path in a Grid")
-
-[Next >](../capital-gainloss "Capital Gain/Loss")
-
-## [1392. Longest Happy Prefix (Hard)](https://leetcode.com/problems/longest-happy-prefix "最长快乐前缀")
-
-
A string is called a happy prefix if is a non-empty prefix which is also a suffix (excluding itself).
-
-
Given a string s, return the longest happy prefix ofs. Return an empty string "" if no such prefix exists.
-
-
-
Example 1:
-
-
-Input: s = "level"
-Output: "l"
-Explanation: s contains 4 prefix excluding itself ("l", "le", "lev", "leve"), and suffix ("l", "el", "vel", "evel"). The largest prefix which is also suffix is given by "l".
-
-
-
Example 2:
-
-
-Input: s = "ababab"
-Output: "abab"
-Explanation: "abab" is the largest prefix which is also suffix. They can overlap in the original string.
-
-
-
-
Constraints:
-
-
-
1 <= s.length <= 105
-
s contains only lowercase English letters.
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
- [[Rolling Hash](../../tag/rolling-hash/README.md)]
- [[String Matching](../../tag/string-matching/README.md)]
- [[Hash Function](../../tag/hash-function/README.md)]
-
-### Hints
-
-Hint 1
-Use Longest Prefix Suffix (KMP-table) or String Hashing.
-
diff --git a/problems/longest-happy-string/README.md b/problems/longest-happy-string/README.md
deleted file mode 100644
index a07549769..000000000
--- a/problems/longest-happy-string/README.md
+++ /dev/null
@@ -1,70 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../number-of-steps-to-reduce-a-number-in-binary-representation-to-one "Number of Steps to Reduce a Number in Binary Representation to One")
-
-[Next >](../stone-game-iii "Stone Game III")
-
-## [1405. Longest Happy String (Medium)](https://leetcode.com/problems/longest-happy-string "最长快乐字符串")
-
-
A string s is called happy if it satisfies the following conditions:
-
-
-
s only contains the letters 'a', 'b', and 'c'.
-
s does not contain any of "aaa", "bbb", or "ccc" as a substring.
-
s contains at mosta occurrences of the letter 'a'.
-
s contains at mostb occurrences of the letter 'b'.
-
s contains at mostc occurrences of the letter 'c'.
-
-
-
Given three integers a, b, and c, return the longest possible happy string. If there are multiple longest happy strings, return any of them. If there is no such string, return the empty string "".
-
-
A substring is a contiguous sequence of characters within a string.
-
-
-
Example 1:
-
-
-Input: a = 1, b = 1, c = 7
-Output: "ccaccbcc"
-Explanation: "ccbccacc" would also be a correct answer.
-
-
-
Example 2:
-
-
-Input: a = 7, b = 1, c = 0
-Output: "aabaa"
-Explanation: It is the only correct answer in this case.
-
-
-
-
Constraints:
-
-
-
0 <= a, b, c <= 100
-
a + b + c > 0
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
- [[Greedy](../../tag/greedy/README.md)]
- [[Heap (Priority Queue)](../../tag/heap-priority-queue/README.md)]
-
-### Similar Questions
- 1. [Reorganize String](../reorganize-string) (Medium)
-
-### Hints
-
-Hint 1
-Use a greedy approach.
-
-
-
-Hint 2
-Use the letter with the maximum current limit that can be added without breaking the condition.
-
diff --git a/problems/longest-harmonious-subsequence/README.md b/problems/longest-harmonious-subsequence/README.md
deleted file mode 100644
index a965eb210..000000000
--- a/problems/longest-harmonious-subsequence/README.md
+++ /dev/null
@@ -1,54 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../valid-square "Valid Square")
-
-[Next >](../big-countries "Big Countries")
-
-## [594. Longest Harmonious Subsequence (Easy)](https://leetcode.com/problems/longest-harmonious-subsequence "最长和谐子序列")
-
-
We define a harmonious array as an array where the difference between its maximum value and its minimum value is exactly1.
-
-
Given an integer array nums, return the length of its longest harmonious subsequence among all its possible subsequences.
-
-
A subsequence of array is a sequence that can be derived from the array by deleting some or no elements without changing the order of the remaining elements.
-
-
-
Example 1:
-
-
-Input: nums = [1,3,2,2,5,2,3,7]
-Output: 5
-Explanation: The longest harmonious subsequence is [3,2,2,2,3].
-
Given an m x n integers matrix, return the length of the longest increasing path in matrix.
-
-
From each cell, you can either move in four directions: left, right, up, or down. You may not move diagonally or move outside the boundary (i.e., wrap-around is not allowed).
-
-
-
Example 1:
-
-
-Input: matrix = [[9,9,4],[6,6,8],[2,1,1]]
-Output: 4
-Explanation: The longest increasing path is [1, 2, 6, 9].
-
-
-
Example 2:
-
-
-Input: matrix = [[3,4,5],[3,2,6],[2,2,1]]
-Output: 4
-Explanation: The longest increasing path is [3, 4, 5, 6]. Moving diagonally is not allowed.
-
Given an integer array nums, return the length of the longest strictly increasing subsequence.
-
-
A subsequence is a sequence that can be derived from an array by deleting some or no elements without changing the order of the remaining elements. For example, [3,6,2,7] is a subsequence of the array [0,3,1,6,2,2,7].
-
-
-
Example 1:
-
-
-Input: nums = [10,9,2,5,3,7,101,18]
-Output: 4
-Explanation: The longest increasing subsequence is [2,3,7,101], therefore the length is 4.
-
-
-
Example 2:
-
-
-Input: nums = [0,1,0,3,2,3]
-Output: 4
-
-
-
Example 3:
-
-
-Input: nums = [7,7,7,7,7,7,7]
-Output: 1
-
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 2500
-
-104 <= nums[i] <= 104
-
-
-
-
Follow up: Can you come up with an algorithm that runs in O(n log(n)) time complexity?
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Similar Questions
- 1. [Increasing Triplet Subsequence](../increasing-triplet-subsequence) (Medium)
- 1. [Russian Doll Envelopes](../russian-doll-envelopes) (Hard)
- 1. [Maximum Length of Pair Chain](../maximum-length-of-pair-chain) (Medium)
- 1. [Number of Longest Increasing Subsequence](../number-of-longest-increasing-subsequence) (Medium)
- 1. [Minimum ASCII Delete Sum for Two Strings](../minimum-ascii-delete-sum-for-two-strings) (Medium)
- 1. [Minimum Number of Removals to Make Mountain Array](../minimum-number-of-removals-to-make-mountain-array) (Hard)
- 1. [Find the Longest Valid Obstacle Course at Each Position](../find-the-longest-valid-obstacle-course-at-each-position) (Hard)
diff --git a/problems/longest-increasing-subsequence/longest_increasing_subsequence.go b/problems/longest-increasing-subsequence/longest_increasing_subsequence.go
deleted file mode 100644
index 12378f915..000000000
--- a/problems/longest-increasing-subsequence/longest_increasing_subsequence.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem300
diff --git a/problems/longest-increasing-subsequence/longest_increasing_subsequence_test.go b/problems/longest-increasing-subsequence/longest_increasing_subsequence_test.go
deleted file mode 100644
index 12378f915..000000000
--- a/problems/longest-increasing-subsequence/longest_increasing_subsequence_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem300
diff --git a/problems/longest-line-of-consecutive-one-in-matrix/README.md b/problems/longest-line-of-consecutive-one-in-matrix/README.md
deleted file mode 100644
index a6ea512dd..000000000
--- a/problems/longest-line-of-consecutive-one-in-matrix/README.md
+++ /dev/null
@@ -1,55 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../array-partition-i "Array Partition I")
-
-[Next >](../binary-tree-tilt "Binary Tree Tilt")
-
-## [562. Longest Line of Consecutive One in Matrix (Medium)](https://leetcode.com/problems/longest-line-of-consecutive-one-in-matrix "矩阵中最长的连续1线段")
-
-Given a 01 matrix M, find the longest line of consecutive one in the matrix. The line could be horizontal, vertical, diagonal or anti-diagonal.
-
-
-Hint:
-The number of elements in the given matrix will not exceed 10,000.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
-
-### Hints
-
-Hint 1
-One solution is to count ones in each direction separately and find the longest line. Don't you think it will take too much lines of code?
-
-
-
-Hint 2
-Is it possible to use some extra space to make the solution simple?
-
-
-
-Hint 3
-Can we use dynamic programming to make use of intermediate results?
-
-
-
-Hint 4
-Think of a 3D array which can be used to store the longest line obtained so far for each direction.
-
diff --git a/problems/longest-line-of-consecutive-one-in-matrix/longest_line_of_consecutive_one_in_matrix.go b/problems/longest-line-of-consecutive-one-in-matrix/longest_line_of_consecutive_one_in_matrix.go
deleted file mode 100644
index aa5027dbc..000000000
--- a/problems/longest-line-of-consecutive-one-in-matrix/longest_line_of_consecutive_one_in_matrix.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem562
diff --git a/problems/longest-line-of-consecutive-one-in-matrix/longest_line_of_consecutive_one_in_matrix_test.go b/problems/longest-line-of-consecutive-one-in-matrix/longest_line_of_consecutive_one_in_matrix_test.go
deleted file mode 100644
index aa5027dbc..000000000
--- a/problems/longest-line-of-consecutive-one-in-matrix/longest_line_of_consecutive_one_in_matrix_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem562
diff --git a/problems/longest-mountain-in-array/README.md b/problems/longest-mountain-in-array/README.md
deleted file mode 100644
index c391abf44..000000000
--- a/problems/longest-mountain-in-array/README.md
+++ /dev/null
@@ -1,65 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../backspace-string-compare "Backspace String Compare")
-
-[Next >](../hand-of-straights "Hand of Straights")
-
-## [845. Longest Mountain in Array (Medium)](https://leetcode.com/problems/longest-mountain-in-array "数组中的最长山脉")
-
-
You may recall that an array arr is a mountain array if and only if:
-
-
-
arr.length >= 3
-
There exists some index i (0-indexed) with 0 < i < arr.length - 1 such that:
-
-
arr[0] < arr[1] < ... < arr[i - 1] < arr[i]
-
arr[i] > arr[i + 1] > ... > arr[arr.length - 1]
-
-
-
-
-
Given an integer array arr, return the length of the longest subarray, which is a mountain. Return 0 if there is no mountain subarray.
-
-
-
Example 1:
-
-
-Input: arr = [2,1,4,7,3,2,5]
-Output: 5
-Explanation: The largest mountain is [1,4,7,3,2] which has length 5.
-
-
-
Example 2:
-
-
-Input: arr = [2,2,2]
-Output: 0
-Explanation: There is no mountain.
-
A string s is nice if, for every letter of the alphabet that s contains, it appears both in uppercase and lowercase. For example, "abABB" is nice because 'A' and 'a' appear, and 'B' and 'b' appear. However, "abA" is not because 'b' appears, but 'B' does not.
-
-
Given a string s, return the longest substring of s that is nice. If there are multiple, return the substring of the earliest occurrence. If there are none, return an empty string.
-
-
-
Example 1:
-
-
-Input: s = "YazaAay"
-Output: "aAa"
-Explanation: "aAa" is a nice string because 'A/a' is the only letter of the alphabet in s, and both 'A' and 'a' appear.
-"aAa" is the longest nice substring.
-
-
-
Example 2:
-
-
-Input: s = "Bb"
-Output: "Bb"
-Explanation: "Bb" is a nice string because both 'B' and 'b' appear. The whole string is a substring.
-
-
-
Example 3:
-
-
-Input: s = "c"
-Output: ""
-Explanation: There are no nice substrings.
-
-
-
-
Constraints:
-
-
-
1 <= s.length <= 100
-
s consists of uppercase and lowercase English letters.
-
-
-### Related Topics
- [[Bit Manipulation](../../tag/bit-manipulation/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
- [[Sliding Window](../../tag/sliding-window/README.md)]
-
-### Hints
-
-Hint 1
-Brute force and check each substring to see if it is nice.
-
diff --git a/problems/longest-palindrome-by-concatenating-two-letter-words/README.md b/problems/longest-palindrome-by-concatenating-two-letter-words/README.md
deleted file mode 100644
index 3efa72307..000000000
--- a/problems/longest-palindrome-by-concatenating-two-letter-words/README.md
+++ /dev/null
@@ -1,80 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-twin-sum-of-a-linked-list "Maximum Twin Sum of a Linked List")
-
-[Next >](../stamping-the-grid "Stamping the Grid")
-
-## [2131. Longest Palindrome by Concatenating Two Letter Words (Medium)](https://leetcode.com/problems/longest-palindrome-by-concatenating-two-letter-words "连接两字母单词得到的最长回文串")
-
-
You are given an array of strings words. Each element of words consists of two lowercase English letters.
-
-
Create the longest possible palindrome by selecting some elements from words and concatenating them in any order. Each element can be selected at most once.
-
-
Return the length of the longest palindrome that you can create. If it is impossible to create any palindrome, return 0.
-
-
A palindrome is a string that reads the same forward and backward.
-
-
-
Example 1:
-
-
-Input: words = ["lc","cl","gg"]
-Output: 6
-Explanation: One longest palindrome is "lc" + "gg" + "cl" = "lcggcl", of length 6.
-Note that "clgglc" is another longest palindrome that can be created.
-
-
-
Example 2:
-
-
-Input: words = ["ab","ty","yt","lc","cl","ab"]
-Output: 8
-Explanation: One longest palindrome is "ty" + "lc" + "cl" + "yt" = "tylcclyt", of length 8.
-Note that "lcyttycl" is another longest palindrome that can be created.
-
-
-
Example 3:
-
-
-Input: words = ["cc","ll","xx"]
-Output: 2
-Explanation: One longest palindrome is "cc", of length 2.
-Note that "ll" is another longest palindrome that can be created, and so is "xx".
-
-
-
-
Constraints:
-
-
-
1 <= words.length <= 105
-
words[i].length == 2
-
words[i] consists of lowercase English letters.
-
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
- [[Counting](../../tag/counting/README.md)]
-
-### Hints
-
-Hint 1
-A palindrome must be mirrored over the center. Suppose we have a palindrome. If we prepend the word "ab" on the left, what must we append on the right to keep it a palindrome?
-
-
-
-Hint 2
-We must append "ba" on the right. The number of times we can do this is the minimum of (occurrences of "ab") and (occurrences of "ba").
-
-
-
-Hint 3
-For words that are already palindromes, e.g. "aa", we can prepend and append these in pairs as described in the previous hint. We can also use exactly one in the middle to form an even longer palindrome.
-
diff --git a/problems/longest-palindrome/README.md b/problems/longest-palindrome/README.md
deleted file mode 100644
index 3081419ec..000000000
--- a/problems/longest-palindrome/README.md
+++ /dev/null
@@ -1,56 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../valid-word-abbreviation "Valid Word Abbreviation")
-
-[Next >](../split-array-largest-sum "Split Array Largest Sum")
-
-## [409. Longest Palindrome (Easy)](https://leetcode.com/problems/longest-palindrome "最长回文串")
-
-
Given a string s which consists of lowercase or uppercase letters, return the length of the longest palindrome that can be built with those letters.
-
-
Letters are case sensitive, for example, "Aa" is not considered a palindrome here.
-
-
-
Example 1:
-
-
-Input: s = "abccccdd"
-Output: 7
-Explanation:
-One longest palindrome that can be built is "dccaccd", whose length is 7.
-
-
-
Example 2:
-
-
-Input: s = "a"
-Output: 1
-
-
-
Example 3:
-
-
-Input: s = "bb"
-Output: 2
-
-
-
-
Constraints:
-
-
-
1 <= s.length <= 2000
-
s consists of lowercase and/or uppercase English letters only.
-
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Similar Questions
- 1. [Palindrome Permutation](../palindrome-permutation) (Easy)
diff --git a/problems/longest-palindrome/longest_palindrome.go b/problems/longest-palindrome/longest_palindrome.go
deleted file mode 100644
index e7796f4c5..000000000
--- a/problems/longest-palindrome/longest_palindrome.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem409
diff --git a/problems/longest-palindrome/longest_palindrome_test.go b/problems/longest-palindrome/longest_palindrome_test.go
deleted file mode 100644
index e7796f4c5..000000000
--- a/problems/longest-palindrome/longest_palindrome_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem409
diff --git a/problems/longest-palindromic-subsequence-ii/README.md b/problems/longest-palindromic-subsequence-ii/README.md
deleted file mode 100644
index 7f8a858a1..000000000
--- a/problems/longest-palindromic-subsequence-ii/README.md
+++ /dev/null
@@ -1,32 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-incompatibility "Minimum Incompatibility")
-
-[Next >](../invalid-tweets "Invalid Tweets")
-
-## [1682. Longest Palindromic Subsequence II (Medium)](https://leetcode.com/problems/longest-palindromic-subsequence-ii "最长回文子序列 II")
-
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Similar Questions
- 1. [Longest Palindromic Subsequence](../longest-palindromic-subsequence) (Medium)
-
-### Hints
-
-Hint 1
-As with any good dp problem that uses palindromes, try building the palindrome from the edges
-
-
-
-Hint 2
-The prime point is to check that no two adjacent characters are equal, so save the past character while building the palindrome.
-
diff --git a/problems/longest-palindromic-subsequence/README.md b/problems/longest-palindromic-subsequence/README.md
deleted file mode 100644
index 7ba508696..000000000
--- a/problems/longest-palindromic-subsequence/README.md
+++ /dev/null
@@ -1,54 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../find-largest-value-in-each-tree-row "Find Largest Value in Each Tree Row")
-
-[Next >](../super-washing-machines "Super Washing Machines")
-
-## [516. Longest Palindromic Subsequence (Medium)](https://leetcode.com/problems/longest-palindromic-subsequence "最长回文子序列")
-
-
Given a string s, find the longest palindromic subsequence's length ins.
-
-
A subsequence is a sequence that can be derived from another sequence by deleting some or no elements without changing the order of the remaining elements.
-
-
-
Example 1:
-
-
-Input: s = "bbbab"
-Output: 4
-Explanation: One possible longest palindromic subsequence is "bbbb".
-
-
-
Example 2:
-
-
-Input: s = "cbbd"
-Output: 2
-Explanation: One possible longest palindromic subsequence is "bb".
-
Given a string s, return the longest palindromic substring in s.
-
-
-
Example 1:
-
-
-Input: s = "babad"
-Output: "bab"
-Note: "aba" is also a valid answer.
-
-
-
Example 2:
-
-
-Input: s = "cbbd"
-Output: "bb"
-
-
-
Example 3:
-
-
-Input: s = "a"
-Output: "a"
-
-
-
Example 4:
-
-
-Input: s = "ac"
-Output: "a"
-
-
-
-
Constraints:
-
-
-
1 <= s.length <= 1000
-
s consist of only digits and English letters.
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Similar Questions
- 1. [Shortest Palindrome](../shortest-palindrome) (Hard)
- 1. [Palindrome Permutation](../palindrome-permutation) (Easy)
- 1. [Palindrome Pairs](../palindrome-pairs) (Hard)
- 1. [Longest Palindromic Subsequence](../longest-palindromic-subsequence) (Medium)
- 1. [Palindromic Substrings](../palindromic-substrings) (Medium)
-
-### Hints
-
-Hint 1
-How can we reuse a previously computed palindrome to compute a larger palindrome?
-
-
-
-Hint 2
-If “aba” is a palindrome, is “xabax” a palindrome? Similarly is “xabay” a palindrome?
-
-
-
-Hint 3
-Complexity based hint:
-If we use brute-force and check whether for every start and end position a substring is a palindrome we have O(n^2) start - end pairs and O(n) palindromic checks. Can we reduce the time for palindromic checks to O(1) by reusing some previous computation.
-
diff --git a/problems/longest-palindromic-substring/longest_palindromic_substring.go b/problems/longest-palindromic-substring/longest_palindromic_substring.go
deleted file mode 100644
index 105c263a5..000000000
--- a/problems/longest-palindromic-substring/longest_palindromic_substring.go
+++ /dev/null
@@ -1,20 +0,0 @@
-package problem5
-
-func longestPalindrome(s string) string {
- start, maxLen, l := 0, 0, len(s)
- for i := 0; i < l; i++ {
- expandAroundCenter(s, i, i, &start, &maxLen)
- expandAroundCenter(s, i, i+1, &start, &maxLen)
- }
- return s[start : start+maxLen]
-}
-
-func expandAroundCenter(s string, l, r int, start, maxLen *int) {
- for l >= 0 && r < len(s) && s[l] == s[r] {
- l, r = l-1, r+1
- }
- if r-l-1 > *maxLen {
- *maxLen = r - l - 1
- *start = l + 1
- }
-}
diff --git a/problems/longest-palindromic-substring/longest_palindromic_substring_test.go b/problems/longest-palindromic-substring/longest_palindromic_substring_test.go
deleted file mode 100644
index 60612ce84..000000000
--- a/problems/longest-palindromic-substring/longest_palindromic_substring_test.go
+++ /dev/null
@@ -1,39 +0,0 @@
-package problem5
-
-import "testing"
-
-type testType struct {
- in string
- want string
-}
-
-func TestLongestPalindrome(t *testing.T) {
- tests := [...]testType{
- {
- in: "babad",
- want: "bab",
- },
- {
- in: "cbbd",
- want: "bb",
- },
- {
- in: "",
- want: "",
- },
- {
- in: "a",
- want: "a",
- },
- {
- in: "abbba",
- want: "abbba",
- },
- }
- for _, tt := range tests {
- got := longestPalindrome(tt.in)
- if got != tt.want {
- t.Fatalf("in: %v, got: %v, want: %v", tt.in, got, tt.want)
- }
- }
-}
diff --git a/problems/longest-repeating-character-replacement/README.md b/problems/longest-repeating-character-replacement/README.md
deleted file mode 100644
index 650562490..000000000
--- a/problems/longest-repeating-character-replacement/README.md
+++ /dev/null
@@ -1,54 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../reconstruct-original-digits-from-english "Reconstruct Original Digits from English")
-
-[Next >](../word-squares "Word Squares")
-
-## [424. Longest Repeating Character Replacement (Medium)](https://leetcode.com/problems/longest-repeating-character-replacement "替换后的最长重复字符")
-
-
You are given a string s and an integer k. You can choose any character of the string and change it to any other uppercase English character. You can perform this operation at most k times.
-
-
Return the length of the longest substring containing the same letter you can get after performing the above operations.
-
-
-
Example 1:
-
-
-Input: s = "ABAB", k = 2
-Output: 4
-Explanation: Replace the two 'A's with two 'B's or vice versa.
-
-
-
Example 2:
-
-
-Input: 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.
-
-
-
-
Constraints:
-
-
-
1 <= s.length <= 105
-
s consists of only uppercase English letters.
-
0 <= k <= s.length
-
-
-### Related Topics
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
- [[Sliding Window](../../tag/sliding-window/README.md)]
-
-### Similar Questions
- 1. [Longest Substring with At Most K Distinct Characters](../longest-substring-with-at-most-k-distinct-characters) (Medium)
- 1. [Max Consecutive Ones III](../max-consecutive-ones-iii) (Medium)
- 1. [Minimum Number of Operations to Make Array Continuous](../minimum-number-of-operations-to-make-array-continuous) (Hard)
- 1. [Maximize the Confusion of an Exam](../maximize-the-confusion-of-an-exam) (Medium)
diff --git a/problems/longest-repeating-character-replacement/longest_repeating_character_replacement.go b/problems/longest-repeating-character-replacement/longest_repeating_character_replacement.go
deleted file mode 100644
index 40325c694..000000000
--- a/problems/longest-repeating-character-replacement/longest_repeating_character_replacement.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem424
diff --git a/problems/longest-repeating-character-replacement/longest_repeating_character_replacement_test.go b/problems/longest-repeating-character-replacement/longest_repeating_character_replacement_test.go
deleted file mode 100644
index 40325c694..000000000
--- a/problems/longest-repeating-character-replacement/longest_repeating_character_replacement_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem424
diff --git a/problems/longest-repeating-substring/README.md b/problems/longest-repeating-substring/README.md
deleted file mode 100644
index 0f83a9c26..000000000
--- a/problems/longest-repeating-substring/README.md
+++ /dev/null
@@ -1,76 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../lexicographically-smallest-equivalent-string "Lexicographically Smallest Equivalent String")
-
-[Next >](../number-of-valid-subarrays "Number of Valid Subarrays")
-
-## [1062. Longest Repeating Substring (Medium)](https://leetcode.com/problems/longest-repeating-substring "最长重复子串")
-
-
Given a string S, find out the length of the longest repeating substring(s). Return 0 if no repeating substring exists.
-
-
-
-
Example 1:
-
-
-Input: "abcd"
-Output: 0
-Explanation: There is no repeating substring.
-
-
-
Example 2:
-
-
-Input: "abbaba"
-Output: 2
-Explanation: The longest repeating substrings are "ab" and "ba", each of which occurs twice.
-
-
-
Example 3:
-
-
-Input: "aabcaabdaab"
-Output: 3
-Explanation: The longest repeating substring is "aab", which occurs 3 times.
-
-
-
Example 4:
-
-
-Input: "aaaaa"
-Output: 4
-Explanation: The longest repeating substring is "aaaa", which occurs twice.
-
-
-
-
-
Note:
-
-
-
The string S consists of only lowercase English letters from 'a' - 'z'.
-
1 <= S.length <= 1500
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Suffix Array](../../tag/suffix-array/README.md)]
- [[Hash Function](../../tag/hash-function/README.md)]
- [[Rolling Hash](../../tag/rolling-hash/README.md)]
-
-### Hints
-
-Hint 1
-Generate all substrings in O(N^2) time with hashing.
-
-
-
-Hint 2
-Choose those hashing of strings with the largest length.
-
diff --git a/problems/longest-string-chain/README.md b/problems/longest-string-chain/README.md
deleted file mode 100644
index d659234b5..000000000
--- a/problems/longest-string-chain/README.md
+++ /dev/null
@@ -1,77 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../remove-all-adjacent-duplicates-in-string "Remove All Adjacent Duplicates In String")
-
-[Next >](../last-stone-weight-ii "Last Stone Weight II")
-
-## [1048. Longest String Chain (Medium)](https://leetcode.com/problems/longest-string-chain "最长字符串链")
-
-
You are given an array of words where each word consists of lowercase English letters.
-
-
wordA is a predecessor of wordB if and only if we can insert exactly one letter anywhere in wordAwithout changing the order of the other characters to make it equal to wordB.
-
-
-
For example, "abc" is a predecessor of "abac", while "cba" is not a predecessor of "bcad".
-
-
-
A word chainis a sequence of words [word1, word2, ..., wordk] with k >= 1, where word1 is a predecessor of word2, word2 is a predecessor of word3, and so on. A single word is trivially a word chain with k == 1.
-
-
Return the length of the longest possible word chain with words chosen from the given list of words.
-
-
-
Example 1:
-
-
-Input: words = ["a","b","ba","bca","bda","bdca"]
-Output: 4
-Explanation: One of the longest word chains is ["a","ba","bda","bdca"].
-
-
-
Example 2:
-
-
-Input: words = ["xbc","pcxbcf","xb","cxbc","pcxbc"]
-Output: 5
-Explanation: All the words can be put in a word chain ["xb", "xbc", "cxbc", "pcxbc", "pcxbcf"].
-
-
-
Example 3:
-
-
-Input: words = ["abcd","dbqca"]
-Output: 1
-Explanation: The trivial word chain ["abcd"] is one of the longest word chains.
-["abcd","dbqca"] is not a valid word chain because the ordering of the letters is changed.
-
-
-
-
Constraints:
-
-
-
1 <= words.length <= 1000
-
1 <= words[i].length <= 16
-
words[i] only consists of lowercase English letters.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Two Pointers](../../tag/two-pointers/README.md)]
- [[String](../../tag/string/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Hints
-
-Hint 1
-Instead of adding a character, try deleting a character to form a chain in reverse.
-
-
-
-Hint 2
-For each word in order of length, for each word2 which is word with one character removed, length[word2] = max(length[word2], length[word] + 1).
-
diff --git a/problems/longest-string-chain/longest_string_chain.go b/problems/longest-string-chain/longest_string_chain.go
deleted file mode 100644
index 48f2ffe95..000000000
--- a/problems/longest-string-chain/longest_string_chain.go
+++ /dev/null
@@ -1,54 +0,0 @@
-package problem1048
-
-func longestStrChain(words []string) int {
- indexs := make([][]int, 17)
- count := make([]int, len(words))
- for i, word := range words {
- l := len(word)
- indexs[l] = append(indexs[l], i)
- count[i] = 1
- }
-
- res := 1
- for length := 1; length+1 <= 16; length++ {
- for _, i := range indexs[length] {
- for _, j := range indexs[length+1] {
- if count[j] > count[i] {
- // because of isPredecessor is expensive
- continue
- }
- if isPredecessor(words[i], words[j]) {
- count[j] = count[i] + 1
- }
- }
- }
- }
-
- for _, v := range count {
- res = max(res, v)
- }
- return res
-}
-
-func isPredecessor(w1, w2 string) bool {
- n := len(w1)
- diff := 0
- i, j := 0, 0
- for i < n && diff <= 1 {
- if w1[i] != w2[j] {
- diff++
- } else {
- i++
- }
- j++
- }
- return diff == 1 ||
- i == j // w1[:i]==w2[:i]
-}
-
-func max(a, b int) int {
- if a > b {
- return a
- }
- return b
-}
diff --git a/problems/longest-subarray-of-1s-after-deleting-one-element/README.md b/problems/longest-subarray-of-1s-after-deleting-one-element/README.md
deleted file mode 100644
index 4c5892b99..000000000
--- a/problems/longest-subarray-of-1s-after-deleting-one-element/README.md
+++ /dev/null
@@ -1,60 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../the-kth-factor-of-n "The kth Factor of n")
-
-[Next >](../parallel-courses-ii "Parallel Courses II")
-
-## [1493. Longest Subarray of 1's After Deleting One Element (Medium)](https://leetcode.com/problems/longest-subarray-of-1s-after-deleting-one-element "删掉一个元素以后全为 1 的最长子数组")
-
-
Given a binary array nums, you should delete one element from it.
-
-
Return the size of the longest non-empty subarray containing only 1's in the resulting array. Return 0 if there is no such subarray.
-
-
-
Example 1:
-
-
-Input: nums = [1,1,0,1]
-Output: 3
-Explanation: After deleting the number in position 2, [1,1,1] contains 3 numbers with value of 1's.
-
-
-
Example 2:
-
-
-Input: nums = [0,1,1,1,0,1,1,0,1]
-Output: 5
-Explanation: After deleting the number in position 4, [0,1,1,1,1,1,0,1] longest subarray with value of 1's is [1,1,1,1,1].
-
-
-
Example 3:
-
-
-Input: nums = [1,1,1]
-Output: 2
-Explanation: You must delete one element.
-
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 105
-
nums[i] is either 0 or 1.
-
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Sliding Window](../../tag/sliding-window/README.md)]
-
-### Hints
-
-Hint 1
-Maintain a sliding window where there is at most one zero on it.
-
diff --git a/problems/longest-subsequence-repeated-k-times/README.md b/problems/longest-subsequence-repeated-k-times/README.md
deleted file mode 100644
index 2879b957e..000000000
--- a/problems/longest-subsequence-repeated-k-times/README.md
+++ /dev/null
@@ -1,83 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../detect-squares "Detect Squares")
-
-[Next >](../average-height-of-buildings-in-each-segment "Average Height of Buildings in Each Segment")
-
-## [2014. Longest Subsequence Repeated k Times (Hard)](https://leetcode.com/problems/longest-subsequence-repeated-k-times "重复 K 次的最长子序列")
-
-
You are given a string s of length n, and an integer k. You are tasked to find the longest subsequence repeatedk times in string s.
-
-
A subsequence is a string that can be derived from another string by deleting some or no characters without changing the order of the remaining characters.
-
-
A subsequence seq is repeatedk times in the string s if seq * k is a subsequence of s, where seq * k represents a string constructed by concatenating seqk times.
-
-
-
For example, "bba" is repeated 2 times in the string "bababcba", because the string "bbabba", constructed by concatenating "bba"2 times, is a subsequence of the string "bababcba".
-
-
-
Return the longest subsequence repeatedk times in string s. If multiple such subsequences are found, return the lexicographically largest one. If there is no such subsequence, return an empty string.
-
-
-
Example 1:
-
-
-Input: s = "letsleetcode", k = 2
-Output: "let"
-Explanation: There are two longest subsequences repeated 2 times: "let" and "ete".
-"let" is the lexicographically largest one.
-
-
-
Example 2:
-
-
-Input: s = "bb", k = 2
-Output: "b"
-Explanation: The longest subsequence repeated 2 times is "b".
-
-
-
Example 3:
-
-
-Input: s = "ab", k = 2
-Output: ""
-Explanation: There is no subsequence repeated 2 times. Empty string is returned.
-
-
-
-
Constraints:
-
-
-
n == s.length
-
2 <= n, k <= 2000
-
2 <= n < k * 8
-
s consists of lowercase English letters.
-
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[String](../../tag/string/README.md)]
- [[Backtracking](../../tag/backtracking/README.md)]
- [[Counting](../../tag/counting/README.md)]
- [[Enumeration](../../tag/enumeration/README.md)]
-
-### Hints
-
-Hint 1
-The length of the longest subsequence does not exceed n/k. Do you know why?
-
-
-
-Hint 2
-Find the characters that could be included in the potential answer. A character occurring more than or equal to k times can be used in the answer up to (count of the character / k) times.
-
-
-
-Hint 3
-Try all possible candidates in reverse lexicographic order, and check the string for the subsequence condition.
-
diff --git a/problems/longest-substring-of-all-vowels-in-order/README.md b/problems/longest-substring-of-all-vowels-in-order/README.md
deleted file mode 100644
index c3cb2938b..000000000
--- a/problems/longest-substring-of-all-vowels-in-order/README.md
+++ /dev/null
@@ -1,72 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../frequency-of-the-most-frequent-element "Frequency of the Most Frequent Element")
-
-[Next >](../maximum-building-height "Maximum Building Height")
-
-## [1839. Longest Substring Of All Vowels in Order (Medium)](https://leetcode.com/problems/longest-substring-of-all-vowels-in-order "所有元音按顺序排布的最长子字符串")
-
-
A string is considered beautiful if it satisfies the following conditions:
-
-
-
Each of the 5 English vowels ('a', 'e', 'i', 'o', 'u') must appear at least once in it.
-
The letters must be sorted in alphabetical order (i.e. all 'a's before 'e's, all 'e's before 'i's, etc.).
-
-
-
For example, strings "aeiou" and "aaaaaaeiiiioou" are considered beautiful, but "uaeio", "aeoiu", and "aaaeeeooo" are not beautiful.
-
-
Given a string word consisting of English vowels, return the length of the longest beautiful substring of word. If no such substring exists, return 0.
-
-
A substring is a contiguous sequence of characters in a string.
-
-
-
Example 1:
-
-
-Input: word = "aeiaaioaaaaeiiiiouuuooaauuaeiu"
-Output: 13
-Explanation: The longest beautiful substring in word is "aaaaeiiiiouuu" of length 13.
-
-
Example 2:
-
-
-Input: word = "aeeeiiiioooauuuaeiou"
-Output: 5
-Explanation: The longest beautiful substring in word is "aeiou" of length 5.
-
-
-
Example 3:
-
-
-Input: word = "a"
-Output: 0
-Explanation: There is no beautiful substring, so return 0.
-
-
-
-
Constraints:
-
-
-
1 <= word.length <= 5 * 105
-
word consists of characters 'a', 'e', 'i', 'o', and 'u'.
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
- [[Sliding Window](../../tag/sliding-window/README.md)]
-
-### Hints
-
-Hint 1
-Start from each 'a' and find the longest beautiful substring starting at that index.
-
-
-
-Hint 2
-Based on the current character decide if you should include the next character in the beautiful substring.
-
diff --git a/problems/longest-substring-with-at-least-k-repeating-characters/README.md b/problems/longest-substring-with-at-least-k-repeating-characters/README.md
deleted file mode 100644
index 399a1e0f2..000000000
--- a/problems/longest-substring-with-at-least-k-repeating-characters/README.md
+++ /dev/null
@@ -1,50 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../decode-string "Decode String")
-
-[Next >](../rotate-function "Rotate Function")
-
-## [395. Longest Substring with At Least K Repeating Characters (Medium)](https://leetcode.com/problems/longest-substring-with-at-least-k-repeating-characters "至少有 K 个重复字符的最长子串")
-
-
Given a string s and an integer k, return the length of the longest substring ofssuch that the frequency of each character in this substring is greater than or equal tok.
-
-
-
Example 1:
-
-
-Input: s = "aaabb", k = 3
-Output: 3
-Explanation: The longest substring is "aaa", as 'a' is repeated 3 times.
-
-
-
Example 2:
-
-
-Input: s = "ababbc", k = 2
-Output: 5
-Explanation: The longest substring is "ababb", as 'a' is repeated 2 times and 'b' is repeated 3 times.
-
-
-
-
Constraints:
-
-
-
1 <= s.length <= 104
-
s consists of only lowercase English letters.
-
1 <= k <= 105
-
-
-### Related Topics
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
- [[Divide and Conquer](../../tag/divide-and-conquer/README.md)]
- [[Sliding Window](../../tag/sliding-window/README.md)]
-
-### Similar Questions
- 1. [Longest Subsequence Repeated k Times](../longest-subsequence-repeated-k-times) (Hard)
- 1. [Number of Equal Count Substrings](../number-of-equal-count-substrings) (Medium)
diff --git a/problems/longest-substring-with-at-least-k-repeating-characters/longest_substring_with_at_least_k_repeating_characters.go b/problems/longest-substring-with-at-least-k-repeating-characters/longest_substring_with_at_least_k_repeating_characters.go
deleted file mode 100644
index 3aa4ce413..000000000
--- a/problems/longest-substring-with-at-least-k-repeating-characters/longest_substring_with_at_least_k_repeating_characters.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem395
diff --git a/problems/longest-substring-with-at-least-k-repeating-characters/longest_substring_with_at_least_k_repeating_characters_test.go b/problems/longest-substring-with-at-least-k-repeating-characters/longest_substring_with_at_least_k_repeating_characters_test.go
deleted file mode 100644
index 3aa4ce413..000000000
--- a/problems/longest-substring-with-at-least-k-repeating-characters/longest_substring_with_at_least_k_repeating_characters_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem395
diff --git a/problems/longest-substring-with-at-most-k-distinct-characters/README.md b/problems/longest-substring-with-at-most-k-distinct-characters/README.md
deleted file mode 100644
index b2e57c3fa..000000000
--- a/problems/longest-substring-with-at-most-k-distinct-characters/README.md
+++ /dev/null
@@ -1,43 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../nested-list-weight-sum "Nested List Weight Sum")
-
-[Next >](../flatten-nested-list-iterator "Flatten Nested List Iterator")
-
-## [340. Longest Substring with At Most K Distinct Characters (Medium)](https://leetcode.com/problems/longest-substring-with-at-most-k-distinct-characters "至多包含 K 个不同字符的最长子串")
-
-
Given a string, find the length of the longest substring T that contains at most k distinct characters.
-
-
Example 1:
-
-
-
-Input: s = "eceba", k = 2
-Output: 3
-Explanation: T is "ece" which its length is 3.
-
-
-
Example 2:
-
-
-Input: s = "aa", k = 1
-Output: 2
-Explanation: T is "aa" which its length is 2.
-
-
-### Related Topics
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
- [[Sliding Window](../../tag/sliding-window/README.md)]
-
-### Similar Questions
- 1. [Longest Substring Without Repeating Characters](../longest-substring-without-repeating-characters) (Medium)
- 1. [Longest Substring with At Most Two Distinct Characters](../longest-substring-with-at-most-two-distinct-characters) (Medium)
- 1. [Longest Repeating Character Replacement](../longest-repeating-character-replacement) (Medium)
- 1. [Subarrays with K Different Integers](../subarrays-with-k-different-integers) (Hard)
- 1. [Max Consecutive Ones III](../max-consecutive-ones-iii) (Medium)
diff --git a/problems/longest-substring-with-at-most-k-distinct-characters/longest_substring_with_at_most_k_distinct_characters.go b/problems/longest-substring-with-at-most-k-distinct-characters/longest_substring_with_at_most_k_distinct_characters.go
deleted file mode 100644
index a5790d8d8..000000000
--- a/problems/longest-substring-with-at-most-k-distinct-characters/longest_substring_with_at_most_k_distinct_characters.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem340
diff --git a/problems/longest-substring-with-at-most-k-distinct-characters/longest_substring_with_at_most_k_distinct_characters_test.go b/problems/longest-substring-with-at-most-k-distinct-characters/longest_substring_with_at_most_k_distinct_characters_test.go
deleted file mode 100644
index a5790d8d8..000000000
--- a/problems/longest-substring-with-at-most-k-distinct-characters/longest_substring_with_at_most_k_distinct_characters_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem340
diff --git a/problems/longest-substring-with-at-most-two-distinct-characters/README.md b/problems/longest-substring-with-at-most-two-distinct-characters/README.md
deleted file mode 100644
index 34675cf52..000000000
--- a/problems/longest-substring-with-at-most-two-distinct-characters/README.md
+++ /dev/null
@@ -1,39 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../read-n-characters-given-read4-ii-call-multiple-times "Read N Characters Given read4 II - Call Multiple Times")
-
-[Next >](../intersection-of-two-linked-lists "Intersection of Two Linked Lists")
-
-## [159. Longest Substring with At Most Two Distinct Characters (Medium)](https://leetcode.com/problems/longest-substring-with-at-most-two-distinct-characters "至多包含两个不同字符的最长子串")
-
-
Given a string s , find the length of the longest substring t that contains at most 2 distinct characters.
-
-
Example 1:
-
-
Input: "eceba"
-Output: 3
-Explanation: tis "ece" which its length is 3.
-
-
-
Example 2:
-
-
Input: "ccaabbb"
-Output: 5
-Explanation: tis "aabbb" which its length is 5.
-
-
-### Related Topics
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
- [[Sliding Window](../../tag/sliding-window/README.md)]
-
-### Similar Questions
- 1. [Longest Substring Without Repeating Characters](../longest-substring-without-repeating-characters) (Medium)
- 1. [Sliding Window Maximum](../sliding-window-maximum) (Hard)
- 1. [Longest Substring with At Most K Distinct Characters](../longest-substring-with-at-most-k-distinct-characters) (Medium)
- 1. [Subarrays with K Different Integers](../subarrays-with-k-different-integers) (Hard)
diff --git a/problems/longest-substring-with-at-most-two-distinct-characters/longest_substring_with_at_most_two_distinct_characters.go b/problems/longest-substring-with-at-most-two-distinct-characters/longest_substring_with_at_most_two_distinct_characters.go
deleted file mode 100644
index efc10f9cd..000000000
--- a/problems/longest-substring-with-at-most-two-distinct-characters/longest_substring_with_at_most_two_distinct_characters.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem159
diff --git a/problems/longest-substring-with-at-most-two-distinct-characters/longest_substring_with_at_most_two_distinct_characters_test.go b/problems/longest-substring-with-at-most-two-distinct-characters/longest_substring_with_at_most_two_distinct_characters_test.go
deleted file mode 100644
index efc10f9cd..000000000
--- a/problems/longest-substring-with-at-most-two-distinct-characters/longest_substring_with_at_most_two_distinct_characters_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem159
diff --git a/problems/longest-substring-without-repeating-characters/README.md b/problems/longest-substring-without-repeating-characters/README.md
deleted file mode 100644
index a1ce2b5d4..000000000
--- a/problems/longest-substring-without-repeating-characters/README.md
+++ /dev/null
@@ -1,65 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../add-two-numbers "Add Two Numbers")
-
-[Next >](../median-of-two-sorted-arrays "Median of Two Sorted Arrays")
-
-## [3. Longest Substring Without Repeating Characters (Medium)](https://leetcode.com/problems/longest-substring-without-repeating-characters "无重复字符的最长子串")
-
-
Given a string s, find the length of the longest substring without repeating characters.
-
-
-
Example 1:
-
-
-Input: s = "abcabcbb"
-Output: 3
-Explanation: The answer is "abc", with the length of 3.
-
-
-
Example 2:
-
-
-Input: s = "bbbbb"
-Output: 1
-Explanation: The answer is "b", with the length of 1.
-
-
-
Example 3:
-
-
-Input: s = "pwwkew"
-Output: 3
-Explanation: The answer is "wke", with the length of 3.
-Notice that the answer must be a substring, "pwke" is a subsequence and not a substring.
-
-
-
Example 4:
-
-
-Input: s = ""
-Output: 0
-
-
-
-
Constraints:
-
-
-
0 <= s.length <= 5 * 104
-
s consists of English letters, digits, symbols and spaces.
-
-
-### Related Topics
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
- [[Sliding Window](../../tag/sliding-window/README.md)]
-
-### Similar Questions
- 1. [Longest Substring with At Most Two Distinct Characters](../longest-substring-with-at-most-two-distinct-characters) (Medium)
- 1. [Longest Substring with At Most K Distinct Characters](../longest-substring-with-at-most-k-distinct-characters) (Medium)
- 1. [Subarrays with K Different Integers](../subarrays-with-k-different-integers) (Hard)
diff --git a/problems/longest-substring-without-repeating-characters/longest_substring_without_repeating_characters.go b/problems/longest-substring-without-repeating-characters/longest_substring_without_repeating_characters.go
deleted file mode 100644
index 2dcdcb6d8..000000000
--- a/problems/longest-substring-without-repeating-characters/longest_substring_without_repeating_characters.go
+++ /dev/null
@@ -1,16 +0,0 @@
-package problem3
-
-func lengthOfLongestSubstring(s string) int {
- ans, l := 0, len(s)
- index := [128]int{}
- for i, j := 0, 0; j < l; j++ {
- if i < index[s[j]] {
- i = index[s[j]]
- }
- if ans < j-i+1 {
- ans = j - i + 1
- }
- index[s[j]] = j + 1
- }
- return ans
-}
diff --git a/problems/longest-substring-without-repeating-characters/longest_substring_without_repeating_characters_test.go b/problems/longest-substring-without-repeating-characters/longest_substring_without_repeating_characters_test.go
deleted file mode 100644
index d1048a179..000000000
--- a/problems/longest-substring-without-repeating-characters/longest_substring_without_repeating_characters_test.go
+++ /dev/null
@@ -1,19 +0,0 @@
-package problem3
-
-import "testing"
-
-func TestLengthOfLongestSubstring(t *testing.T) {
- tests := map[string]int{
- "abcabcbb": 3,
- "bbbbb": 1,
- "pwwkew": 3,
- "abcdef": 6,
- }
-
- for in, want := range tests {
- got := lengthOfLongestSubstring(in)
- if got != want {
- t.Fatalf("in: %v, got: %v, want: %v", in, got, want)
- }
- }
-}
diff --git a/problems/longest-turbulent-subarray/README.md b/problems/longest-turbulent-subarray/README.md
deleted file mode 100644
index f73561019..000000000
--- a/problems/longest-turbulent-subarray/README.md
+++ /dev/null
@@ -1,72 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../squares-of-a-sorted-array "Squares of a Sorted Array")
-
-[Next >](../distribute-coins-in-binary-tree "Distribute Coins in Binary Tree")
-
-## [978. Longest Turbulent Subarray (Medium)](https://leetcode.com/problems/longest-turbulent-subarray "最长湍流子数组")
-
-
Given an integer array arr, return the length of a maximum size turbulent subarray ofarr.
-
-
A subarray is turbulent if the comparison sign flips between each adjacent pair of elements in the subarray.
-
-
More formally, a subarray [arr[i], arr[i + 1], ..., arr[j]] of arr is said to be turbulent if and only if:
Given two strings a and b, return the length of the longest uncommon subsequence between aandb. If the longest uncommon subsequence does not exist, return -1.
-
-
An uncommon subsequence between two strings is a string that is a subsequence of one but not the other.
-
-
A subsequence of a string s is a string that can be obtained after deleting any number of characters from s.
-
-
-
For example, "abc" is a subsequence of "aebdc" because you can delete the underlined characters in "aebdc" to get "abc". Other subsequences of "aebdc" include "aebdc", "aeb", and "" (empty string).
-
-
-
-
Example 1:
-
-
-Input: a = "aba", b = "cdc"
-Output: 3
-Explanation: One longest uncommon subsequence is "aba" because "aba" is a subsequence of "aba" but not "cdc".
-Note that "cdc" is also a longest uncommon subsequence.
-
-
-
Example 2:
-
-
-Input: a = "aaa", b = "bbb"
-Output: 3
-Explanation: The longest uncommon subsequences are "aaa" and "bbb".
-
-
-
Example 3:
-
-
-Input: a = "aaa", b = "aaa"
-Output: -1
-Explanation: Every subsequence of string a is also a subsequence of string b. Similarly, every subsequence of string b is also a subsequence of string a.
-
Given an array of strings strs, return the length of the longest uncommon subsequence between them. If the longest uncommon subsequence does not exist, return -1.
-
-
An uncommon subsequence between an array of strings is a string that is a subsequence of one string but not the others.
-
-
A subsequence of a string s is a string that can be obtained after deleting any number of characters from s.
-
-
-
For example, "abc" is a subsequence of "aebdc" because you can delete the underlined characters in "aebdc" to get "abc". Other subsequences of "aebdc" include "aebdc", "aeb", and "" (empty string).
Given the root of a binary tree, return the length of the longest path, where each node in the path has the same value. This path may or may not pass through the root.
-
-
The length of the path between two nodes is represented by the number of edges between them.
-
-
-
Example 1:
-
-
-Input: root = [5,4,5,1,1,5]
-Output: 2
-
-
-
Example 2:
-
-
-Input: root = [1,4,5,4,4,5]
-Output: 2
-
-
-
-
Constraints:
-
-
-
The number of nodes in the tree is in the range [0, 104].
Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring.
-
-
-
Example 1:
-
-
-Input: s = "(()"
-Output: 2
-Explanation: The longest valid parentheses substring is "()".
-
-
-
Example 2:
-
-
-Input: s = ")()())"
-Output: 4
-Explanation: The longest valid parentheses substring is "()()".
-
-
-
Example 3:
-
-
-Input: s = ""
-Output: 0
-
-
-
-
Constraints:
-
-
-
0 <= s.length <= 3 * 104
-
s[i] is '(', or ')'.
-
-
-### Related Topics
- [[Stack](../../tag/stack/README.md)]
- [[String](../../tag/string/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Similar Questions
- 1. [Valid Parentheses](../valid-parentheses) (Easy)
diff --git a/problems/longest-valid-parentheses/longest_valid_parentheses.go b/problems/longest-valid-parentheses/longest_valid_parentheses.go
deleted file mode 100644
index 138fca601..000000000
--- a/problems/longest-valid-parentheses/longest_valid_parentheses.go
+++ /dev/null
@@ -1,26 +0,0 @@
-package problem32
-
-func longestValidParentheses(s string) int {
- ans, l := 0, len(s)
- dp := make([]int, l)
- for i, c := range s {
- if i == 0 || c == '(' {
- continue
- }
- if s[i-1] == '(' {
- dp[i] = 2
- if i > 1 {
- dp[i] += dp[i-2]
- }
- } else if i > dp[i-1] && s[i-1-dp[i-1]] == '(' {
- dp[i] = dp[i-1] + 2
- if i-1 > dp[i-1] {
- dp[i] += dp[i-2-dp[i-1]]
- }
- }
- if dp[i] > ans {
- ans = dp[i]
- }
- }
- return ans
-}
diff --git a/problems/longest-valid-parentheses/longest_valid_parentheses_test.go b/problems/longest-valid-parentheses/longest_valid_parentheses_test.go
deleted file mode 100644
index d77b2d465..000000000
--- a/problems/longest-valid-parentheses/longest_valid_parentheses_test.go
+++ /dev/null
@@ -1,35 +0,0 @@
-package problem32
-
-import "testing"
-
-type testType struct {
- in string
- want int
-}
-
-func TestLongestValidParentheses(t *testing.T) {
- tests := [...]testType{
- {
- in: "(()",
- want: 2,
- },
- {
- in: ")()())",
- want: 4,
- },
- {
- in: ")()())(())()(",
- want: 6,
- },
- {
- in: "()(())",
- want: 6,
- },
- }
- for _, tt := range tests {
- got := longestValidParentheses(tt.in)
- if got != tt.want {
- t.Fatalf("in: %v, got: %v, want: %v", tt.in, got, tt.want)
- }
- }
-}
diff --git a/problems/longest-well-performing-interval/README.md b/problems/longest-well-performing-interval/README.md
deleted file mode 100644
index d9318ddc4..000000000
--- a/problems/longest-well-performing-interval/README.md
+++ /dev/null
@@ -1,62 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../lowest-common-ancestor-of-deepest-leaves "Lowest Common Ancestor of Deepest Leaves")
-
-[Next >](../smallest-sufficient-team "Smallest Sufficient Team")
-
-## [1124. Longest Well-Performing Interval (Medium)](https://leetcode.com/problems/longest-well-performing-interval "表现良好的最长时间段")
-
-
We are given hours, a list of the number of hours worked per day for a given employee.
-
-
A day is considered to be a tiring day if and only if the number of hours worked is (strictly) greater than 8.
-
-
A well-performing interval is an interval of days for which the number of tiring days is strictly larger than the number of non-tiring days.
-
-
Return the length of the longest well-performing interval.
-
-
-
Example 1:
-
-
-Input: hours = [9,9,6,0,6,6,9]
-Output: 3
-Explanation: The longest well-performing interval is [9,9,6].
-
-
-
Example 2:
-
-
-Input: hours = [6,6,6]
-Output: 0
-
-
-
-
Constraints:
-
-
-
1 <= hours.length <= 104
-
0 <= hours[i] <= 16
-
-
-### Related Topics
- [[Stack](../../tag/stack/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Prefix Sum](../../tag/prefix-sum/README.md)]
- [[Monotonic Stack](../../tag/monotonic-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/longest-well-performing-interval/longest_well_performing_interval.go b/problems/longest-well-performing-interval/longest_well_performing_interval.go
deleted file mode 100644
index 80ccb2806..000000000
--- a/problems/longest-well-performing-interval/longest_well_performing_interval.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem1124
diff --git a/problems/longest-winning-streak/README.md b/problems/longest-winning-streak/README.md
deleted file mode 100644
index d136c15df..000000000
--- a/problems/longest-winning-streak/README.md
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-and-sum-of-array "Maximum AND Sum of Array")
-
-Next >
-
-## [2173. Longest Winning Streak (Hard)](https://leetcode.com/problems/longest-winning-streak "")
-
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/longest-winning-streak/mysql_schemas.sql b/problems/longest-winning-streak/mysql_schemas.sql
deleted file mode 100644
index 6da5cb0fb..000000000
--- a/problems/longest-winning-streak/mysql_schemas.sql
+++ /dev/null
@@ -1,10 +0,0 @@
-Create table If Not Exists Matches (player_id int, match_day date, result ENUM('Win', 'Draw', 'Lose'));
-Truncate table Matches;
-insert into Matches (player_id, match_day, result) values ('1', '2022-01-17', 'Win');
-insert into Matches (player_id, match_day, result) values ('1', '2022-01-18', 'Win');
-insert into Matches (player_id, match_day, result) values ('1', '2022-01-25', 'Win');
-insert into Matches (player_id, match_day, result) values ('1', '2022-01-31', 'Draw');
-insert into Matches (player_id, match_day, result) values ('1', '2022-02-08', 'Win');
-insert into Matches (player_id, match_day, result) values ('2', '2022-02-06', 'Lose');
-insert into Matches (player_id, match_day, result) values ('2', '2022-02-08', 'Lose');
-insert into Matches (player_id, match_day, result) values ('3', '2022-03-30', 'Win');
diff --git a/problems/longest-word-in-dictionary-through-deleting/README.md b/problems/longest-word-in-dictionary-through-deleting/README.md
deleted file mode 100644
index 4569d4553..000000000
--- a/problems/longest-word-in-dictionary-through-deleting/README.md
+++ /dev/null
@@ -1,48 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../continuous-subarray-sum "Continuous Subarray Sum")
-
-[Next >](../contiguous-array "Contiguous Array")
-
-## [524. Longest Word in Dictionary through Deleting (Medium)](https://leetcode.com/problems/longest-word-in-dictionary-through-deleting "通过删除字母匹配到字典里最长单词")
-
-
Given a string s and a string array dictionary, return the longest string in the dictionary that can be formed by deleting some of the given string characters. If there is more than one possible result, return the longest word with the smallest lexicographical order. If there is no possible result, return the empty string.
-
-
-
Example 1:
-
-
-Input: s = "abpcplea", dictionary = ["ale","apple","monkey","plea"]
-Output: "apple"
-
-
-
Example 2:
-
-
-Input: s = "abpcplea", dictionary = ["a","b","c"]
-Output: "a"
-
-
-
-
Constraints:
-
-
-
1 <= s.length <= 1000
-
1 <= dictionary.length <= 1000
-
1 <= dictionary[i].length <= 1000
-
s and dictionary[i] consist of lowercase English letters.
Given an array of strings words representing an English Dictionary, return the longest word inwordsthat can be built one character at a time by other words inwords.
-
-
If there is more than one possible answer, return the longest word with the smallest lexicographical order. If there is no answer, return the empty string.
-
-
-
Example 1:
-
-
-Input: words = ["w","wo","wor","worl","world"]
-Output: "world"
-Explanation: The word "world" can be built one character at a time by "w", "wo", "wor", and "worl".
-
-
-
Example 2:
-
-
-Input: words = ["a","banana","app","appl","ap","apply","apple"]
-Output: "apple"
-Explanation: Both "apply" and "apple" can be built from other words in the dictionary. However, "apple" is lexicographically smaller than "apply".
-
-
-
-
Constraints:
-
-
-
1 <= words.length <= 1000
-
1 <= words[i].length <= 30
-
words[i] consists of lowercase English letters.
-
-
-### Related Topics
- [[Trie](../../tag/trie/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Similar Questions
- 1. [Longest Word in Dictionary through Deleting](../longest-word-in-dictionary-through-deleting) (Medium)
- 1. [Implement Magic Dictionary](../implement-magic-dictionary) (Medium)
-
-### Hints
-
-Hint 1
-For every word in the input list, we can check whether all prefixes of that word are in the input list by using a Set.
-
diff --git a/problems/longest-word-in-dictionary/longest_word_in_dictionary.go b/problems/longest-word-in-dictionary/longest_word_in_dictionary.go
deleted file mode 100644
index 62df4f52a..000000000
--- a/problems/longest-word-in-dictionary/longest_word_in_dictionary.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem720
diff --git a/problems/longest-word-in-dictionary/longest_word_in_dictionary_test.go b/problems/longest-word-in-dictionary/longest_word_in_dictionary_test.go
deleted file mode 100644
index 62df4f52a..000000000
--- a/problems/longest-word-in-dictionary/longest_word_in_dictionary_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem720
diff --git a/problems/longest-word-with-all-prefixes/README.md b/problems/longest-word-with-all-prefixes/README.md
deleted file mode 100644
index f43785bbb..000000000
--- a/problems/longest-word-with-all-prefixes/README.md
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../largest-color-value-in-a-directed-graph "Largest Color Value in a Directed Graph")
-
-[Next >](../sorting-the-sentence "Sorting the Sentence")
-
-## [1858. Longest Word With All Prefixes (Medium)](https://leetcode.com/problems/longest-word-with-all-prefixes "包含所有前缀的最长单词")
-
-
-
-### Related Topics
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Trie](../../tag/trie/README.md)]
-
-### Hints
-
-Hint 1
-Add all the words to a trie.
-
-
-
-Hint 2
-Check the longest path where all the nodes are words.
-
diff --git a/problems/longest-zigzag-path-in-a-binary-tree/README.md b/problems/longest-zigzag-path-in-a-binary-tree/README.md
deleted file mode 100644
index 9790e1013..000000000
--- a/problems/longest-zigzag-path-in-a-binary-tree/README.md
+++ /dev/null
@@ -1,71 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../find-the-longest-substring-containing-vowels-in-even-counts "Find the Longest Substring Containing Vowels in Even Counts")
-
-[Next >](../maximum-sum-bst-in-binary-tree "Maximum Sum BST in Binary Tree")
-
-## [1372. Longest ZigZag Path in a Binary Tree (Medium)](https://leetcode.com/problems/longest-zigzag-path-in-a-binary-tree "二叉树中的最长交错路径")
-
-
You are given the root of a binary tree.
-
-
A ZigZag path for a binary tree is defined as follow:
-
-
-
Choose any node in the binary tree and a direction (right or left).
-
If the current direction is right, move to the right child of the current node; otherwise, move to the left child.
-
Change the direction from right to left or from left to right.
-
Repeat the second and third steps until you can't move in the tree.
-
-
-
Zigzag length is defined as the number of nodes visited - 1. (A single node has a length of 0).
-
-
Return the longest ZigZag path contained in that tree.
-
-
-
Example 1:
-
-
-Input: root = [1,null,1,1,1,null,null,1,1,null,1,null,null,null,1,null,1]
-Output: 3
-Explanation: Longest ZigZag path in blue nodes (right -> left -> right).
-
-
-
Example 2:
-
-
-Input: root = [1,1,1,null,1,null,null,1,1,null,1]
-Output: 4
-Explanation: Longest ZigZag path in blue nodes (left -> right -> left -> right).
-
-
-
Example 3:
-
-
-Input: root = [1]
-Output: 0
-
-
-
-
Constraints:
-
-
-
The number of nodes in the tree is in the range [1, 5 * 104].
-
1 <= Node.val <= 100
-
-
-### Related Topics
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Tree](../../tag/tree/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Binary Tree](../../tag/binary-tree/README.md)]
-
-### Hints
-
-Hint 1
-Create this function maxZigZag(node, direction) maximum zigzag given a node and direction (right or left).
-
diff --git a/problems/loud-and-rich/README.md b/problems/loud-and-rich/README.md
deleted file mode 100644
index 051aa61ab..000000000
--- a/problems/loud-and-rich/README.md
+++ /dev/null
@@ -1,61 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../rectangle-area-ii "Rectangle Area II")
-
-[Next >](../peak-index-in-a-mountain-array "Peak Index in a Mountain Array")
-
-## [851. Loud and Rich (Medium)](https://leetcode.com/problems/loud-and-rich "喧闹和富有")
-
-
There is a group of n people labeled from 0 to n - 1 where each person has a different amount of money and a different level of quietness.
-
-
You are given an array richer where richer[i] = [ai, bi] indicates that ai has more money than bi and an integer array quiet where quiet[i] is the quietness of the ith person. All the given data in richer are logically correct (i.e., the data will not lead you to a situation where x is richer than y and y is richer than x at the same time).
-
-
Return an integer array answer where answer[x] = y if y is the least quiet person (that is, the person y with the smallest value of quiet[y]) among all people who definitely have equal to or more money than the person x.
-
-
-
Example 1:
-
-
-Input: richer = [[1,0],[2,1],[3,1],[3,7],[4,3],[5,3],[6,3]], quiet = [3,2,5,4,6,1,7,0]
-Output: [5,5,2,5,4,5,6,7]
-Explanation:
-answer[0] = 5.
-Person 5 has more money than 3, which has more money than 1, which has more money than 0.
-The only person who is quieter (has lower quiet[x]) is person 7, but it is not clear if they have more money than person 0.
-answer[7] = 7.
-Among all people that definitely have equal to or more money than person 7 (which could be persons 3, 4, 5, 6, or 7), the person who is the quietest (has lower quiet[x]) is person 7.
-The other answers can be filled out with similar reasoning.
-
-
-
Example 2:
-
-
-Input: richer = [], quiet = [0]
-Output: [0]
-
-
-
-
Constraints:
-
-
-
n == quiet.length
-
1 <= n <= 500
-
0 <= quiet[i] < n
-
All the values of quiet are unique.
-
0 <= richer.length <= n * (n - 1) / 2
-
0 <= ai, bi < n
-
ai != bi
-
All the pairs of richer are unique.
-
The observations in richer are all logically consistent.
-
-
-### Related Topics
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Graph](../../tag/graph/README.md)]
- [[Topological Sort](../../tag/topological-sort/README.md)]
- [[Array](../../tag/array/README.md)]
diff --git a/problems/loud-and-rich/loud_and_rich.go b/problems/loud-and-rich/loud_and_rich.go
deleted file mode 100644
index f724c8ef0..000000000
--- a/problems/loud-and-rich/loud_and_rich.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem851
diff --git a/problems/loud-and-rich/loud_and_rich_test.go b/problems/loud-and-rich/loud_and_rich_test.go
deleted file mode 100644
index f724c8ef0..000000000
--- a/problems/loud-and-rich/loud_and_rich_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem851
diff --git a/problems/low-quality-problems/README.md b/problems/low-quality-problems/README.md
deleted file mode 100644
index 09b5a0c7a..000000000
--- a/problems/low-quality-problems/README.md
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-number-of-ways-to-partition-an-array "Maximum Number of Ways to Partition an Array")
-
-[Next >](../minimum-moves-to-convert-string "Minimum Moves to Convert String")
-
-## [2026. Low-Quality Problems (Easy)](https://leetcode.com/problems/low-quality-problems "低质量的问题")
-
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/low-quality-problems/mysql_schemas.sql b/problems/low-quality-problems/mysql_schemas.sql
deleted file mode 100644
index 07951b77f..000000000
--- a/problems/low-quality-problems/mysql_schemas.sql
+++ /dev/null
@@ -1,8 +0,0 @@
-Create table If Not Exists Problems (problem_id int, likes int, dislikes int);
-Truncate table Problems;
-insert into Problems (problem_id, likes, dislikes) values ('6', '1290', '425');
-insert into Problems (problem_id, likes, dislikes) values ('11', '2677', '8659');
-insert into Problems (problem_id, likes, dislikes) values ('1', '4446', '2760');
-insert into Problems (problem_id, likes, dislikes) values ('7', '8569', '6086');
-insert into Problems (problem_id, likes, dislikes) values ('13', '2050', '4164');
-insert into Problems (problem_id, likes, dislikes) values ('10', '9002', '7446');
diff --git a/problems/lowest-common-ancestor-of-a-binary-search-tree/README.md b/problems/lowest-common-ancestor-of-a-binary-search-tree/README.md
deleted file mode 100644
index ec0abe1e0..000000000
--- a/problems/lowest-common-ancestor-of-a-binary-search-tree/README.md
+++ /dev/null
@@ -1,61 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../palindrome-linked-list "Palindrome Linked List")
-
-[Next >](../lowest-common-ancestor-of-a-binary-tree "Lowest Common Ancestor of a Binary Tree")
-
-## [235. Lowest Common Ancestor of a Binary Search Tree (Easy)](https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-search-tree "二叉搜索树的最近公共祖先")
-
-
Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST.
-
-
According to the definition of LCA on Wikipedia: “The lowest common ancestor is defined between two nodes p and q as the lowest node in T that has both p and q as descendants (where we allow a node to be a descendant of itself).”
-
-
-
Example 1:
-
-
-Input: root = [6,2,8,0,4,7,9,null,null,3,5], p = 2, q = 8
-Output: 6
-Explanation: The LCA of nodes 2 and 8 is 6.
-
-
-
Example 2:
-
-
-Input: root = [6,2,8,0,4,7,9,null,null,3,5], p = 2, q = 4
-Output: 2
-Explanation: The LCA of nodes 2 and 4 is 2, since a node can be a descendant of itself according to the LCA definition.
-
-
-
Example 3:
-
-
-Input: root = [2,1], p = 2, q = 1
-Output: 2
-
-
-
-
Constraints:
-
-
-
The number of nodes in the tree is in the range [2, 105].
-
-109 <= Node.val <= 109
-
All Node.val are unique.
-
p != q
-
p and q will exist in the BST.
-
-
-### Related Topics
- [[Tree](../../tag/tree/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Binary Search Tree](../../tag/binary-search-tree/README.md)]
- [[Binary Tree](../../tag/binary-tree/README.md)]
-
-### Similar Questions
- 1. [Lowest Common Ancestor of a Binary Tree](../lowest-common-ancestor-of-a-binary-tree) (Medium)
- 1. [Smallest Common Region](../smallest-common-region) (Medium)
diff --git a/problems/lowest-common-ancestor-of-a-binary-search-tree/lowest_common_ancestor_of_a_binary_search_tree.go b/problems/lowest-common-ancestor-of-a-binary-search-tree/lowest_common_ancestor_of_a_binary_search_tree.go
deleted file mode 100644
index 2f33d7cc8..000000000
--- a/problems/lowest-common-ancestor-of-a-binary-search-tree/lowest_common_ancestor_of_a_binary_search_tree.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem235
diff --git a/problems/lowest-common-ancestor-of-a-binary-search-tree/lowest_common_ancestor_of_a_binary_search_tree_test.go b/problems/lowest-common-ancestor-of-a-binary-search-tree/lowest_common_ancestor_of_a_binary_search_tree_test.go
deleted file mode 100644
index 2f33d7cc8..000000000
--- a/problems/lowest-common-ancestor-of-a-binary-search-tree/lowest_common_ancestor_of_a_binary_search_tree_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem235
diff --git a/problems/lowest-common-ancestor-of-a-binary-tree-ii/README.md b/problems/lowest-common-ancestor-of-a-binary-tree-ii/README.md
deleted file mode 100644
index bd6b7bf17..000000000
--- a/problems/lowest-common-ancestor-of-a-binary-tree-ii/README.md
+++ /dev/null
@@ -1,30 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../kth-smallest-instructions "Kth Smallest Instructions")
-
-[Next >](../hopper-company-queries-ii "Hopper Company Queries II")
-
-## [1644. Lowest Common Ancestor of a Binary Tree II (Medium)](https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree-ii "二叉树的最近公共祖先 II")
-
-
-
-### Related Topics
- [[Tree](../../tag/tree/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Binary Tree](../../tag/binary-tree/README.md)]
-
-### Hints
-
-Hint 1
-Traverse the graph visiting root, left, root, right, root to make an Euler Path
-
-
-
-Hint 2
-Return the node (LCA) that is at the lowest depth between p and q in the Euler Path
-
diff --git a/problems/lowest-common-ancestor-of-a-binary-tree-iii/README.md b/problems/lowest-common-ancestor-of-a-binary-tree-iii/README.md
deleted file mode 100644
index 856c04b3a..000000000
--- a/problems/lowest-common-ancestor-of-a-binary-tree-iii/README.md
+++ /dev/null
@@ -1,30 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../create-sorted-array-through-instructions "Create Sorted Array through Instructions")
-
-[Next >](../hopper-company-queries-iii "Hopper Company Queries III")
-
-## [1650. Lowest Common Ancestor of a Binary Tree III (Medium)](https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree-iii "二叉树的最近公共祖先 III")
-
-
-
-### Related Topics
- [[Tree](../../tag/tree/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Binary Tree](../../tag/binary-tree/README.md)]
-
-### Hints
-
-Hint 1
-Store the path from p to the root.
-
-
-
-Hint 2
-Traverse the path from q to the root, the first common point of the two paths is the LCA.
-
diff --git a/problems/lowest-common-ancestor-of-a-binary-tree-iv/README.md b/problems/lowest-common-ancestor-of-a-binary-tree-iv/README.md
deleted file mode 100644
index a616f79c8..000000000
--- a/problems/lowest-common-ancestor-of-a-binary-tree-iv/README.md
+++ /dev/null
@@ -1,43 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimize-deviation-in-array "Minimize Deviation in Array")
-
-[Next >](../products-worth-over-invoices "Product's Worth Over Invoices")
-
-## [1676. Lowest Common Ancestor of a Binary Tree IV (Medium)](https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree-iv "二叉树的最近公共祖先 IV")
-
-
-
-### Related Topics
- [[Tree](../../tag/tree/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Binary Tree](../../tag/binary-tree/README.md)]
-
-### Similar Questions
- 1. [Lowest Common Ancestor of a Binary Search Tree](../lowest-common-ancestor-of-a-binary-search-tree) (Easy)
- 1. [Lowest Common Ancestor of a Binary Tree](../lowest-common-ancestor-of-a-binary-tree) (Medium)
- 1. [Lowest Common Ancestor of Deepest Leaves](../lowest-common-ancestor-of-deepest-leaves) (Medium)
- 1. [Lowest Common Ancestor of a Binary Tree II](../lowest-common-ancestor-of-a-binary-tree-ii) (Medium)
- 1. [Lowest Common Ancestor of a Binary Tree III](../lowest-common-ancestor-of-a-binary-tree-iii) (Medium)
- 1. [Lowest Common Ancestor of a Binary Tree IV](../lowest-common-ancestor-of-a-binary-tree-iv) (Medium)
-
-### Hints
-
-Hint 1
-Starting from the root, traverse the left and the right subtrees, checking if one of the nodes exist there.
-
-
-
-Hint 2
-If one of the subtrees doesn't contain any given node, the LCA can be the node returned from the other subtree
-
-
-
-Hint 3
-If both subtrees contain nodes, the LCA node is the current node.
-
diff --git a/problems/lowest-common-ancestor-of-a-binary-tree/README.md b/problems/lowest-common-ancestor-of-a-binary-tree/README.md
deleted file mode 100644
index bd54f479f..000000000
--- a/problems/lowest-common-ancestor-of-a-binary-tree/README.md
+++ /dev/null
@@ -1,60 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../lowest-common-ancestor-of-a-binary-search-tree "Lowest Common Ancestor of a Binary Search Tree")
-
-[Next >](../delete-node-in-a-linked-list "Delete Node in a Linked List")
-
-## [236. Lowest Common Ancestor of a Binary Tree (Medium)](https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree "二叉树的最近公共祖先")
-
-
Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree.
-
-
According to the definition of LCA on Wikipedia: “The lowest common ancestor is defined between two nodes p and q as the lowest node in T that has both p and q as descendants (where we allow a node to be a descendant of itself).”
-
-
-
Example 1:
-
-
-Input: root = [3,5,1,6,2,0,8,null,null,7,4], p = 5, q = 1
-Output: 3
-Explanation: The LCA of nodes 5 and 1 is 3.
-
-
-
Example 2:
-
-
-Input: root = [3,5,1,6,2,0,8,null,null,7,4], p = 5, q = 4
-Output: 5
-Explanation: The LCA of nodes 5 and 4 is 5, since a node can be a descendant of itself according to the LCA definition.
-
-
-
Example 3:
-
-
-Input: root = [1,2], p = 1, q = 2
-Output: 1
-
-
-
-
Constraints:
-
-
-
The number of nodes in the tree is in the range [2, 105].
Given the root of a binary tree, return the lowest common ancestor of its deepest leaves.
-
-
Recall that:
-
-
-
The node of a binary tree is a leaf if and only if it has no children
-
The depth of the root of the tree is 0. if the depth of a node is d, the depth of each of its children is d + 1.
-
The lowest common ancestor of a set S of nodes, is the node A with the largest depth such that every node in S is in the subtree with root A.
-
-
-
-
Example 1:
-
-
-Input: root = [3,5,1,6,2,0,8,null,null,7,4]
-Output: [2,7,4]
-Explanation: We return the node with value 2, colored in yellow in the diagram.
-The nodes coloured in blue are the deepest leaf-nodes of the tree.
-Note that nodes 6, 0, and 8 are also leaf nodes, but the depth of them is 2, but the depth of nodes 7 and 4 is 3.
-
-
Example 2:
-
-
-Input: root = [1]
-Output: [1]
-Explanation: The root is the deepest node in the tree, and it's the lca of itself.
-
-
-
Example 3:
-
-
-Input: root = [0,1,3,null,2]
-Output: [2]
-Explanation: The deepest leaf node in the tree is 2, the lca of one node is itself.
-
-
-
-
Constraints:
-
-
-
The number of nodes in the tree will be in the range [1, 1000].
LRUCache(int capacity) Initialize the LRU cache with positive size capacity.
-
int get(int key) Return the value of the key if the key exists, otherwise return -1.
-
void put(int key, int value) Update the value of the key if the key exists. Otherwise, add the key-value pair to the cache. If the number of keys exceeds the capacity from this operation, evict the least recently used key.
-
-
-
The functions get and put must each run in O(1) average time complexity.
At most 2 * 105 calls will be made to get and put.
-
-
-### Related Topics
- [[Design](../../tag/design/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Linked List](../../tag/linked-list/README.md)]
- [[Doubly-Linked List](../../tag/doubly-linked-list/README.md)]
-
-### Similar Questions
- 1. [LFU Cache](../lfu-cache) (Hard)
- 1. [Design In-Memory File System](../design-in-memory-file-system) (Hard)
- 1. [Design Compressed String Iterator](../design-compressed-string-iterator) (Easy)
diff --git a/problems/lru-cache/lru_cache.go b/problems/lru-cache/lru_cache.go
deleted file mode 100644
index 837f672d4..000000000
--- a/problems/lru-cache/lru_cache.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem146
diff --git a/problems/lru-cache/lru_cache_test.go b/problems/lru-cache/lru_cache_test.go
deleted file mode 100644
index 837f672d4..000000000
--- a/problems/lru-cache/lru_cache_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem146
diff --git a/problems/lucky-numbers-in-a-matrix/README.md b/problems/lucky-numbers-in-a-matrix/README.md
deleted file mode 100644
index a48481978..000000000
--- a/problems/lucky-numbers-in-a-matrix/README.md
+++ /dev/null
@@ -1,75 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../find-a-corresponding-node-of-a-binary-tree-in-a-clone-of-that-tree "Find a Corresponding Node of a Binary Tree in a Clone of That Tree")
-
-[Next >](../design-a-stack-with-increment-operation "Design a Stack With Increment Operation")
-
-## [1380. Lucky Numbers in a Matrix (Easy)](https://leetcode.com/problems/lucky-numbers-in-a-matrix "矩阵中的幸运数")
-
-
Given an m x n matrix of distinct numbers, return all lucky numbers in the matrix in any order.
-
-
A lucky number is an element of the matrix such that it is the minimum element in its row and maximum in its column.
-
-
-
Example 1:
-
-
-Input: matrix = [[3,7,8],[9,11,13],[15,16,17]]
-Output: [15]
-Explanation: 15 is the only lucky number since it is the minimum in its row and the maximum in its column
-
-
-
Example 2:
-
-
-Input: matrix = [[1,10,4,2],[9,3,8,7],[15,16,17,12]]
-Output: [12]
-Explanation: 12 is the only lucky number since it is the minimum in its row and the maximum in its column.
-
-
-
Example 3:
-
-
-Input: matrix = [[7,8],[1,2]]
-Output: [7]
-Explanation: 7 is the only lucky number since it is the minimum in its row and the maximum in its column.
-
-
-
Example 4:
-
-
-Input: matrix = [[3,6],[7,1],[5,2],[4,8]]
-Output: []
-Explanation: There is no lucky number.
-
-
-
-
Constraints:
-
-
-
m == mat.length
-
n == mat[i].length
-
1 <= n, m <= 50
-
1 <= matrix[i][j] <= 105.
-
All elements in the matrix are distinct.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
-
-### Hints
-
-Hint 1
-Find out and save the minimum of each row and maximum of each column in two lists.
-
-
-
-Hint 2
-Then scan through the whole matrix to identify the elements that satisfy the criteria.
-
diff --git a/problems/magic-squares-in-grid/README.md b/problems/magic-squares-in-grid/README.md
deleted file mode 100644
index 64e497d1a..000000000
--- a/problems/magic-squares-in-grid/README.md
+++ /dev/null
@@ -1,66 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../similar-string-groups "Similar String Groups")
-
-[Next >](../keys-and-rooms "Keys and Rooms")
-
-## [840. Magic Squares In Grid (Medium)](https://leetcode.com/problems/magic-squares-in-grid "矩阵中的幻方")
-
-
A 3 x 3 magic square is a 3 x 3 grid filled with distinct numbers from 1 to 9 such that each row, column, and both diagonals all have the same sum.
-
-
Given a row x colgrid of integers, how many 3 x 3 "magic square" subgrids are there? (Each subgrid is contiguous).
-
-
-
Example 1:
-
-
-Input: grid = [[4,3,8,4],[9,5,1,9],[2,7,6,2]]
-Output: 1
-Explanation:
-The following subgrid is a 3 x 3 magic square:
-
-while this one is not:
-
-In total, there is only one magic square inside the given grid.
-
A magical string s consists of only '1' and '2' and obeys the following rules:
-
-
-
The string s is magical because concatenating the number of contiguous occurrences of characters '1' and '2' generates the string s itself.
-
-
-
The first few elements of s is s = "1221121221221121122……". If we group the consecutive 1's and 2's in s, it will be "1 22 11 2 1 22 1 22 11 2 11 22 ......" and the occurrences of 1's or 2's in each group are "1 2 2 1 1 2 1 2 2 1 2 2 ......". You can see that the occurrence sequence is s itself.
-
-
Given an integer n, return the number of 1's in the first n number in the magical string s.
-
-
-
Example 1:
-
-
-Input: n = 6
-Output: 3
-Explanation: The first 6 elements of magical string s is "122112" and it contains three 1's, so return 3.
-
-
-
Example 2:
-
-
-Input: n = 1
-Output: 1
-
-
-
-
Constraints:
-
-
-
1 <= n <= 105
-
-
-### Related Topics
- [[Two Pointers](../../tag/two-pointers/README.md)]
- [[String](../../tag/string/README.md)]
diff --git a/problems/magical-string/magical_string.go b/problems/magical-string/magical_string.go
deleted file mode 100644
index 9895d2d66..000000000
--- a/problems/magical-string/magical_string.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem481
diff --git a/problems/magical-string/magical_string_test.go b/problems/magical-string/magical_string_test.go
deleted file mode 100644
index 9895d2d66..000000000
--- a/problems/magical-string/magical_string_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem481
diff --git a/problems/magnetic-force-between-two-balls/README.md b/problems/magnetic-force-between-two-balls/README.md
deleted file mode 100644
index f9fc9e02f..000000000
--- a/problems/magnetic-force-between-two-balls/README.md
+++ /dev/null
@@ -1,70 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-operations-to-make-array-equal "Minimum Operations to Make Array Equal")
-
-[Next >](../minimum-number-of-days-to-eat-n-oranges "Minimum Number of Days to Eat N Oranges")
-
-## [1552. Magnetic Force Between Two Balls (Medium)](https://leetcode.com/problems/magnetic-force-between-two-balls "两球之间的磁力")
-
-
In the universe Earth C-137, Rick discovered a special form of magnetic force between two balls if they are put in his new invented basket. Rick has n empty baskets, the ith basket is at position[i], Morty has m balls and needs to distribute the balls into the baskets such that the minimum magnetic force between any two balls is maximum.
-
-
Rick stated that magnetic force between two different balls at positions x and y is |x - y|.
-
-
Given the integer array position and the integer m. Return the required force.
-
-
-
Example 1:
-
-
-Input: position = [1,2,3,4,7], m = 3
-Output: 3
-Explanation: Distributing the 3 balls into baskets 1, 4 and 7 will make the magnetic force between ball pairs [3, 3, 6]. The minimum magnetic force is 3. We cannot achieve a larger minimum magnetic force than 3.
-
-
-
Example 2:
-
-
-Input: position = [5,4,3,2,1,1000000000], m = 2
-Output: 999999999
-Explanation: We can use baskets 1 and 1000000000.
-
-
-
-
Constraints:
-
-
-
n == position.length
-
2 <= n <= 105
-
1 <= position[i] <= 109
-
All integers in position are distinct.
-
2 <= m <= position.length
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Similar Questions
- 1. [Minimized Maximum of Products Distributed to Any Store](../minimized-maximum-of-products-distributed-to-any-store) (Medium)
-
-### Hints
-
-Hint 1
-If you can place balls such that the answer is x then you can do it for y where y < x.
-
-
-
-Hint 2
-Similarly if you cannot place balls such that the answer is x then you can do it for y where y > x.
-
-
-
-Hint 3
-Binary search on the answer and greedily see if it is possible.
-
diff --git a/problems/majority-element-ii/README.md b/problems/majority-element-ii/README.md
deleted file mode 100644
index 07c9879d8..000000000
--- a/problems/majority-element-ii/README.md
+++ /dev/null
@@ -1,65 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../summary-ranges "Summary Ranges")
-
-[Next >](../kth-smallest-element-in-a-bst "Kth Smallest Element in a BST")
-
-## [229. Majority Element II (Medium)](https://leetcode.com/problems/majority-element-ii "求众数 II")
-
-
Given an integer array of size n, find all elements that appear more than ⌊ n/3 ⌋ times.
-
-
-
Example 1:
-
-
-Input: nums = [3,2,3]
-Output: [3]
-
-
-
Example 2:
-
-
-Input: nums = [1]
-Output: [1]
-
-
-
Example 3:
-
-
-Input: nums = [1,2]
-Output: [1,2]
-
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 5 * 104
-
-109 <= nums[i] <= 109
-
-
-
-
Follow up: Could you solve the problem in linear time and in O(1) space?
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
- [[Counting](../../tag/counting/README.md)]
-
-### Similar Questions
- 1. [Majority Element](../majority-element) (Easy)
- 1. [Check If a Number Is Majority Element in a Sorted Array](../check-if-a-number-is-majority-element-in-a-sorted-array) (Easy)
-
-### Hints
-
-Hint 1
-How many majority elements could it possibly have?
-
-Do you have a better hint? Suggest it!
-
diff --git a/problems/majority-element-ii/majority_element_ii.go b/problems/majority-element-ii/majority_element_ii.go
deleted file mode 100644
index 66cf0b90d..000000000
--- a/problems/majority-element-ii/majority_element_ii.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem229
diff --git a/problems/majority-element-ii/majority_element_ii_test.go b/problems/majority-element-ii/majority_element_ii_test.go
deleted file mode 100644
index 66cf0b90d..000000000
--- a/problems/majority-element-ii/majority_element_ii_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem229
diff --git a/problems/majority-element/README.md b/problems/majority-element/README.md
deleted file mode 100644
index 0e1ec3228..000000000
--- a/problems/majority-element/README.md
+++ /dev/null
@@ -1,47 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../excel-sheet-column-title "Excel Sheet Column Title")
-
-[Next >](../two-sum-iii-data-structure-design "Two Sum III - Data structure design")
-
-## [169. Majority Element (Easy)](https://leetcode.com/problems/majority-element "多数元素")
-
-
Given an array nums of size n, return the majority element.
-
-
The majority element is the element that appears more than ⌊n / 2⌋ times. You may assume that the majority element always exists in the array.
-
-
-
Example 1:
-
Input: nums = [3,2,3]
-Output: 3
-
Example 2:
-
Input: nums = [2,2,1,1,1,2,2]
-Output: 2
-
-
-
Constraints:
-
-
-
n == nums.length
-
1 <= n <= 5 * 104
-
-231 <= nums[i] <= 231 - 1
-
-
-
-Follow-up: Could you solve the problem in linear time and in O(1) space?
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Divide and Conquer](../../tag/divide-and-conquer/README.md)]
- [[Counting](../../tag/counting/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Similar Questions
- 1. [Majority Element II](../majority-element-ii) (Medium)
- 1. [Check If a Number Is Majority Element in a Sorted Array](../check-if-a-number-is-majority-element-in-a-sorted-array) (Easy)
diff --git a/problems/majority-element/majority_element.go b/problems/majority-element/majority_element.go
deleted file mode 100644
index afc141c5f..000000000
--- a/problems/majority-element/majority_element.go
+++ /dev/null
@@ -1,17 +0,0 @@
-package problem169
-
-func majorityElement(nums []int) int {
- ans, count := 0, 0
- for _, n := range nums {
- if n == ans {
- count++
- } else {
- count--
- }
- if count <= 0 {
- ans = n
- count = 1
- }
- }
- return ans
-}
diff --git a/problems/majority-element/majority_element_test.go b/problems/majority-element/majority_element_test.go
deleted file mode 100644
index 168a96e87..000000000
--- a/problems/majority-element/majority_element_test.go
+++ /dev/null
@@ -1,35 +0,0 @@
-package problem169
-
-import "testing"
-
-type testType struct {
- in []int
- want int
-}
-
-func TestMajorityElement(t *testing.T) {
- tests := [...]testType{
- {
- in: []int{3, 2, 3},
- want: 3,
- },
- {
- in: []int{2, 2, 1, 1, 1, 2, 2},
- want: 2,
- },
- {
- in: []int{2, 2, 2, 2, 1, 1, 1},
- want: 2,
- },
- {
- in: []int{1},
- want: 1,
- },
- }
- for _, tt := range tests {
- got := majorityElement(tt.in)
- if got != tt.want {
- t.Fatalf("in: %v, got: %v, want: %v", tt.in, got, tt.want)
- }
- }
-}
diff --git a/problems/make-array-strictly-increasing/README.md b/problems/make-array-strictly-increasing/README.md
deleted file mode 100644
index 42344907a..000000000
--- a/problems/make-array-strictly-increasing/README.md
+++ /dev/null
@@ -1,68 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-subarray-sum-with-one-deletion "Maximum Subarray Sum with One Deletion")
-
-[Next >](../design-bounded-blocking-queue "Design Bounded Blocking Queue")
-
-## [1187. Make Array Strictly Increasing (Hard)](https://leetcode.com/problems/make-array-strictly-increasing "使数组严格递增")
-
-
Given two integer arrays arr1 and arr2, return the minimum number of operations (possibly zero) needed to make arr1 strictly increasing.
-
-
In one operation, you can choose two indices 0 <= i < arr1.length and 0 <= j < arr2.length and do the assignment arr1[i] = arr2[j].
-
-
If there is no way to make arr1 strictly increasing, return -1.
-Input: arr1 = [1,5,3,6,7], arr2 = [4,3,1]
-Output: 2
-Explanation: Replace 5 with 3 and then replace 3 with 4. arr1 = [1, 3, 4, 6, 7].
-
-
-
Example 3:
-
-
-Input: arr1 = [1,5,3,6,7], arr2 = [1,6,3,3]
-Output: -1
-Explanation: You can't make arr1 strictly increasing.
-
-
-
Constraints:
-
-
-
1 <= arr1.length, arr2.length <= 2000
-
0 <= arr1[i], arr2[i] <= 10^9
-
-
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Hints
-
-Hint 1
-Use dynamic programming.
-
-
-
-Hint 2
-The state would be the index in arr1 and the index of the previous element in arr2 after sorting it and removing duplicates.
-
diff --git a/problems/make-sum-divisible-by-p/README.md b/problems/make-sum-divisible-by-p/README.md
deleted file mode 100644
index bcdc0d891..000000000
--- a/problems/make-sum-divisible-by-p/README.md
+++ /dev/null
@@ -1,73 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-sum-obtained-of-any-permutation "Maximum Sum Obtained of Any Permutation")
-
-[Next >](../strange-printer-ii "Strange Printer II")
-
-## [1590. Make Sum Divisible by P (Medium)](https://leetcode.com/problems/make-sum-divisible-by-p "使数组和能被 P 整除")
-
-
Given an array of positive integers nums, remove the smallest subarray (possibly empty) such that the sum of the remaining elements is divisible by p. It is not allowed to remove the whole array.
-
-
Return the length of the smallest subarray that you need to remove, or -1 if it's impossible.
-
-
A subarray is defined as a contiguous block of elements in the array.
-
-
-
Example 1:
-
-
-Input: nums = [3,1,4,2], p = 6
-Output: 1
-Explanation: The sum of the elements in nums is 10, which is not divisible by 6. We can remove the subarray [4], and the sum of the remaining elements is 6, which is divisible by 6.
-
-
-
Example 2:
-
-
-Input: nums = [6,3,5,2], p = 9
-Output: 2
-Explanation: We cannot remove a single element to get a sum divisible by 9. The best way is to remove the subarray [5,2], leaving us with [6,3] with sum 9.
-
-
-
Example 3:
-
-
-Input: nums = [1,2,3], p = 3
-Output: 0
-Explanation: Here the sum is 6. which is already divisible by 3. Thus we do not need to remove anything.
-
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 105
-
1 <= nums[i] <= 109
-
1 <= p <= 109
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Prefix Sum](../../tag/prefix-sum/README.md)]
-
-### Hints
-
-Hint 1
-Use prefix sums to calculate the subarray sums.
-
-
-
-Hint 2
-Suppose you know the remainder for the sum of the entire array. How does removing a subarray affect that remainder? What remainder does the subarray need to have in order to make the rest of the array sum up to be divisible by k?
-
-
-
-Hint 3
-Use a map to keep track of the rightmost index for every prefix sum % p.
-
diff --git a/problems/make-the-string-great/README.md b/problems/make-the-string-great/README.md
deleted file mode 100644
index 2f6e82d68..000000000
--- a/problems/make-the-string-great/README.md
+++ /dev/null
@@ -1,76 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../fix-product-name-format "Fix Product Name Format")
-
-[Next >](../find-kth-bit-in-nth-binary-string "Find Kth Bit in Nth Binary String")
-
-## [1544. Make The String Great (Easy)](https://leetcode.com/problems/make-the-string-great "整理字符串")
-
-
Given a string s of lower and upper case English letters.
-
-
A good string is a string which doesn't have two adjacent characterss[i] and s[i + 1] where:
-
-
-
0 <= i <= s.length - 2
-
s[i] is a lower-case letter and s[i + 1] is the same letter but in upper-case or vice-versa.
-
-
-
To make the string good, you can choose two adjacent characters that make the string bad and remove them. You can keep doing this until the string becomes good.
-
-
Return the string after making it good. The answer is guaranteed to be unique under the given constraints.
-
-
Notice that an empty string is also good.
-
-
-
Example 1:
-
-
-Input: s = "leEeetcode"
-Output: "leetcode"
-Explanation: In the first step, either you choose i = 1 or i = 2, both will result "leEeetcode" to be reduced to "leetcode".
-
-
-
Example 2:
-
-
-Input: s = "abBAcC"
-Output: ""
-Explanation: We have many possible scenarios, and all lead to the same answer. For example:
-"abBAcC" --> "aAcC" --> "cC" --> ""
-"abBAcC" --> "abBA" --> "aA" --> ""
-
-
-
Example 3:
-
-
-Input: s = "s"
-Output: "s"
-
-
-
-
Constraints:
-
-
-
1 <= s.length <= 100
-
s contains only lower and upper case English letters.
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
- [[Stack](../../tag/stack/README.md)]
-
-### Hints
-
-Hint 1
-The order you choose 2 characters to remove doesn't matter.
-
-
-
-Hint 2
-Keep applying the mentioned step to s till the length of the string is not changed.
-
diff --git a/problems/make-the-xor-of-all-segments-equal-to-zero/README.md b/problems/make-the-xor-of-all-segments-equal-to-zero/README.md
deleted file mode 100644
index 050bb69d1..000000000
--- a/problems/make-the-xor-of-all-segments-equal-to-zero/README.md
+++ /dev/null
@@ -1,64 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../number-of-restricted-paths-from-first-to-last-node "Number of Restricted Paths From First to Last Node")
-
-[Next >](../maximize-the-beauty-of-the-garden "Maximize the Beauty of the Garden")
-
-## [1787. Make the XOR of All Segments Equal to Zero (Hard)](https://leetcode.com/problems/make-the-xor-of-all-segments-equal-to-zero "使所有区间的异或结果为零")
-
-
You are given an array nums and an integer k. The XOR of a segment [left, right] where left <= right is the XOR of all the elements with indices between left and right, inclusive: nums[left] XOR nums[left+1] XOR ... XOR nums[right].
-
-
Return the minimum number of elements to change in the array such that the XOR of all segments of size k is equal to zero.
-
-
-
Example 1:
-
-
-Input: nums = [1,2,0,3,0], k = 1
-Output: 3
-Explanation: Modify the array from [1,2,0,3,0] to from [0,0,0,0,0].
-
-
-
Example 2:
-
-
-Input: nums = [3,4,5,2,1,7,3,4,7], k = 3
-Output: 3
-Explanation: Modify the array from [3,4,5,2,1,7,3,4,7] to [3,4,7,3,4,7,3,4,7].
-
-
-
Example 3:
-
-
-Input: nums = [1,2,4,1,2,5,1,2,6], k = 3
-Output: 3
-Explanation: Modify the array from [1,2,4,1,2,5,1,2,6] to [1,2,3,1,2,3,1,2,3].
-
-
-
Constraints:
-
-
-
1 <= k <= nums.length <= 2000
-
0 <= nums[i] < 210
-
-
-### Related Topics
- [[Bit Manipulation](../../tag/bit-manipulation/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Hints
-
-Hint 1
-Let's note that for the XOR of all segments with size K to be equal to zeros, nums[i] has to be equal to nums[i+k]
-
-
-
-Hint 2
-Basically, we need to make the first K elements have XOR = 0 and then modify them.
-
diff --git a/problems/make-two-arrays-equal-by-reversing-sub-arrays/README.md b/problems/make-two-arrays-equal-by-reversing-sub-arrays/README.md
deleted file mode 100644
index 3f98c203d..000000000
--- a/problems/make-two-arrays-equal-by-reversing-sub-arrays/README.md
+++ /dev/null
@@ -1,71 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../rectangles-area "Rectangles Area")
-
-[Next >](../check-if-a-string-contains-all-binary-codes-of-size-k "Check If a String Contains All Binary Codes of Size K")
-
-## [1460. Make Two Arrays Equal by Reversing Sub-arrays (Easy)](https://leetcode.com/problems/make-two-arrays-equal-by-reversing-sub-arrays "通过翻转子数组使两个数组相等")
-
-
You are given two integer arrays of equal length target and arr. In one step, you can select any non-empty sub-array of arr and reverse it. You are allowed to make any number of steps.
-
-
Return trueif you can make arr equal to target or false otherwise.
-
-
-
Example 1:
-
-
-Input: target = [1,2,3,4], arr = [2,4,1,3]
-Output: true
-Explanation: You can follow the next steps to convert arr to target:
-1- Reverse sub-array [2,4,1], arr becomes [1,4,2,3]
-2- Reverse sub-array [4,2], arr becomes [1,2,4,3]
-3- Reverse sub-array [4,3], arr becomes [1,2,3,4]
-There are multiple ways to convert arr to target, this is not the only way to do so.
-
-
-
Example 2:
-
-
-Input: target = [7], arr = [7]
-Output: true
-Explanation: arr is equal to target without any reverses.
-
-
-
Example 3:
-
-
-Input: target = [3,7,9], arr = [3,7,11]
-Output: false
-Explanation: arr does not have value 9 and it can never be converted to target.
-
-
-
-
Constraints:
-
-
-
target.length == arr.length
-
1 <= target.length <= 1000
-
1 <= target[i] <= 1000
-
1 <= arr[i] <= 1000
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Hints
-
-Hint 1
-Each element of target should have a corresponding element in arr, and if it doesn't have a corresponding element, return false.
-
-
-
-Hint 2
-To solve it easiely you can sort the two arrays and check if they are equal.
-
diff --git a/problems/making-a-large-island/README.md b/problems/making-a-large-island/README.md
deleted file mode 100644
index ecb878491..000000000
--- a/problems/making-a-large-island/README.md
+++ /dev/null
@@ -1,59 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../most-profit-assigning-work "Most Profit Assigning Work")
-
-[Next >](../count-unique-characters-of-all-substrings-of-a-given-string "Count Unique Characters of All Substrings of a Given String")
-
-## [827. Making A Large Island (Hard)](https://leetcode.com/problems/making-a-large-island "最大人工岛")
-
-
You are given an n x n binary matrix grid. You are allowed to change at most one0 to be 1.
-
-
Return the size of the largest island ingridafter applying this operation.
-
-
An island is a 4-directionally connected group of 1s.
-
-
-
Example 1:
-
-
-Input: grid = [[1,0],[0,1]]
-Output: 3
-Explanation: Change one 0 to 1 and connect two 1s, then we get an island with area = 3.
-
-
-
Example 2:
-
-
-Input: grid = [[1,1],[1,0]]
-Output: 4
-Explanation: Change the 0 to 1 and make the island bigger, only one island with area = 4.
-
-
Example 3:
-
-
-Input: grid = [[1,1],[1,1]]
-Output: 4
-Explanation: Can't change any 0 to 1, only one island with area = 4.
-
Given an array of strings names of size n. You will create n folders in your file system such that, at the ith minute, you will create a folder with the name names[i].
-
-
Since two files cannot have the same name, if you enter a folder name that was previously used, the system will have a suffix addition to its name in the form of (k), where, k is the smallest positive integer such that the obtained name remains unique.
-
-
Return an array of strings of length n where ans[i] is the actual name the system will assign to the ith folder when you create it.
-
-
-
Example 1:
-
-
-Input: names = ["pes","fifa","gta","pes(2019)"]
-Output: ["pes","fifa","gta","pes(2019)"]
-Explanation: Let's see how the file system creates folder names:
-"pes" --> not assigned before, remains "pes"
-"fifa" --> not assigned before, remains "fifa"
-"gta" --> not assigned before, remains "gta"
-"pes(2019)" --> not assigned before, remains "pes(2019)"
-
-
-
Example 2:
-
-
-Input: names = ["gta","gta(1)","gta","avalon"]
-Output: ["gta","gta(1)","gta(2)","avalon"]
-Explanation: Let's see how the file system creates folder names:
-"gta" --> not assigned before, remains "gta"
-"gta(1)" --> not assigned before, remains "gta(1)"
-"gta" --> the name is reserved, system adds (k), since "gta(1)" is also reserved, systems put k = 2. it becomes "gta(2)"
-"avalon" --> not assigned before, remains "avalon"
-
-
-
Example 3:
-
-
-Input: names = ["onepiece","onepiece(1)","onepiece(2)","onepiece(3)","onepiece"]
-Output: ["onepiece","onepiece(1)","onepiece(2)","onepiece(3)","onepiece(4)"]
-Explanation: When the last folder is created, the smallest positive valid k is 4, and it becomes "onepiece(4)".
-
-
-
-
Constraints:
-
-
-
1 <= names.length <= 5 * 104
-
1 <= names[i].length <= 20
-
names[i] consists of lowercase English letters, digits, and/or round brackets.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Hints
-
-Hint 1
-Keep a map of each name and the smallest valid integer that can be appended as a suffix to it.
-
-
-
-Hint 2
-If the name is not present in the map, you can use it without adding any suffixes.
-
-
-
-Hint 3
-If the name is present in the map, append the smallest proper suffix, and add the new name to the map.
-
diff --git a/problems/managers-with-at-least-5-direct-reports/README.md b/problems/managers-with-at-least-5-direct-reports/README.md
deleted file mode 100644
index 56112b8e5..000000000
--- a/problems/managers-with-at-least-5-direct-reports/README.md
+++ /dev/null
@@ -1,64 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../median-employee-salary "Median Employee Salary")
-
-[Next >](../find-median-given-frequency-of-numbers "Find Median Given Frequency of Numbers")
-
-## [570. Managers with at Least 5 Direct Reports (Medium)](https://leetcode.com/problems/managers-with-at-least-5-direct-reports "至少有5名直接下属的经理")
-
-
The Employee table holds all employees including their managers. Every employee has an Id, and there is also a column for the manager Id.
Given the Employee table, write a SQL query that finds out managers with at least 5 direct report. For the above table, your SQL query should return:
-
-
-+-------+
-| Name |
-+-------+
-| John |
-+-------+
-
-
-
Note:
-No one would report to himself.
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
-
-### Hints
-
-Hint 1
-Try to get all the mangerIDs that have count bigger than 5
-
-
-
-Hint 2
-Use the last hint's result as a table and do join with origin table at id equals to managerId
-
-
-
-Hint 3
-This is a very good example to show the performance of SQL code. Try to work out other solutions and you may be surprised by running time difference.
-
-
-
-Hint 4
-If your solution uses 'IN' function and runs more than 5 seconds, try to optimize it by using 'JOIN' instead.
-
diff --git a/problems/managers-with-at-least-5-direct-reports/managers_with_at_least_5_direct_reports.sql b/problems/managers-with-at-least-5-direct-reports/managers_with_at_least_5_direct_reports.sql
deleted file mode 100644
index bae62cf19..000000000
--- a/problems/managers-with-at-least-5-direct-reports/managers_with_at_least_5_direct_reports.sql
+++ /dev/null
@@ -1 +0,0 @@
-# Write your MySQL query statement below
diff --git a/problems/managers-with-at-least-5-direct-reports/mysql_schemas.sql b/problems/managers-with-at-least-5-direct-reports/mysql_schemas.sql
deleted file mode 100644
index 1c7195415..000000000
--- a/problems/managers-with-at-least-5-direct-reports/mysql_schemas.sql
+++ /dev/null
@@ -1,8 +0,0 @@
-Create table If Not Exists Employee (Id int, Name varchar(255), Department varchar(255), ManagerId int);
-Truncate table Employee;
-insert into Employee (Id, Name, Department, ManagerId) values ('101', 'John', 'A', 'None');
-insert into Employee (Id, Name, Department, ManagerId) values ('102', 'Dan', 'A', '101');
-insert into Employee (Id, Name, Department, ManagerId) values ('103', 'James', 'A', '101');
-insert into Employee (Id, Name, Department, ManagerId) values ('104', 'Amy', 'A', '101');
-insert into Employee (Id, Name, Department, ManagerId) values ('105', 'Anne', 'A', '101');
-insert into Employee (Id, Name, Department, ManagerId) values ('106', 'Ron', 'B', '101');
diff --git a/problems/map-of-highest-peak/README.md b/problems/map-of-highest-peak/README.md
deleted file mode 100644
index e87e23d08..000000000
--- a/problems/map-of-highest-peak/README.md
+++ /dev/null
@@ -1,81 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../form-array-by-concatenating-subarrays-of-another-array "Form Array by Concatenating Subarrays of Another Array")
-
-[Next >](../tree-of-coprimes "Tree of Coprimes")
-
-## [1765. Map of Highest Peak (Medium)](https://leetcode.com/problems/map-of-highest-peak "地图中的最高点")
-
-
You are given an integer matrix isWater of size m x n that represents a map of land and water cells.
-
-
-
If isWater[i][j] == 0, cell (i, j) is a land cell.
-
If isWater[i][j] == 1, cell (i, j) is a water cell.
-
-
-
You must assign each cell a height in a way that follows these rules:
-
-
-
The height of each cell must be non-negative.
-
If the cell is a water cell, its height must be 0.
-
Any two adjacent cells must have an absolute height difference of at most1. A cell is adjacent to another cell if the former is directly north, east, south, or west of the latter (i.e., their sides are touching).
-
-
-
Find an assignment of heights such that the maximum height in the matrix is maximized.
-
-
Return an integer matrix height of size m x n where height[i][j] is cell (i, j)'s height. If there are multiple solutions, return any of them.
-
-
-
Example 1:
-
-
-
-
-Input: isWater = [[0,1],[0,0]]
-Output: [[1,0],[2,1]]
-Explanation: The image shows the assigned heights of each cell.
-The blue cell is the water cell, and the green cells are the land cells.
-
-
-
Example 2:
-
-
-
-
-Input: isWater = [[0,0,1],[1,0,0],[0,0,0]]
-Output: [[1,1,0],[0,1,1],[1,2,2]]
-Explanation: A height of 2 is the maximum possible height of any assignment.
-Any height assignment that has a maximum height of 2 while still meeting the rules will also be accepted.
-
-
-
-
Constraints:
-
-
-
m == isWater.length
-
n == isWater[i].length
-
1 <= m, n <= 1000
-
isWater[i][j] is 0 or 1.
-
There is at least one water cell.
-
-
-### Related Topics
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
-
-### Hints
-
-Hint 1
-Set each water cell to be 0. The height of each cell is limited by its closest water cell.
-
-
-
-Hint 2
-Perform a multi-source BFS with all the water cells as sources.
-
diff --git a/problems/map-sum-pairs/README.md b/problems/map-sum-pairs/README.md
deleted file mode 100644
index ffca94185..000000000
--- a/problems/map-sum-pairs/README.md
+++ /dev/null
@@ -1,61 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../implement-magic-dictionary "Implement Magic Dictionary")
-
-[Next >](../valid-parenthesis-string "Valid Parenthesis String")
-
-## [677. Map Sum Pairs (Medium)](https://leetcode.com/problems/map-sum-pairs "键值映射")
-
-
Design a map that allows you to do the following:
-
-
-
Maps a string key to a given value.
-
Returns the sum of the values that have a key with a prefix equal to a given string.
-
-
-
Implement the MapSum class:
-
-
-
MapSum() Initializes the MapSum object.
-
void insert(String key, int val) Inserts the key-val pair into the map. If the key already existed, the original key-value pair will be overridden to the new one.
-
int sum(string prefix) Returns the sum of all the pairs' value whose key starts with the prefix.
-+----------------+---------+
-| Column Name | Type |
-+----------------+---------+
-| user_id | int |
-| join_date | date |
-| favorite_brand | varchar |
-+----------------+---------+
-user_id is the primary key of this table.
-This table has the info of the users of an online shopping website where users can sell and buy items.
-
-
Table: Orders
-
-
-+---------------+---------+
-| Column Name | Type |
-+---------------+---------+
-| order_id | int |
-| order_date | date |
-| item_id | int |
-| buyer_id | int |
-| seller_id | int |
-+---------------+---------+
-order_id is the primary key of this table.
-item_id is a foreign key to the Items table.
-buyer_id and seller_id are foreign keys to the Users table.
-
-
-
Table: Items
-
-
-+---------------+---------+
-| Column Name | Type |
-+---------------+---------+
-| item_id | int |
-| item_brand | varchar |
-+---------------+---------+
-item_id is the primary key of this table.
-
-
-
-
-
Write an SQL query to find for each user, the join date and the number of orders they made as a buyer in 2019.
-
-
The query result format is in the following example:
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/market-analysis-i/mysql_schemas.sql b/problems/market-analysis-i/mysql_schemas.sql
deleted file mode 100644
index 82f724345..000000000
--- a/problems/market-analysis-i/mysql_schemas.sql
+++ /dev/null
@@ -1,20 +0,0 @@
-Create table If Not Exists Users (user_id int, join_date date, favorite_brand varchar(10));
-Create table If Not Exists Orders (order_id int, order_date date, item_id int, buyer_id int, seller_id int);
-Create table If Not Exists Items (item_id int, item_brand varchar(10));
-Truncate table Users;
-insert into Users (user_id, join_date, favorite_brand) values ('1', '2018-01-01', 'Lenovo');
-insert into Users (user_id, join_date, favorite_brand) values ('2', '2018-02-09', 'Samsung');
-insert into Users (user_id, join_date, favorite_brand) values ('3', '2018-01-19', 'LG');
-insert into Users (user_id, join_date, favorite_brand) values ('4', '2018-05-21', 'HP');
-Truncate table Orders;
-insert into Orders (order_id, order_date, item_id, buyer_id, seller_id) values ('1', '2019-08-01', '4', '1', '2');
-insert into Orders (order_id, order_date, item_id, buyer_id, seller_id) values ('2', '2018-08-02', '2', '1', '3');
-insert into Orders (order_id, order_date, item_id, buyer_id, seller_id) values ('3', '2019-08-03', '3', '2', '3');
-insert into Orders (order_id, order_date, item_id, buyer_id, seller_id) values ('4', '2018-08-04', '1', '4', '2');
-insert into Orders (order_id, order_date, item_id, buyer_id, seller_id) values ('5', '2018-08-04', '1', '3', '4');
-insert into Orders (order_id, order_date, item_id, buyer_id, seller_id) values ('6', '2019-08-05', '2', '2', '4');
-Truncate table Items;
-insert into Items (item_id, item_brand) values ('1', 'Samsung');
-insert into Items (item_id, item_brand) values ('2', 'Lenovo');
-insert into Items (item_id, item_brand) values ('3', 'LG');
-insert into Items (item_id, item_brand) values ('4', 'HP');
diff --git a/problems/market-analysis-ii/README.md b/problems/market-analysis-ii/README.md
deleted file mode 100644
index 90625782d..000000000
--- a/problems/market-analysis-ii/README.md
+++ /dev/null
@@ -1,112 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../market-analysis-i "Market Analysis I")
-
-[Next >](../find-words-that-can-be-formed-by-characters "Find Words That Can Be Formed by Characters")
-
-## [1159. Market Analysis II (Hard)](https://leetcode.com/problems/market-analysis-ii "市场分析 II")
-
-
Table: Users
-
-
-+----------------+---------+
-| Column Name | Type |
-+----------------+---------+
-| user_id | int |
-| join_date | date |
-| favorite_brand | varchar |
-+----------------+---------+
-user_id is the primary key of this table.
-This table has the info of the users of an online shopping website where users can sell and buy items.
-
-
Table: Orders
-
-
-+---------------+---------+
-| Column Name | Type |
-+---------------+---------+
-| order_id | int |
-| order_date | date |
-| item_id | int |
-| buyer_id | int |
-| seller_id | int |
-+---------------+---------+
-order_id is the primary key of this table.
-item_id is a foreign key to the Items table.
-buyer_id and seller_id are foreign keys to the Users table.
-
-
-
Table: Items
-
-
-+---------------+---------+
-| Column Name | Type |
-+---------------+---------+
-| item_id | int |
-| item_brand | varchar |
-+---------------+---------+
-item_id is the primary key of this table.
-
-
-
-
-
Write an SQL query to find for each user, whether the brand of the second item (by date) they sold is their favorite brand. If a user sold less than two items, report the answer for that user as no.
-
-
It is guaranteed that no seller sold more than one item on a day.
-
-
The query result format is in the following example:
-
-
-Users table:
-+---------+------------+----------------+
-| user_id | join_date | favorite_brand |
-+---------+------------+----------------+
-| 1 | 2019-01-01 | Lenovo |
-| 2 | 2019-02-09 | Samsung |
-| 3 | 2019-01-19 | LG |
-| 4 | 2019-05-21 | HP |
-+---------+------------+----------------+
-
-Orders table:
-+----------+------------+---------+----------+-----------+
-| order_id | order_date | item_id | buyer_id | seller_id |
-+----------+------------+---------+----------+-----------+
-| 1 | 2019-08-01 | 4 | 1 | 2 |
-| 2 | 2019-08-02 | 2 | 1 | 3 |
-| 3 | 2019-08-03 | 3 | 2 | 3 |
-| 4 | 2019-08-04 | 1 | 4 | 2 |
-| 5 | 2019-08-04 | 1 | 3 | 4 |
-| 6 | 2019-08-05 | 2 | 2 | 4 |
-+----------+------------+---------+----------+-----------+
-
-Items table:
-+---------+------------+
-| item_id | item_brand |
-+---------+------------+
-| 1 | Samsung |
-| 2 | Lenovo |
-| 3 | LG |
-| 4 | HP |
-+---------+------------+
-
-Result table:
-+-----------+--------------------+
-| seller_id | 2nd_item_fav_brand |
-+-----------+--------------------+
-| 1 | no |
-| 2 | yes |
-| 3 | yes |
-| 4 | no |
-+-----------+--------------------+
-
-The answer for the user with id 1 is no because they sold nothing.
-The answer for the users with id 2 and 3 is yes because the brands of their second sold items are their favorite brands.
-The answer for the user with id 4 is no because the brand of their second sold item is not their favorite brand.
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/market-analysis-ii/mysql_schemas.sql b/problems/market-analysis-ii/mysql_schemas.sql
deleted file mode 100644
index 1eea2fa16..000000000
--- a/problems/market-analysis-ii/mysql_schemas.sql
+++ /dev/null
@@ -1,20 +0,0 @@
-Create table If Not Exists Users (user_id int, join_date date, favorite_brand varchar(10));
-Create table If Not Exists Orders (order_id int, order_date date, item_id int, buyer_id int, seller_id int);
-Create table If Not Exists Items (item_id int, item_brand varchar(10));
-Truncate table Users;
-insert into Users (user_id, join_date, favorite_brand) values ('1', '2019-01-01', 'Lenovo');
-insert into Users (user_id, join_date, favorite_brand) values ('2', '2019-02-09', 'Samsung');
-insert into Users (user_id, join_date, favorite_brand) values ('3', '2019-01-19', 'LG');
-insert into Users (user_id, join_date, favorite_brand) values ('4', '2019-05-21', 'HP');
-Truncate table Orders;
-insert into Orders (order_id, order_date, item_id, buyer_id, seller_id) values ('1', '2019-08-01', '4', '1', '2');
-insert into Orders (order_id, order_date, item_id, buyer_id, seller_id) values ('2', '2019-08-02', '2', '1', '3');
-insert into Orders (order_id, order_date, item_id, buyer_id, seller_id) values ('3', '2019-08-03', '3', '2', '3');
-insert into Orders (order_id, order_date, item_id, buyer_id, seller_id) values ('4', '2019-08-04', '1', '4', '2');
-insert into Orders (order_id, order_date, item_id, buyer_id, seller_id) values ('5', '2019-08-04', '1', '3', '4');
-insert into Orders (order_id, order_date, item_id, buyer_id, seller_id) values ('6', '2019-08-05', '2', '2', '4');
-Truncate table Items;
-insert into Items (item_id, item_brand) values ('1', 'Samsung');
-insert into Items (item_id, item_brand) values ('2', 'Lenovo');
-insert into Items (item_id, item_brand) values ('3', 'LG');
-insert into Items (item_id, item_brand) values ('4', 'HP');
diff --git a/problems/masking-personal-information/README.md b/problems/masking-personal-information/README.md
deleted file mode 100644
index 7269126a5..000000000
--- a/problems/masking-personal-information/README.md
+++ /dev/null
@@ -1,119 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../positions-of-large-groups "Positions of Large Groups")
-
-[Next >](../flipping-an-image "Flipping an Image")
-
-## [831. Masking Personal Information (Medium)](https://leetcode.com/problems/masking-personal-information "隐藏个人信息")
-
-
You are given a personal information string s, representing either an email address or a phone number. Return the masked personal information using the below rules.
-
-
Email address:
-
-
An email address is:
-
-
-
A name consisting of uppercase and lowercase English letters, followed by
-
The '@' symbol, followed by
-
The domain consisting of uppercase and lowercase English letters with a dot '.' somewhere in the middle (not the first or last character).
-
-
-
To mask an email:
-
-
-
The uppercase letters in the name and domain must be converted to lowercase letters.
-
The middle letters of the name (i.e., all but the first and last letters) must be replaced by 5 asterisks "*****".
-
-
-
Phone number:
-
-
A phone number is formatted as follows:
-
-
-
The phone number contains 10-13 digits.
-
The last 10 digits make up the local number.
-
The remaining 0-3 digits, in the beginning, make up the country code.
-
Separation characters from the set {'+', '-', '(', ')', ' '} separate the above digits in some way.
-
-
-
To mask a phone number:
-
-
-
Remove all separation characters.
-
The masked phone number should have the form:
-
-
"***-***-XXXX" if the country code has 0 digits.
-
"+*-***-***-XXXX" if the country code has 1 digit.
-
"+**-***-***-XXXX" if the country code has 2 digits.
-
"+***-***-***-XXXX" if the country code has 3 digits.
-
-
-
"XXXX" is the last 4 digits of the local number.
-
-
-
-
Example 1:
-
-
-Input: s = "LeetCode@LeetCode.com"
-Output: "l*****e@leetcode.com"
-Explanation: s is an email address.
-The name and domain are converted to lowercase, and the middle of the name is replaced by 5 asterisks.
-
-
-
Example 2:
-
-
-Input: s = "AB@qq.com"
-Output: "a*****b@qq.com"
-Explanation: s is an email address.
-The name and domain are converted to lowercase, and the middle of the name is replaced by 5 asterisks.
-Note that even though "ab" is 2 characters, it still must have 5 asterisks in the middle.
-
-
-
Example 3:
-
-
-Input: s = "1(234)567-890"
-Output: "***-***-7890"
-Explanation: s is a phone number.
-There are 10 digits, so the local number is 10 digits and the country code is 0 digits.
-Thus, the resulting masked number is "***-***-7890".
-
-
-
Example 4:
-
-
-Input: s = "86-(10)12345678"
-Output: "+**-***-***-5678"
-Explanation: s is a phone number.
-There are 12 digits, so the local number is 10 digits and the country code is 2 digits.
-Thus, the resulting masked number is "+**-***-***-7890".
-
-
-
-
Constraints:
-
-
-
s is either a valid email or a phone number.
-
If s is an email:
-
-
8 <= s.length <= 40
-
s consists of uppercase and lowercase English letters and exactly one '@' symbol and '.' symbol.
-
-
-
If s is a phone number:
-
-
10 <= s.length <= 20
-
s consists of digits, spaces, and the symbols '(', ')', '-', and '+'.
You are given an integer array matchsticks where matchsticks[i] is the length of the ith matchstick. You want to use all the matchsticks to make one square. You should not break any stick, but you can link them up, and each matchstick must be used exactly one time.
-
-
Return true if you can make this square and false otherwise.
-
-
-
Example 1:
-
-
-Input: matchsticks = [1,1,2,2,2]
-Output: true
-Explanation: You can form a square with length 2, one side of the square came two sticks with length 1.
-
-
-
Example 2:
-
-
-Input: matchsticks = [3,3,3,3,4]
-Output: false
-Explanation: You cannot find a way to form a square with all the matchsticks.
-
-
-
-
Constraints:
-
-
-
1 <= matchsticks.length <= 15
-
1 <= matchsticks[i] <= 108
-
-
-### Related Topics
- [[Bit Manipulation](../../tag/bit-manipulation/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Backtracking](../../tag/backtracking/README.md)]
- [[Bitmask](../../tag/bitmask/README.md)]
-
-### Hints
-
-Hint 1
-Treat the matchsticks as an array. Can we split the array into 4 equal halves?
-
-
-
-Hint 2
-Every matchstick can belong to either of the 4 sides. We don't know which one. Maybe try out all options!
-
-
-
-Hint 3
-For every matchstick, we have to try out each of the 4 options i.e. which side it can belong to. We can make use of recursion for this.
-
-
-
-Hint 4
-We don't really need to keep track of which matchsticks belong to a particular side during recursion. We just need to keep track of the length of each of the 4 sides.
-
-
-
-Hint 5
-When all matchsticks have been used we simply need to see the length of all 4 sides. If they're equal, we have a square on our hands!
-
diff --git a/problems/matchsticks-to-square/matchsticks_to_square.go b/problems/matchsticks-to-square/matchsticks_to_square.go
deleted file mode 100644
index f5b5fb253..000000000
--- a/problems/matchsticks-to-square/matchsticks_to_square.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem473
diff --git a/problems/matchsticks-to-square/matchsticks_to_square_test.go b/problems/matchsticks-to-square/matchsticks_to_square_test.go
deleted file mode 100644
index f5b5fb253..000000000
--- a/problems/matchsticks-to-square/matchsticks_to_square_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem473
diff --git a/problems/matrix-block-sum/README.md b/problems/matrix-block-sum/README.md
deleted file mode 100644
index 9fe7fe48f..000000000
--- a/problems/matrix-block-sum/README.md
+++ /dev/null
@@ -1,69 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../decompress-run-length-encoded-list "Decompress Run-Length Encoded List")
-
-[Next >](../sum-of-nodes-with-even-valued-grandparent "Sum of Nodes with Even-Valued Grandparent")
-
-## [1314. Matrix Block Sum (Medium)](https://leetcode.com/problems/matrix-block-sum "矩阵区域和")
-
-
Given a m x n matrix mat and an integer k, return a matrixanswerwhere eachanswer[i][j]is the sum of all elementsmat[r][c]for:
-
-
-
i - k <= r <= i + k,
-
j - k <= c <= j + k, and
-
(r, c) is a valid position in the matrix.
-
-
-
-
Example 1:
-
-
-Input: mat = [[1,2,3],[4,5,6],[7,8,9]], k = 1
-Output: [[12,21,16],[27,45,33],[24,39,28]]
-
-
-
Example 2:
-
-
-Input: mat = [[1,2,3],[4,5,6],[7,8,9]], k = 2
-Output: [[45,45,45],[45,45,45],[45,45,45]]
-
-
-
-
Constraints:
-
-
-
m == mat.length
-
n == mat[i].length
-
1 <= m, n, k <= 100
-
1 <= mat[i][j] <= 100
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
- [[Prefix Sum](../../tag/prefix-sum/README.md)]
-
-### Similar Questions
- 1. [Stamping the Grid](../stamping-the-grid) (Hard)
-
-### Hints
-
-Hint 1
-How to calculate the required sum for a cell (i,j) fast ?
-
-
-
-Hint 2
-Use the concept of cumulative sum array.
-
-
-
-Hint 3
-Create a cumulative sum matrix where dp[i][j] is the sum of all cells in the rectangle from (0,0) to (i,j), use inclusion-exclusion idea.
-
diff --git a/problems/matrix-cells-in-distance-order/README.md b/problems/matrix-cells-in-distance-order/README.md
deleted file mode 100644
index 9fa55ff71..000000000
--- a/problems/matrix-cells-in-distance-order/README.md
+++ /dev/null
@@ -1,61 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../two-city-scheduling "Two City Scheduling")
-
-[Next >](../maximum-sum-of-two-non-overlapping-subarrays "Maximum Sum of Two Non-Overlapping Subarrays")
-
-## [1030. Matrix Cells in Distance Order (Easy)](https://leetcode.com/problems/matrix-cells-in-distance-order "距离顺序排列矩阵单元格")
-
-
You are given four integers row, cols, rCenter, and cCenter. There is a rows x cols matrix and you are on the cell with the coordinates (rCenter, cCenter).
-
-
Return the coordinates of all cells in the matrix, sorted by their distance from (rCenter, cCenter) from the smallest distance to the largest distance. You may return the answer in any order that satisfies this condition.
-
-
The distance between two cells (r1, c1) and (r2, c2) is |r1 - r2| + |c1 - c2|.
-
-
-
Example 1:
-
-
-Input: rows = 1, cols = 2, rCenter = 0, cCenter = 0
-Output: [[0,0],[0,1]]
-Explanation: The distances from (0, 0) to other cells are: [0,1]
-
-
-
Example 2:
-
-
-Input: rows = 2, cols = 2, rCenter = 0, cCenter = 1
-Output: [[0,1],[0,0],[1,1],[1,0]]
-Explanation: The distances from (0, 1) to other cells are: [0,1,1,2]
-The answer [[0,1],[1,1],[0,0],[1,0]] would also be accepted as correct.
-
-
-
Example 3:
-
-
-Input: rows = 2, cols = 3, rCenter = 1, cCenter = 2
-Output: [[1,2],[0,2],[1,1],[0,1],[1,0],[0,0]]
-Explanation: The distances from (1, 2) to other cells are: [0,1,1,2,2,3]
-There are other answers that would also be accepted as correct, such as [[1,2],[1,1],[0,2],[1,0],[0,1],[0,0]].
-
-
-
-
Constraints:
-
-
-
1 <= rows, cols <= 100
-
0 <= rCenter < rows
-
0 <= cCenter < cols
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Math](../../tag/math/README.md)]
- [[Geometry](../../tag/geometry/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
diff --git a/problems/matrix-cells-in-distance-order/matrix_cells_in_distance_order.go b/problems/matrix-cells-in-distance-order/matrix_cells_in_distance_order.go
deleted file mode 100644
index 02046c07f..000000000
--- a/problems/matrix-cells-in-distance-order/matrix_cells_in_distance_order.go
+++ /dev/null
@@ -1,26 +0,0 @@
-package problem1030
-
-var res = [10000][]int{}
-
-func allCellsDistOrder(R int, C int, r0 int, c0 int) [][]int {
- dist := [200][][]int{}
- for r := 0; r < R; r++ {
- for c := 0; c < C; c++ {
- d := abs(r-r0) + abs(c-c0)
- dist[d] = append(dist[d], []int{r, c})
- }
- }
- begin, end := 0, 0
- for d := 0; len(dist[d]) > 0; d++ {
- begin, end = end, end+len(dist[d])
- copy(res[begin:end], dist[d])
- }
- return res[:end]
-}
-
-func abs(n int) int {
- if n < 0 {
- return -n
- }
- return n
-}
diff --git a/problems/matrix-diagonal-sum/README.md b/problems/matrix-diagonal-sum/README.md
deleted file mode 100644
index ea3934e05..000000000
--- a/problems/matrix-diagonal-sum/README.md
+++ /dev/null
@@ -1,67 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../warehouse-manager "Warehouse Manager")
-
-[Next >](../number-of-ways-to-split-a-string "Number of Ways to Split a String")
-
-## [1572. Matrix Diagonal Sum (Easy)](https://leetcode.com/problems/matrix-diagonal-sum "矩阵对角线元素的和")
-
-
Given a square matrix mat, return the sum of the matrix diagonals.
-
-
Only include the sum of all the elements on the primary diagonal and all the elements on the secondary diagonal that are not part of the primary diagonal.
-
-
-
Example 1:
-
-
-Input: mat = [[1,2,3],
- [4,5,6],
- [7,8,9]]
-Output: 25
-Explanation: Diagonals sum: 1 + 5 + 9 + 3 + 7 = 25
-Notice that element mat[1][1] = 5 is counted only once.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
-
-### Similar Questions
- 1. [Check if Every Row and Column Contains All Numbers](../check-if-every-row-and-column-contains-all-numbers) (Easy)
-
-### Hints
-
-Hint 1
-There will be overlap of elements in the primary and secondary diagonals if and only if the length of the matrix is odd, which is at the center.
-
diff --git a/problems/max-area-of-island/README.md b/problems/max-area-of-island/README.md
deleted file mode 100644
index 670981ff1..000000000
--- a/problems/max-area-of-island/README.md
+++ /dev/null
@@ -1,56 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../number-of-distinct-islands "Number of Distinct Islands")
-
-[Next >](../count-binary-substrings "Count Binary Substrings")
-
-## [695. Max Area of Island (Medium)](https://leetcode.com/problems/max-area-of-island "岛屿的最大面积")
-
-
You are given an m x n binary matrix grid. An island is a group of 1's (representing land) connected 4-directionally (horizontal or vertical.) You may assume all four edges of the grid are surrounded by water.
-
-
The area of an island is the number of cells with a value 1 in the island.
-
-
Return the maximum area of an island in grid. If there is no island, return 0.
-
-
-
Example 1:
-
-
-Input: grid = [[0,0,1,0,0,0,0,1,0,0,0,0,0],[0,0,0,0,0,0,0,1,1,1,0,0,0],[0,1,1,0,1,0,0,0,0,0,0,0,0],[0,1,0,0,1,1,0,0,1,0,1,0,0],[0,1,0,0,1,1,0,0,1,1,1,0,0],[0,0,0,0,0,0,0,0,0,0,1,0,0],[0,0,0,0,0,0,0,1,1,1,0,0,0],[0,0,0,0,0,0,0,1,1,0,0,0,0]]
-Output: 6
-Explanation: The answer is not 11, because the island must be connected 4-directionally.
-
-
-
Example 2:
-
-
-Input: grid = [[0,0,0,0,0,0,0,0]]
-Output: 0
-
-
-
-
Constraints:
-
-
-
m == grid.length
-
n == grid[i].length
-
1 <= m, n <= 50
-
grid[i][j] is either 0 or 1.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Union Find](../../tag/union-find/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
-
-### Similar Questions
- 1. [Number of Islands](../number-of-islands) (Medium)
- 1. [Island Perimeter](../island-perimeter) (Easy)
- 1. [Largest Submatrix With Rearrangements](../largest-submatrix-with-rearrangements) (Medium)
diff --git a/problems/max-area-of-island/max_area_of_island.go b/problems/max-area-of-island/max_area_of_island.go
deleted file mode 100644
index 57d0f0002..000000000
--- a/problems/max-area-of-island/max_area_of_island.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem695
diff --git a/problems/max-area-of-island/max_area_of_island_test.go b/problems/max-area-of-island/max_area_of_island_test.go
deleted file mode 100644
index 57d0f0002..000000000
--- a/problems/max-area-of-island/max_area_of_island_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem695
diff --git a/problems/max-chunks-to-make-sorted-ii/README.md b/problems/max-chunks-to-make-sorted-ii/README.md
deleted file mode 100644
index c0c9f7075..000000000
--- a/problems/max-chunks-to-make-sorted-ii/README.md
+++ /dev/null
@@ -1,63 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../reorganize-string "Reorganize String")
-
-[Next >](../max-chunks-to-make-sorted "Max Chunks To Make Sorted")
-
-## [768. Max Chunks To Make Sorted II (Hard)](https://leetcode.com/problems/max-chunks-to-make-sorted-ii "最多能完成排序的块 II")
-
-
You are given an integer array arr.
-
-
We split arr into some number of chunks (i.e., partitions), and individually sort each chunk. After concatenating them, the result should equal the sorted array.
-
-
Return the largest number of chunks we can make to sort the array.
-
-
-
Example 1:
-
-
-Input: arr = [5,4,3,2,1]
-Output: 1
-Explanation:
-Splitting into two or more chunks will not return the required result.
-For example, splitting into [5, 4], [3, 2, 1] will result in [4, 5, 1, 2, 3], which isn't sorted.
-
-
-
Example 2:
-
-
-Input: arr = [2,1,3,4,4]
-Output: 4
-Explanation:
-We can split into two chunks, such as [2, 1], [3, 4, 4].
-However, splitting into [2, 1], [3], [4], [4] is the highest number of chunks possible.
-
-
-
-
Constraints:
-
-
-
1 <= arr.length <= 2000
-
0 <= arr[i] <= 108
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Stack](../../tag/stack/README.md)]
- [[Greedy](../../tag/greedy/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
- [[Monotonic Stack](../../tag/monotonic-stack/README.md)]
-
-### Similar Questions
- 1. [Max Chunks To Make Sorted](../max-chunks-to-make-sorted) (Medium)
-
-### Hints
-
-Hint 1
-Each k for which some permutation of arr[:k] is equal to sorted(arr)[:k] is where we should cut each chunk.
-
diff --git a/problems/max-chunks-to-make-sorted-ii/max_chunks_to_make_sorted_ii.go b/problems/max-chunks-to-make-sorted-ii/max_chunks_to_make_sorted_ii.go
deleted file mode 100644
index 0b9379bb2..000000000
--- a/problems/max-chunks-to-make-sorted-ii/max_chunks_to_make_sorted_ii.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem768
diff --git a/problems/max-chunks-to-make-sorted-ii/max_chunks_to_make_sorted_ii_test.go b/problems/max-chunks-to-make-sorted-ii/max_chunks_to_make_sorted_ii_test.go
deleted file mode 100644
index 0b9379bb2..000000000
--- a/problems/max-chunks-to-make-sorted-ii/max_chunks_to_make_sorted_ii_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem768
diff --git a/problems/max-chunks-to-make-sorted/README.md b/problems/max-chunks-to-make-sorted/README.md
deleted file mode 100644
index f5bbcec5d..000000000
--- a/problems/max-chunks-to-make-sorted/README.md
+++ /dev/null
@@ -1,65 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../max-chunks-to-make-sorted-ii "Max Chunks To Make Sorted II")
-
-[Next >](../basic-calculator-iv "Basic Calculator IV")
-
-## [769. Max Chunks To Make Sorted (Medium)](https://leetcode.com/problems/max-chunks-to-make-sorted "最多能完成排序的块")
-
-
You are given an integer array arr of length n that represents a permutation of the integers in the range [0, n - 1].
-
-
We split arr into some number of chunks (i.e., partitions), and individually sort each chunk. After concatenating them, the result should equal the sorted array.
-
-
Return the largest number of chunks we can make to sort the array.
-
-
-
Example 1:
-
-
-Input: arr = [4,3,2,1,0]
-Output: 1
-Explanation:
-Splitting into two or more chunks will not return the required result.
-For example, splitting into [4, 3], [2, 1, 0] will result in [3, 4, 0, 1, 2], which isn't sorted.
-
-
-
Example 2:
-
-
-Input: arr = [1,0,2,3,4]
-Output: 4
-Explanation:
-We can split into two chunks, such as [1, 0], [2, 3, 4].
-However, splitting into [1, 0], [2], [3], [4] is the highest number of chunks possible.
-
-
-
-
Constraints:
-
-
-
n == arr.length
-
1 <= n <= 10
-
0 <= arr[i] < n
-
All the elements of arr are unique.
-
-
-### Related Topics
- [[Stack](../../tag/stack/README.md)]
- [[Greedy](../../tag/greedy/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
- [[Monotonic Stack](../../tag/monotonic-stack/README.md)]
-
-### Similar Questions
- 1. [Max Chunks To Make Sorted II](../max-chunks-to-make-sorted-ii) (Hard)
-
-### Hints
-
-Hint 1
-The first chunk can be found as the smallest k for which A[:k+1] == [0, 1, 2, ...k]; then we repeat this process.
-
diff --git a/problems/max-chunks-to-make-sorted/max_chunks_to_make_sorted.go b/problems/max-chunks-to-make-sorted/max_chunks_to_make_sorted.go
deleted file mode 100644
index c73d14383..000000000
--- a/problems/max-chunks-to-make-sorted/max_chunks_to_make_sorted.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem769
diff --git a/problems/max-chunks-to-make-sorted/max_chunks_to_make_sorted_test.go b/problems/max-chunks-to-make-sorted/max_chunks_to_make_sorted_test.go
deleted file mode 100644
index c73d14383..000000000
--- a/problems/max-chunks-to-make-sorted/max_chunks_to_make_sorted_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem769
diff --git a/problems/max-consecutive-ones-ii/README.md b/problems/max-consecutive-ones-ii/README.md
deleted file mode 100644
index 6c28cd7d7..000000000
--- a/problems/max-consecutive-ones-ii/README.md
+++ /dev/null
@@ -1,45 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../predict-the-winner "Predict the Winner")
-
-[Next >](../zuma-game "Zuma Game")
-
-## [487. Max Consecutive Ones II (Medium)](https://leetcode.com/problems/max-consecutive-ones-ii "最大连续1的个数 II")
-
-
-Given a binary array, find the maximum number of consecutive 1s in this array if you can flip at most one 0.
-
-
-
Example 1:
-
-Input: [1,0,1,1,0]
-Output: 4
-Explanation: Flip the first zero will get the the maximum number of consecutive 1s.
- After flipping, the maximum number of consecutive 1s is 4.
-
-
-
-
Note:
-
-
The input array will only contain 0 and 1.
-
The length of input array is a positive integer and will not exceed 10,000
-
-
-
-
Follow up:
-What if the input numbers come in one by one as an infinite stream? In other words, you can't store all numbers coming from the stream as it's too large to hold in memory. Could you solve it efficiently?
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Sliding Window](../../tag/sliding-window/README.md)]
-
-### Similar Questions
- 1. [Max Consecutive Ones](../max-consecutive-ones) (Easy)
- 1. [Max Consecutive Ones III](../max-consecutive-ones-iii) (Medium)
diff --git a/problems/max-consecutive-ones-ii/max_consecutive_ones_ii.go b/problems/max-consecutive-ones-ii/max_consecutive_ones_ii.go
deleted file mode 100644
index b0097ae9e..000000000
--- a/problems/max-consecutive-ones-ii/max_consecutive_ones_ii.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem487
diff --git a/problems/max-consecutive-ones-ii/max_consecutive_ones_ii_test.go b/problems/max-consecutive-ones-ii/max_consecutive_ones_ii_test.go
deleted file mode 100644
index b0097ae9e..000000000
--- a/problems/max-consecutive-ones-ii/max_consecutive_ones_ii_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem487
diff --git a/problems/max-consecutive-ones-iii/README.md b/problems/max-consecutive-ones-iii/README.md
deleted file mode 100644
index 2d8260401..000000000
--- a/problems/max-consecutive-ones-iii/README.md
+++ /dev/null
@@ -1,74 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../check-if-word-is-valid-after-substitutions "Check If Word Is Valid After Substitutions")
-
-[Next >](../maximize-sum-of-array-after-k-negations "Maximize Sum Of Array After K Negations")
-
-## [1004. Max Consecutive Ones III (Medium)](https://leetcode.com/problems/max-consecutive-ones-iii "最大连续1的个数 III")
-
-
Given a binary array nums and an integer k, return the maximum number of consecutive 1's in the array if you can flip at mostk0's.
-
-
-
Example 1:
-
-
-Input: nums = [1,1,1,0,0,0,1,1,1,1,0], k = 2
-Output: 6
-Explanation: [1,1,1,0,0,1,1,1,1,1,1]
-Bolded numbers were flipped from 0 to 1. The longest subarray is underlined.
-
-
Example 2:
-
-
-Input: nums = [0,0,1,1,0,0,1,1,1,0,1,1,0,0,0,1,1,1,1], k = 3
-Output: 10
-Explanation: [0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1]
-Bolded numbers were flipped from 0 to 1. The longest subarray is underlined.
-
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 105
-
nums[i] is either 0 or 1.
-
0 <= k <= nums.length
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
- [[Prefix Sum](../../tag/prefix-sum/README.md)]
- [[Sliding Window](../../tag/sliding-window/README.md)]
-
-### Similar Questions
- 1. [Longest Substring with At Most K Distinct Characters](../longest-substring-with-at-most-k-distinct-characters) (Medium)
- 1. [Longest Repeating Character Replacement](../longest-repeating-character-replacement) (Medium)
- 1. [Max Consecutive Ones](../max-consecutive-ones) (Easy)
- 1. [Max Consecutive Ones II](../max-consecutive-ones-ii) (Medium)
-
-### Hints
-
-Hint 1
-One thing's for sure, we will only flip a zero if it extends an existing window of 1s. Otherwise, there's no point in doing it, right? Think Sliding Window!
-
-
-
-Hint 2
-Since we know this problem can be solved using the sliding window construct, we might as well focus in that direction for hints. Basically, in a given window, we can never have > K zeros, right?
-
-
-
-Hint 3
-We don't have a fixed size window in this case. The window size can grow and shrink depending upon the number of zeros we have (we don't actually have to flip the zeros here!).
-
-
-
-Hint 4
-The way to shrink or expand a window would be based on the number of zeros that can still be flipped and so on.
-
diff --git a/problems/max-consecutive-ones-iii/max_consecutive_ones_iii.go b/problems/max-consecutive-ones-iii/max_consecutive_ones_iii.go
deleted file mode 100644
index 9e756c14a..000000000
--- a/problems/max-consecutive-ones-iii/max_consecutive_ones_iii.go
+++ /dev/null
@@ -1,15 +0,0 @@
-package problem1004
-
-func longestOnes(A []int, K int) int {
- left, right := 0, 0
- for right = range A {
- K -= 1 ^ A[right] // 每次遇到 0 就会消耗一次 K
- if K < 0 { // K 不够用的时候,就从左边回血
- K += 1 ^ A[left]
- left++
- }
- }
- // A[left:right+1] 并不是真的 max-length-sliding-windows
- // 把 right-left+1 当作是 A[:right+1] 中出现过的最长子数组的长度,更合适
- return right - left + 1
-}
diff --git a/problems/max-consecutive-ones/README.md b/problems/max-consecutive-ones/README.md
deleted file mode 100644
index 9ac8a9976..000000000
--- a/problems/max-consecutive-ones/README.md
+++ /dev/null
@@ -1,53 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../find-permutation "Find Permutation")
-
-[Next >](../predict-the-winner "Predict the Winner")
-
-## [485. Max Consecutive Ones (Easy)](https://leetcode.com/problems/max-consecutive-ones "最大连续 1 的个数")
-
-
Given a binary array nums, return the maximum number of consecutive 1's in the array.
-
-
-
Example 1:
-
-
-Input: nums = [1,1,0,1,1,1]
-Output: 3
-Explanation: The first two digits or the last three digits are consecutive 1s. The maximum number of consecutive 1s is 3.
-
-
-
Example 2:
-
-
-Input: nums = [1,0,1,1,0,1]
-Output: 2
-
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 105
-
nums[i] is either 0 or 1.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
-
-### Similar Questions
- 1. [Max Consecutive Ones II](../max-consecutive-ones-ii) (Medium)
- 1. [Max Consecutive Ones III](../max-consecutive-ones-iii) (Medium)
-
-### Hints
-
-Hint 1
-You need to think about two things as far as any window is concerned. One is the starting point for the window. How do you detect that a new window of 1s has started? The next part is detecting the ending point for this window.
-
-How do you detect the ending point for an existing window? If you figure these two things out, you will be able to detect the windows of consecutive ones. All that remains afterward is to find the longest such window and return the size.
-
diff --git a/problems/max-consecutive-ones/max_consecutive_ones.go b/problems/max-consecutive-ones/max_consecutive_ones.go
deleted file mode 100644
index 9f9419761..000000000
--- a/problems/max-consecutive-ones/max_consecutive_ones.go
+++ /dev/null
@@ -1,16 +0,0 @@
-package problem485
-
-func findMaxConsecutiveOnes(nums []int) int {
- ans, count := 0, 0
- for _, v := range nums {
- if v == 1 {
- count++
- if count > ans {
- ans = count
- }
- } else {
- count = 0
- }
- }
- return ans
-}
diff --git a/problems/max-consecutive-ones/max_consecutive_ones_test.go b/problems/max-consecutive-ones/max_consecutive_ones_test.go
deleted file mode 100644
index ef665ebe0..000000000
--- a/problems/max-consecutive-ones/max_consecutive_ones_test.go
+++ /dev/null
@@ -1,27 +0,0 @@
-package problem485
-
-import "testing"
-
-type testType struct {
- in []int
- want int
-}
-
-func TestFindMaxConsecutiveOnes(t *testing.T) {
- tests := [...]testType{
- {
- in: []int{1, 1, 0, 1, 1, 1},
- want: 3,
- },
- {
- in: []int{1, 0, 1, 1, 0, 1},
- want: 2,
- },
- }
- for _, tt := range tests {
- got := findMaxConsecutiveOnes(tt.in)
- if got != tt.want {
- t.Fatalf("in: %v, got: %v, want: %v", tt.in, got, tt.want)
- }
- }
-}
diff --git a/problems/max-difference-you-can-get-from-changing-an-integer/README.md b/problems/max-difference-you-can-get-from-changing-an-integer/README.md
deleted file mode 100644
index 1643c22e9..000000000
--- a/problems/max-difference-you-can-get-from-changing-an-integer/README.md
+++ /dev/null
@@ -1,89 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../kids-with-the-greatest-number-of-candies "Kids With the Greatest Number of Candies")
-
-[Next >](../check-if-a-string-can-break-another-string "Check If a String Can Break Another String")
-
-## [1432. Max Difference You Can Get From Changing an Integer (Medium)](https://leetcode.com/problems/max-difference-you-can-get-from-changing-an-integer "改变一个整数能得到的最大差值")
-
-
You are given an integer num. You will apply the following steps exactly two times:
-
-
-
Pick a digit x (0 <= x <= 9).
-
Pick another digit y (0 <= y <= 9). The digit y can be equal to x.
-
Replace all the occurrences of x in the decimal representation of num by y.
-
The new integer cannot have any leading zeros, also the new integer cannot be 0.
-
-
-
Let a and b be the results of applying the operations to num the first and second times, respectively.
-
-
Return the max difference between a and b.
-
-
-
Example 1:
-
-
-Input: num = 555
-Output: 888
-Explanation: The first time pick x = 5 and y = 9 and store the new integer in a.
-The second time pick x = 5 and y = 1 and store the new integer in b.
-We have now a = 999 and b = 111 and max difference = 888
-
-
-
Example 2:
-
-
-Input: num = 9
-Output: 8
-Explanation: The first time pick x = 9 and y = 9 and store the new integer in a.
-The second time pick x = 9 and y = 1 and store the new integer in b.
-We have now a = 9 and b = 1 and max difference = 8
-
-
-
Example 3:
-
-
-Input: num = 123456
-Output: 820000
-
-
-
Example 4:
-
-
-Input: num = 10000
-Output: 80000
-
-
-
Example 5:
-
-
-Input: num = 9288
-Output: 8700
-
-
-
-
Constraints:
-
-
-
1 <= num <= 10^8
-
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[Math](../../tag/math/README.md)]
-
-### Hints
-
-Hint 1
-We need to get the max and min value after changing num and the answer is max - min.
-
-
-
-Hint 2
-Use brute force, try all possible changes and keep the minimum and maximum values.
-
diff --git a/problems/max-dot-product-of-two-subsequences/README.md b/problems/max-dot-product-of-two-subsequences/README.md
deleted file mode 100644
index 87cfbc3c3..000000000
--- a/problems/max-dot-product-of-two-subsequences/README.md
+++ /dev/null
@@ -1,61 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../pseudo-palindromic-paths-in-a-binary-tree "Pseudo-Palindromic Paths in a Binary Tree")
-
-[Next >](../rectangles-area "Rectangles Area")
-
-## [1458. Max Dot Product of Two Subsequences (Hard)](https://leetcode.com/problems/max-dot-product-of-two-subsequences "两个子序列的最大点积")
-
-
Given two arrays nums1 and nums2.
-
-
Return the maximum dot product between non-empty subsequences of nums1 and nums2 with the same length.
-
-
A subsequence of a array is a new array which is formed from the original array by deleting some (can be none) of the characters without disturbing the relative positions of the remaining characters. (ie, [2,3,5] is a subsequence of [1,2,3,4,5] while [1,5,3] is not).
-
-
-
Example 1:
-
-
-Input: nums1 = [2,1,-2,5], nums2 = [3,0,-6]
-Output: 18
-Explanation: Take subsequence [2,-2] from nums1 and subsequence [3,-6] from nums2.
-Their dot product is (2*3 + (-2)*(-6)) = 18.
-
-
Example 2:
-
-
-Input: nums1 = [3,-2], nums2 = [2,-6,7]
-Output: 21
-Explanation: Take subsequence [3] from nums1 and subsequence [7] from nums2.
-Their dot product is (3*7) = 21.
-
-
Example 3:
-
-
-Input: nums1 = [-1,-1], nums2 = [1,1]
-Output: -1
-Explanation: Take subsequence [-1] from nums1 and subsequence [1] from nums2.
-Their dot product is -1.
-
-
-
Constraints:
-
-
-
1 <= nums1.length, nums2.length <= 500
-
-1000 <= nums1[i], nums2[i] <= 1000
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Hints
-
-Hint 1
-Use dynamic programming, define DP[i][j] as the maximum dot product of two subsequences starting in the position i of nums1 and position j of nums2.
-
diff --git a/problems/max-increase-to-keep-city-skyline/README.md b/problems/max-increase-to-keep-city-skyline/README.md
deleted file mode 100644
index 272f8486a..000000000
--- a/problems/max-increase-to-keep-city-skyline/README.md
+++ /dev/null
@@ -1,58 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../number-of-lines-to-write-string "Number of Lines To Write String")
-
-[Next >](../soup-servings "Soup Servings")
-
-## [807. Max Increase to Keep City Skyline (Medium)](https://leetcode.com/problems/max-increase-to-keep-city-skyline "保持城市天际线")
-
-
There is a city composed of n x n blocks, where each block contains a single building shaped like a vertical square prism. You are given a 0-indexedn x n integer matrix grid where grid[r][c] represents the height of the building located in the block at row r and column c.
-
-
A city's skyline is the the outer contour formed by all the building when viewing the side of the city from a distance. The skyline from each cardinal direction north, east, south, and west may be different.
-
-
We are allowed to increase the height of any number of buildings by any amount (the amount can be different per building). The height of a 0-height building can also be increased. However, increasing the height of a building should not affect the city's skyline from any cardinal direction.
-
-
Return the maximum total sum that the height of the buildings can be increased by without changing the city's skyline from any cardinal direction.
-
-
-
Example 1:
-
-
-Input: grid = [[3,0,8,4],[2,4,5,7],[9,2,6,3],[0,3,1,0]]
-Output: 35
-Explanation: The building heights are shown in the center of the above image.
-The skylines when viewed from each cardinal direction are drawn in red.
-The grid after increasing the height of buildings without affecting skylines is:
-gridNew = [ [8, 4, 8, 7],
- [7, 4, 7, 7],
- [9, 4, 8, 7],
- [3, 3, 3, 3] ]
-
-
-
Example 2:
-
-
-Input: grid = [[0,0,0],[0,0,0],[0,0,0]]
-Output: 0
-Explanation: Increasing the height of any building will result in the skyline changing.
-
You are given an integer array nums and an integer k.
-
-
In one operation, you can pick two numbers from the array whose sum equals k and remove them from the array.
-
-
Return the maximum number of operations you can perform on the array.
-
-
-
Example 1:
-
-
-Input: nums = [1,2,3,4], k = 5
-Output: 2
-Explanation: Starting with nums = [1,2,3,4]:
-- Remove numbers 1 and 4, then nums = [2,3]
-- Remove numbers 2 and 3, then nums = []
-There are no more pairs that sum up to 5, hence a total of 2 operations.
-
-
Example 2:
-
-
-Input: nums = [3,1,3,4,3], k = 6
-Output: 1
-Explanation: Starting with nums = [3,1,3,4,3]:
-- Remove the first two 3's, then nums = [1,4,3]
-There are no more pairs that sum up to 6, hence a total of 1 operation.
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 105
-
1 <= nums[i] <= 109
-
1 <= k <= 109
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Two Pointers](../../tag/two-pointers/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Hints
-
-Hint 1
-The abstract problem asks to count the number of disjoint pairs with a given sum k.
-
-
-
-Hint 2
-For each possible value x, it can be paired up with k - x.
-
-
-
-Hint 3
-The number of such pairs equals to min(count(x), count(k-x)), unless that x = k / 2, where the number of such pairs will be floor(count(x) / 2).
-
diff --git a/problems/max-points-on-a-line/README.md b/problems/max-points-on-a-line/README.md
deleted file mode 100644
index 30d9071b2..000000000
--- a/problems/max-points-on-a-line/README.md
+++ /dev/null
@@ -1,47 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../sort-list "Sort List")
-
-[Next >](../evaluate-reverse-polish-notation "Evaluate Reverse Polish Notation")
-
-## [149. Max Points on a Line (Hard)](https://leetcode.com/problems/max-points-on-a-line "直线上最多的点数")
-
-
Given an array of points where points[i] = [xi, yi] represents a point on the X-Y plane, return the maximum number of points that lie on the same straight line.
The last four operations won't be called when stack is empty.
-
-
-
-### Related Topics
- [[Stack](../../tag/stack/README.md)]
- [[Design](../../tag/design/README.md)]
- [[Linked List](../../tag/linked-list/README.md)]
- [[Doubly-Linked List](../../tag/doubly-linked-list/README.md)]
- [[Ordered Set](../../tag/ordered-set/README.md)]
-
-### Similar Questions
- 1. [Min Stack](../min-stack) (Easy)
diff --git a/problems/max-stack/max_stack.go b/problems/max-stack/max_stack.go
deleted file mode 100644
index 11d92ea69..000000000
--- a/problems/max-stack/max_stack.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem716
diff --git a/problems/max-stack/max_stack_test.go b/problems/max-stack/max_stack_test.go
deleted file mode 100644
index 11d92ea69..000000000
--- a/problems/max-stack/max_stack_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem716
diff --git a/problems/max-sum-of-rectangle-no-larger-than-k/README.md b/problems/max-sum-of-rectangle-no-larger-than-k/README.md
deleted file mode 100644
index fd0a83635..000000000
--- a/problems/max-sum-of-rectangle-no-larger-than-k/README.md
+++ /dev/null
@@ -1,53 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../design-hit-counter "Design Hit Counter")
-
-[Next >](../nested-list-weight-sum-ii "Nested List Weight Sum II")
-
-## [363. Max Sum of Rectangle No Larger Than K (Hard)](https://leetcode.com/problems/max-sum-of-rectangle-no-larger-than-k "矩形区域不超过 K 的最大数值和")
-
-
Given an m x n matrix matrix and an integer k, return the max sum of a rectangle in the matrix such that its sum is no larger thank.
-
-
It is guaranteed that there will be a rectangle with a sum no larger than k.
-
-
-
Example 1:
-
-
-Input: matrix = [[1,0,1],[0,-2,3]], k = 2
-Output: 2
-Explanation: Because the sum of the blue rectangle [[0, 1], [-2, 3]] is 2, and 2 is the max number no larger than k (k = 2).
-
-
-
Example 2:
-
-
-Input: matrix = [[2,2,-1]], k = 3
-Output: 3
-
-
-
-
Constraints:
-
-
-
m == matrix.length
-
n == matrix[i].length
-
1 <= m, n <= 100
-
-100 <= matrix[i][j] <= 100
-
-105 <= k <= 105
-
-
-
-
Follow up: What if the number of rows is much larger than the number of columns?
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
- [[Ordered Set](../../tag/ordered-set/README.md)]
diff --git a/problems/max-sum-of-rectangle-no-larger-than-k/max_sum_of_rectangle_no_larger_than_k.go b/problems/max-sum-of-rectangle-no-larger-than-k/max_sum_of_rectangle_no_larger_than_k.go
deleted file mode 100644
index 0ace882ee..000000000
--- a/problems/max-sum-of-rectangle-no-larger-than-k/max_sum_of_rectangle_no_larger_than_k.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem363
diff --git a/problems/max-sum-of-rectangle-no-larger-than-k/max_sum_of_rectangle_no_larger_than_k_test.go b/problems/max-sum-of-rectangle-no-larger-than-k/max_sum_of_rectangle_no_larger_than_k_test.go
deleted file mode 100644
index 0ace882ee..000000000
--- a/problems/max-sum-of-rectangle-no-larger-than-k/max_sum_of_rectangle_no_larger_than_k_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem363
diff --git a/problems/max-value-of-equation/README.md b/problems/max-value-of-equation/README.md
deleted file mode 100644
index 4acc64f7b..000000000
--- a/problems/max-value-of-equation/README.md
+++ /dev/null
@@ -1,74 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../number-of-subsequences-that-satisfy-the-given-sum-condition "Number of Subsequences That Satisfy the Given Sum Condition")
-
-[Next >](../design-a-file-sharing-system "Design a File Sharing System")
-
-## [1499. Max Value of Equation (Hard)](https://leetcode.com/problems/max-value-of-equation "满足不等式的最大值")
-
-
You are given an array points containing the coordinates of points on a 2D plane, sorted by the x-values, where points[i] = [xi, yi] such that xi < xj for all 1 <= i < j <= points.length. You are also given an integer k.
-
-
Return the maximum value of the equation yi + yj + |xi - xj| where |xi - xj| <= k and 1 <= i < j <= points.length.
-
-
It is guaranteed that there exists at least one pair of points that satisfy the constraint |xi - xj| <= k.
-
-
-
Example 1:
-
-
-Input: points = [[1,3],[2,0],[5,10],[6,-10]], k = 1
-Output: 4
-Explanation: The first two points satisfy the condition |xi - xj| <= 1 and if we calculate the equation we get 3 + 0 + |1 - 2| = 4. Third and fourth points also satisfy the condition and give a value of 10 + -10 + |5 - 6| = 1.
-No other pairs satisfy the condition, so we return the max of 4 and 1.
-
-
-
Example 2:
-
-
-Input: points = [[0,0],[3,0],[9,2]], k = 3
-Output: 3
-Explanation: Only the first two points have an absolute difference of 3 or less in the x-values, and give the value of 0 + 0 + |0 - 3| = 3.
-
-
-
-
Constraints:
-
-
-
2 <= points.length <= 105
-
points[i].length == 2
-
-108 <= xi, yi <= 108
-
0 <= k <= 2 * 108
-
xi < xj for all 1 <= i < j <= points.length
-
xi form a strictly increasing sequence.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Queue](../../tag/queue/README.md)]
- [[Sliding Window](../../tag/sliding-window/README.md)]
- [[Heap (Priority Queue)](../../tag/heap-priority-queue/README.md)]
- [[Monotonic Queue](../../tag/monotonic-queue/README.md)]
-
-### Similar Questions
- 1. [Count Pairs in Two Arrays](../count-pairs-in-two-arrays) (Medium)
-
-### Hints
-
-Hint 1
-Use a priority queue to store for each point i, the tuple [yi-xi, xi]
-
-
-
-Hint 2
-Loop through the array and pop elements from the heap if the condition xj - xi > k, where j is the current index and i is the point on top the queue.
-
-
-
-Hint 3
-After popping elements from the queue. If the queue is not empty, calculate the equation with the current point and the point on top of the queue and maximize the answer.
-
diff --git a/problems/maximal-network-rank/README.md b/problems/maximal-network-rank/README.md
deleted file mode 100644
index d5630d2b3..000000000
--- a/problems/maximal-network-rank/README.md
+++ /dev/null
@@ -1,80 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-nesting-depth-of-the-parentheses "Maximum Nesting Depth of the Parentheses")
-
-[Next >](../split-two-strings-to-make-palindrome "Split Two Strings to Make Palindrome")
-
-## [1615. Maximal Network Rank (Medium)](https://leetcode.com/problems/maximal-network-rank "最大网络秩")
-
-
There is an infrastructure of n cities with some number of roads connecting these cities. Each roads[i] = [ai, bi] indicates that there is a bidirectional road between cities ai and bi.
-
-
The network rankof two different cities is defined as the total number of directly connected roads to either city. If a road is directly connected to both cities, it is only counted once.
-
-
The maximal network rank of the infrastructure is the maximum network rank of all pairs of different cities.
-
-
Given the integer n and the array roads, return the maximal network rank of the entire infrastructure.
-
-
-
Example 1:
-
-
-
-
-Input: n = 4, roads = [[0,1],[0,3],[1,2],[1,3]]
-Output: 4
-Explanation: The network rank of cities 0 and 1 is 4 as there are 4 roads that are connected to either 0 or 1. The road between 0 and 1 is only counted once.
-
-
-
Example 2:
-
-
-
-
-Input: n = 5, roads = [[0,1],[0,3],[1,2],[1,3],[2,3],[2,4]]
-Output: 5
-Explanation: There are 5 roads that are connected to cities 1 or 2.
-
-
-
Example 3:
-
-
-Input: n = 8, roads = [[0,1],[1,2],[2,3],[2,4],[5,6],[5,7]]
-Output: 5
-Explanation: The network rank of 2 and 5 is 5. Notice that all the cities do not have to be connected.
-
-
-
-
Constraints:
-
-
-
2 <= n <= 100
-
0 <= roads.length <= n * (n - 1) / 2
-
roads[i].length == 2
-
0 <= ai, bi <= n-1
-
ai != bi
-
Each pair of cities has at most one road connecting them.
-
-
-### Related Topics
- [[Graph](../../tag/graph/README.md)]
-
-### Hints
-
-Hint 1
-Try every pair of different cities and calculate its network rank.
-
-
-
-Hint 2
-The network rank of two vertices is almost the sum of their degrees.
-
-
-
-Hint 3
-How can you efficiently check if there is a road connecting two different cities?
-
diff --git a/problems/maximal-rectangle/README.md b/problems/maximal-rectangle/README.md
deleted file mode 100644
index 78ebdca14..000000000
--- a/problems/maximal-rectangle/README.md
+++ /dev/null
@@ -1,58 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../largest-rectangle-in-histogram "Largest Rectangle in Histogram")
-
-[Next >](../partition-list "Partition List")
-
-## [85. Maximal Rectangle (Hard)](https://leetcode.com/problems/maximal-rectangle "最大矩形")
-
-
Given a rows x cols binary matrix filled with 0's and 1's, find the largest rectangle containing only 1's and return its area.
-
-
-
Example 1:
-
-
-Input: matrix = [["1","0","1","0","0"],["1","0","1","1","1"],["1","1","1","1","1"],["1","0","0","1","0"]]
-Output: 6
-Explanation: The maximal rectangle is shown in the above picture.
-
You are given an array representing a row of seats where seats[i] = 1 represents a person sitting in the ith seat, and seats[i] = 0 represents that the ith seat is empty (0-indexed).
-
-
There is at least one empty seat, and at least one person sitting.
-
-
Alex wants to sit in the seat such that the distance between him and the closest person to him is maximized.
-
-
Return that maximum distance to the closest person.
-
-
-
Example 1:
-
-
-Input: seats = [1,0,0,0,1,0,1]
-Output: 2
-Explanation:
-If Alex sits in the second open seat (i.e. seats[2]), then the closest person has distance 2.
-If Alex sits in any other open seat, the closest person has distance 1.
-Thus, the maximum distance to the closest person is 2.
-
-
-
Example 2:
-
-
-Input: seats = [1,0,0,0]
-Output: 3
-Explanation:
-If Alex sits in the last seat (i.e. seats[3]), the closest person is 3 seats away.
-This is the maximum distance possible, so the answer is 3.
-
You are given four integers, m, n, introvertsCount, and extrovertsCount. You have an m x n grid, and there are two types of people: introverts and extroverts. There are introvertsCount introverts and extrovertsCount extroverts.
-
-
You should decide how many people you want to live in the grid and assign each of them one grid cell. Note that you do not have to have all the people living in the grid.
-
-
The happiness of each person is calculated as follows:
-
-
-
Introverts start with 120 happiness and lose30 happiness for each neighbor (introvert or extrovert).
-
Extroverts start with 40 happiness and gain20 happiness for each neighbor (introvert or extrovert).
-
-
-
Neighbors live in the directly adjacent cells north, east, south, and west of a person's cell.
-
-
The grid happiness is the sum of each person's happiness. Return the maximum possible grid happiness.
-
-
-
Example 1:
-
-
-Input: m = 2, n = 3, introvertsCount = 1, extrovertsCount = 2
-Output: 240
-Explanation: Assume the grid is 1-indexed with coordinates (row, column).
-We can put the introvert in cell (1,1) and put the extroverts in cells (1,3) and (2,3).
-- Introvert at (1,1) happiness: 120 (starting happiness) - (0 * 30) (0 neighbors) = 120
-- Extrovert at (1,3) happiness: 40 (starting happiness) + (1 * 20) (1 neighbor) = 60
-- Extrovert at (2,3) happiness: 40 (starting happiness) + (1 * 20) (1 neighbor) = 60
-The grid happiness is 120 + 60 + 60 = 240.
-The above figure shows the grid in this example with each person's happiness. The introvert stays in the light green cell while the extroverts live on the light purple cells.
-
-
-
Example 2:
-
-
-Input: m = 3, n = 1, introvertsCount = 2, extrovertsCount = 1
-Output: 260
-Explanation: Place the two introverts in (1,1) and (3,1) and the extrovert at (2,1).
-- Introvert at (1,1) happiness: 120 (starting happiness) - (1 * 30) (1 neighbor) = 90
-- Extrovert at (2,1) happiness: 40 (starting happiness) + (2 * 20) (2 neighbors) = 80
-- Introvert at (3,1) happiness: 120 (starting happiness) - (1 * 30) (1 neighbor) = 90
-The grid happiness is 90 + 80 + 90 = 260.
-
-
-
Example 3:
-
-
-Input: m = 2, n = 2, introvertsCount = 4, extrovertsCount = 0
-Output: 240
-
-
-
-
Constraints:
-
-
-
1 <= m, n <= 5
-
0 <= introvertsCount, extrovertsCount <= min(m * n, 6)
-
-
-### Related Topics
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Bit Manipulation](../../tag/bit-manipulation/README.md)]
- [[Memoization](../../tag/memoization/README.md)]
- [[Bitmask](../../tag/bitmask/README.md)]
-
-### Hints
-
-Hint 1
-For each cell, it has 3 options, either it is empty, or contains an introvert, or an extrovert.
-
-
-
-Hint 2
-You can do DP where you maintain the state of the previous row, the number of remaining introverts and extroverts, the current row and column, and try the 3 options for each cell.
-
-
-
-Hint 3
-Assume that the previous columns in the current row already belong to the previous row.
-
diff --git a/problems/maximize-number-of-nice-divisors/README.md b/problems/maximize-number-of-nice-divisors/README.md
deleted file mode 100644
index 69b41c77f..000000000
--- a/problems/maximize-number-of-nice-divisors/README.md
+++ /dev/null
@@ -1,76 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../evaluate-the-bracket-pairs-of-a-string "Evaluate the Bracket Pairs of a String")
-
-[Next >](../ad-free-sessions "Ad-Free Sessions")
-
-## [1808. Maximize Number of Nice Divisors (Hard)](https://leetcode.com/problems/maximize-number-of-nice-divisors "好因子的最大数目")
-
-
You are given a positive integer primeFactors. You are asked to construct a positive integer n that satisfies the following conditions:
-
-
-
The number of prime factors of n (not necessarily distinct) is at mostprimeFactors.
-
The number of nice divisors of n is maximized. Note that a divisor of n is nice if it is divisible by every prime factor of n. For example, if n = 12, then its prime factors are [2,2,3], then 6 and 12 are nice divisors, while 3 and 4 are not.
-
-
-
Return the number of nice divisors ofn. Since that number can be too large, return it modulo109 + 7.
-
-
Note that a prime number is a natural number greater than 1 that is not a product of two smaller natural numbers. The prime factors of a number n is a list of prime numbers such that their product equals n.
-
-
-
Example 1:
-
-
-Input: primeFactors = 5
-Output: 6
-Explanation: 200 is a valid value of n.
-It has 5 prime factors: [2,2,2,5,5], and it has 6 nice divisors: [10,20,40,50,100,200].
-There is not other value of n that has at most 5 prime factors and more nice divisors.
-
-
-
Example 2:
-
-
-Input: primeFactors = 8
-Output: 18
-
-
-
-
Constraints:
-
-
-
1 <= primeFactors <= 109
-
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
- [[Recursion](../../tag/recursion/README.md)]
-
-### Similar Questions
- 1. [Integer Break](../integer-break) (Medium)
-
-### Hints
-
-Hint 1
-The number of nice divisors is equal to the product of the count of each prime factor. Then the problem is reduced to: given n, find a sequence of numbers whose sum equals n and whose product is maximized.
-
-
-
-Hint 2
-This sequence can have no numbers that are larger than 4. Proof: if it contains a number x that is larger than 4, then you can replace x with floor(x/2) and ceil(x/2), and floor(x/2) * ceil(x/2) > x. You can also replace 4s with two 2s. Hence, there will always be optimal solutions with only 2s and 3s.
-
-
-
-Hint 3
-If there are three 2s, you can replace them with two 3s to get a better product. Hence, you'll never have more than two 2s.
-
-
-
-Hint 4
-Keep adding 3s as long as n ≥ 5.
-
diff --git a/problems/maximize-palindrome-length-from-subsequences/README.md b/problems/maximize-palindrome-length-from-subsequences/README.md
deleted file mode 100644
index d81e5e0b6..000000000
--- a/problems/maximize-palindrome-length-from-subsequences/README.md
+++ /dev/null
@@ -1,71 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-score-from-performing-multiplication-operations "Maximum Score from Performing Multiplication Operations")
-
-[Next >](../sort-features-by-popularity "Sort Features by Popularity")
-
-## [1771. Maximize Palindrome Length From Subsequences (Hard)](https://leetcode.com/problems/maximize-palindrome-length-from-subsequences "由子序列构造的最长回文串的长度")
-
-
You are given two strings, word1 and word2. You want to construct a string in the following manner:
-
-
-
Choose some non-empty subsequence subsequence1 from word1.
-
Choose some non-empty subsequence subsequence2 from word2.
-
Concatenate the subsequences: subsequence1 + subsequence2, to make the string.
-
-
-
Return the length of the longest palindrome that can be constructed in the described manner. If no palindromes can be constructed, return 0.
-
-
A subsequence of a string s is a string that can be made by deleting some (possibly none) characters from s without changing the order of the remaining characters.
-
-
A palindrome is a string that reads the same forward as well as backward.
-
-
-
Example 1:
-
-
-Input: word1 = "cacb", word2 = "cbba"
-Output: 5
-Explanation: Choose "ab" from word1 and "cba" from word2 to make "abcba", which is a palindrome.
-
-
Example 2:
-
-
-Input: word1 = "ab", word2 = "ab"
-Output: 3
-Explanation: Choose "ab" from word1 and "a" from word2 to make "aba", which is a palindrome.
-
-
Example 3:
-
-
-Input: word1 = "aa", word2 = "bb"
-Output: 0
-Explanation: You cannot construct a palindrome from the described method, so return 0.
-
-
-
Constraints:
-
-
-
1 <= word1.length, word2.length <= 1000
-
word1 and word2 consist of lowercase English letters.
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Hints
-
-Hint 1
-Let's ignore the non-empty subsequence constraint. We can concatenate the two strings and find the largest palindromic subsequence with dynamic programming.
-
-
-
-Hint 2
-Iterate through every pair of characters word1[i] and word2[j], and see if some palindrome begins with word1[i] and ends with word2[j]. This ensures that the subsequences are non-empty.
-
diff --git a/problems/maximize-score-after-n-operations/README.md b/problems/maximize-score-after-n-operations/README.md
deleted file mode 100644
index 2435627b1..000000000
--- a/problems/maximize-score-after-n-operations/README.md
+++ /dev/null
@@ -1,83 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-number-of-consecutive-values-you-can-make "Maximum Number of Consecutive Values You Can Make")
-
-[Next >](../maximum-ascending-subarray-sum "Maximum Ascending Subarray Sum")
-
-## [1799. Maximize Score After N Operations (Hard)](https://leetcode.com/problems/maximize-score-after-n-operations "N 次操作后的最大分数和")
-
-
You are given nums, an array of positive integers of size 2 * n. You must perform n operations on this array.
-
-
In the ith operation (1-indexed), you will:
-
-
-
Choose two elements, x and y.
-
Receive a score of i * gcd(x, y).
-
Remove x and y from nums.
-
-
-
Return the maximum score you can receive after performing n operations.
-
-
The function gcd(x, y) is the greatest common divisor of x and y.
-
-
-
Example 1:
-
-
-Input: nums = [1,2]
-Output: 1
-Explanation: The optimal choice of operations is:
-(1 * gcd(1, 2)) = 1
-
-
-
Example 2:
-
-
-Input: nums = [3,4,6,8]
-Output: 11
-Explanation: The optimal choice of operations is:
-(1 * gcd(3, 6)) + (2 * gcd(4, 8)) = 3 + 8 = 11
-
-
-### Related Topics
- [[Bit Manipulation](../../tag/bit-manipulation/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Math](../../tag/math/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Backtracking](../../tag/backtracking/README.md)]
- [[Bitmask](../../tag/bitmask/README.md)]
- [[Number Theory](../../tag/number-theory/README.md)]
-
-### Hints
-
-Hint 1
-Find every way to split the array until n groups of 2. Brute force recursion is acceptable.
-
-
-
-Hint 2
-Calculate the gcd of every pair and greedily multiply the largest gcds.
-
diff --git a/problems/maximize-sum-of-array-after-k-negations/README.md b/problems/maximize-sum-of-array-after-k-negations/README.md
deleted file mode 100644
index 881f9c9c8..000000000
--- a/problems/maximize-sum-of-array-after-k-negations/README.md
+++ /dev/null
@@ -1,61 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../max-consecutive-ones-iii "Max Consecutive Ones III")
-
-[Next >](../clumsy-factorial "Clumsy Factorial")
-
-## [1005. Maximize Sum Of Array After K Negations (Easy)](https://leetcode.com/problems/maximize-sum-of-array-after-k-negations "K 次取反后最大化的数组和")
-
-
Given an integer array nums and an integer k, modify the array in the following way:
-
-
-
choose an index i and replace nums[i] with -nums[i].
-
-
-
You should apply this process exactly k times. You may choose the same index i multiple times.
-
-
Return the largest possible sum of the array after modifying it in this way.
-
-
-
Example 1:
-
-
-Input: nums = [4,2,3], k = 1
-Output: 5
-Explanation: Choose index 1 and nums becomes [4,-2,3].
-
-
-
Example 2:
-
-
-Input: nums = [3,-1,0,2], k = 3
-Output: 6
-Explanation: Choose indices (1, 2, 2) and nums becomes [3,1,0,2].
-
-
-
Example 3:
-
-
-Input: nums = [2,-3,-1,5,-4], k = 2
-Output: 13
-Explanation: Choose indices (1, 4) and nums becomes [2,3,-1,5,4].
-
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 104
-
-100 <= nums[i] <= 100
-
1 <= k <= 104
-
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
diff --git a/problems/maximize-sum-of-array-after-k-negations/maximize_sum_of_array_after_k_negations.go b/problems/maximize-sum-of-array-after-k-negations/maximize_sum_of_array_after_k_negations.go
deleted file mode 100644
index c00535350..000000000
--- a/problems/maximize-sum-of-array-after-k-negations/maximize_sum_of_array_after_k_negations.go
+++ /dev/null
@@ -1,21 +0,0 @@
-package problem1005
-
-import "sort"
-
-func largestSumAfterKNegations(A []int, K int) int {
- sort.Ints(A)
- ans, min := 0, A[len(A)-1]
- for _, v := range A {
- if K > 0 && v <= 0 {
- K, v = K-1, -v
- }
- if v < min {
- min = v
- }
- ans += v
- }
- if K&1 == 1 {
- ans -= min * 2
- }
- return ans
-}
diff --git a/problems/maximize-sum-of-array-after-k-negations/maximize_sum_of_array_after_k_negations_test.go b/problems/maximize-sum-of-array-after-k-negations/maximize_sum_of_array_after_k_negations_test.go
deleted file mode 100644
index d506d5842..000000000
--- a/problems/maximize-sum-of-array-after-k-negations/maximize_sum_of_array_after_k_negations_test.go
+++ /dev/null
@@ -1,35 +0,0 @@
-package problem1005
-
-import "testing"
-
-type testType struct {
- in []int
- k int
- want int
-}
-
-func TestLargestSumAfterKNegations(t *testing.T) {
- tests := [...]testType{
- {
- in: []int{4, 2, 3},
- k: 1,
- want: 5,
- },
- {
- in: []int{3, -1, 0, 2},
- k: 3,
- want: 6,
- },
- {
- in: []int{2, -3, -1, 5, -4},
- k: 2,
- want: 13,
- },
- }
- for _, tt := range tests {
- got := largestSumAfterKNegations(tt.in, tt.k)
- if got != tt.want {
- t.Fatalf("in: %v, got: %v, want: %v", tt.in, got, tt.want)
- }
- }
-}
diff --git a/problems/maximize-the-beauty-of-the-garden/README.md b/problems/maximize-the-beauty-of-the-garden/README.md
deleted file mode 100644
index 20133a4ef..000000000
--- a/problems/maximize-the-beauty-of-the-garden/README.md
+++ /dev/null
@@ -1,30 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../make-the-xor-of-all-segments-equal-to-zero "Make the XOR of All Segments Equal to Zero")
-
-[Next >](../primary-department-for-each-employee "Primary Department for Each Employee")
-
-## [1788. Maximize the Beauty of the Garden (Hard)](https://leetcode.com/problems/maximize-the-beauty-of-the-garden "最大化花园的美观度")
-
-
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Prefix Sum](../../tag/prefix-sum/README.md)]
-
-### Hints
-
-Hint 1
-Consider every possible beauty and its first and last index in flowers.
-
-
-
-Hint 2
-Remove all flowers with negative beauties within those indices.
-
diff --git a/problems/maximize-the-confusion-of-an-exam/README.md b/problems/maximize-the-confusion-of-an-exam/README.md
deleted file mode 100644
index f750e9c89..000000000
--- a/problems/maximize-the-confusion-of-an-exam/README.md
+++ /dev/null
@@ -1,79 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../number-of-pairs-of-strings-with-concatenation-equal-to-target "Number of Pairs of Strings With Concatenation Equal to Target")
-
-[Next >](../maximum-number-of-ways-to-partition-an-array "Maximum Number of Ways to Partition an Array")
-
-## [2024. Maximize the Confusion of an Exam (Medium)](https://leetcode.com/problems/maximize-the-confusion-of-an-exam "考试的最大困扰度")
-
-
A teacher is writing a test with n true/false questions, with 'T' denoting true and 'F' denoting false. He wants to confuse the students by maximizing the number of consecutive questions with the same answer (multiple trues or multiple falses in a row).
-
-
You are given a string answerKey, where answerKey[i] is the original answer to the ith question. In addition, you are given an integer k, the maximum number of times you may perform the following operation:
-
-
-
Change the answer key for any question to 'T' or 'F' (i.e., set answerKey[i] to 'T' or 'F').
-
-
-
Return the maximum number of consecutive'T's or 'F's in the answer key after performing the operation at mostktimes.
-
-
-
Example 1:
-
-
-Input: answerKey = "TTFF", k = 2
-Output: 4
-Explanation: We can replace both the 'F's with 'T's to make answerKey = "TTTT".
-There are four consecutive 'T's.
-
-
-
Example 2:
-
-
-Input: answerKey = "TFFT", k = 1
-Output: 3
-Explanation: We can replace the first 'T' with an 'F' to make answerKey = "FFFT".
-Alternatively, we can replace the second 'T' with an 'F' to make answerKey = "TFFF".
-In both cases, there are three consecutive 'F's.
-
-
-
Example 3:
-
-
-Input: answerKey = "TTFTTFTT", k = 1
-Output: 5
-Explanation: We can replace the first 'F' to make answerKey = "TTTTTFTT"
-Alternatively, we can replace the second 'F' to make answerKey = "TTFTTTTT".
-In both cases, there are five consecutive 'T's.
-
-
-
-
Constraints:
-
-
-
n == answerKey.length
-
1 <= n <= 5 * 104
-
answerKey[i] is either 'T' or 'F'
-
1 <= k <= n
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
- [[Prefix Sum](../../tag/prefix-sum/README.md)]
- [[Sliding Window](../../tag/sliding-window/README.md)]
-
-### Hints
-
-Hint 1
-Can we use the maximum length at the previous position to help us find the answer for the current position?
-
-
-
-Hint 2
-Can we use binary search to find the maximum consecutive same answer at every position?
-
diff --git a/problems/maximum-69-number/README.md b/problems/maximum-69-number/README.md
deleted file mode 100644
index 79c1b13da..000000000
--- a/problems/maximum-69-number/README.md
+++ /dev/null
@@ -1,67 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../ads-performance "Ads Performance")
-
-[Next >](../print-words-vertically "Print Words Vertically")
-
-## [1323. Maximum 69 Number (Easy)](https://leetcode.com/problems/maximum-69-number "6 和 9 组成的最大数字")
-
-
Given a positive integer num consisting only of digits 6 and 9.
-
-
Return the maximum number you can get by changing at most one digit (6 becomes 9, and 9 becomes 6).
-
-
-
Example 1:
-
-
-Input: num = 9669
-Output: 9969
-Explanation:
-Changing the first digit results in 6669.
-Changing the second digit results in 9969.
-Changing the third digit results in 9699.
-Changing the fourth digit results in 9666.
-The maximum number is 9969.
-
-
-
Example 2:
-
-
-Input: num = 9996
-Output: 9999
-Explanation: Changing the last digit 6 to 9 results in the maximum number.
-
-
Example 3:
-
-
-Input: num = 9999
-Output: 9999
-Explanation: It is better not to apply any change.
-
-
-
Constraints:
-
-
-
1 <= num <= 10^4
-
num's digits are 6 or 9.
-
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
- [[Greedy](../../tag/greedy/README.md)]
-
-### Hints
-
-Hint 1
-Convert the number in an array of its digits.
-
-
-
-Hint 2
-Brute force on every digit to get the maximum number.
-
diff --git a/problems/maximum-absolute-sum-of-any-subarray/README.md b/problems/maximum-absolute-sum-of-any-subarray/README.md
deleted file mode 100644
index 77031437a..000000000
--- a/problems/maximum-absolute-sum-of-any-subarray/README.md
+++ /dev/null
@@ -1,73 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../sum-of-unique-elements "Sum of Unique Elements")
-
-[Next >](../minimum-length-of-string-after-deleting-similar-ends "Minimum Length of String After Deleting Similar Ends")
-
-## [1749. Maximum Absolute Sum of Any Subarray (Medium)](https://leetcode.com/problems/maximum-absolute-sum-of-any-subarray "任意子数组和的绝对值的最大值")
-
-
You are given an integer array nums. The absolute sum of a subarray [numsl, numsl+1, ..., numsr-1, numsr] is abs(numsl + numsl+1 + ... + numsr-1 + numsr).
-
-
Return the maximum absolute sum of any (possibly empty) subarray of nums.
-
-
Note that abs(x) is defined as follows:
-
-
-
If x is a negative integer, then abs(x) = -x.
-
If x is a non-negative integer, then abs(x) = x.
-
-
-
-
Example 1:
-
-
-Input: nums = [1,-3,2,3,-4]
-Output: 5
-Explanation: The subarray [2,3] has absolute sum = abs(2+3) = abs(5) = 5.
-
-
-
Example 2:
-
-
-Input: nums = [2,-5,1,-4,3,-2]
-Output: 8
-Explanation: The subarray [-5,1,-4] has absolute sum = abs(-5+1-4) = abs(-8) = 8.
-
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 105
-
-104 <= nums[i] <= 104
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Hints
-
-Hint 1
-What if we asked for maximum sum, not absolute sum?
-
-
-
-Hint 2
-It's a standard problem that can be solved by Kadane's algorithm.
-
-
-
-Hint 3
-The key idea is the max absolute sum will be either the max sum or the min sum.
-
-
-
-Hint 4
-So just run kadane twice, once calculating the max sum and once calculating the min sum.
-
diff --git a/problems/maximum-alternating-subarray-sum/README.md b/problems/maximum-alternating-subarray-sum/README.md
deleted file mode 100644
index d761dc4d7..000000000
--- a/problems/maximum-alternating-subarray-sum/README.md
+++ /dev/null
@@ -1,39 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../partition-array-into-two-arrays-to-minimize-sum-difference "Partition Array Into Two Arrays to Minimize Sum Difference")
-
-[Next >](../minimum-number-of-moves-to-seat-everyone "Minimum Number of Moves to Seat Everyone")
-
-## [2036. Maximum Alternating Subarray Sum (Medium)](https://leetcode.com/problems/maximum-alternating-subarray-sum "最大交替子数组和")
-
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Hints
-
-Hint 1
-How can Kadane's Algorithm help us?
-
-
-
-Hint 2
-If you convert all the numbers at odd indices to the negative version of that number, the problem simplifies to finding the maximum subarray sum.
-
-
-
-Hint 3
-However, this strategy needs you to start each subarray at an even index.
-
-
-
-Hint 4
-Do the same except converting all the numbers at even indices to the negative version of that number.
-
diff --git a/problems/maximum-alternating-subsequence-sum/README.md b/problems/maximum-alternating-subsequence-sum/README.md
deleted file mode 100644
index 340f9b788..000000000
--- a/problems/maximum-alternating-subsequence-sum/README.md
+++ /dev/null
@@ -1,76 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../remove-all-occurrences-of-a-substring "Remove All Occurrences of a Substring")
-
-[Next >](../design-movie-rental-system "Design Movie Rental System")
-
-## [1911. Maximum Alternating Subsequence Sum (Medium)](https://leetcode.com/problems/maximum-alternating-subsequence-sum "最大子序列交替和")
-
-
The alternating sum of a 0-indexed array is defined as the sum of the elements at even indices minus the sum of the elements at odd indices.
-
-
-
For example, the alternating sum of [4,2,5,3] is (4 + 5) - (2 + 3) = 4.
-
-
-
Given an array nums, return the maximum alternating sum of any subsequence of nums (after reindexing the elements of the subsequence).
-
-
-
-
-
A subsequence of an array is a new array generated from the original array by deleting some elements (possibly none) without changing the remaining elements' relative order. For example, [2,7,4] is a subsequence of [4,2,3,7,2,1,4] (the underlined elements), while [2,4,2] is not.
-
-
-
Example 1:
-
-
-Input: nums = [4,2,5,3]
-Output: 7
-Explanation: It is optimal to choose the subsequence [4,2,5] with alternating sum (4 + 5) - 2 = 7.
-
-
-
Example 2:
-
-
-Input: nums = [5,6,7,8]
-Output: 8
-Explanation: It is optimal to choose the subsequence [8] with alternating sum 8.
-
-
-
Example 3:
-
-
-Input: nums = [6,2,1,2,4,5]
-Output: 10
-Explanation: It is optimal to choose the subsequence [6,1,5] with alternating sum (6 + 5) - 1 = 10.
-
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 105
-
1 <= nums[i] <= 105
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Similar Questions
- 1. [Maximum Alternating Subarray Sum](../maximum-alternating-subarray-sum) (Medium)
-
-### Hints
-
-Hint 1
-Is only tracking a single sum enough to solve the problem?
-
-
-
-Hint 2
-How does tracking an odd sum and an even sum reduce the number of states?
-
diff --git a/problems/maximum-and-sum-of-array/README.md b/problems/maximum-and-sum-of-array/README.md
deleted file mode 100644
index c3a632e65..000000000
--- a/problems/maximum-and-sum-of-array/README.md
+++ /dev/null
@@ -1,69 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../removing-minimum-number-of-magic-beans "Removing Minimum Number of Magic Beans")
-
-[Next >](../longest-winning-streak "Longest Winning Streak")
-
-## [2172. Maximum AND Sum of Array (Hard)](https://leetcode.com/problems/maximum-and-sum-of-array "数组的最大与和")
-
-
You are given an integer array nums of length n and an integer numSlots such that 2 * numSlots >= n. There are numSlots slots numbered from 1 to numSlots.
-
-
You have to place all n integers into the slots such that each slot contains at most two numbers. The AND sum of a given placement is the sum of the bitwiseAND of every number with its respective slot number.
-
-
-
For example, the AND sum of placing the numbers [1, 3] into slot 1 and [4, 6] into slot 2 is equal to (1 AND 1) + (3 AND 1) + (4 AND 2) + (6 AND 2) = 1 + 1 + 0 + 2 = 4.
-
-
-
Return the maximum possible AND sum of nums given numSlots slots.
-
-
-
Example 1:
-
-
-Input: nums = [1,2,3,4,5,6], numSlots = 3
-Output: 9
-Explanation: One possible placement is [1, 4] into slot 1, [2, 6] into slot 2, and [3, 5] into slot 3.
-This gives the maximum AND sum of (1 AND 1) + (4 AND 1) + (2 AND 2) + (6 AND 2) + (3 AND 3) + (5 AND 3) = 1 + 0 + 2 + 2 + 3 + 1 = 9.
-
-
-
Example 2:
-
-
-Input: nums = [1,3,10,4,7,1], numSlots = 9
-Output: 24
-Explanation: One possible placement is [1, 1] into slot 1, [3] into slot 3, [4] into slot 4, [7] into slot 7, and [10] into slot 9.
-This gives the maximum AND sum of (1 AND 1) + (1 AND 1) + (3 AND 3) + (4 AND 4) + (7 AND 7) + (10 AND 9) = 1 + 1 + 3 + 4 + 7 + 8 = 24.
-Note that slots 2, 5, 6, and 8 are empty which is permitted.
-
-
-
-
Constraints:
-
-
-
n == nums.length
-
1 <= numSlots <= 9
-
1 <= n <= 2 * numSlots
-
1 <= nums[i] <= 15
-
-
-### Related Topics
- [[Bit Manipulation](../../tag/bit-manipulation/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Bitmask](../../tag/bitmask/README.md)]
-
-### Hints
-
-Hint 1
-Can you think of a dynamic programming solution to this problem?
-
-
-
-Hint 2
-Can you use a bitmask to represent the state of the slots?
-
diff --git a/problems/maximum-area-of-a-piece-of-cake-after-horizontal-and-vertical-cuts/README.md b/problems/maximum-area-of-a-piece-of-cake-after-horizontal-and-vertical-cuts/README.md
deleted file mode 100644
index 43b1a9eeb..000000000
--- a/problems/maximum-area-of-a-piece-of-cake-after-horizontal-and-vertical-cuts/README.md
+++ /dev/null
@@ -1,74 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-product-of-two-elements-in-an-array "Maximum Product of Two Elements in an Array")
-
-[Next >](../reorder-routes-to-make-all-paths-lead-to-the-city-zero "Reorder Routes to Make All Paths Lead to the City Zero")
-
-## [1465. Maximum Area of a Piece of Cake After Horizontal and Vertical Cuts (Medium)](https://leetcode.com/problems/maximum-area-of-a-piece-of-cake-after-horizontal-and-vertical-cuts "切割后面积最大的蛋糕")
-
-
You are given a rectangular cake of size h x w and two arrays of integers horizontalCuts and verticalCuts where:
-
-
-
horizontalCuts[i] is the distance from the top of the rectangular cake to the ith horizontal cut and similarly, and
-
verticalCuts[j] is the distance from the left of the rectangular cake to the jth vertical cut.
-
-
-
Return the maximum area of a piece of cake after you cut at each horizontal and vertical position provided in the arrayshorizontalCutsandverticalCuts. Since the answer can be a large number, return this modulo109 + 7.
-
-
-
Example 1:
-
-
-Input: h = 5, w = 4, horizontalCuts = [1,2,4], verticalCuts = [1,3]
-Output: 4
-Explanation: The figure above represents the given rectangular cake. Red lines are the horizontal and vertical cuts. After you cut the cake, the green piece of cake has the maximum area.
-
-
-
Example 2:
-
-
-Input: h = 5, w = 4, horizontalCuts = [3,1], verticalCuts = [1]
-Output: 6
-Explanation: The figure above represents the given rectangular cake. Red lines are the horizontal and vertical cuts. After you cut the cake, the green and yellow pieces of cake have the maximum area.
-
-
-
Example 3:
-
-
-Input: h = 5, w = 4, horizontalCuts = [3], verticalCuts = [3]
-Output: 9
-
-
-
-
Constraints:
-
-
-
2 <= h, w <= 109
-
1 <= horizontalCuts.length <= min(h - 1, 105)
-
1 <= verticalCuts.length <= min(w - 1, 105)
-
1 <= horizontalCuts[i] < h
-
1 <= verticalCuts[i] < w
-
All the elements in horizontalCuts are distinct.
-
All the elements in verticalCuts are distinct.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Greedy](../../tag/greedy/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Hints
-
-Hint 1
-Sort the arrays, then compute the maximum difference between two consecutive elements for horizontal cuts and vertical cuts.
-
-
-
-Hint 2
-The answer is the product of these maximum values in horizontal cuts and vertical cuts.
-
diff --git a/problems/maximum-ascending-subarray-sum/README.md b/problems/maximum-ascending-subarray-sum/README.md
deleted file mode 100644
index 349c6752a..000000000
--- a/problems/maximum-ascending-subarray-sum/README.md
+++ /dev/null
@@ -1,68 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximize-score-after-n-operations "Maximize Score After N Operations")
-
-[Next >](../number-of-orders-in-the-backlog "Number of Orders in the Backlog")
-
-## [1800. Maximum Ascending Subarray Sum (Easy)](https://leetcode.com/problems/maximum-ascending-subarray-sum "最大升序子数组和")
-
-
Given an array of positive integers nums, return the maximum possible sum of an ascending subarray in nums.
-
-
A subarray is defined as a contiguous sequence of numbers in an array.
-
-
A subarray [numsl, numsl+1, ..., numsr-1, numsr] is ascending if for all i where l <= i < r, numsi < numsi+1. Note that a subarray of size 1 is ascending.
-
-
-
Example 1:
-
-
-Input: nums = [10,20,30,5,10,50]
-Output: 65
-Explanation: [5,10,50] is the ascending subarray with the maximum sum of 65.
-
-
-
Example 2:
-
-
-Input: nums = [10,20,30,40,50]
-Output: 150
-Explanation: [10,20,30,40,50] is the ascending subarray with the maximum sum of 150.
-
-
-
Example 3:
-
-
-Input: nums = [12,17,15,13,10,11,12]
-Output: 33
-Explanation: [10,11,12] is the ascending subarray with the maximum sum of 33.
-
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 100
-
1 <= nums[i] <= 100
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
-
-### Similar Questions
- 1. [Find Good Days to Rob the Bank](../find-good-days-to-rob-the-bank) (Medium)
-
-### Hints
-
-Hint 1
-It is fast enough to check all possible subarrays
-
-
-
-Hint 2
-The end of each ascending subarray will be the start of the next
-
diff --git a/problems/maximum-average-pass-ratio/README.md b/problems/maximum-average-pass-ratio/README.md
deleted file mode 100644
index d4bcfbbb9..000000000
--- a/problems/maximum-average-pass-ratio/README.md
+++ /dev/null
@@ -1,72 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../find-center-of-star-graph "Find Center of Star Graph")
-
-[Next >](../maximum-score-of-a-good-subarray "Maximum Score of a Good Subarray")
-
-## [1792. Maximum Average Pass Ratio (Medium)](https://leetcode.com/problems/maximum-average-pass-ratio "最大平均通过率")
-
-
There is a school that has classes of students and each class will be having a final exam. You are given a 2D integer array classes, where classes[i] = [passi, totali]. You know beforehand that in the ith class, there are totali total students, but only passi number of students will pass the exam.
-
-
You are also given an integer extraStudents. There are another extraStudents brilliant students that are guaranteed to pass the exam of any class they are assigned to. You want to assign each of the extraStudents students to a class in a way that maximizes the average pass ratio across all the classes.
-
-
The pass ratio of a class is equal to the number of students of the class that will pass the exam divided by the total number of students of the class. The average pass ratio is the sum of pass ratios of all the classes divided by the number of the classes.
-
-
Return the maximum possible average pass ratio after assigning the extraStudents students. Answers within 10-5 of the actual answer will be accepted.
-
-
-
Example 1:
-
-
-Input: classes = [[1,2],[3,5],[2,2]], extraStudents = 2
-Output: 0.78333
-Explanation: You can assign the two extra students to the first class. The average pass ratio will be equal to (3/4 + 3/5 + 2/2) / 3 = 0.78333.
-
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Heap (Priority Queue)](../../tag/heap-priority-queue/README.md)]
-
-### Hints
-
-Hint 1
-Pay attention to how much the pass ratio changes when you add a student to the class. If you keep adding students, what happens to the change in pass ratio? The more students you add to a class, the smaller the change in pass ratio becomes.
-
-
-
-Hint 2
-Since the change in the pass ratio is always decreasing with the more students you add, then the very first student you add to each class is the one that makes the biggest change in the pass ratio.
-
-
-
-Hint 3
-Because each class's pass ratio is weighted equally, it's always optimal to put the student in the class that makes the biggest change among all the other classes.
-
-
-
-Hint 4
-Keep a max heap of the current class sizes and order them by the change in pass ratio. For each extra student, take the top of the heap, update the class size, and put it back in the heap.
-
diff --git a/problems/maximum-average-subarray-i/README.md b/problems/maximum-average-subarray-i/README.md
deleted file mode 100644
index 47c8abf56..000000000
--- a/problems/maximum-average-subarray-i/README.md
+++ /dev/null
@@ -1,48 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../design-search-autocomplete-system "Design Search Autocomplete System")
-
-[Next >](../maximum-average-subarray-ii "Maximum Average Subarray II")
-
-## [643. Maximum Average Subarray I (Easy)](https://leetcode.com/problems/maximum-average-subarray-i "子数组最大平均数 I")
-
-
You are given an integer array nums consisting of n elements, and an integer k.
-
-
Find a contiguous subarray whose length is equal tok that has the maximum average value and return this value. Any answer with a calculation error less than 10-5 will be accepted.
-
-
-
Example 1:
-
-
-Input: nums = [1,12,-5,-6,50,3], k = 4
-Output: 12.75000
-Explanation: Maximum average is (12 - 5 - 6 + 50) / 4 = 51 / 4 = 12.75
-
-
-
Example 2:
-
-
-Input: nums = [5], k = 1
-Output: 5.00000
-
-
-
-
Constraints:
-
-
-
n == nums.length
-
1 <= k <= n <= 105
-
-104 <= nums[i] <= 104
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Sliding Window](../../tag/sliding-window/README.md)]
-
-### Similar Questions
- 1. [Maximum Average Subarray II](../maximum-average-subarray-ii) (Hard)
diff --git a/problems/maximum-average-subarray-i/maximum_average_subarray_i.go b/problems/maximum-average-subarray-i/maximum_average_subarray_i.go
deleted file mode 100644
index 7d6150bdd..000000000
--- a/problems/maximum-average-subarray-i/maximum_average_subarray_i.go
+++ /dev/null
@@ -1,17 +0,0 @@
-package problem643
-
-func findMaxAverage(nums []int, k int) float64 {
- max, sum := 0, 0
- for i, v := range nums {
- sum += v
- if i == k-1 {
- max = sum
- } else if i >= k {
- sum -= nums[i-k]
- }
- if sum > max {
- max = sum
- }
- }
- return float64(max) / float64(k)
-}
diff --git a/problems/maximum-average-subarray-i/maximum_average_subarray_i_test.go b/problems/maximum-average-subarray-i/maximum_average_subarray_i_test.go
deleted file mode 100644
index 17738a5fe..000000000
--- a/problems/maximum-average-subarray-i/maximum_average_subarray_i_test.go
+++ /dev/null
@@ -1,25 +0,0 @@
-package problem643
-
-import "testing"
-
-type testType struct {
- nums []int
- k int
- want float64
-}
-
-func TestFindMaxAverage(t *testing.T) {
- tests := [...]testType{
- {
- nums: []int{1, 12, -5, -6, 50, 3},
- k: 4,
- want: 12.75,
- },
- }
- for _, tt := range tests {
- got := findMaxAverage(tt.nums, tt.k)
- if got != tt.want {
- t.Fatalf("in: %v %v, got: %v, want: %v", tt.nums, tt.k, got, tt.want)
- }
- }
-}
diff --git a/problems/maximum-average-subarray-ii/README.md b/problems/maximum-average-subarray-ii/README.md
deleted file mode 100644
index 323fe56de..000000000
--- a/problems/maximum-average-subarray-ii/README.md
+++ /dev/null
@@ -1,44 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-average-subarray-i "Maximum Average Subarray I")
-
-[Next >](../set-mismatch "Set Mismatch")
-
-## [644. Maximum Average Subarray II (Hard)](https://leetcode.com/problems/maximum-average-subarray-ii "子数组最大平均数 II")
-
-
-Given an array consisting of n integers, find the contiguous subarray whose length is greater than or equal tok that has the maximum average value. And you need to output the maximum average value.
-
-
-
-
Example 1:
-
-Input: [1,12,-5,-6,50,3], k = 4
-Output: 12.75
-Explanation:
-when length is 5, maximum average value is 10.8,
-when length is 6, maximum average value is 9.16667.
-Thus return 12.75.
-
-
-
-
-
Note:
-
-
1 <= k <= n <= 10,000.
-
Elements of the given array will be in range [-10,000, 10,000].
-
The answer with the calculation error less than 10-5 will be accepted.
Given the root of a binary tree, find the maximum average value of any subtree of that tree.
-
-
(A subtree of a tree is any node of that tree plus all its descendants. The average value of a tree is the sum of its values, divided by the number of nodes.)
-
-
-
-
Example 1:
-
-
-
-
-Input: [5,6,1]
-Output: 6.00000
-Explanation:
-For the node with value = 5 we have an average of (5 + 6 + 1) / 3 = 4.
-For the node with value = 6 we have an average of 6 / 1 = 6.
-For the node with value = 1 we have an average of 1 / 1 = 1.
-So the answer is 6 which is the maximum.
-
-
-
-
-
Note:
-
-
-
The number of nodes in the tree is between 1 and 5000.
-
Each node will have a value between 0 and 100000.
-
Answers will be accepted as correct if they are within 10^-5 of the correct answer.
-
-
-### Related Topics
- [[Tree](../../tag/tree/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Binary Tree](../../tag/binary-tree/README.md)]
-
-### Similar Questions
- 1. [Count Nodes Equal to Sum of Descendants](../count-nodes-equal-to-sum-of-descendants) (Medium)
-
-### Hints
-
-Hint 1
-Can you find the sum of values and the number of nodes for every sub-tree ?
-
-
-
-Hint 2
-Can you find the sum of values and the number of nodes for a sub-tree given the sum of values and the number of nodes of it's left and right sub-trees ?
-
-
-
-Hint 3
-Use depth first search to recursively find the solution for the children of a node then use their solutions to compute the current node's solution.
-
diff --git a/problems/maximum-binary-string-after-change/README.md b/problems/maximum-binary-string-after-change/README.md
deleted file mode 100644
index 8f105f46c..000000000
--- a/problems/maximum-binary-string-after-change/README.md
+++ /dev/null
@@ -1,69 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../average-waiting-time "Average Waiting Time")
-
-[Next >](../minimum-adjacent-swaps-for-k-consecutive-ones "Minimum Adjacent Swaps for K Consecutive Ones")
-
-## [1702. Maximum Binary String After Change (Medium)](https://leetcode.com/problems/maximum-binary-string-after-change "修改后的最大二进制字符串")
-
-
You are given a binary string binary consisting of only 0's or 1's. You can apply each of the following operations any number of times:
-
-
-
Operation 1: If the number contains the substring "00", you can replace it with "10".
-
-
For example, "00010" -> "10010"
-
-
-
Operation 2: If the number contains the substring "10", you can replace it with "01".
-
-
For example, "00010" -> "00001"
-
-
-
-
-
Return the maximum binary string you can obtain after any number of operations. Binary string x is greater than binary string y if x's decimal representation is greater than y's decimal representation.
-Input: binary = "01"
-Output: "01"
-Explanation: "01" cannot be transformed any further.
-
-
-
-
Constraints:
-
-
-
1 <= binary.length <= 105
-
binary consist of '0' and '1'.
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
- [[Greedy](../../tag/greedy/README.md)]
-
-### Hints
-
-Hint 1
-Note that with the operations, you can always make the string only contain at most 1 zero.
-
diff --git a/problems/maximum-binary-tree-ii/README.md b/problems/maximum-binary-tree-ii/README.md
deleted file mode 100644
index b720ca6e7..000000000
--- a/problems/maximum-binary-tree-ii/README.md
+++ /dev/null
@@ -1,74 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../find-the-town-judge "Find the Town Judge")
-
-[Next >](../available-captures-for-rook "Available Captures for Rook")
-
-## [998. Maximum Binary Tree II (Medium)](https://leetcode.com/problems/maximum-binary-tree-ii "最大二叉树 II")
-
-
A maximum tree is a tree where every node has a value greater than any other value in its subtree.
-
-
You are given the root of a maximum binary tree and an integer val.
-
-
Just as in the previous problem, the given tree was constructed from a list a (root = Construct(a)) recursively with the following Construct(a) routine:
-
-
-
If a is empty, return null.
-
Otherwise, let a[i] be the largest element of a. Create a root node with the value a[i].
-
The left child of root will be Construct([a[0], a[1], ..., a[i - 1]]).
-
The right child of root will be Construct([a[i + 1], a[i + 2], ..., a[a.length - 1]]).
-
Return root.
-
-
-
Note that we were not given a directly, only a root node root = Construct(a).
-
-
Suppose b is a copy of a with the value val appended to it. It is guaranteed that b has unique values.
-
-
Return Construct(b).
-
-
-
Example 1:
-
-
-Input: root = [4,1,3,null,null,2], val = 5
-Output: [5,4,null,1,3,null,null,2]
-Explanation: a = [1,4,2,3], b = [1,4,2,3,5]
-
-
-
Example 2:
-
-
-Input: root = [5,2,4,null,1], val = 3
-Output: [5,2,4,null,1,null,3]
-Explanation: a = [2,1,5,4], b = [2,1,5,4,3]
-
-
-
Example 3:
-
-
-Input: root = [5,2,3,null,1], val = 4
-Output: [5,2,4,null,1,3]
-Explanation: a = [2,1,5,3], b = [2,1,5,3,4]
-
-
-
-
Constraints:
-
-
-
The number of nodes in the tree is in the range [1, 100].
-
1 <= Node.val <= 100
-
All the values of the tree are unique.
-
1 <= val <= 100
-
-
-### Related Topics
- [[Tree](../../tag/tree/README.md)]
- [[Binary Tree](../../tag/binary-tree/README.md)]
-
-### Similar Questions
- 1. [Maximum Binary Tree](../maximum-binary-tree) (Medium)
diff --git a/problems/maximum-binary-tree-ii/maximum_binary_tree_ii.go b/problems/maximum-binary-tree-ii/maximum_binary_tree_ii.go
deleted file mode 100644
index e77abd09a..000000000
--- a/problems/maximum-binary-tree-ii/maximum_binary_tree_ii.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem998
diff --git a/problems/maximum-binary-tree/README.md b/problems/maximum-binary-tree/README.md
deleted file mode 100644
index c2a8af6e9..000000000
--- a/problems/maximum-binary-tree/README.md
+++ /dev/null
@@ -1,67 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../two-sum-iv-input-is-a-bst "Two Sum IV - Input is a BST")
-
-[Next >](../print-binary-tree "Print Binary Tree")
-
-## [654. Maximum Binary Tree (Medium)](https://leetcode.com/problems/maximum-binary-tree "最大二叉树")
-
-
You are given an integer array nums with no duplicates. A maximum binary tree can be built recursively from nums using the following algorithm:
-
-
-
Create a root node whose value is the maximum value in nums.
-
Recursively build the left subtree on the subarray prefix to the left of the maximum value.
-
Recursively build the right subtree on the subarray suffix to the right of the maximum value.
-
-
-
Return the maximum binary tree built from nums.
-
-
-
Example 1:
-
-
-Input: nums = [3,2,1,6,0,5]
-Output: [6,3,5,null,2,0,null,null,1]
-Explanation: The recursive calls are as follow:
-- The largest value in [3,2,1,6,0,5] is 6. Left prefix is [3,2,1] and right suffix is [0,5].
- - The largest value in [3,2,1] is 3. Left prefix is [] and right suffix is [2,1].
- - Empty array, so no child.
- - The largest value in [2,1] is 2. Left prefix is [] and right suffix is [1].
- - Empty array, so no child.
- - Only one element, so child is a node with value 1.
- - The largest value in [0,5] is 5. Left prefix is [0] and right suffix is [].
- - Only one element, so child is a node with value 0.
- - Empty array, so no child.
-
-
-### Related Topics
- [[Stack](../../tag/stack/README.md)]
- [[Tree](../../tag/tree/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Divide and Conquer](../../tag/divide-and-conquer/README.md)]
- [[Binary Tree](../../tag/binary-tree/README.md)]
- [[Monotonic Stack](../../tag/monotonic-stack/README.md)]
-
-### Similar Questions
- 1. [Maximum Binary Tree II](../maximum-binary-tree-ii) (Medium)
diff --git a/problems/maximum-binary-tree/maximum_binary_tree.go b/problems/maximum-binary-tree/maximum_binary_tree.go
deleted file mode 100644
index 9de3051a4..000000000
--- a/problems/maximum-binary-tree/maximum_binary_tree.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem654
diff --git a/problems/maximum-binary-tree/maximum_binary_tree_test.go b/problems/maximum-binary-tree/maximum_binary_tree_test.go
deleted file mode 100644
index 9de3051a4..000000000
--- a/problems/maximum-binary-tree/maximum_binary_tree_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem654
diff --git a/problems/maximum-building-height/README.md b/problems/maximum-building-height/README.md
deleted file mode 100644
index 00f21bae3..000000000
--- a/problems/maximum-building-height/README.md
+++ /dev/null
@@ -1,81 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../longest-substring-of-all-vowels-in-order "Longest Substring Of All Vowels in Order")
-
-[Next >](../league-statistics "League Statistics")
-
-## [1840. Maximum Building Height (Hard)](https://leetcode.com/problems/maximum-building-height "最高建筑高度")
-
-
You want to build n new buildings in a city. The new buildings will be built in a line and are labeled from 1 to n.
-
-
However, there are city restrictions on the heights of the new buildings:
-
-
-
The height of each building must be a non-negative integer.
-
The height of the first building must be 0.
-
The height difference between any two adjacent buildings cannot exceed1.
-
-
-
Additionally, there are city restrictions on the maximum height of specific buildings. These restrictions are given as a 2D integer array restrictions where restrictions[i] = [idi, maxHeighti] indicates that building idi must have a height less than or equal tomaxHeighti.
-
-
It is guaranteed that each building will appear at most once in restrictions, and building 1 will not be in restrictions.
-
-
Return the maximum possible height of the tallest building.
-
-
-
Example 1:
-
-
-Input: n = 5, restrictions = [[2,1],[4,1]]
-Output: 2
-Explanation: The green area in the image indicates the maximum allowed height for each building.
-We can build the buildings with heights [0,1,2,1,2], and the tallest building has a height of 2.
-
-
Example 2:
-
-
-Input: n = 6, restrictions = []
-Output: 5
-Explanation: The green area in the image indicates the maximum allowed height for each building.
-We can build the buildings with heights [0,1,2,3,4,5], and the tallest building has a height of 5.
-
-
-
Example 3:
-
-
-Input: n = 10, restrictions = [[5,3],[2,5],[7,4],[10,3]]
-Output: 5
-Explanation: The green area in the image indicates the maximum allowed height for each building.
-We can build the buildings with heights [0,1,2,3,3,4,4,5,4,3], and the tallest building has a height of 5.
-
-
-
-
Constraints:
-
-
-
2 <= n <= 109
-
0 <= restrictions.length <= min(n - 1, 105)
-
2 <= idi <= n
-
idi is unique.
-
0 <= maxHeighti <= 109
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Math](../../tag/math/README.md)]
-
-### Hints
-
-Hint 1
-Is it possible to find the max height if given the height range of a particular building?
-
-
-
-Hint 2
-You can find the height range of a restricted building by doing 2 passes from the left and right.
-
diff --git a/problems/maximum-candies-you-can-get-from-boxes/README.md b/problems/maximum-candies-you-can-get-from-boxes/README.md
deleted file mode 100644
index d714a6c5d..000000000
--- a/problems/maximum-candies-you-can-get-from-boxes/README.md
+++ /dev/null
@@ -1,75 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-number-of-occurrences-of-a-substring "Maximum Number of Occurrences of a Substring")
-
-[Next >](../replace-elements-with-greatest-element-on-right-side "Replace Elements with Greatest Element on Right Side")
-
-## [1298. Maximum Candies You Can Get from Boxes (Hard)](https://leetcode.com/problems/maximum-candies-you-can-get-from-boxes "你能从盒子里获得的最大糖果数")
-
-
You have n boxes labeled from 0 to n - 1. You are given four arrays: status, candies, keys, and containedBoxes where:
-
-
-
status[i] is 1 if the ith box is open and 0 if the ith box is closed,
-
candies[i] is the number of candies in the ith box,
-
keys[i] is a list of the labels of the boxes you can open after opening the ith box.
-
containedBoxes[i] is a list of the boxes you found inside the ith box.
-
-
-
You are given an integer array initialBoxes that contains the labels of the boxes you initially have. You can take all the candies in any open box and you can use the keys in it to open new boxes and you also can use the boxes you find in it.
-
-
Return the maximum number of candies you can get following the rules above.
-
-
-
Example 1:
-
-
-Input: status = [1,0,1,0], candies = [7,5,4,100], keys = [[],[],[1],[]], containedBoxes = [[1,2],[3],[],[]], initialBoxes = [0]
-Output: 16
-Explanation: You will be initially given box 0. You will find 7 candies in it and boxes 1 and 2.
-Box 1 is closed and you do not have a key for it so you will open box 2. You will find 4 candies and a key to box 1 in box 2.
-In box 1, you will find 5 candies and box 3 but you will not find a key to box 3 so box 3 will remain closed.
-Total number of candies collected = 7 + 4 + 5 = 16 candy.
-
-
-
Example 2:
-
-
-Input: status = [1,0,0,0,0,0], candies = [1,1,1,1,1,1], keys = [[1,2,3,4,5],[],[],[],[],[]], containedBoxes = [[1,2,3,4,5],[],[],[],[],[]], initialBoxes = [0]
-Output: 6
-Explanation: You have initially box 0. Opening it you can find boxes 1,2,3,4 and 5 and their keys.
-The total number of candies will be 6.
-
-
-
-
Constraints:
-
-
-
n == status.length == candies.length == keys.length == containedBoxes.length
-
1 <= n <= 1000
-
status[i] is either 0 or 1.
-
1 <= candies[i] <= 1000
-
0 <= keys[i].length <= n
-
0 <= keys[i][j] < n
-
All values of keys[i] are unique.
-
0 <= containedBoxes[i].length <= n
-
0 <= containedBoxes[i][j] < n
-
All values of containedBoxes[i] are unique.
-
Each box is contained in one box at most.
-
0 <= initialBoxes.length <= n
-
0 <= initialBoxes[i] < n
-
-
-### Related Topics
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Array](../../tag/array/README.md)]
-
-### Hints
-
-Hint 1
-Use Breadth First Search (BFS) to traverse all possible boxes you can open. Only push to the queue the boxes the you have with their keys.
-
diff --git a/problems/maximum-compatibility-score-sum/README.md b/problems/maximum-compatibility-score-sum/README.md
deleted file mode 100644
index f0aa7c7a8..000000000
--- a/problems/maximum-compatibility-score-sum/README.md
+++ /dev/null
@@ -1,76 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../largest-number-after-mutating-substring "Largest Number After Mutating Substring")
-
-[Next >](../delete-duplicate-folders-in-system "Delete Duplicate Folders in System")
-
-## [1947. Maximum Compatibility Score Sum (Medium)](https://leetcode.com/problems/maximum-compatibility-score-sum "最大兼容性评分和")
-
-
There is a survey that consists of n questions where each question's answer is either 0 (no) or 1 (yes).
-
-
The survey was given to m students numbered from 0 to m - 1 and m mentors numbered from 0 to m - 1. The answers of the students are represented by a 2D integer array students where students[i] is an integer array that contains the answers of the ith student (0-indexed). The answers of the mentors are represented by a 2D integer array mentors where mentors[j] is an integer array that contains the answers of the jth mentor (0-indexed).
-
-
Each student will be assigned to one mentor, and each mentor will have one student assigned to them. The compatibility score of a student-mentor pair is the number of answers that are the same for both the student and the mentor.
-
-
-
For example, if the student's answers were [1, 0, 1] and the mentor's answers were [0, 0, 1], then their compatibility score is 2 because only the second and the third answers are the same.
-
-
-
You are tasked with finding the optimal student-mentor pairings to maximize the sum of the compatibility scores.
-
-
Given students and mentors, return the maximum compatibility score sum that can be achieved.
-
-
-
Example 1:
-
-
-Input: students = [[1,1,0],[1,0,1],[0,0,1]], mentors = [[1,0,0],[0,0,1],[1,1,0]]
-Output: 8
-Explanation: We assign students to mentors in the following way:
-- student 0 to mentor 2 with a compatibility score of 3.
-- student 1 to mentor 0 with a compatibility score of 2.
-- student 2 to mentor 1 with a compatibility score of 3.
-The compatibility score sum is 3 + 2 + 3 = 8.
-
-
-
Example 2:
-
-
-Input: students = [[0,0],[0,0],[0,0]], mentors = [[1,1],[1,1],[1,1]]
-Output: 0
-Explanation: The compatibility score of any student-mentor pair is 0.
-
-
-
-
Constraints:
-
-
-
m == students.length == mentors.length
-
n == students[i].length == mentors[j].length
-
1 <= m, n <= 8
-
students[i][k] is either 0 or 1.
-
mentors[j][k] is either 0 or 1.
-
-
-### Related Topics
- [[Bit Manipulation](../../tag/bit-manipulation/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Backtracking](../../tag/backtracking/README.md)]
- [[Bitmask](../../tag/bitmask/README.md)]
-
-### Hints
-
-Hint 1
-Calculate the compatibility score for each student-mentor pair.
-
-
-
-Hint 2
-Try every permutation of students with the original mentors array.
-
diff --git a/problems/maximum-depth-of-binary-tree/README.md b/problems/maximum-depth-of-binary-tree/README.md
deleted file mode 100644
index 7ff9c358c..000000000
--- a/problems/maximum-depth-of-binary-tree/README.md
+++ /dev/null
@@ -1,65 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../binary-tree-zigzag-level-order-traversal "Binary Tree Zigzag Level Order Traversal")
-
-[Next >](../construct-binary-tree-from-preorder-and-inorder-traversal "Construct Binary Tree from Preorder and Inorder Traversal")
-
-## [104. Maximum Depth of Binary Tree (Easy)](https://leetcode.com/problems/maximum-depth-of-binary-tree "二叉树的最大深度")
-
-
Given the root of a binary tree, return its maximum depth.
-
-
A binary tree's maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.
The total number of nodes is in the range [0, 104].
-
The depth of the n-ary tree is less than or equal to 1000.
-
-
-### Related Topics
- [[Tree](../../tag/tree/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
-
-### Similar Questions
- 1. [Maximum Depth of Binary Tree](../maximum-depth-of-binary-tree) (Easy)
- 1. [The Time When the Network Becomes Idle](../the-time-when-the-network-becomes-idle) (Medium)
diff --git a/problems/maximum-depth-of-n-ary-tree/maximum_depth_of_n_ary_tree.go b/problems/maximum-depth-of-n-ary-tree/maximum_depth_of_n_ary_tree.go
deleted file mode 100644
index 1e6e2f5d8..000000000
--- a/problems/maximum-depth-of-n-ary-tree/maximum_depth_of_n_ary_tree.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem559
diff --git a/problems/maximum-depth-of-n-ary-tree/maximum_depth_of_n_ary_tree.py b/problems/maximum-depth-of-n-ary-tree/maximum_depth_of_n_ary_tree.py
deleted file mode 100755
index 47fb17228..000000000
--- a/problems/maximum-depth-of-n-ary-tree/maximum_depth_of_n_ary_tree.py
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/usr/bin/env python
-
-"""
-# Definition for a Node.
-class Node:
- def __init__(self, val, children):
- self.val = val
- self.children = children
-"""
-class Solution:
- def maxDepth(self, root: 'Node') -> int:
-
\ No newline at end of file
diff --git a/problems/maximum-depth-of-n-ary-tree/maximum_depth_of_n_ary_tree_test.go b/problems/maximum-depth-of-n-ary-tree/maximum_depth_of_n_ary_tree_test.go
deleted file mode 100644
index 1e6e2f5d8..000000000
--- a/problems/maximum-depth-of-n-ary-tree/maximum_depth_of_n_ary_tree_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem559
diff --git a/problems/maximum-difference-between-increasing-elements/README.md b/problems/maximum-difference-between-increasing-elements/README.md
deleted file mode 100644
index 30cb293a1..000000000
--- a/problems/maximum-difference-between-increasing-elements/README.md
+++ /dev/null
@@ -1,68 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../average-height-of-buildings-in-each-segment "Average Height of Buildings in Each Segment")
-
-[Next >](../grid-game "Grid Game")
-
-## [2016. Maximum Difference Between Increasing Elements (Easy)](https://leetcode.com/problems/maximum-difference-between-increasing-elements "增量元素之间的最大差值")
-
-
Given a 0-indexed integer array nums of size n, find the maximum difference between nums[i] and nums[j] (i.e., nums[j] - nums[i]), such that 0 <= i < j < n and nums[i] < nums[j].
-
-
Return the maximum difference. If no such i and j exists, return -1.
-
-
-
Example 1:
-
-
-Input: nums = [7,1,5,4]
-Output: 4
-Explanation:
-The maximum difference occurs with i = 1 and j = 2, nums[j] - nums[i] = 5 - 1 = 4.
-Note that with i = 1 and j = 0, the difference nums[j] - nums[i] = 7 - 1 = 6, but i > j, so it is not valid.
-
-
-
Example 2:
-
-
-Input: nums = [9,4,3,2]
-Output: -1
-Explanation:
-There is no i and j such that i < j and nums[i] < nums[j].
-
-
-
Example 3:
-
-
-Input: nums = [1,5,2,10]
-Output: 9
-Explanation:
-The maximum difference occurs with i = 0 and j = 3, nums[j] - nums[i] = 10 - 1 = 9.
-
-
-
-
Constraints:
-
-
-
n == nums.length
-
2 <= n <= 1000
-
1 <= nums[i] <= 109
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
-
-### Hints
-
-Hint 1
-Could you keep track of the minimum element visited while traversing?
-
-
-
-Hint 2
-We have a potential candidate for the answer if the prefix min is lesser than nums[i].
-
diff --git a/problems/maximum-difference-between-node-and-ancestor/README.md b/problems/maximum-difference-between-node-and-ancestor/README.md
deleted file mode 100644
index d8ad9af3b..000000000
--- a/problems/maximum-difference-between-node-and-ancestor/README.md
+++ /dev/null
@@ -1,55 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../divisor-game "Divisor Game")
-
-[Next >](../longest-arithmetic-subsequence "Longest Arithmetic Subsequence")
-
-## [1026. Maximum Difference Between Node and Ancestor (Medium)](https://leetcode.com/problems/maximum-difference-between-node-and-ancestor "节点与其祖先之间的最大差值")
-
-
Given the root of a binary tree, find the maximum value v for which there exist different nodes a and b where v = |a.val - b.val| and a is an ancestor of b.
-
-
A node a is an ancestor of b if either: any child of a is equal to b or any child of a is an ancestor of b.
-
-
-
Example 1:
-
-
-Input: root = [8,3,10,1,6,null,14,null,null,4,7,13]
-Output: 7
-Explanation: We have various ancestor-node differences, some of which are given below :
-|8 - 3| = 5
-|3 - 7| = 4
-|8 - 1| = 7
-|10 - 13| = 3
-Among all possible differences, the maximum value of 7 is obtained by |8 - 1| = 7.
-
-
Example 2:
-
-
-Input: root = [1,null,2,null,0,3]
-Output: 3
-
-
-
-
Constraints:
-
-
-
The number of nodes in the tree is in the range [2, 5000].
-
0 <= Node.val <= 105
-
-
-### Related Topics
- [[Tree](../../tag/tree/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Binary Tree](../../tag/binary-tree/README.md)]
-
-### Hints
-
-Hint 1
-For each subtree, find the minimum value and maximum value of its descendants.
-
diff --git a/problems/maximum-distance-between-a-pair-of-values/README.md b/problems/maximum-distance-between-a-pair-of-values/README.md
deleted file mode 100644
index e88895f23..000000000
--- a/problems/maximum-distance-between-a-pair-of-values/README.md
+++ /dev/null
@@ -1,74 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-population-year "Maximum Population Year")
-
-[Next >](../maximum-subarray-min-product "Maximum Subarray Min-Product")
-
-## [1855. Maximum Distance Between a Pair of Values (Medium)](https://leetcode.com/problems/maximum-distance-between-a-pair-of-values "下标对中的最大距离")
-
-
You are given two non-increasing 0-indexed integer arrays nums1 and nums2.
-
-
A pair of indices (i, j), where 0 <= i < nums1.length and 0 <= j < nums2.length, is valid if both i <= j and nums1[i] <= nums2[j]. The distance of the pair is j - i.
-
-
Return the maximum distance of any valid pair (i, j). If there are no valid pairs, return 0.
-
-
An array arr is non-increasing if arr[i-1] >= arr[i] for every 1 <= i < arr.length.
-
-
-
Example 1:
-
-
-Input: nums1 = [55,30,5,4,2], nums2 = [100,20,10,10,5]
-Output: 2
-Explanation: The valid pairs are (0,0), (2,2), (2,3), (2,4), (3,3), (3,4), and (4,4).
-The maximum distance is 2 with pair (2,4).
-
-
-
Example 2:
-
-
-Input: nums1 = [2,2,2], nums2 = [10,10,1]
-Output: 1
-Explanation: The valid pairs are (0,0), (0,1), and (1,1).
-The maximum distance is 1 with pair (0,1).
-
-
-
Example 3:
-
-
-Input: nums1 = [30,29,19,5], nums2 = [25,25,25,25,25]
-Output: 2
-Explanation: The valid pairs are (2,2), (2,3), (2,4), (3,3), and (3,4).
-The maximum distance is 2 with pair (2,4).
-
-
-
-
Constraints:
-
-
-
1 <= nums1.length, nums2.length <= 105
-
1 <= nums1[i], nums2[j] <= 105
-
Both nums1 and nums2 are non-increasing.
-
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Two Pointers](../../tag/two-pointers/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
-
-### Hints
-
-Hint 1
-Since both arrays are sorted in a non-increasing way this means that for each value in the first array. We can find the farthest value smaller than it using binary search.
-
-
-
-Hint 2
-There is another solution using a two pointers approach since the first array is non-increasing the farthest j such that nums2[j] ≥ nums1[i] is at least as far as the farthest j such that nums2[j] ≥ nums1[i-1]
-
diff --git a/problems/maximum-distance-in-arrays/README.md b/problems/maximum-distance-in-arrays/README.md
deleted file mode 100644
index 4190a9404..000000000
--- a/problems/maximum-distance-in-arrays/README.md
+++ /dev/null
@@ -1,39 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../add-one-row-to-tree "Add One Row to Tree")
-
-[Next >](../minimum-factorization "Minimum Factorization")
-
-## [624. Maximum Distance in Arrays (Medium)](https://leetcode.com/problems/maximum-distance-in-arrays "数组列表中的最大距离")
-
-
-Given m arrays, and each array is sorted in ascending order. Now you can pick up two integers from two different arrays (each array picks one) and calculate the distance. We define the distance between two integers a and b to be their absolute difference |a-b|. Your task is to find the maximum distance.
-
-
-
Example 1:
-
Input:
-[[1,2,3],
- [4,5],
- [1,2,3]]
-Output: 4
-Explanation:
-One way to reach the maximum distance 4 is to pick 1 in the first or third array and pick 5 in the second array.
-
-
-
-
Note:
-
-
Each given array will have at least 1 number. There will be at least two non-empty arrays.
-
The total number of the integers in all the m arrays will be in the range of [2, 10000].
-
The integers in the m arrays will be in the range of [-10000, 10000].
-
-
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[Array](../../tag/array/README.md)]
diff --git a/problems/maximum-distance-in-arrays/maximum_distance_in_arrays.go b/problems/maximum-distance-in-arrays/maximum_distance_in_arrays.go
deleted file mode 100644
index 42e642e60..000000000
--- a/problems/maximum-distance-in-arrays/maximum_distance_in_arrays.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem624
diff --git a/problems/maximum-distance-in-arrays/maximum_distance_in_arrays_test.go b/problems/maximum-distance-in-arrays/maximum_distance_in_arrays_test.go
deleted file mode 100644
index 42e642e60..000000000
--- a/problems/maximum-distance-in-arrays/maximum_distance_in_arrays_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem624
diff --git a/problems/maximum-earnings-from-taxi/README.md b/problems/maximum-earnings-from-taxi/README.md
deleted file mode 100644
index 94e38354e..000000000
--- a/problems/maximum-earnings-from-taxi/README.md
+++ /dev/null
@@ -1,70 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../find-original-array-from-doubled-array "Find Original Array From Doubled Array")
-
-[Next >](../minimum-number-of-operations-to-make-array-continuous "Minimum Number of Operations to Make Array Continuous")
-
-## [2008. Maximum Earnings From Taxi (Medium)](https://leetcode.com/problems/maximum-earnings-from-taxi "出租车的最大盈利")
-
-
There are n points on a road you are driving your taxi on. The n points on the road are labeled from 1 to n in the direction you are going, and you want to drive from point 1 to point n to make money by picking up passengers. You cannot change the direction of the taxi.
-
-
The passengers are represented by a 0-indexed 2D integer array rides, where rides[i] = [starti, endi, tipi] denotes the ith passenger requesting a ride from point starti to point endi who is willing to give a tipi dollar tip.
-
-
For each passenger i you pick up, you earnendi - starti + tipi dollars. You may only drive at most one passenger at a time.
-
-
Given n and rides, return the maximum number of dollars you can earn by picking up the passengers optimally.
-
-
Note: You may drop off a passenger and pick up a different passenger at the same point.
-
-
-
Example 1:
-
-
-Input: n = 5, rides = [[2,5,4],[1,5,1]]
-Output: 7
-Explanation: We can pick up passenger 0 to earn 5 - 2 + 4 = 7 dollars.
-
-
-
Example 2:
-
-
-Input: n = 20, rides = [[1,6,1],[3,10,2],[10,12,3],[11,12,2],[12,15,2],[13,18,1]]
-Output: 20
-Explanation: We will pick up the following passengers:
-- Drive passenger 1 from point 3 to point 10 for a profit of 10 - 3 + 2 = 9 dollars.
-- Drive passenger 2 from point 10 to point 12 for a profit of 12 - 10 + 3 = 5 dollars.
-- Drive passenger 5 from point 13 to point 18 for a profit of 18 - 13 + 1 = 6 dollars.
-We earn 9 + 5 + 6 = 20 dollars in total.
-
-
-
Constraints:
-
-
-
1 <= n <= 105
-
1 <= rides.length <= 3 * 104
-
rides[i].length == 3
-
1 <= starti < endi <= n
-
1 <= tipi <= 105
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Hints
-
-Hint 1
-Can we sort the array to help us solve the problem?
-
-
-
-Hint 2
-We can use dynamic programming to keep track of the maximum at each position.
-
diff --git a/problems/maximum-element-after-decreasing-and-rearranging/README.md b/problems/maximum-element-after-decreasing-and-rearranging/README.md
deleted file mode 100644
index b3c3ef248..000000000
--- a/problems/maximum-element-after-decreasing-and-rearranging/README.md
+++ /dev/null
@@ -1,85 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../seat-reservation-manager "Seat Reservation Manager")
-
-[Next >](../closest-room "Closest Room")
-
-## [1846. Maximum Element After Decreasing and Rearranging (Medium)](https://leetcode.com/problems/maximum-element-after-decreasing-and-rearranging "减小和重新排列数组后的最大元素")
-
-
You are given an array of positive integers arr. Perform some operations (possibly none) on arr so that it satisfies these conditions:
-
-
-
The value of the first element in arr must be 1.
-
The absolute difference between any 2 adjacent elements must be less than or equal to 1. In other words, abs(arr[i] - arr[i - 1]) <= 1 for each i where 1 <= i < arr.length (0-indexed). abs(x) is the absolute value of x.
-
-
-
There are 2 types of operations that you can perform any number of times:
-
-
-
Decrease the value of any element of arr to a smaller positive integer.
-
Rearrange the elements of arr to be in any order.
-
-
-
Return the maximum possible value of an element in arr after performing the operations to satisfy the conditions.
-
-
-
Example 1:
-
-
-Input: arr = [2,2,1,2,1]
-Output: 2
-Explanation:
-We can satisfy the conditions by rearranging arr so it becomes [1,2,2,2,1].
-The largest element in arr is 2.
-
-
-
Example 2:
-
-
-Input: arr = [100,1,1000]
-Output: 3
-Explanation:
-One possible way to satisfy the conditions is by doing the following:
-1. Rearrange arr so it becomes [1,100,1000].
-2. Decrease the value of the second element to 2.
-3. Decrease the value of the third element to 3.
-Now arr = [1,2,3], which satisfies the conditions.
-The largest element in arr is 3.
-
-
-
Example 3:
-
-
-Input: arr = [1,2,3,4,5]
-Output: 5
-Explanation: The array already satisfies the conditions, and the largest element is 5.
-
-
-
-
Constraints:
-
-
-
1 <= arr.length <= 105
-
1 <= arr[i] <= 109
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Greedy](../../tag/greedy/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Hints
-
-Hint 1
-Sort the Array.
-
-
-
-Hint 2
-Decrement each element to the largest integer that satisfies the conditions.
-
diff --git a/problems/maximum-employees-to-be-invited-to-a-meeting/README.md b/problems/maximum-employees-to-be-invited-to-a-meeting/README.md
deleted file mode 100644
index b593c81e1..000000000
--- a/problems/maximum-employees-to-be-invited-to-a-meeting/README.md
+++ /dev/null
@@ -1,88 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../destroying-asteroids "Destroying Asteroids")
-
-[Next >](../remove-all-ones-with-row-and-column-flips "Remove All Ones With Row and Column Flips")
-
-## [2127. Maximum Employees to Be Invited to a Meeting (Hard)](https://leetcode.com/problems/maximum-employees-to-be-invited-to-a-meeting "参加会议的最多员工数")
-
-
A company is organizing a meeting and has a list of n employees, waiting to be invited. They have arranged for a large circular table, capable of seating any number of employees.
-
-
The employees are numbered from 0 to n - 1. Each employee has a favorite person and they will attend the meeting only if they can sit next to their favorite person at the table. The favorite person of an employee is not themself.
-
-
Given a 0-indexed integer array favorite, where favorite[i] denotes the favorite person of the ith employee, return the maximum number of employees that can be invited to the meeting.
-
-
-
Example 1:
-
-
-Input: favorite = [2,2,1,2]
-Output: 3
-Explanation:
-The above figure shows how the company can invite employees 0, 1, and 2, and seat them at the round table.
-All employees cannot be invited because employee 2 cannot sit beside employees 0, 1, and 3, simultaneously.
-Note that the company can also invite employees 1, 2, and 3, and give them their desired seats.
-The maximum number of employees that can be invited to the meeting is 3.
-
-
-
Example 2:
-
-
-Input: favorite = [1,2,0]
-Output: 3
-Explanation:
-Each employee is the favorite person of at least one other employee, and the only way the company can invite them is if they invite every employee.
-The seating arrangement will be the same as that in the figure given in example 1:
-- Employee 0 will sit between employees 2 and 1.
-- Employee 1 will sit between employees 0 and 2.
-- Employee 2 will sit between employees 1 and 0.
-The maximum number of employees that can be invited to the meeting is 3.
-
-
-
Example 3:
-
-
-Input: favorite = [3,0,1,4,1]
-Output: 4
-Explanation:
-The above figure shows how the company will invite employees 0, 1, 3, and 4, and seat them at the round table.
-Employee 2 cannot be invited because the two spots next to their favorite employee 1 are taken.
-So the company leaves them out of the meeting.
-The maximum number of employees that can be invited to the meeting is 4.
-
-
-
-
Constraints:
-
-
-
n == favorite.length
-
2 <= n <= 105
-
0 <= favorite[i] <= n - 1
-
favorite[i] != i
-
-
-### Related Topics
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Graph](../../tag/graph/README.md)]
- [[Topological Sort](../../tag/topological-sort/README.md)]
-
-### Hints
-
-Hint 1
-From the given array favorite, create a graph where for every index i, there is a directed edge from favorite[i] to i. The graph will be a combination of cycles and chains of acyclic edges. Now, what are the ways in which we can choose employees to sit at the table?
-
-
-
-Hint 2
-The first way by which we can choose employees is by selecting a cycle of the graph. It can be proven that in this case, the employees that do not lie in the cycle can never be seated at the table.
-
-
-
-Hint 3
-The second way is by combining acyclic chains. At most two chains can be combined by a cycle of length 2, where each chain ends on one of the employees in the cycle.
-
diff --git a/problems/maximum-equal-frequency/README.md b/problems/maximum-equal-frequency/README.md
deleted file mode 100644
index 8657085d5..000000000
--- a/problems/maximum-equal-frequency/README.md
+++ /dev/null
@@ -1,69 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../dice-roll-simulation "Dice Roll Simulation")
-
-[Next >](../report-contiguous-dates "Report Contiguous Dates")
-
-## [1224. Maximum Equal Frequency (Hard)](https://leetcode.com/problems/maximum-equal-frequency "最大相等频率")
-
-
Given an array nums of positive integers, return the longest possible length of an array prefix of nums, such that it is possible to remove exactly one element from this prefix so that every number that has appeared in it will have the same number of occurrences.
-
-
If after removing one element there are no remaining elements, it's still considered that every appeared number has the same number of ocurrences (0).
-
-
-
Example 1:
-
-
-Input: nums = [2,2,1,1,5,3,3,5]
-Output: 7
-Explanation: For the subarray [2,2,1,1,5,3,3] of length 7, if we remove nums[4]=5, we will get [2,2,1,1,3,3], so that each number will appear exactly twice.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
-
-### Hints
-
-Hint 1
-Keep track of the min and max frequencies.
-
-
-
-Hint 2
-The number to be eliminated must have a frequency of 1, same as the others or the same +1.
-
diff --git a/problems/maximum-erasure-value/README.md b/problems/maximum-erasure-value/README.md
deleted file mode 100644
index 212f859cf..000000000
--- a/problems/maximum-erasure-value/README.md
+++ /dev/null
@@ -1,59 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../reformat-phone-number "Reformat Phone Number")
-
-[Next >](../jump-game-vi "Jump Game VI")
-
-## [1695. Maximum Erasure Value (Medium)](https://leetcode.com/problems/maximum-erasure-value "删除子数组的最大得分")
-
-
You are given an array of positive integers nums and want to erase a subarray containing unique elements. The score you get by erasing the subarray is equal to the sum of its elements.
-
-
Return the maximum score you can get by erasing exactly one subarray.
-
-
An array b is called to be a subarray of a if it forms a contiguous subsequence of a, that is, if it is equal to a[l],a[l+1],...,a[r] for some (l,r).
-
-
-
Example 1:
-
-
-Input: nums = [4,2,4,5,6]
-Output: 17
-Explanation: The optimal subarray here is [2,4,5,6].
-
-
-
Example 2:
-
-
-Input: nums = [5,2,1,2,5,2,1,2,5]
-Output: 8
-Explanation: The optimal subarray here is [5,2,1] or [1,2,5].
-
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 105
-
1 <= nums[i] <= 104
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Sliding Window](../../tag/sliding-window/README.md)]
-
-### Hints
-
-Hint 1
-The main point here is for the subarray to contain unique elements for each index. Only the first subarrays starting from that index have unique elements.
-
-
-
-Hint 2
-This can be solved using the two pointers technique
-
diff --git a/problems/maximum-font-to-fit-a-sentence-in-a-screen/README.md b/problems/maximum-font-to-fit-a-sentence-in-a-screen/README.md
deleted file mode 100644
index fdb3b26d9..000000000
--- a/problems/maximum-font-to-fit-a-sentence-in-a-screen/README.md
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../count-subtrees-with-max-distance-between-cities "Count Subtrees With Max Distance Between Cities")
-
-[Next >](../mean-of-array-after-removing-some-elements "Mean of Array After Removing Some Elements")
-
-## [1618. Maximum Font to Fit a Sentence in a Screen (Medium)](https://leetcode.com/problems/maximum-font-to-fit-a-sentence-in-a-screen "找出适应屏幕的最大字号")
-
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[String](../../tag/string/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
- [[Interactive](../../tag/interactive/README.md)]
-
-### Hints
-
-Hint 1
-Use binary search to find the last valid font.
-
diff --git a/problems/maximum-frequency-stack/README.md b/problems/maximum-frequency-stack/README.md
deleted file mode 100644
index 03b442b2d..000000000
--- a/problems/maximum-frequency-stack/README.md
+++ /dev/null
@@ -1,65 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../all-possible-full-binary-trees "All Possible Full Binary Trees")
-
-[Next >](../monotonic-array "Monotonic Array")
-
-## [895. Maximum Frequency Stack (Hard)](https://leetcode.com/problems/maximum-frequency-stack "最大频率栈")
-
-
Design a stack-like data structure to push elements to the stack and pop the most frequent element from the stack.
-
-
Implement the FreqStack class:
-
-
-
FreqStack() constructs an empty frequency stack.
-
void push(int val) pushes an integer val onto the top of the stack.
-
int pop() removes and returns the most frequent element in the stack.
-
-
If there is a tie for the most frequent element, the element closest to the stack's top is removed and returned.
-
-
-
-
-
-
Example 1:
-
-
-Input
-["FreqStack", "push", "push", "push", "push", "push", "push", "pop", "pop", "pop", "pop"]
-[[], [5], [7], [5], [7], [4], [5], [], [], [], []]
-Output
-[null, null, null, null, null, null, null, 5, 7, 5, 4]
-
-Explanation
-FreqStack freqStack = new FreqStack();
-freqStack.push(5); // The stack is [5]
-freqStack.push(7); // The stack is [5,7]
-freqStack.push(5); // The stack is [5,7,5]
-freqStack.push(7); // The stack is [5,7,5,7]
-freqStack.push(4); // The stack is [5,7,5,7,4]
-freqStack.push(5); // The stack is [5,7,5,7,4,5]
-freqStack.pop(); // return 5, as 5 is the most frequent. The stack becomes [5,7,5,7,4].
-freqStack.pop(); // return 7, as 5 and 7 is the most frequent, but 7 is closest to the top. The stack becomes [5,7,5,4].
-freqStack.pop(); // return 5, as 5 is the most frequent. The stack becomes [5,7,4].
-freqStack.pop(); // return 4, as 4, 5 and 7 is the most frequent, but 4 is closest to the top. The stack becomes [5,7].
-
-
-
-
Constraints:
-
-
-
0 <= val <= 109
-
At most 2 * 104 calls will be made to push and pop.
-
It is guaranteed that there will be at least one element in the stack before calling pop.
-
-
-### Related Topics
- [[Stack](../../tag/stack/README.md)]
- [[Design](../../tag/design/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Ordered Set](../../tag/ordered-set/README.md)]
diff --git a/problems/maximum-frequency-stack/maximum_frequency_stack.go b/problems/maximum-frequency-stack/maximum_frequency_stack.go
deleted file mode 100644
index e88294255..000000000
--- a/problems/maximum-frequency-stack/maximum_frequency_stack.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem895
diff --git a/problems/maximum-frequency-stack/maximum_frequency_stack_test.go b/problems/maximum-frequency-stack/maximum_frequency_stack_test.go
deleted file mode 100644
index e88294255..000000000
--- a/problems/maximum-frequency-stack/maximum_frequency_stack_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem895
diff --git a/problems/maximum-fruits-harvested-after-at-most-k-steps/README.md b/problems/maximum-fruits-harvested-after-at-most-k-steps/README.md
deleted file mode 100644
index 997d2537c..000000000
--- a/problems/maximum-fruits-harvested-after-at-most-k-steps/README.md
+++ /dev/null
@@ -1,99 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../watering-plants-ii "Watering Plants II")
-
-[Next >](../number-of-unique-flavors-after-sharing-k-candies "Number of Unique Flavors After Sharing K Candies")
-
-## [2106. Maximum Fruits Harvested After at Most K Steps (Hard)](https://leetcode.com/problems/maximum-fruits-harvested-after-at-most-k-steps "摘水果")
-
-
Fruits are available at some positions on an infinite x-axis. You are given a 2D integer array fruits where fruits[i] = [positioni, amounti] depicts amounti fruits at the position positioni. fruits is already sorted by positioni in ascending order, and each positioni is unique.
-
-
You are also given an integer startPos and an integer k. Initially, you are at the position startPos. From any position, you can either walk to the left or right. It takes one step to move one unit on the x-axis, and you can walk at mostk steps in total. For every position you reach, you harvest all the fruits at that position, and the fruits will disappear from that position.
-
-
Return the maximum total number of fruits you can harvest.
-
-
-
Example 1:
-
-
-Input: fruits = [[2,8],[6,3],[8,6]], startPos = 5, k = 4
-Output: 9
-Explanation:
-The optimal way is to:
-- Move right to position 6 and harvest 3 fruits
-- Move right to position 8 and harvest 6 fruits
-You moved 3 steps and harvested 3 + 6 = 9 fruits in total.
-
-
-
Example 2:
-
-
-Input: fruits = [[0,9],[4,1],[5,7],[6,2],[7,4],[10,9]], startPos = 5, k = 4
-Output: 14
-Explanation:
-You can move at most k = 4 steps, so you cannot reach position 0 nor 10.
-The optimal way is to:
-- Harvest the 7 fruits at the starting position 5
-- Move left to position 4 and harvest 1 fruit
-- Move right to position 6 and harvest 2 fruits
-- Move right to position 7 and harvest 4 fruits
-You moved 1 + 3 = 4 steps and harvested 7 + 1 + 2 + 4 = 14 fruits in total.
-
-
-
Example 3:
-
-
-Input: fruits = [[0,3],[6,4],[8,5]], startPos = 3, k = 2
-Output: 0
-Explanation:
-You can move at most k = 2 steps and cannot reach any position with fruits.
-
-
-
-
Constraints:
-
-
-
1 <= fruits.length <= 105
-
fruits[i].length == 2
-
0 <= startPos, positioni <= 2 * 105
-
positioni-1 < positioni for any i > 0 (0-indexed)
-
1 <= amounti <= 104
-
0 <= k <= 2 * 105
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
- [[Prefix Sum](../../tag/prefix-sum/README.md)]
- [[Sliding Window](../../tag/sliding-window/README.md)]
-
-### Hints
-
-Hint 1
-Does an optimal path have very few patterns? For example, could a path that goes left, turns and goes right, then turns again and goes left be any better than a path that simply goes left, turns, and goes right?
-
-
-
-Hint 2
-The optimal path turns at most once. That is, the optimal path is one of these: to go left only; to go right only; to go left, turn and go right; or to go right, turn and go left.
-
-
-
-Hint 3
-Moving x steps left then k-x steps right gives you a range of positions that you can reach.
-
-
-
-Hint 4
-Use prefix sums to get the sum of all fruits for each possible range.
-
-
-
-Hint 5
-Use a similar strategy for all the paths that go right, then turn and go left.
-
diff --git a/problems/maximum-gap/README.md b/problems/maximum-gap/README.md
deleted file mode 100644
index d0c7d9316..000000000
--- a/problems/maximum-gap/README.md
+++ /dev/null
@@ -1,47 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../missing-ranges "Missing Ranges")
-
-[Next >](../compare-version-numbers "Compare Version Numbers")
-
-## [164. Maximum Gap (Hard)](https://leetcode.com/problems/maximum-gap "最大间距")
-
-
Given an integer array nums, return the maximum difference between two successive elements in its sorted form. If the array contains less than two elements, return 0.
-
-
You must write an algorithm that runs in linear time and uses linear extra space.
-
-
-
Example 1:
-
-
-Input: nums = [3,6,9,1]
-Output: 3
-Explanation: The sorted form of the array is [1,3,6,9], either (3,6) or (6,9) has the maximum difference 3.
-
-
-
Example 2:
-
-
-Input: nums = [10]
-Output: 0
-Explanation: The array contains less than 2 elements, therefore return 0.
-
There is a rooted tree consisting of n nodes numbered 0 to n - 1. Each node's number denotes its unique genetic value (i.e. the genetic value of node x is x). The genetic difference between two genetic values is defined as the bitwise-XOR of their values. You are given the integer array parents, where parents[i] is the parent for node i. If node x is the root of the tree, then parents[x] == -1.
-
-
You are also given the array queries where queries[i] = [nodei, vali]. For each query i, find the maximum genetic difference between vali and pi, where pi is the genetic value of any node that is on the path between nodei and the root (including nodei and the root). More formally, you want to maximize vali XOR pi.
-
-
Return an array ans where ans[i] is the answer to the ith query.
-
-
-
Example 1:
-
-
-Input: parents = [-1,0,1,1], queries = [[0,2],[3,2],[2,5]]
-Output: [2,3,7]
-Explanation: The queries are processed as follows:
-- [0,2]: The node with the maximum genetic difference is 0, with a difference of 2 XOR 0 = 2.
-- [3,2]: The node with the maximum genetic difference is 1, with a difference of 2 XOR 1 = 3.
-- [2,5]: The node with the maximum genetic difference is 2, with a difference of 5 XOR 2 = 7.
-
-
-
Example 2:
-
-
-Input: parents = [3,7,-1,2,0,7,0,2], queries = [[4,6],[1,15],[0,5]]
-Output: [6,14,7]
-Explanation: The queries are processed as follows:
-- [4,6]: The node with the maximum genetic difference is 0, with a difference of 6 XOR 0 = 6.
-- [1,15]: The node with the maximum genetic difference is 1, with a difference of 15 XOR 1 = 14.
-- [0,5]: The node with the maximum genetic difference is 2, with a difference of 5 XOR 2 = 7.
-
-
-
-
Constraints:
-
-
-
2 <= parents.length <= 105
-
0 <= parents[i] <= parents.length - 1 for every node i that is not the root.
-
parents[root] == -1
-
1 <= queries.length <= 3 * 104
-
0 <= nodei <= parents.length - 1
-
0 <= vali <= 2 * 105
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Bit Manipulation](../../tag/bit-manipulation/README.md)]
- [[Trie](../../tag/trie/README.md)]
-
-### Similar Questions
- 1. [Maximum XOR With an Element From Array](../maximum-xor-with-an-element-from-array) (Hard)
-
-### Hints
-
-Hint 1
-How can we use a trie to store all the XOR values in the path from a node to the root?
-
-
-
-Hint 2
-How can we dynamically add the XOR values with a DFS search?
-
diff --git a/problems/maximum-good-people-based-on-statements/README.md b/problems/maximum-good-people-based-on-statements/README.md
deleted file mode 100644
index 9b0cf9661..000000000
--- a/problems/maximum-good-people-based-on-statements/README.md
+++ /dev/null
@@ -1,114 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../find-all-lonely-numbers-in-the-array "Find All Lonely Numbers in the Array")
-
-[Next >](../minimum-number-of-lines-to-cover-points "Minimum Number of Lines to Cover Points")
-
-## [2151. Maximum Good People Based on Statements (Hard)](https://leetcode.com/problems/maximum-good-people-based-on-statements "基于陈述统计最多好人数")
-
-
There are two types of persons:
-
-
-
The good person: The person who always tells the truth.
-
The bad person: The person who might tell the truth and might lie.
-
-
-
You are given a 0-indexed 2D integer array statements of size n x n that represents the statements made by n people about each other. More specifically, statements[i][j] could be one of the following:
-
-
-
0 which represents a statement made by person i that person j is a bad person.
-
1 which represents a statement made by person i that person j is a good person.
-
2 represents that no statement is made by person i about person j.
-
-
-
Additionally, no person ever makes a statement about themselves. Formally, we have that statements[i][i] = 2 for all 0 <= i < n.
-
-
Return the maximum number of people who can be good based on the statements made by the n people.
-
-
-
Example 1:
-
-
-Input: statements = [[2,1,2],[1,2,2],[2,0,2]]
-Output: 2
-Explanation: Each person makes a single statement.
-- Person 0 states that person 1 is good.
-- Person 1 states that person 0 is good.
-- Person 2 states that person 1 is bad.
-Let's take person 2 as the key.
-- Assuming that person 2 is a good person:
- - Based on the statement made by person 2, person 1 is a bad person.
- - Now we know for sure that person 1 is bad and person 2 is good.
- - Based on the statement made by person 1, and since person 1 is bad, they could be:
- - telling the truth. There will be a contradiction in this case and this assumption is invalid.
- - lying. In this case, person 0 is also a bad person and lied in their statement.
- - Following that person 2 is a good person, there will be only one good person in the group.
-- Assuming that person 2 is a bad person:
- - Based on the statement made by person 2, and since person 2 is bad, they could be:
- - telling the truth. Following this scenario, person 0 and 1 are both bad as explained before.
- - Following that person 2 is bad but told the truth, there will be no good persons in the group.
- - lying. In this case person 1 is a good person.
- - Since person 1 is a good person, person 0 is also a good person.
- - Following that person 2 is bad and lied, there will be two good persons in the group.
-We can see that at most 2 persons are good in the best case, so we return 2.
-Note that there is more than one way to arrive at this conclusion.
-
-
-
Example 2:
-
-
-Input: statements = [[2,0],[0,2]]
-Output: 1
-Explanation: Each person makes a single statement.
-- Person 0 states that person 1 is bad.
-- Person 1 states that person 0 is bad.
-Let's take person 0 as the key.
-- Assuming that person 0 is a good person:
- - Based on the statement made by person 0, person 1 is a bad person and was lying.
- - Following that person 0 is a good person, there will be only one good person in the group.
-- Assuming that person 0 is a bad person:
- - Based on the statement made by person 0, and since person 0 is bad, they could be:
- - telling the truth. Following this scenario, person 0 and 1 are both bad.
- - Following that person 0 is bad but told the truth, there will be no good persons in the group.
- - lying. In this case person 1 is a good person.
- - Following that person 0 is bad and lied, there will be only one good person in the group.
-We can see that at most, one person is good in the best case, so we return 1.
-Note that there is more than one way to arrive at this conclusion.
-
-
-
-
Constraints:
-
-
-
n == statements.length == statements[i].length
-
2 <= n <= 15
-
statements[i][j] is either 0, 1, or 2.
-
statements[i][i] == 2
-
-
-### Related Topics
- [[Bit Manipulation](../../tag/bit-manipulation/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Backtracking](../../tag/backtracking/README.md)]
- [[Enumeration](../../tag/enumeration/README.md)]
-
-### Hints
-
-Hint 1
-You should test every possible assignment of good and bad people, using a bitmask.
-
-
-
-Hint 2
-In each bitmask, if the person i is good, then his statements should be consistent with the bitmask in order for the assignment to be valid.
-
-
-
-Hint 3
-If the assignment is valid, count how many people are good and keep track of the maximum.
-
diff --git a/problems/maximum-height-by-stacking-cuboids/README.md b/problems/maximum-height-by-stacking-cuboids/README.md
deleted file mode 100644
index 4c988381f..000000000
--- a/problems/maximum-height-by-stacking-cuboids/README.md
+++ /dev/null
@@ -1,79 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../stone-game-vii "Stone Game VII")
-
-[Next >](../count-ways-to-distribute-candies "Count Ways to Distribute Candies")
-
-## [1691. Maximum Height by Stacking Cuboids (Hard)](https://leetcode.com/problems/maximum-height-by-stacking-cuboids "堆叠长方体的最大高度")
-
-
Given ncuboids where the dimensions of the ith cuboid is cuboids[i] = [widthi, lengthi, heighti] (0-indexed). Choose a subset of cuboids and place them on each other.
-
-
You can place cuboid i on cuboid j if widthi <= widthj and lengthi <= lengthj and heighti <= heightj. You can rearrange any cuboid's dimensions by rotating it to put it on another cuboid.
-
-
Return the maximum height of the stackedcuboids.
-
-
-
Example 1:
-
-
-
-
-Input: cuboids = [[50,45,20],[95,37,53],[45,23,12]]
-Output: 190
-Explanation:
-Cuboid 1 is placed on the bottom with the 53x37 side facing down with height 95.
-Cuboid 0 is placed next with the 45x20 side facing down with height 50.
-Cuboid 2 is placed next with the 23x12 side facing down with height 45.
-The total height is 95 + 50 + 45 = 190.
-
-
-
Example 2:
-
-
-Input: cuboids = [[38,25,45],[76,35,3]]
-Output: 76
-Explanation:
-You can't place any of the cuboids on the other.
-We choose cuboid 1 and rotate it so that the 35x3 side is facing down and its height is 76.
-
-
-
Example 3:
-
-
-Input: cuboids = [[7,11,17],[7,17,11],[11,7,17],[11,17,7],[17,7,11],[17,11,7]]
-Output: 102
-Explanation:
-After rearranging the cuboids, you can see that all cuboids have the same dimension.
-You can place the 11x7 side down on all cuboids so their heights are 17.
-The maximum height of stacked cuboids is 6 * 17 = 102.
-
-
-
-
Constraints:
-
-
-
n == cuboids.length
-
1 <= n <= 100
-
1 <= widthi, lengthi, heighti <= 100
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Hints
-
-Hint 1
-Does the dynamic programming sound like the right algorithm after sorting?
-
-
-
-Hint 2
-Let's say box1 can be placed on top of box2. No matter what orientation box2 is in, we can rotate box1 so that it can be placed on top. Why don't we orient everything such that height is the biggest?
-
diff --git a/problems/maximum-ice-cream-bars/README.md b/problems/maximum-ice-cream-bars/README.md
deleted file mode 100644
index 5b90aaafb..000000000
--- a/problems/maximum-ice-cream-bars/README.md
+++ /dev/null
@@ -1,71 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../check-if-the-sentence-is-pangram "Check if the Sentence Is Pangram")
-
-[Next >](../single-threaded-cpu "Single-Threaded CPU")
-
-## [1833. Maximum Ice Cream Bars (Medium)](https://leetcode.com/problems/maximum-ice-cream-bars "雪糕的最大数量")
-
-
It is a sweltering summer day, and a boy wants to buy some ice cream bars.
-
-
At the store, there are n ice cream bars. You are given an array costs of length n, where costs[i] is the price of the ith ice cream bar in coins. The boy initially has coins coins to spend, and he wants to buy as many ice cream bars as possible.
-
-
Return the maximum number of ice cream bars the boy can buy with coins coins.
-
-
Note: The boy can buy the ice cream bars in any order.
-
-
-
Example 1:
-
-
-Input: costs = [1,3,2,4,1], coins = 7
-Output: 4
-Explanation: The boy can buy ice cream bars at indices 0,1,2,4 for a total price of 1 + 3 + 2 + 1 = 7.
-
-
-
Example 2:
-
-
-Input: costs = [10,6,8,7,7,8], coins = 5
-Output: 0
-Explanation: The boy cannot afford any of the ice cream bars.
-
-
-
Example 3:
-
-
-Input: costs = [1,6,3,1,2,5], coins = 20
-Output: 6
-Explanation: The boy can buy all the ice cream bars for a total price of 1 + 6 + 3 + 1 + 2 + 5 = 18.
-
-
-
-
Constraints:
-
-
-
costs.length == n
-
1 <= n <= 105
-
1 <= costs[i] <= 105
-
1 <= coins <= 108
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Greedy](../../tag/greedy/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Hints
-
-Hint 1
-It is always optimal to buy the least expensive ice cream bar first.
-
-
-
-Hint 2
-Sort the prices so that the cheapest ice cream bar comes first.
-
diff --git a/problems/maximum-length-of-a-concatenated-string-with-unique-characters/README.md b/problems/maximum-length-of-a-concatenated-string-with-unique-characters/README.md
deleted file mode 100644
index cc15cde53..000000000
--- a/problems/maximum-length-of-a-concatenated-string-with-unique-characters/README.md
+++ /dev/null
@@ -1,76 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../circular-permutation-in-binary-representation "Circular Permutation in Binary Representation")
-
-[Next >](../tiling-a-rectangle-with-the-fewest-squares "Tiling a Rectangle with the Fewest Squares")
-
-## [1239. Maximum Length of a Concatenated String with Unique Characters (Medium)](https://leetcode.com/problems/maximum-length-of-a-concatenated-string-with-unique-characters "串联字符串的最大长度")
-
-
You are given an array of strings arr. A string s is formed by the concatenation of a subsequence of arr that has unique characters.
-
-
Return the maximum possible length of s.
-
-
A subsequence is an array that can be derived from another array by deleting some or no elements without changing the order of the remaining elements.
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Sliding Window](../../tag/sliding-window/README.md)]
- [[Rolling Hash](../../tag/rolling-hash/README.md)]
- [[Hash Function](../../tag/hash-function/README.md)]
-
-### Similar Questions
- 1. [Minimum Size Subarray Sum](../minimum-size-subarray-sum) (Medium)
- 1. [Longest Common Subpath](../longest-common-subpath) (Hard)
-
-### Hints
-
-Hint 1
-Use dynamic programming. dp[i][j] will be the answer for inputs A[i:], B[j:].
-
diff --git a/problems/maximum-length-of-repeated-subarray/maximum_length_of_repeated_subarray.go b/problems/maximum-length-of-repeated-subarray/maximum_length_of_repeated_subarray.go
deleted file mode 100644
index 41a41d01f..000000000
--- a/problems/maximum-length-of-repeated-subarray/maximum_length_of_repeated_subarray.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem718
diff --git a/problems/maximum-length-of-repeated-subarray/maximum_length_of_repeated_subarray_test.go b/problems/maximum-length-of-repeated-subarray/maximum_length_of_repeated_subarray_test.go
deleted file mode 100644
index 41a41d01f..000000000
--- a/problems/maximum-length-of-repeated-subarray/maximum_length_of_repeated_subarray_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem718
diff --git a/problems/maximum-length-of-subarray-with-positive-product/README.md b/problems/maximum-length-of-subarray-with-positive-product/README.md
deleted file mode 100644
index d1b1c444c..000000000
--- a/problems/maximum-length-of-subarray-with-positive-product/README.md
+++ /dev/null
@@ -1,72 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../detect-pattern-of-length-m-repeated-k-or-more-times "Detect Pattern of Length M Repeated K or More Times")
-
-[Next >](../minimum-number-of-days-to-disconnect-island "Minimum Number of Days to Disconnect Island")
-
-## [1567. Maximum Length of Subarray With Positive Product (Medium)](https://leetcode.com/problems/maximum-length-of-subarray-with-positive-product "乘积为正数的最长子数组长度")
-
-
Given an array of integers nums, find the maximum length of a subarray where the product of all its elements is positive.
-
-
A subarray of an array is a consecutive sequence of zero or more values taken out of that array.
-
-
Return the maximum length of a subarray with positive product.
-
-
-
Example 1:
-
-
-Input: nums = [1,-2,-3,4]
-Output: 4
-Explanation: The array nums already has a positive product of 24.
-
-
-
Example 2:
-
-
-Input: nums = [0,1,-2,-3,-4]
-Output: 3
-Explanation: The longest subarray with positive product is [1,-2,-3] which has a product of 6.
-Notice that we cannot include 0 in the subarray since that'll make the product 0 which is not positive.
-
-
Example 3:
-
-
-Input: nums = [-1,-2,-3,0,1]
-Output: 2
-Explanation: The longest subarray with positive product is [-1,-2] or [-2,-3].
-
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 105
-
-109 <= nums[i] <= 109
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Greedy](../../tag/greedy/README.md)]
-
-### Hints
-
-Hint 1
-Split the whole array into subarrays by zeroes since a subarray with positive product cannot contain any zero.
-
-
-
-Hint 2
-If the subarray has even number of negative numbers, the whole subarray has positive product.
-
-
-
-Hint 3
-Otherwise, we have two choices, either - remove the prefix till the first negative element in this subarray, or remove the suffix starting from the last negative element in this subarray.
-
diff --git a/problems/maximum-level-sum-of-a-binary-tree/README.md b/problems/maximum-level-sum-of-a-binary-tree/README.md
deleted file mode 100644
index f91184c27..000000000
--- a/problems/maximum-level-sum-of-a-binary-tree/README.md
+++ /dev/null
@@ -1,70 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../find-words-that-can-be-formed-by-characters "Find Words That Can Be Formed by Characters")
-
-[Next >](../as-far-from-land-as-possible "As Far from Land as Possible")
-
-## [1161. Maximum Level Sum of a Binary Tree (Medium)](https://leetcode.com/problems/maximum-level-sum-of-a-binary-tree "最大层内元素和")
-
-
Given the root of a binary tree, the level of its root is 1, the level of its children is 2, and so on.
-
-
Return the smallest level x such that the sum of all the values of nodes at level x is maximal.
-
-
-
Example 1:
-
-
-Input: root = [1,7,0,7,-8,null,null]
-Output: 2
-Explanation:
-Level 1 sum = 1.
-Level 2 sum = 7 + 0 = 7.
-Level 3 sum = 7 + -8 = -1.
-So we return the level with the maximum sum which is level 2.
-
The number of nodes in the tree is in the range [1, 104].
-
-105 <= Node.val <= 105
-
-
-### Related Topics
- [[Tree](../../tag/tree/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Binary Tree](../../tag/binary-tree/README.md)]
-
-### Hints
-
-Hint 1
-Calculate the sum for each level then find the level with the maximum sum.
-
-
-
-Hint 2
-How can you traverse the tree ?
-
-
-
-Hint 3
-How can you sum up the values for every level ?
-
-
-
-Hint 4
-Use DFS or BFS to traverse the tree keeping the level of each node, and sum up those values with a map or a frequency array.
-
diff --git a/problems/maximum-matrix-sum/README.md b/problems/maximum-matrix-sum/README.md
deleted file mode 100644
index 8eb766ade..000000000
--- a/problems/maximum-matrix-sum/README.md
+++ /dev/null
@@ -1,67 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-time-to-type-word-using-special-typewriter "Minimum Time to Type Word Using Special Typewriter")
-
-[Next >](../number-of-ways-to-arrive-at-destination "Number of Ways to Arrive at Destination")
-
-## [1975. Maximum Matrix Sum (Medium)](https://leetcode.com/problems/maximum-matrix-sum "最大方阵和")
-
-
You are given an n x n integer matrix. You can do the following operation any number of times:
-
-
-
Choose any two adjacent elements of matrix and multiply each of them by -1.
-
-
-
Two elements are considered adjacent if and only if they share a border.
-
-
Your goal is to maximize the summation of the matrix's elements. Return the maximum sum of the matrix's elements using the operation mentioned above.
-
-
-
Example 1:
-
-
-Input: matrix = [[1,-1],[-1,1]]
-Output: 4
-Explanation: We can follow the following steps to reach sum equals 4:
-- Multiply the 2 elements in the first row by -1.
-- Multiply the 2 elements in the first column by -1.
-
-
-
Example 2:
-
-
-Input: matrix = [[1,2,3],[-1,-2,-3],[1,2,3]]
-Output: 16
-Explanation: We can follow the following step to reach sum equals 16:
-- Multiply the 2 last elements in the second row by -1.
-
-
-
-
Constraints:
-
-
-
n == matrix.length == matrix[i].length
-
2 <= n <= 250
-
-105 <= matrix[i][j] <= 105
-
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
-
-### Hints
-
-Hint 1
-Try to use the operation so that each row has only one negative number.
-
-
-
-Hint 2
-If you have only one negative element you cannot convert it to positive.
-
diff --git a/problems/maximum-nesting-depth-of-the-parentheses/README.md b/problems/maximum-nesting-depth-of-the-parentheses/README.md
deleted file mode 100644
index 93c9ebc78..000000000
--- a/problems/maximum-nesting-depth-of-the-parentheses/README.md
+++ /dev/null
@@ -1,71 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../find-the-missing-ids "Find the Missing IDs")
-
-[Next >](../maximal-network-rank "Maximal Network Rank")
-
-## [1614. Maximum Nesting Depth of the Parentheses (Easy)](https://leetcode.com/problems/maximum-nesting-depth-of-the-parentheses "括号的最大嵌套深度")
-
-
A string is a valid parentheses string (denoted VPS) if it meets one of the following:
-
-
-
It is an empty string "", or a single character not equal to "(" or ")",
-
It can be written as AB (A concatenated with B), where A and B are VPS's, or
-
It can be written as (A), where A is a VPS.
-
-
-
We can similarly define the nesting depthdepth(S) of any VPS S as follows:
-
-
-
depth("") = 0
-
depth(C) = 0, where C is a string with a single character not equal to "(" or ")".
-
depth(A + B) = max(depth(A), depth(B)), where A and B are VPS's.
-
depth("(" + A + ")") = 1 + depth(A), where A is a VPS.
-
-
-
For example, "", "()()", and "()(()())" are VPS's (with nesting depths 0, 1, and 2), and ")(" and "(()" are not VPS's.
-
-
Given a VPS represented as string s, return the nesting depth of s.
-
-
-
Example 1:
-
-
-Input: s = "(1+(2*3)+((8)/4))+1"
-Output: 3
-Explanation: Digit 8 is inside of 3 nested parentheses in the string.
-
-
-
Example 2:
-
-
-Input: s = "(1)+((2))+(((3)))"
-Output: 3
-
-
-
-
Constraints:
-
-
-
1 <= s.length <= 100
-
s consists of digits 0-9 and characters '+', '-', '*', '/', '(', and ')'.
-
It is guaranteed that parentheses expression s is a VPS.
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
- [[Stack](../../tag/stack/README.md)]
-
-### Similar Questions
- 1. [Maximum Nesting Depth of Two Valid Parentheses Strings](../maximum-nesting-depth-of-two-valid-parentheses-strings) (Medium)
-
-### Hints
-
-Hint 1
-The depth of any character in the VPS is the ( number of left brackets before it ) - ( number of right brackets before it )
-
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
deleted file mode 100644
index ef9ae45b3..000000000
--- a/problems/maximum-nesting-depth-of-two-valid-parentheses-strings/README.md
+++ /dev/null
@@ -1,67 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../delete-nodes-and-return-forest "Delete Nodes And Return Forest")
-
-[Next >](../highest-grade-for-each-student "Highest Grade For Each Student")
-
-## [1111. Maximum Nesting Depth of Two Valid Parentheses Strings (Medium)](https://leetcode.com/problems/maximum-nesting-depth-of-two-valid-parentheses-strings "有效括号的嵌套深度")
-
-
A string is a valid parentheses string (denoted VPS) if and only if it consists of "(" and ")" characters only, and:
-
-
-
It is the empty string, or
-
It can be written as AB (A concatenated with B), where A and B are VPS's, or
-
It can be written as (A), where A is a VPS.
-
-
-
We can similarly define the nesting depthdepth(S) of any VPS S as follows:
-
-
-
depth("") = 0
-
depth(A + B) = max(depth(A), depth(B)), where A and B are VPS's
-
depth("(" + A + ")") = 1 + depth(A), where A is a VPS.
-
-
-
For example, "", "()()", and "()(()())" are VPS's (with nesting depths 0, 1, and 2), and ")(" and "(()" are not VPS's.
-
-
-
-
Given a VPS seq, split it into two disjoint subsequences A and B, such that A and B are VPS's (and A.length + B.length = seq.length).
-
-
Now choose any such A and B such that max(depth(A), depth(B)) is the minimum possible value.
-
-
Return an answer array (of length seq.length) that encodes such a choice of A and B: answer[i] = 0 if seq[i] is part of A, else answer[i] = 1. Note that even though multiple answers may exist, you may return any of them.
-
-### Related Topics
- [[String](../../tag/string/README.md)]
- [[Stack](../../tag/stack/README.md)]
-
-### Similar Questions
- 1. [Maximum Nesting Depth of the Parentheses](../maximum-nesting-depth-of-the-parentheses) (Easy)
diff --git a/problems/maximum-nesting-depth-of-two-valid-parentheses-strings/maximum_nesting_depth_of_two_valid_parentheses_strings.go b/problems/maximum-nesting-depth-of-two-valid-parentheses-strings/maximum_nesting_depth_of_two_valid_parentheses_strings.go
deleted file mode 100644
index fe042a468..000000000
--- a/problems/maximum-nesting-depth-of-two-valid-parentheses-strings/maximum_nesting_depth_of_two_valid_parentheses_strings.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem1111
diff --git a/problems/maximum-non-negative-product-in-a-matrix/README.md b/problems/maximum-non-negative-product-in-a-matrix/README.md
deleted file mode 100644
index 061a705d5..000000000
--- a/problems/maximum-non-negative-product-in-a-matrix/README.md
+++ /dev/null
@@ -1,66 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../split-a-string-into-the-max-number-of-unique-substrings "Split a String Into the Max Number of Unique Substrings")
-
-[Next >](../minimum-cost-to-connect-two-groups-of-points "Minimum Cost to Connect Two Groups of Points")
-
-## [1594. Maximum Non Negative Product in a Matrix (Medium)](https://leetcode.com/problems/maximum-non-negative-product-in-a-matrix "矩阵的最大非负积")
-
-
You are given a m x n matrix grid. Initially, you are located at the top-left corner (0, 0), and in each step, you can only move right or down in the matrix.
-
-
Among all possible paths starting from the top-left corner (0, 0) and ending in the bottom-right corner (m - 1, n - 1), find the path with the maximum non-negative product. The product of a path is the product of all integers in the grid cells visited along the path.
-
-
Return the maximum non-negative product modulo109 + 7. If the maximum product is negative, return -1.
-
-
Notice that the modulo is performed after getting the maximum product.
-
-
-
Example 1:
-
-
-Input: grid = [[-1,-2,-3],[-2,-3,-3],[-3,-3,-2]]
-Output: -1
-Explanation: It is not possible to get non-negative product in the path from (0, 0) to (2, 2), so return -1.
-
-Input: grid = [[1,3],[0,-4]]
-Output: 0
-Explanation: Maximum non-negative product is shown (1 * 0 * -4 = 0).
-
-
-
-
Constraints:
-
-
-
m == grid.length
-
n == grid[i].length
-
1 <= m, n <= 15
-
-4 <= grid[i][j] <= 4
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
-
-### Hints
-
-Hint 1
-Use Dynamic programming. Keep the highest value and lowest value you can achieve up to a point.
-
diff --git a/problems/maximum-number-of-accepted-invitations/README.md b/problems/maximum-number-of-accepted-invitations/README.md
deleted file mode 100644
index ef403fdb6..000000000
--- a/problems/maximum-number-of-accepted-invitations/README.md
+++ /dev/null
@@ -1,35 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../number-of-different-subsequences-gcds "Number of Different Subsequences GCDs")
-
-[Next >](../find-customers-with-positive-revenue-this-year "Find Customers With Positive Revenue this Year")
-
-## [1820. Maximum Number of Accepted Invitations (Medium)](https://leetcode.com/problems/maximum-number-of-accepted-invitations "最多邀请的个数")
-
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Backtracking](../../tag/backtracking/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
-
-### Hints
-
-Hint 1
-We can see that the problem can be represented as a directed graph with an edge from each boy to the girl he invited.
-
-
-
-Hint 2
-We need to choose a set of edges such that no to source points in the graph (i.e., boys) have an edge with the same endpoint (i.e., the same girl).
-
-
-
-Hint 3
-The problem is maximum bipartite matching in the graph.
-
diff --git a/problems/maximum-number-of-achievable-transfer-requests/README.md b/problems/maximum-number-of-achievable-transfer-requests/README.md
deleted file mode 100644
index 8c9be33c7..000000000
--- a/problems/maximum-number-of-achievable-transfer-requests/README.md
+++ /dev/null
@@ -1,81 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../throne-inheritance "Throne Inheritance")
-
-[Next >](../find-nearest-right-node-in-binary-tree "Find Nearest Right Node in Binary Tree")
-
-## [1601. Maximum Number of Achievable Transfer Requests (Hard)](https://leetcode.com/problems/maximum-number-of-achievable-transfer-requests "最多可达成的换楼请求数目")
-
-
We have n buildings numbered from 0 to n - 1. Each building has a number of employees. It's transfer season, and some employees want to change the building they reside in.
-
-
You are given an array requests where requests[i] = [fromi, toi] represents an employee's request to transfer from building fromi to building toi.
-
-
All buildings are full, so a list of requests is achievable only if for each building, the net change in employee transfers is zero. This means the number of employees leaving is equal to the number of employees moving in. For example if n = 3 and two employees are leaving building 0, one is leaving building 1, and one is leaving building 2, there should be two employees moving to building 0, one employee moving to building 1, and one employee moving to building 2.
-
-
Return the maximum number of achievable requests.
-
-
-
Example 1:
-
-
-Input: n = 5, requests = [[0,1],[1,0],[0,1],[1,2],[2,0],[3,4]]
-Output: 5
-Explantion: Let's see the requests:
-From building 0 we have employees x and y and both want to move to building 1.
-From building 1 we have employees a and b and they want to move to buildings 2 and 0 respectively.
-From building 2 we have employee z and they want to move to building 0.
-From building 3 we have employee c and they want to move to building 4.
-From building 4 we don't have any requests.
-We can achieve the requests of users x and b by swapping their places.
-We can achieve the requests of users y, a and z by swapping the places in the 3 buildings.
-
-
-
Example 2:
-
-
-Input: n = 3, requests = [[0,0],[1,2],[2,1]]
-Output: 3
-Explantion: Let's see the requests:
-From building 0 we have employee x and they want to stay in the same building 0.
-From building 1 we have employee y and they want to move to building 2.
-From building 2 we have employee z and they want to move to building 1.
-We can achieve all the requests.
-
-
Example 3:
-
-
-Input: n = 4, requests = [[0,3],[3,1],[1,2],[2,0]]
-Output: 4
-
-
-
-
Constraints:
-
-
-
1 <= n <= 20
-
1 <= requests.length <= 16
-
requests[i].length == 2
-
0 <= fromi, toi < n
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Backtracking](../../tag/backtracking/README.md)]
- [[Bit Manipulation](../../tag/bit-manipulation/README.md)]
- [[Enumeration](../../tag/enumeration/README.md)]
-
-### Hints
-
-Hint 1
-Think brute force
-
-
-
-Hint 2
-When is a subset of requests okay?
-
diff --git a/problems/maximum-number-of-balloons/README.md b/problems/maximum-number-of-balloons/README.md
deleted file mode 100644
index b871476da..000000000
--- a/problems/maximum-number-of-balloons/README.md
+++ /dev/null
@@ -1,66 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../design-bounded-blocking-queue "Design Bounded Blocking Queue")
-
-[Next >](../reverse-substrings-between-each-pair-of-parentheses "Reverse Substrings Between Each Pair of Parentheses")
-
-## [1189. Maximum Number of Balloons (Easy)](https://leetcode.com/problems/maximum-number-of-balloons "“气球” 的最大数量")
-
-
Given a string text, you want to use the characters of text to form as many instances of the word "balloon" as possible.
-
-
You can use each character in textat most once. Return the maximum number of instances that can be formed.
-
-
-
Example 1:
-
-
-
-
-Input: text = "nlaebolko"
-Output: 1
-
-
-
Example 2:
-
-
-
-
-Input: text = "loonbalxballpoon"
-Output: 2
-
-
-
Example 3:
-
-
-Input: text = "leetcode"
-Output: 0
-
-
-
-
Constraints:
-
-
-
1 <= text.length <= 104
-
text consists of lower case English letters only.
-
-
-### Related Topics
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
- [[Counting](../../tag/counting/README.md)]
-
-### Hints
-
-Hint 1
-Count the frequency of letters in the given string.
-
-
-
-Hint 2
-Find the letter than can make the minimum number of instances of the word "balloon".
-
diff --git a/problems/maximum-number-of-balloons/maximum_number_of_balloons.go b/problems/maximum-number-of-balloons/maximum_number_of_balloons.go
deleted file mode 100644
index 264646152..000000000
--- a/problems/maximum-number-of-balloons/maximum_number_of_balloons.go
+++ /dev/null
@@ -1,20 +0,0 @@
-package problem1189
-
-func maxNumberOfBalloons(text string) int {
- ans, m := len(text), make(map[byte]int, 5)
- for i := 0; i < ans; i++ {
- switch text[i] {
- case 'b', 'a', 'l', 'o', 'n':
- m[text[i]]++
- }
- }
- for _, c := range [...]byte{'b', 'a', 'l', 'o', 'n'} {
- if c == 'l' || c == 'o' {
- m[c] /= 2
- }
- if ans > m[c] {
- ans = m[c]
- }
- }
- return ans
-}
diff --git a/problems/maximum-number-of-balloons/maximum_number_of_balloons_test.go b/problems/maximum-number-of-balloons/maximum_number_of_balloons_test.go
deleted file mode 100644
index 14206e51b..000000000
--- a/problems/maximum-number-of-balloons/maximum_number_of_balloons_test.go
+++ /dev/null
@@ -1,35 +0,0 @@
-package problem1189
-
-import "testing"
-
-type testType struct {
- in string
- want int
-}
-
-func TestMaxNumberOfBalloons(t *testing.T) {
- tests := [...]testType{
- {
- in: "nlaebolko",
- want: 1,
- },
- {
- in: "loonbalxballpoon",
- want: 2,
- },
- {
- in: "leetcode",
- want: 0,
- },
- {
- in: "lloo",
- want: 0,
- },
- }
- for _, tt := range tests {
- got := maxNumberOfBalloons(tt.in)
- if got != tt.want {
- t.Fatalf("in: %v, got: %v, want: %v", tt.in, got, tt.want)
- }
- }
-}
diff --git a/problems/maximum-number-of-balls-in-a-box/README.md b/problems/maximum-number-of-balls-in-a-box/README.md
deleted file mode 100644
index a31e84d04..000000000
--- a/problems/maximum-number-of-balls-in-a-box/README.md
+++ /dev/null
@@ -1,74 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../find-total-time-spent-by-each-employee "Find Total Time Spent by Each Employee")
-
-[Next >](../restore-the-array-from-adjacent-pairs "Restore the Array From Adjacent Pairs")
-
-## [1742. Maximum Number of Balls in a Box (Easy)](https://leetcode.com/problems/maximum-number-of-balls-in-a-box "盒子中小球的最大数量")
-
-
You are working in a ball factory where you have n balls numbered from lowLimit up to highLimitinclusive (i.e., n == highLimit - lowLimit + 1), and an infinite number of boxes numbered from 1 to infinity.
-
-
Your job at this factory is to put each ball in the box with a number equal to the sum of digits of the ball's number. For example, the ball number 321 will be put in the box number 3 + 2 + 1 = 6 and the ball number 10 will be put in the box number 1 + 0 = 1.
-
-
Given two integers lowLimit and highLimit, return the number of balls in the box with the most balls.
-
-
-
Example 1:
-
-
-Input: lowLimit = 1, highLimit = 10
-Output: 2
-Explanation:
-Box Number: 1 2 3 4 5 6 7 8 9 10 11 ...
-Ball Count: 2 1 1 1 1 1 1 1 1 0 0 ...
-Box 1 has the most number of balls with 2 balls.
-
-
Example 2:
-
-
-Input: lowLimit = 5, highLimit = 15
-Output: 2
-Explanation:
-Box Number: 1 2 3 4 5 6 7 8 9 10 11 ...
-Ball Count: 1 1 1 1 2 2 1 1 1 0 0 ...
-Boxes 5 and 6 have the most number of balls with 2 balls in each.
-
-
-
Example 3:
-
-
-Input: lowLimit = 19, highLimit = 28
-Output: 2
-Explanation:
-Box Number: 1 2 3 4 5 6 7 8 9 10 11 12 ...
-Ball Count: 0 1 1 1 1 1 1 1 1 2 0 0 ...
-Box 10 has the most number of balls with 2 balls.
-
-
-
-
Constraints:
-
-
-
1 <= lowLimit <= highLimit <= 105
-
-
-### Related Topics
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Math](../../tag/math/README.md)]
- [[Counting](../../tag/counting/README.md)]
-
-### Hints
-
-Hint 1
-Note that both lowLimit and highLimit are of small constraints so you can iterate on all nubmer between them
-
-
-
-Hint 2
-You can simulate the boxes by counting for each box the number of balls with digit sum equal to that box number
-
diff --git a/problems/maximum-number-of-coins-you-can-get/README.md b/problems/maximum-number-of-coins-you-can-get/README.md
deleted file mode 100644
index 61ecb3167..000000000
--- a/problems/maximum-number-of-coins-you-can-get/README.md
+++ /dev/null
@@ -1,79 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../most-visited-sector-in-a-circular-track "Most Visited Sector in a Circular Track")
-
-[Next >](../find-latest-group-of-size-m "Find Latest Group of Size M")
-
-## [1561. Maximum Number of Coins You Can Get (Medium)](https://leetcode.com/problems/maximum-number-of-coins-you-can-get "你可以获得的最大硬币数目")
-
-
There are 3n piles of coins of varying size, you and your friends will take piles of coins as follows:
-
-
-
In each step, you will choose any 3 piles of coins (not necessarily consecutive).
-
Of your choice, Alice will pick the pile with the maximum number of coins.
-
You will pick the next pile with the maximum number of coins.
-
Your friend Bob will pick the last pile.
-
Repeat until there are no more piles of coins.
-
-
-
Given an array of integers piles where piles[i] is the number of coins in the ith pile.
-
-
Return the maximum number of coins that you can have.
-
-
-
Example 1:
-
-
-Input: piles = [2,4,1,2,7,8]
-Output: 9
-Explanation: Choose the triplet (2, 7, 8), Alice Pick the pile with 8 coins, you the pile with 7 coins and Bob the last one.
-Choose the triplet (1, 2, 4), Alice Pick the pile with 4 coins, you the pile with 2 coins and Bob the last one.
-The maximum number of coins which you can have are: 7 + 2 = 9.
-On the other hand if we choose this arrangement (1, 2, 8), (2, 4, 7) you only get 2 + 4 = 6 coins which is not optimal.
-
-
-
Example 2:
-
-
-Input: piles = [2,4,5]
-Output: 4
-
-
-
Example 3:
-
-
-Input: piles = [9,8,7,6,5,1,2,3,4]
-Output: 18
-
-
-
-
Constraints:
-
-
-
3 <= piles.length <= 105
-
piles.length % 3 == 0
-
1 <= piles[i] <= 104
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Math](../../tag/math/README.md)]
- [[Greedy](../../tag/greedy/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
- [[Game Theory](../../tag/game-theory/README.md)]
-
-### Hints
-
-Hint 1
-Which pile of coins will you never be able to pick up?
-
-
-
-Hint 2
-Bob is forced to take the last pile of coins, no matter what it is. Which pile should you give to him?
-
diff --git a/problems/maximum-number-of-consecutive-values-you-can-make/README.md b/problems/maximum-number-of-consecutive-values-you-can-make/README.md
deleted file mode 100644
index b0826514c..000000000
--- a/problems/maximum-number-of-consecutive-values-you-can-make/README.md
+++ /dev/null
@@ -1,83 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../design-authentication-manager "Design Authentication Manager")
-
-[Next >](../maximize-score-after-n-operations "Maximize Score After N Operations")
-
-## [1798. Maximum Number of Consecutive Values You Can Make (Medium)](https://leetcode.com/problems/maximum-number-of-consecutive-values-you-can-make "你能构造出连续值的最大数目")
-
-
You are given an integer array coins of length n which represents the n coins that you own. The value of the ith coin is coins[i]. You can make some value x if you can choose some of your n coins such that their values sum up to x.
-
-
Return the maximum number of consecutive integer values that you canmake with your coins starting from and including0.
-
-
Note that you may have multiple coins of the same value.
-
-
-
Example 1:
-
-
-Input: coins = [1,3]
-Output: 2
-Explanation: You can make the following values:
-- 0: take []
-- 1: take [1]
-You can make 2 consecutive integer values starting from 0.
-
-
Example 2:
-
-
-Input: coins = [1,1,1,4]
-Output: 8
-Explanation: You can make the following values:
-- 0: take []
-- 1: take [1]
-- 2: take [1,1]
-- 3: take [1,1,1]
-- 4: take [4]
-- 5: take [4,1]
-- 6: take [4,1,1]
-- 7: take [4,1,1,1]
-You can make 8 consecutive integer values starting from 0.
-
-
Example 3:
-
-
-Input: nums = [1,4,10,3,1]
-Output: 20
-
-
-
Constraints:
-
-
-
coins.length == n
-
1 <= n <= 4 * 104
-
1 <= coins[i] <= 4 * 104
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Greedy](../../tag/greedy/README.md)]
-
-### Similar Questions
- 1. [Patching Array](../patching-array) (Hard)
-
-### Hints
-
-Hint 1
-If you can make the first x values and you have a value v, then you can make all the values ≤ v + x
-
-
-
-Hint 2
-Sort the array of coins. You can always make the value 0 so you can start with x = 0.
-
-
-
-Hint 3
-Process the values starting from the smallest and stop when there is a value that cannot be achieved with the current x.
-
diff --git a/problems/maximum-number-of-darts-inside-of-a-circular-dartboard/README.md b/problems/maximum-number-of-darts-inside-of-a-circular-dartboard/README.md
deleted file mode 100644
index 7767a3d0e..000000000
--- a/problems/maximum-number-of-darts-inside-of-a-circular-dartboard/README.md
+++ /dev/null
@@ -1,66 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../people-whose-list-of-favorite-companies-is-not-a-subset-of-another-list "People Whose List of Favorite Companies Is Not a Subset of Another List")
-
-[Next >](../active-users "Active Users")
-
-## [1453. Maximum Number of Darts Inside of a Circular Dartboard (Hard)](https://leetcode.com/problems/maximum-number-of-darts-inside-of-a-circular-dartboard "圆形靶内的最大飞镖数量")
-
-
Alice is throwing n darts on a very large wall. You are given an array darts where darts[i] = [xi, yi] is the position of the ith dart that Alice threw on the wall.
-
-
Bob knows the positions of the n darts on the wall. He wants to place a dartboard of radius r on the wall so that the maximum number of darts that Alice throws lies on the dartboard.
-
-
Given the integer r, return the maximum number of darts that can lie on the dartboard.
-
-
-
Example 1:
-
-
-Input: darts = [[-2,0],[2,0],[0,2],[0,-2]], r = 2
-Output: 4
-Explanation: Circle dartboard with center in (0,0) and radius = 2 contain all points.
-
-
-
Example 2:
-
-
-Input: darts = [[-3,0],[3,0],[2,6],[5,4],[0,9],[7,8]], r = 5
-Output: 5
-Explanation: Circle dartboard with center in (0,4) and radius = 5 contain all points except the point (7,8).
-
-
-
-
Constraints:
-
-
-
1 <= darts.length <= 100
-
darts[i].length == 2
-
-104 <= xi, yi <= 104
-
1 <= r <= 5000
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Math](../../tag/math/README.md)]
- [[Geometry](../../tag/geometry/README.md)]
-
-### Hints
-
-Hint 1
-If there is an optimal solution, you can always move the circle so that two points lie on the boundary of the circle.
-
-
-
-Hint 2
-When the radius is fixed, you can find either 0 or 1 or 2 circles that pass two given points at the same time.
-
-
-
-Hint 3
-Loop for each pair of points and find the center of the circle, after that count the number of points inside the circle.
-
diff --git a/problems/maximum-number-of-eaten-apples/README.md b/problems/maximum-number-of-eaten-apples/README.md
deleted file mode 100644
index 4d83aebe7..000000000
--- a/problems/maximum-number-of-eaten-apples/README.md
+++ /dev/null
@@ -1,68 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../determine-if-string-halves-are-alike "Determine if String Halves Are Alike")
-
-[Next >](../where-will-the-ball-fall "Where Will the Ball Fall")
-
-## [1705. Maximum Number of Eaten Apples (Medium)](https://leetcode.com/problems/maximum-number-of-eaten-apples "吃苹果的最大数目")
-
-
There is a special kind of apple tree that grows apples every day for n days. On the ith day, the tree grows apples[i] apples that will rot after days[i] days, that is on day i + days[i] the apples will be rotten and cannot be eaten. On some days, the apple tree does not grow any apples, which are denoted by apples[i] == 0 and days[i] == 0.
-
-
You decided to eat at most one apple a day (to keep the doctors away). Note that you can keep eating after the first n days.
-
-
Given two integer arrays days and apples of length n, return the maximum number of apples you can eat.
-
-
-
Example 1:
-
-
-Input: apples = [1,2,3,5,2], days = [3,2,1,4,2]
-Output: 7
-Explanation: You can eat 7 apples:
-- On the first day, you eat an apple that grew on the first day.
-- On the second day, you eat an apple that grew on the second day.
-- On the third day, you eat an apple that grew on the second day. After this day, the apples that grew on the third day rot.
-- On the fourth to the seventh days, you eat apples that grew on the fourth day.
-
-
-
Example 2:
-
-
-Input: apples = [3,0,0,0,0,2], days = [3,0,0,0,0,2]
-Output: 5
-Explanation: You can eat 5 apples:
-- On the first to the third day you eat apples that grew on the first day.
-- Do nothing on the fouth and fifth days.
-- On the sixth and seventh days you eat apples that grew on the sixth day.
-
-
-
-
Constraints:
-
-
-
n == apples.length == days.length
-
1 <= n <= 2 * 104
-
0 <= apples[i], days[i] <= 2 * 104
-
days[i] = 0 if and only if apples[i] = 0.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Greedy](../../tag/greedy/README.md)]
- [[Heap (Priority Queue)](../../tag/heap-priority-queue/README.md)]
-
-### Hints
-
-Hint 1
-It's optimal to finish the apples that will rot first before those that will rot last
-
-
-
-Hint 2
-You need a structure to keep the apples sorted by their finish time
-
diff --git a/problems/maximum-number-of-events-that-can-be-attended-ii/README.md b/problems/maximum-number-of-events-that-can-be-attended-ii/README.md
deleted file mode 100644
index dc8c37595..000000000
--- a/problems/maximum-number-of-events-that-can-be-attended-ii/README.md
+++ /dev/null
@@ -1,73 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-length-of-string-after-deleting-similar-ends "Minimum Length of String After Deleting Similar Ends")
-
-[Next >](../check-if-array-is-sorted-and-rotated "Check if Array Is Sorted and Rotated")
-
-## [1751. Maximum Number of Events That Can Be Attended II (Hard)](https://leetcode.com/problems/maximum-number-of-events-that-can-be-attended-ii "最多可以参加的会议数目 II")
-
-
You are given an array of events where events[i] = [startDayi, endDayi, valuei]. The ith event starts at startDayiand ends at endDayi, and if you attend this event, you will receive a value of valuei. You are also given an integer k which represents the maximum number of events you can attend.
-
-
You can only attend one event at a time. If you choose to attend an event, you must attend the entire event. Note that the end day is inclusive: that is, you cannot attend two events where one of them starts and the other ends on the same day.
-
-
Return the maximum sum of values that you can receive by attending events.
-
-
-
Example 1:
-
-
-
-
-Input: events = [[1,2,4],[3,4,3],[2,3,1]], k = 2
-Output: 7
-Explanation: Choose the green events, 0 and 1 (0-indexed) for a total value of 4 + 3 = 7.
-
-
Example 2:
-
-
-
-
-Input: events = [[1,2,4],[3,4,3],[2,3,10]], k = 2
-Output: 10
-Explanation: Choose event 2 for a total value of 10.
-Notice that you cannot attend any other event as they overlap, and that you do not have to attend k events.
-
-
Example 3:
-
-
-
-
-Input: events = [[1,1,1],[2,2,2],[3,3,3],[4,4,4]], k = 3
-Output: 9
-Explanation: Although the events do not overlap, you can only attend 3 events. Pick the highest valued three.
-
-
-
Constraints:
-
-
-
1 <= k <= events.length
-
1 <= k * events.length <= 106
-
1 <= startDayi <= endDayi <= 109
-
1 <= valuei <= 106
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Hints
-
-Hint 1
-Sort the events by its startTime.
-
-
-
-Hint 2
-For every event, you can either choose it and consider the next event available, or you can ignore it. You can efficiently find the next event that is available using binary search.
-
diff --git a/problems/maximum-number-of-events-that-can-be-attended/README.md b/problems/maximum-number-of-events-that-can-be-attended/README.md
deleted file mode 100644
index 1db35bebc..000000000
--- a/problems/maximum-number-of-events-that-can-be-attended/README.md
+++ /dev/null
@@ -1,63 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../product-of-the-last-k-numbers "Product of the Last K Numbers")
-
-[Next >](../construct-target-array-with-multiple-sums "Construct Target Array With Multiple Sums")
-
-## [1353. Maximum Number of Events That Can Be Attended (Medium)](https://leetcode.com/problems/maximum-number-of-events-that-can-be-attended "最多可以参加的会议数目")
-
-
You are given an array of events where events[i] = [startDayi, endDayi]. Every event i starts at startDayiand ends at endDayi.
-
-
You can attend an event i at any day d where startTimei <= d <= endTimei. You can only attend one event at any time d.
-
-
Return the maximum number of events you can attend.
-
-
-
Example 1:
-
-
-Input: events = [[1,2],[2,3],[3,4]]
-Output: 3
-Explanation: You can attend all the three events.
-One way to attend them all is as shown.
-Attend the first event on day 1.
-Attend the second event on day 2.
-Attend the third event on day 3.
-
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Heap (Priority Queue)](../../tag/heap-priority-queue/README.md)]
-
-### Hints
-
-Hint 1
-Sort the events by the start time and in case of tie by the end time in ascending order.
-
-
-
-Hint 2
-Loop over the sorted events. Attend as much as you can and keep the last day occupied. When you try to attend new event keep in mind the first day you can attend a new event in.
-
diff --git a/problems/maximum-number-of-groups-getting-fresh-donuts/README.md b/problems/maximum-number-of-groups-getting-fresh-donuts/README.md
deleted file mode 100644
index 415e129b0..000000000
--- a/problems/maximum-number-of-groups-getting-fresh-donuts/README.md
+++ /dev/null
@@ -1,71 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../count-nice-pairs-in-an-array "Count Nice Pairs in an Array")
-
-[Next >](../truncate-sentence "Truncate Sentence")
-
-## [1815. Maximum Number of Groups Getting Fresh Donuts (Hard)](https://leetcode.com/problems/maximum-number-of-groups-getting-fresh-donuts "得到新鲜甜甜圈的最多组数")
-
-
There is a donuts shop that bakes donuts in batches of batchSize. They have a rule where they must serve all of the donuts of a batch before serving any donuts of the next batch. You are given an integer batchSize and an integer array groups, where groups[i] denotes that there is a group of groups[i] customers that will visit the shop. Each customer will get exactly one donut.
-
-
When a group visits the shop, all customers of the group must be served before serving any of the following groups. A group will be happy if they all get fresh donuts. That is, the first customer of the group does not receive a donut that was left over from the previous group.
-
-
You can freely rearrange the ordering of the groups. Return the maximum possible number of happy groups after rearranging the groups.
-
-
-
Example 1:
-
-
-Input: batchSize = 3, groups = [1,2,3,4,5,6]
-Output: 4
-Explanation: You can arrange the groups as [6,2,4,5,1,3]. Then the 1st, 2nd, 4th, and 6th groups will be happy.
-
-
-
Example 2:
-
-
-Input: batchSize = 4, groups = [1,3,2,5,2,2,1,6]
-Output: 4
-
-
-
-
Constraints:
-
-
-
1 <= batchSize <= 9
-
1 <= groups.length <= 30
-
1 <= groups[i] <= 109
-
-
-### Related Topics
- [[Bit Manipulation](../../tag/bit-manipulation/README.md)]
- [[Memoization](../../tag/memoization/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Bitmask](../../tag/bitmask/README.md)]
-
-### Hints
-
-Hint 1
-The maximum number of happy groups is the maximum number of partitions you can split the groups into such that the sum of group sizes in each partition is 0 mod batchSize. At most one partition is allowed to have a different remainder (the first group will get fresh donuts anyway).
-
-
-
-Hint 2
-Suppose you have an array freq of length k where freq[i] = number of groups of size i mod batchSize. How can you utilize this in a dp solution?
-
-
-
-Hint 3
-Make a DP state dp[freq][r] that represents "the maximum number of partitions you can form given the current freq and current remainder r". You can hash the freq array to store it more easily in the dp table.
-
-
-
-Hint 4
-For each i from 0 to batchSize-1, the next DP state is dp[freq`][(r+i)%batchSize] where freq` is freq but with freq[i] decremented by 1. Take the largest of all of the next states and store it in ans. If r == 0, then return ans+1 (because you can form a new partition), otherwise return ans (continuing the current partition).
-
diff --git a/problems/maximum-number-of-non-overlapping-subarrays-with-sum-equals-target/README.md b/problems/maximum-number-of-non-overlapping-subarrays-with-sum-equals-target/README.md
deleted file mode 100644
index e7e645d7d..000000000
--- a/problems/maximum-number-of-non-overlapping-subarrays-with-sum-equals-target/README.md
+++ /dev/null
@@ -1,58 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../find-kth-bit-in-nth-binary-string "Find Kth Bit in Nth Binary String")
-
-[Next >](../minimum-cost-to-cut-a-stick "Minimum Cost to Cut a Stick")
-
-## [1546. Maximum Number of Non-Overlapping Subarrays With Sum Equals Target (Medium)](https://leetcode.com/problems/maximum-number-of-non-overlapping-subarrays-with-sum-equals-target "和为目标值且不重叠的非空子数组的最大数目")
-
-
Given an array nums and an integer target, return the maximum number of non-emptynon-overlapping subarrays such that the sum of values in each subarray is equal totarget.
-
-
-
Example 1:
-
-
-Input: nums = [1,1,1,1,1], target = 2
-Output: 2
-Explanation: There are 2 non-overlapping subarrays [1,1,1,1,1] with sum equals to target(2).
-
-
-
Example 2:
-
-
-Input: nums = [-1,3,5,1,4,2,-9], target = 6
-Output: 2
-Explanation: There are 3 subarrays with sum equal to 6.
-([5,1], [4,2], [3,5,1,4,2,-9]) but only the first 2 are non-overlapping.
-
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 105
-
-104 <= nums[i] <= 104
-
0 <= target <= 106
-
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Prefix Sum](../../tag/prefix-sum/README.md)]
-
-### Hints
-
-Hint 1
-Keep track of prefix sums to quickly look up what subarray that sums "target" can be formed at each step of scanning the input array.
-
-
-
-Hint 2
-It can be proved that greedily forming valid subarrays as soon as one is found is optimal.
-
diff --git a/problems/maximum-number-of-non-overlapping-substrings/README.md b/problems/maximum-number-of-non-overlapping-substrings/README.md
deleted file mode 100644
index 2fb424741..000000000
--- a/problems/maximum-number-of-non-overlapping-substrings/README.md
+++ /dev/null
@@ -1,82 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../number-of-nodes-in-the-sub-tree-with-the-same-label "Number of Nodes in the Sub-Tree With the Same Label")
-
-[Next >](../find-a-value-of-a-mysterious-function-closest-to-target "Find a Value of a Mysterious Function Closest to Target")
-
-## [1520. Maximum Number of Non-Overlapping Substrings (Hard)](https://leetcode.com/problems/maximum-number-of-non-overlapping-substrings "最多的不重叠子字符串")
-
-
Given a string s of lowercase letters, you need to find the maximum number of non-empty substrings of s that meet the following conditions:
-
-
-
The substrings do not overlap, that is for any two substrings s[i..j] and s[k..l], either j < k or i > l is true.
-
A substring that contains a certain character c must also contain all occurrences of c.
-
-
-
Find the maximum number of substrings that meet the above conditions. If there are multiple solutions with the same number of substrings, return the one with minimum total length. It can be shown that there exists a unique solution of minimum total length.
-
-
Notice that you can return the substrings in any order.
-
-
-
Example 1:
-
-
-Input: s = "adefaddaccc"
-Output: ["e","f","ccc"]
-Explanation: The following are all the possible substrings that meet the conditions:
-[
- "adefaddaccc"
- "adefadda",
- "ef",
- "e",
- "f",
- "ccc",
-]
-If we choose the first string, we cannot choose anything else and we'd get only 1. If we choose "adefadda", we are left with "ccc" which is the only one that doesn't overlap, thus obtaining 2 substrings. Notice also, that it's not optimal to choose "ef" since it can be split into two. Therefore, the optimal way is to choose ["e","f","ccc"] which gives us 3 substrings. No other solution of the same number of substrings exist.
-
-
-
Example 2:
-
-
-Input: s = "abbaccd"
-Output: ["d","bb","cc"]
-Explanation: Notice that while the set of substrings ["d","abba","cc"] also has length 3, it's considered incorrect since it has larger total length.
-
-
-
-
Constraints:
-
-
-
1 <= s.length <= 10^5
-
s contains only lowercase English letters.
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
- [[Greedy](../../tag/greedy/README.md)]
-
-### Hints
-
-Hint 1
-Notice that it's impossible for any two valid substrings to overlap unless one is inside another.
-
-
-
-Hint 2
-We can start by finding the starting and ending index for each character.
-
-
-
-Hint 3
-From these indices, we can form the substrings by expanding each character's range if necessary (if another character exists in the range with smaller/larger starting/ending index).
-
-
-
-Hint 4
-Sort the valid substrings by length and greedily take those with the smallest length, discarding the ones that overlap those we took.
-
diff --git a/problems/maximum-number-of-occurrences-of-a-substring/README.md b/problems/maximum-number-of-occurrences-of-a-substring/README.md
deleted file mode 100644
index c8a0ba0fb..000000000
--- a/problems/maximum-number-of-occurrences-of-a-substring/README.md
+++ /dev/null
@@ -1,68 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../divide-array-in-sets-of-k-consecutive-numbers "Divide Array in Sets of K Consecutive Numbers")
-
-[Next >](../maximum-candies-you-can-get-from-boxes "Maximum Candies You Can Get from Boxes")
-
-## [1297. Maximum Number of Occurrences of a Substring (Medium)](https://leetcode.com/problems/maximum-number-of-occurrences-of-a-substring "子串的最大出现次数")
-
-
Given a string s, return the maximum number of ocurrences of any substring under the following rules:
-
-
-
The number of unique characters in the substring must be less than or equal to maxLetters.
-
The substring size must be between minSize and maxSize inclusive.
-
-
-
-
Example 1:
-
-
-Input: s = "aababcaab", maxLetters = 2, minSize = 3, maxSize = 4
-Output: 2
-Explanation: Substring "aab" has 2 ocurrences in the original string.
-It satisfies the conditions, 2 unique letters and size 3 (between minSize and maxSize).
-
-
-
Example 2:
-
-
-Input: s = "aaaa", maxLetters = 1, minSize = 3, maxSize = 3
-Output: 2
-Explanation: Substring "aaa" occur 2 times in the string. It can overlap.
-
-
-
-
Constraints:
-
-
-
1 <= s.length <= 105
-
1 <= maxLetters <= 26
-
1 <= minSize <= maxSize <= min(26, s.length)
-
s consists of only lowercase English letters.
-
-
-### Related Topics
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
- [[Sliding Window](../../tag/sliding-window/README.md)]
-
-### Hints
-
-Hint 1
-Check out the constraints, (maxSize <=26).
-
-
-
-Hint 2
-This means you can explore all substrings in O(n * 26).
-
-
-
-Hint 3
-Find the Maximum Number of Occurrences of a Substring with bruteforce.
-
diff --git a/problems/maximum-number-of-ones/README.md b/problems/maximum-number-of-ones/README.md
deleted file mode 100644
index dca5bed9c..000000000
--- a/problems/maximum-number-of-ones/README.md
+++ /dev/null
@@ -1,75 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../shortest-distance-to-target-color "Shortest Distance to Target Color")
-
-[Next >](../distance-between-bus-stops "Distance Between Bus Stops")
-
-## [1183. Maximum Number of Ones (Hard)](https://leetcode.com/problems/maximum-number-of-ones "矩阵中 1 的最大数量")
-
-
Consider a matrix M with dimensions width * height, such that every cell has value 0 or 1, and any square sub-matrix of M of size sideLength * sideLength has at most maxOnes ones.
-
-
Return the maximum possible number of ones that the matrix M can have.
-
-
-
Example 1:
-
-
-Input: width = 3, height = 3, sideLength = 2, maxOnes = 1
-Output: 4
-Explanation:
-In a 3*3 matrix, no 2*2 sub-matrix can have more than 1 one.
-The best solution that has 4 ones is:
-[1,0,1]
-[0,0,0]
-[1,0,1]
-
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[Heap (Priority Queue)](../../tag/heap-priority-queue/README.md)]
-
-### Hints
-
-Hint 1
-Think of a greedy mathematical solution.
-
-
-
-Hint 2
-Say you choose to set some cell (i, j) to 1, all cells (x, y) such that i % sideLength == x % sideLength and j % sideLength == y % sideLength can also be set to 1 without increasing the max number of ones in a sub-matrix.
-
-
-
-Hint 3
-In one move, choose to set all the cells with some modulus (i % sideLength, j % sideLength) to 1.
-
-
-
-Hint 4
-Choose the cells with max frequency.
-
diff --git a/problems/maximum-number-of-people-that-can-be-caught-in-tag/README.md b/problems/maximum-number-of-people-that-can-be-caught-in-tag/README.md
deleted file mode 100644
index bdce1b715..000000000
--- a/problems/maximum-number-of-people-that-can-be-caught-in-tag/README.md
+++ /dev/null
@@ -1,40 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../find-cutoff-score-for-each-school "Find Cutoff Score for Each School")
-
-[Next >](../count-the-number-of-experiments "Count the Number of Experiments")
-
-## [1989. Maximum Number of People That Can Be Caught in Tag (Medium)](https://leetcode.com/problems/maximum-number-of-people-that-can-be-caught-in-tag "")
-
-
-
-### Hints
-
-Hint 1
-Try to use as much of the range of a person who is "it" as possible.
-
-
-
-Hint 2
-Find the leftmost person who is "it" that has not caught anyone yet, and the leftmost person who is not "it" that has not been caught yet.
-
-
-
-Hint 3
-If the person who is not "it" can be caught, pair them together and repeat the process.
-
-
-
-Hint 4
-If the person who is not "it" cannot be caught, and the person who is not "it" is on the left of the person who is "it", find the next leftmost person who is not "it".
-
-
-
-Hint 5
-If the person who is not "it" cannot be caught, and the person who is "it" is on the left of the person who is not "it", find the next leftmost person who is "it".
-
diff --git a/problems/maximum-number-of-points-with-cost/README.md b/problems/maximum-number-of-points-with-cost/README.md
deleted file mode 100644
index 971d5b4e4..000000000
--- a/problems/maximum-number-of-points-with-cost/README.md
+++ /dev/null
@@ -1,74 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../add-minimum-number-of-rungs "Add Minimum Number of Rungs")
-
-[Next >](../maximum-genetic-difference-query "Maximum Genetic Difference Query")
-
-## [1937. Maximum Number of Points with Cost (Medium)](https://leetcode.com/problems/maximum-number-of-points-with-cost "扣分后的最大得分")
-
-
You are given an m x n integer matrix points (0-indexed). Starting with 0 points, you want to maximize the number of points you can get from the matrix.
-
-
To gain points, you must pick one cell in each row. Picking the cell at coordinates (r, c) will addpoints[r][c] to your score.
-
-
However, you will lose points if you pick a cell too far from the cell that you picked in the previous row. For every two adjacent rows r and r + 1 (where 0 <= r < m - 1), picking cells at coordinates (r, c1) and (r + 1, c2) will subtractabs(c1 - c2) from your score.
-
-
Return the maximum number of points you can achieve.
-
-
abs(x) is defined as:
-
-
-
x for x >= 0.
-
-x for x < 0.
-
-
-
-
Example 1:
-
-
-Input: points = [[1,2,3],[1,5,1],[3,1,1]]
-Output: 9
-Explanation:
-The blue cells denote the optimal cells to pick, which have coordinates (0, 2), (1, 1), and (2, 0).
-You add 3 + 5 + 3 = 11 to your score.
-However, you must subtract abs(2 - 1) + abs(1 - 0) = 2 from your score.
-Your final score is 11 - 2 = 9.
-
-
-
Example 2:
-
-
-Input: points = [[1,5],[2,3],[4,2]]
-Output: 11
-Explanation:
-The blue cells denote the optimal cells to pick, which have coordinates (0, 1), (1, 1), and (2, 0).
-You add 5 + 3 + 4 = 12 to your score.
-However, you must subtract abs(1 - 1) + abs(1 - 0) = 1 from your score.
-Your final score is 12 - 1 = 11.
-
-
-
-
Constraints:
-
-
-
m == points.length
-
n == points[r].length
-
1 <= m, n <= 105
-
1 <= m * n <= 105
-
0 <= points[r][c] <= 105
-
-
-### Hints
-
-Hint 1
-Try using dynamic programming.
-
-
-
-Hint 2
-dp[i][j] is the maximum number of points you can have if points[i][j] is the most recent cell you picked.
-
diff --git a/problems/maximum-number-of-removable-characters/README.md b/problems/maximum-number-of-removable-characters/README.md
deleted file mode 100644
index 6dc55f65c..000000000
--- a/problems/maximum-number-of-removable-characters/README.md
+++ /dev/null
@@ -1,77 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../redistribute-characters-to-make-all-strings-equal "Redistribute Characters to Make All Strings Equal")
-
-[Next >](../merge-triplets-to-form-target-triplet "Merge Triplets to Form Target Triplet")
-
-## [1898. Maximum Number of Removable Characters (Medium)](https://leetcode.com/problems/maximum-number-of-removable-characters "可移除字符的最大数目")
-
-
You are given two strings s and p where p is a subsequence of s. You are also given a distinct 0-indexed integer array removable containing a subset of indices of s (s is also 0-indexed).
-
-
You want to choose an integer k (0 <= k <= removable.length) such that, after removing k characters from s using the firstk indices in removable, p is still a subsequence of s. More formally, you will mark the character at s[removable[i]] for each 0 <= i < k, then remove all marked characters and check if p is still a subsequence.
-
-
Return the maximumk you can choose such that p is still a subsequence of s after the removals.
-
-
A subsequence of a string is a new string generated from the original string with some characters (can be none) deleted without changing the relative order of the remaining characters.
-
-
-
Example 1:
-
-
-Input: s = "abcacb", p = "ab", removable = [3,1,0]
-Output: 2
-Explanation: After removing the characters at indices 3 and 1, "abcacb" becomes "accb".
-"ab" is a subsequence of "accb".
-If we remove the characters at indices 3, 1, and 0, "abcacb" becomes "ccb", and "ab" is no longer a subsequence.
-Hence, the maximum k is 2.
-
-
-
Example 2:
-
-
-Input: s = "abcbddddd", p = "abcd", removable = [3,2,1,4,5,6]
-Output: 1
-Explanation: After removing the character at index 3, "abcbddddd" becomes "abcddddd".
-"abcd" is a subsequence of "abcddddd".
-
-
-
Example 3:
-
-
-Input: s = "abcab", p = "abc", removable = [0,1,2,3,4]
-Output: 0
-Explanation: If you remove the first index in the array removable, "abc" is no longer a subsequence.
-
-
-
-
Constraints:
-
-
-
1 <= p.length <= s.length <= 105
-
0 <= removable.length < s.length
-
0 <= removable[i] < s.length
-
p is a subsequence of s.
-
s and p both consist of lowercase English letters.
-
The elements in removable are distinct.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[String](../../tag/string/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
-
-### Hints
-
-Hint 1
-First, we need to think about solving an easier problem, If we remove a set of indices from the string does P exist in S as a subsequence
-
-
-
-Hint 2
-We can binary search the K and check by solving the above problem.
-
diff --git a/problems/maximum-number-of-tasks-you-can-assign/README.md b/problems/maximum-number-of-tasks-you-can-assign/README.md
deleted file mode 100644
index 03bd179c2..000000000
--- a/problems/maximum-number-of-tasks-you-can-assign/README.md
+++ /dev/null
@@ -1,86 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../most-beautiful-item-for-each-query "Most Beautiful Item for Each Query")
-
-[Next >](../the-winner-university "The Winner University")
-
-## [2071. Maximum Number of Tasks You Can Assign (Hard)](https://leetcode.com/problems/maximum-number-of-tasks-you-can-assign "你可以安排的最多任务数目")
-
-
You have n tasks and m workers. Each task has a strength requirement stored in a 0-indexed integer array tasks, with the ith task requiring tasks[i] strength to complete. The strength of each worker is stored in a 0-indexed integer array workers, with the jth worker having workers[j] strength. Each worker can only be assigned to a single task and must have a strength greater than or equal to the task's strength requirement (i.e., workers[j] >= tasks[i]).
-
-
Additionally, you have pills magical pills that will increase a worker's strength by strength. You can decide which workers receive the magical pills, however, you may only give each worker at most one magical pill.
-
-
Given the 0-indexed integer arrays tasks and workers and the integers pills and strength, return the maximum number of tasks that can be completed.
-
-
-
Example 1:
-
-
-Input: tasks = [3,2,1], workers = [0,3,3], pills = 1, strength = 1
-Output: 3
-Explanation:
-We can assign the magical pill and tasks as follows:
-- Give the magical pill to worker 0.
-- Assign worker 0 to task 2 (0 + 1 >= 1)
-- Assign worker 1 to task 1 (3 >= 2)
-- Assign worker 2 to task 0 (3 >= 3)
-
-
-
Example 2:
-
-
-Input: tasks = [5,4], workers = [0,0,0], pills = 1, strength = 5
-Output: 1
-Explanation:
-We can assign the magical pill and tasks as follows:
-- Give the magical pill to worker 0.
-- Assign worker 0 to task 0 (0 + 5 >= 5)
-
-
-
Example 3:
-
-
-Input: tasks = [10,15,30], workers = [0,10,10,10,10], pills = 3, strength = 10
-Output: 2
-Explanation:
-We can assign the magical pills and tasks as follows:
-- Give the magical pill to worker 0 and worker 1.
-- Assign worker 0 to task 0 (0 + 10 >= 10)
-- Assign worker 1 to task 1 (10 + 10 >= 15)
-The last pill is not given because it will not make any worker strong enough for the last task.
-
-
-
-
Constraints:
-
-
-
n == tasks.length
-
m == workers.length
-
1 <= n, m <= 5 * 104
-
0 <= pills <= m
-
0 <= tasks[i], workers[j], strength <= 109
-
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[Queue](../../tag/queue/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
- [[Monotonic Queue](../../tag/monotonic-queue/README.md)]
-
-### Hints
-
-Hint 1
-Is it possible to assign the first k smallest tasks to the workers?
-
-
-
-Hint 2
-How can you efficiently try every k?
-
diff --git a/problems/maximum-number-of-visible-points/README.md b/problems/maximum-number-of-visible-points/README.md
deleted file mode 100644
index f9401d886..000000000
--- a/problems/maximum-number-of-visible-points/README.md
+++ /dev/null
@@ -1,85 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../even-odd-tree "Even Odd Tree")
-
-[Next >](../minimum-one-bit-operations-to-make-integers-zero "Minimum One Bit Operations to Make Integers Zero")
-
-## [1610. Maximum Number of Visible Points (Hard)](https://leetcode.com/problems/maximum-number-of-visible-points "可见点的最大数目")
-
-
You are given an array points, an integer angle, and your location, where location = [posx, posy] and points[i] = [xi, yi] both denote integral coordinates on the X-Y plane.
-
-
Initially, you are facing directly east from your position. You cannot move from your position, but you can rotate. In other words, posx and posy cannot be changed. Your field of view in degrees is represented by angle, determining how wide you can see from any given view direction. Let d be the amount in degrees that you rotate counterclockwise. Then, your field of view is the inclusive range of angles [d - angle/2, d + angle/2].
-
-
-
-
-
-
You can see some set of points if, for each point, the angle formed by the point, your position, and the immediate east direction from your position is in your field of view.
-
-
There can be multiple points at one coordinate. There may be points at your location, and you can always see these points regardless of your rotation. Points do not obstruct your vision to other points.
-
-
Return the maximum number of points you can see.
-
-
-
Example 1:
-
-
-Input: points = [[2,1],[2,2],[3,3]], angle = 90, location = [1,1]
-Output: 3
-Explanation: The shaded region represents your field of view. All points can be made visible in your field of view, including [3,3] even though [2,2] is in front and in the same line of sight.
-
-
-
Example 2:
-
-
-Input: points = [[2,1],[2,2],[3,4],[1,1]], angle = 90, location = [1,1]
-Output: 4
-Explanation: All points can be made visible in your field of view, including the one at your location.
-
-
-
Example 3:
-
-
-Input: points = [[1,0],[2,1]], angle = 13, location = [1,1]
-Output: 1
-Explanation: You can only see one of the two points, as shown above.
-
-
-
-
Constraints:
-
-
-
1 <= points.length <= 105
-
points[i].length == 2
-
location.length == 2
-
0 <= angle < 360
-
0 <= posx, posy, xi, yi <= 100
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Math](../../tag/math/README.md)]
- [[Geometry](../../tag/geometry/README.md)]
- [[Sliding Window](../../tag/sliding-window/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Hints
-
-Hint 1
-Sort the points by polar angle with the original position. Now only a consecutive collection of points would be visible from any coordinate.
-
-
-
-Hint 2
-We can use two pointers to keep track of visible points for each start point
-
-
-
-Hint 3
-For handling the cyclic condition, it’d be helpful to append the point list to itself after sorting.
-
diff --git a/problems/maximum-number-of-vowels-in-a-substring-of-given-length/README.md b/problems/maximum-number-of-vowels-in-a-substring-of-given-length/README.md
deleted file mode 100644
index 0222974a8..000000000
--- a/problems/maximum-number-of-vowels-in-a-substring-of-given-length/README.md
+++ /dev/null
@@ -1,65 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../check-if-a-word-occurs-as-a-prefix-of-any-word-in-a-sentence "Check If a Word Occurs As a Prefix of Any Word in a Sentence")
-
-[Next >](../pseudo-palindromic-paths-in-a-binary-tree "Pseudo-Palindromic Paths in a Binary Tree")
-
-## [1456. Maximum Number of Vowels in a Substring of Given Length (Medium)](https://leetcode.com/problems/maximum-number-of-vowels-in-a-substring-of-given-length "定长子串中元音的最大数目")
-
-
Given a string s and an integer k, return the maximum number of vowel letters in any substring of s with length k.
-
-
Vowel letters in English are 'a', 'e', 'i', 'o', and 'u'.
-
-
-
Example 1:
-
-
-Input: s = "abciiidef", k = 3
-Output: 3
-Explanation: The substring "iii" contains 3 vowel letters.
-
-
-
Example 2:
-
-
-Input: s = "aeiou", k = 2
-Output: 2
-Explanation: Any substring of length 2 contains 2 vowels.
-
-
-
Example 3:
-
-
-Input: s = "leetcode", k = 3
-Output: 2
-Explanation: "lee", "eet" and "ode" contain 2 vowels.
-
-
-
-
Constraints:
-
-
-
1 <= s.length <= 105
-
s consists of lowercase English letters.
-
1 <= k <= s.length
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
- [[Sliding Window](../../tag/sliding-window/README.md)]
-
-### Hints
-
-Hint 1
-Keep a window of size k and maintain the number of vowels in it.
-
-
-
-Hint 2
-Keep moving the window and update the number of vowels while moving. Answer is max number of vowels of any window.
-
diff --git a/problems/maximum-number-of-ways-to-partition-an-array/README.md b/problems/maximum-number-of-ways-to-partition-an-array/README.md
deleted file mode 100644
index 9ab28a83d..000000000
--- a/problems/maximum-number-of-ways-to-partition-an-array/README.md
+++ /dev/null
@@ -1,86 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximize-the-confusion-of-an-exam "Maximize the Confusion of an Exam")
-
-[Next >](../low-quality-problems "Low-Quality Problems")
-
-## [2025. Maximum Number of Ways to Partition an Array (Hard)](https://leetcode.com/problems/maximum-number-of-ways-to-partition-an-array "分割数组的最多方案数")
-
-
You are given a 0-indexed integer array nums of length n. The number of ways to partitionnums is the number of pivot indices that satisfy both conditions:
You are also given an integer k. You can choose to change the value of one element of nums to k, or to leave the array unchanged.
-
-
Return the maximum possible number of ways to partitionnums to satisfy both conditions after changing at most one element.
-
-
-
Example 1:
-
-
-Input: nums = [2,-1,2], k = 3
-Output: 1
-Explanation: One optimal approach is to change nums[0] to k. The array becomes [3,-1,2].
-There is one way to partition the array:
-- For pivot = 2, we have the partition [3,-1 | 2]: 3 + -1 == 2.
-
-
-
Example 2:
-
-
-Input: nums = [0,0,0], k = 1
-Output: 2
-Explanation: The optimal approach is to leave the array unchanged.
-There are two ways to partition the array:
-- For pivot = 1, we have the partition [0 | 0,0]: 0 == 0 + 0.
-- For pivot = 2, we have the partition [0,0 | 0]: 0 + 0 == 0.
-
-
-
Example 3:
-
-
-Input: nums = [22,4,-25,-20,-15,15,-16,7,19,-10,0,-13,-14], k = -33
-Output: 4
-Explanation: One optimal approach is to change nums[2] to k. The array becomes [22,4,-33,-20,-15,15,-16,7,19,-10,0,-13,-14].
-There are four ways to partition the array.
-
-
-
-
Constraints:
-
-
-
n == nums.length
-
2 <= n <= 105
-
-105 <= k, nums[i] <= 105
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Counting](../../tag/counting/README.md)]
- [[Enumeration](../../tag/enumeration/README.md)]
- [[Prefix Sum](../../tag/prefix-sum/README.md)]
-
-### Hints
-
-Hint 1
-A pivot point splits the array into equal prefix and suffix. If no change is made to the array, the goal is to find the number of pivot p such that prefix[p-1] == suffix[p].
-
-
-
-Hint 2
-Consider how prefix and suffix will change when we change a number nums[i] to k.
-
-
-
-Hint 3
-When sweeping through each element, can you find the total number of pivots where the difference of prefix and suffix happens to equal to the changes of k-nums[i].
-
diff --git a/problems/maximum-number-of-weeks-for-which-you-can-work/README.md b/problems/maximum-number-of-weeks-for-which-you-can-work/README.md
deleted file mode 100644
index 406210336..000000000
--- a/problems/maximum-number-of-weeks-for-which-you-can-work/README.md
+++ /dev/null
@@ -1,86 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../three-divisors "Three Divisors")
-
-[Next >](../minimum-garden-perimeter-to-collect-enough-apples "Minimum Garden Perimeter to Collect Enough Apples")
-
-## [1953. Maximum Number of Weeks for Which You Can Work (Medium)](https://leetcode.com/problems/maximum-number-of-weeks-for-which-you-can-work "你可以工作的最大周数")
-
-
There are n projects numbered from 0 to n - 1. You are given an integer array milestones where each milestones[i] denotes the number of milestones the ith project has.
-
-
You can work on the projects following these two rules:
-
-
-
Every week, you will finish exactly one milestone of one project. You must work every week.
-
You cannot work on two milestones from the same project for two consecutive weeks.
-
-
-
Once all the milestones of all the projects are finished, or if the only milestones that you can work on will cause you to violate the above rules, you will stop working. Note that you may not be able to finish every project's milestones due to these constraints.
-
-
Return the maximum number of weeks you would be able to work on the projects without violating the rules mentioned above.
-
-
-
Example 1:
-
-
-Input: milestones = [1,2,3]
-Output: 6
-Explanation: One possible scenario is:
-- During the 1st week, you will work on a milestone of project 0.
-- During the 2nd week, you will work on a milestone of project 2.
-- During the 3rd week, you will work on a milestone of project 1.
-- During the 4th week, you will work on a milestone of project 2.
-- During the 5th week, you will work on a milestone of project 1.
-- During the 6th week, you will work on a milestone of project 2.
-The total number of weeks is 6.
-
-
-
Example 2:
-
-
-Input: milestones = [5,2,1]
-Output: 7
-Explanation: One possible scenario is:
-- During the 1st week, you will work on a milestone of project 0.
-- During the 2nd week, you will work on a milestone of project 1.
-- During the 3rd week, you will work on a milestone of project 0.
-- During the 4th week, you will work on a milestone of project 1.
-- During the 5th week, you will work on a milestone of project 0.
-- During the 6th week, you will work on a milestone of project 2.
-- During the 7th week, you will work on a milestone of project 0.
-The total number of weeks is 7.
-Note that you cannot work on the last milestone of project 0 on 8th week because it would violate the rules.
-Thus, one milestone in project 0 will remain unfinished.
-
-
-
-
Constraints:
-
-
-
n == milestones.length
-
1 <= n <= 105
-
1 <= milestones[i] <= 109
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Greedy](../../tag/greedy/README.md)]
-
-### Similar Questions
- 1. [Task Scheduler](../task-scheduler) (Medium)
-
-### Hints
-
-Hint 1
-Work on the project with the largest number of milestones as long as it is possible.
-
-
-
-Hint 2
-Does the project with the largest number of milestones affect the number of weeks?
-
diff --git a/problems/maximum-number-of-words-found-in-sentences/README.md b/problems/maximum-number-of-words-found-in-sentences/README.md
deleted file mode 100644
index 38e5c6b31..000000000
--- a/problems/maximum-number-of-words-found-in-sentences/README.md
+++ /dev/null
@@ -1,61 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../elements-in-array-after-removing-and-replacing-elements "Elements in Array After Removing and Replacing Elements")
-
-[Next >](../find-all-possible-recipes-from-given-supplies "Find All Possible Recipes from Given Supplies")
-
-## [2114. Maximum Number of Words Found in Sentences (Easy)](https://leetcode.com/problems/maximum-number-of-words-found-in-sentences "句子中的最多单词数")
-
-
A sentence is a list of words that are separated by a single space with no leading or trailing spaces.
-
-
You are given an array of strings sentences, where each sentences[i] represents a single sentence.
-
-
Return the maximum number of words that appear in a single sentence.
-
-
-
Example 1:
-
-
-Input: sentences = ["alice and bob love leetcode", "i think so too", "this is great thanks very much"]
-Output: 6
-Explanation:
-- The first sentence, "alice and bob love leetcode", has 5 words in total.
-- The second sentence, "i think so too", has 4 words in total.
-- The third sentence, "this is great thanks very much", has 6 words in total.
-Thus, the maximum number of words in a single sentence comes from the third sentence, which has 6 words.
-
-
-
Example 2:
-
-
-Input: sentences = ["please wait", "continue to fight", "continue to win"]
-Output: 3
-Explanation: It is possible that multiple sentences contain the same number of words.
-In this example, the second and third sentences (underlined) have the same number of words.
-
-
-
-
Constraints:
-
-
-
1 <= sentences.length <= 100
-
1 <= sentences[i].length <= 100
-
sentences[i] consists only of lowercase English letters and ' ' only.
-
sentences[i] does not have leading or trailing spaces.
-
All the words in sentences[i] are separated by a single space.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Hints
-
-Hint 1
-Process each sentence separately and count the number of words by looking for the number of space characters in the sentence and adding it by 1.
-
diff --git a/problems/maximum-number-of-words-you-can-type/README.md b/problems/maximum-number-of-words-you-can-type/README.md
deleted file mode 100644
index 2426e2dd3..000000000
--- a/problems/maximum-number-of-words-you-can-type/README.md
+++ /dev/null
@@ -1,67 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../confirmation-rate "Confirmation Rate")
-
-[Next >](../add-minimum-number-of-rungs "Add Minimum Number of Rungs")
-
-## [1935. Maximum Number of Words You Can Type (Easy)](https://leetcode.com/problems/maximum-number-of-words-you-can-type "可以输入的最大单词数")
-
-
There is a malfunctioning keyboard where some letter keys do not work. All other keys on the keyboard work properly.
-
-
Given a string text of words separated by a single space (no leading or trailing spaces) and a string brokenLetters of all distinct letter keys that are broken, return the number of words intextyou can fully type using this keyboard.
-
-
-
Example 1:
-
-
-Input: text = "hello world", brokenLetters = "ad"
-Output: 1
-Explanation: We cannot type "world" because the 'd' key is broken.
-
-
-
Example 2:
-
-
-Input: text = "leet code", brokenLetters = "lt"
-Output: 1
-Explanation: We cannot type "leet" because the 'l' and 't' keys are broken.
-
-
-
Example 3:
-
-
-Input: text = "leet code", brokenLetters = "e"
-Output: 0
-Explanation: We cannot type either word because the 'e' key is broken.
-
-
-
-
Constraints:
-
-
-
1 <= text.length <= 104
-
0 <= brokenLetters.length <= 26
-
text consists of words separated by a single space without any leading or trailing spaces.
-
Each word only consists of lowercase English letters.
-
brokenLetters consists of distinct lowercase English letters.
-
-
-### Related Topics
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Hints
-
-Hint 1
-Check each word separately if it can be typed.
-
-
-
-Hint 2
-A word can be typed if all its letters are not broken.
-
diff --git a/problems/maximum-of-absolute-value-expression/README.md b/problems/maximum-of-absolute-value-expression/README.md
deleted file mode 100644
index 1ab54a71d..000000000
--- a/problems/maximum-of-absolute-value-expression/README.md
+++ /dev/null
@@ -1,51 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-cost-tree-from-leaf-values "Minimum Cost Tree From Leaf Values")
-
-[Next >](../reported-posts-ii "Reported Posts II")
-
-## [1131. Maximum of Absolute Value Expression (Medium)](https://leetcode.com/problems/maximum-of-absolute-value-expression "绝对值表达式的最大值")
-
-
Given two arrays of integers with equal lengths, return the maximum value of:
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Math](../../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-of-minimum-values-in-all-subarrays/README.md b/problems/maximum-of-minimum-values-in-all-subarrays/README.md
deleted file mode 100644
index 2bad1050a..000000000
--- a/problems/maximum-of-minimum-values-in-all-subarrays/README.md
+++ /dev/null
@@ -1,35 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../strong-friendship "Strong Friendship")
-
-[Next >](../all-the-pairs-with-the-maximum-number-of-common-followers "All the Pairs With the Maximum Number of Common Followers")
-
-## [1950. Maximum of Minimum Values in All Subarrays (Medium)](https://leetcode.com/problems/maximum-of-minimum-values-in-all-subarrays "所有子数组最小值中的最大值")
-
-
-
-### Related Topics
- [[Stack](../../tag/stack/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Monotonic Stack](../../tag/monotonic-stack/README.md)]
-
-### Hints
-
-Hint 1
-Imagine the array is empty, and each element is coming to its index one by one, starting with the smallest element.
-
-
-
-Hint 2
-For each coming element nums[i], calculate L and R, the indices of the first smallest elements on the left and the right respectively.
-
-
-
-Hint 3
-The answer of the queries from 1 to R-L+1 will be at least this element.
-
diff --git a/problems/maximum-path-quality-of-a-graph/README.md b/problems/maximum-path-quality-of-a-graph/README.md
deleted file mode 100644
index 9e6c3bbfd..000000000
--- a/problems/maximum-path-quality-of-a-graph/README.md
+++ /dev/null
@@ -1,83 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimized-maximum-of-products-distributed-to-any-store "Minimized Maximum of Products Distributed to Any Store")
-
-[Next >](../account-balance "Account Balance")
-
-## [2065. Maximum Path Quality of a Graph (Hard)](https://leetcode.com/problems/maximum-path-quality-of-a-graph "最大化一张图中的路径价值")
-
-
There is an undirected graph with n nodes numbered from 0 to n - 1 (inclusive). You are given a 0-indexed integer array values where values[i] is the value of the ith node. You are also given a 0-indexed 2D integer array edges, where each edges[j] = [uj, vj, timej] indicates that there is an undirected edge between the nodes uj and vj,and it takes timej seconds to travel between the two nodes. Finally, you are given an integer maxTime.
-
-
A validpath in the graph is any path that starts at node 0, ends at node 0, and takes at mostmaxTime seconds to complete. You may visit the same node multiple times. The quality of a valid path is the sum of the values of the unique nodes visited in the path (each node's value is added at most once to the sum).
-
-
Return the maximum quality of a valid path.
-
-
Note: There are at most four edges connected to each node.
-
-
-
Example 1:
-
-
-Input: values = [0,32,10,43], edges = [[0,1,10],[1,2,15],[0,3,10]], maxTime = 49
-Output: 75
-Explanation:
-One possible path is 0 -> 1 -> 0 -> 3 -> 0. The total time taken is 10 + 10 + 10 + 10 = 40 <= 49.
-The nodes visited are 0, 1, and 3, giving a maximal path quality of 0 + 32 + 43 = 75.
-
-
-
Example 2:
-
-
-Input: values = [5,10,15,20], edges = [[0,1,10],[1,2,10],[0,3,10]], maxTime = 30
-Output: 25
-Explanation:
-One possible path is 0 -> 3 -> 0. The total time taken is 10 + 10 = 20 <= 30.
-The nodes visited are 0 and 3, giving a maximal path quality of 5 + 20 = 25.
-
-
-
Example 3:
-
-
-Input: values = [1,2,3,4], edges = [[0,1,10],[1,2,11],[2,3,12],[1,3,13]], maxTime = 50
-Output: 7
-Explanation:
-One possible path is 0 -> 1 -> 3 -> 1 -> 0. The total time taken is 10 + 13 + 13 + 10 = 46 <= 50.
-The nodes visited are 0, 1, and 3, giving a maximal path quality of 1 + 2 + 4 = 7.
-
-
-
-
Constraints:
-
-
-
n == values.length
-
1 <= n <= 1000
-
0 <= values[i] <= 108
-
0 <= edges.length <= 2000
-
edges[j].length == 3
-
0 <= uj < vj <= n - 1
-
10 <= timej, maxTime <= 100
-
All the pairs [uj, vj] are unique.
-
There are at most four edges connected to each node.
-
The graph may not be connected.
-
-
-### Related Topics
- [[Graph](../../tag/graph/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Backtracking](../../tag/backtracking/README.md)]
-
-### Hints
-
-Hint 1
-How many nodes can you visit within maxTime seconds?
-
-
-
-Hint 2
-Can you try every valid path?
-
diff --git a/problems/maximum-performance-of-a-team/README.md b/problems/maximum-performance-of-a-team/README.md
deleted file mode 100644
index 875210e17..000000000
--- a/problems/maximum-performance-of-a-team/README.md
+++ /dev/null
@@ -1,77 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../balance-a-binary-search-tree "Balance a Binary Search Tree")
-
-[Next >](../total-sales-amount-by-year "Total Sales Amount by Year")
-
-## [1383. Maximum Performance of a Team (Hard)](https://leetcode.com/problems/maximum-performance-of-a-team "最大的团队表现值")
-
-
You are given two integers n and k and two integer arrays speed and efficiency both of length n. There are n engineers numbered from 1 to n. speed[i] and efficiency[i] represent the speed and efficiency of the ith engineer respectively.
-
-
Choose at mostk different engineers out of the n engineers to form a team with the maximum performance.
-
-
The performance of a team is the sum of their engineers' speeds multiplied by the minimum efficiency among their engineers.
-
-
Return the maximum performance of this team. Since the answer can be a huge number, return it modulo109 + 7.
-
-
-
Example 1:
-
-
-Input: n = 6, speed = [2,10,3,1,5,8], efficiency = [5,4,3,9,7,2], k = 2
-Output: 60
-Explanation:
-We have the maximum performance of the team by selecting engineer 2 (with speed=10 and efficiency=4) and engineer 5 (with speed=5 and efficiency=7). That is, performance = (10 + 5) * min(4, 7) = 60.
-
-
-
Example 2:
-
-
-Input: n = 6, speed = [2,10,3,1,5,8], efficiency = [5,4,3,9,7,2], k = 3
-Output: 68
-Explanation:
-This is the same example as the first but k = 3. We can select engineer 1, engineer 2 and engineer 5 to get the maximum performance of the team. That is, performance = (2 + 10 + 5) * min(5, 4, 7) = 68.
-
-
-
Example 3:
-
-
-Input: n = 6, speed = [2,10,3,1,5,8], efficiency = [5,4,3,9,7,2], k = 4
-Output: 72
-
-
-
-
Constraints:
-
-
-
1 <= k <= n <= 105
-
speed.length == n
-
efficiency.length == n
-
1 <= speed[i] <= 105
-
1 <= efficiency[i] <= 108
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Greedy](../../tag/greedy/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
- [[Heap (Priority Queue)](../../tag/heap-priority-queue/README.md)]
-
-### Similar Questions
- 1. [Maximum Fruits Harvested After at Most K Steps](../maximum-fruits-harvested-after-at-most-k-steps) (Hard)
-
-### Hints
-
-Hint 1
-Keep track of the engineers by their efficiency in decreasing order.
-
-
-
-Hint 2
-Starting from one engineer, to build a team, it suffices to bring K-1 more engineers who have higher efficiencies as well as high speeds.
-
diff --git a/problems/maximum-points-you-can-obtain-from-cards/README.md b/problems/maximum-points-you-can-obtain-from-cards/README.md
deleted file mode 100644
index d01d36990..000000000
--- a/problems/maximum-points-you-can-obtain-from-cards/README.md
+++ /dev/null
@@ -1,74 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-score-after-splitting-a-string "Maximum Score After Splitting a String")
-
-[Next >](../diagonal-traverse-ii "Diagonal Traverse II")
-
-## [1423. Maximum Points You Can Obtain from Cards (Medium)](https://leetcode.com/problems/maximum-points-you-can-obtain-from-cards "可获得的最大点数")
-
-
There are several cards arranged in a row, and each card has an associated number of points. The points are given in the integer array cardPoints.
-
-
In one step, you can take one card from the beginning or from the end of the row. You have to take exactly k cards.
-
-
Your score is the sum of the points of the cards you have taken.
-
-
Given the integer array cardPoints and the integer k, return the maximum score you can obtain.
-
-
-
Example 1:
-
-
-Input: cardPoints = [1,2,3,4,5,6,1], k = 3
-Output: 12
-Explanation: After the first step, your score will always be 1. However, choosing the rightmost card first will maximize your total score. The optimal strategy is to take the three cards on the right, giving a final score of 1 + 6 + 5 = 12.
-
-
-
Example 2:
-
-
-Input: cardPoints = [2,2,2], k = 2
-Output: 4
-Explanation: Regardless of which two cards you take, your score will always be 4.
-
-
-
Example 3:
-
-
-Input: cardPoints = [9,7,7,9,7,7,9], k = 7
-Output: 55
-Explanation: You have to take all the cards. Your score is the sum of points of all cards.
-
-
-
-
Constraints:
-
-
-
1 <= cardPoints.length <= 105
-
1 <= cardPoints[i] <= 104
-
1 <= k <= cardPoints.length
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Sliding Window](../../tag/sliding-window/README.md)]
- [[Prefix Sum](../../tag/prefix-sum/README.md)]
-
-### Similar Questions
- 1. [Maximum Score from Performing Multiplication Operations](../maximum-score-from-performing-multiplication-operations) (Medium)
- 1. [Removing Minimum and Maximum From Array](../removing-minimum-and-maximum-from-array) (Medium)
-
-### Hints
-
-Hint 1
-Let the sum of all points be total_pts. You need to remove a sub-array from cardPoints with length n - k.
-
-
-
-Hint 2
-Keep a window of size n - k over the array. The answer is max(answer, total_pts - sumOfCurrentWindow)
-
diff --git a/problems/maximum-population-year/README.md b/problems/maximum-population-year/README.md
deleted file mode 100644
index 5c709dc10..000000000
--- a/problems/maximum-population-year/README.md
+++ /dev/null
@@ -1,59 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../convert-date-format "Convert Date Format")
-
-[Next >](../maximum-distance-between-a-pair-of-values "Maximum Distance Between a Pair of Values")
-
-## [1854. Maximum Population Year (Easy)](https://leetcode.com/problems/maximum-population-year "人口最多的年份")
-
-
You are given a 2D integer array logs where each logs[i] = [birthi, deathi] indicates the birth and death years of the ith person.
-
-
The population of some year x is the number of people alive during that year. The ith person is counted in year x's population if x is in the inclusive range [birthi, deathi - 1]. Note that the person is not counted in the year that they die.
-
-
Return the earliest year with the maximum population.
-
-
-
Example 1:
-
-
-Input: logs = [[1993,1999],[2000,2010]]
-Output: 1993
-Explanation: The maximum population is 1, and 1993 is the earliest year with this population.
-
-
-
Example 2:
-
-
-Input: logs = [[1950,1961],[1960,1971],[1970,1981]]
-Output: 1960
-Explanation:
-The maximum population is 2, and it had happened in years 1960 and 1970.
-The earlier year between them is 1960.
-
-
-
Constraints:
-
-
-
1 <= logs.length <= 100
-
1950 <= birthi < deathi <= 2050
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Counting](../../tag/counting/README.md)]
-
-### Hints
-
-Hint 1
-For each year find the number of people whose birth_i ≤ year and death_i > year.
-
-
-
-Hint 2
-Find the maximum value between all years.
-
diff --git a/problems/maximum-product-difference-between-two-pairs/README.md b/problems/maximum-product-difference-between-two-pairs/README.md
deleted file mode 100644
index c42a5e7f6..000000000
--- a/problems/maximum-product-difference-between-two-pairs/README.md
+++ /dev/null
@@ -1,64 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../design-movie-rental-system "Design Movie Rental System")
-
-[Next >](../cyclically-rotating-a-grid "Cyclically Rotating a Grid")
-
-## [1913. Maximum Product Difference Between Two Pairs (Easy)](https://leetcode.com/problems/maximum-product-difference-between-two-pairs "两个数对之间的最大乘积差")
-
-
The product difference between two pairs (a, b) and (c, d) is defined as (a * b) - (c * d).
-
-
-
For example, the product difference between (5, 6) and (2, 7) is (5 * 6) - (2 * 7) = 16.
-
-
-
Given an integer array nums, choose four distinct indices w, x, y, and z such that the product difference between pairs (nums[w], nums[x]) and (nums[y], nums[z]) is maximized.
-
-
Return the maximum such product difference.
-
-
-
Example 1:
-
-
-Input: nums = [5,6,2,7,4]
-Output: 34
-Explanation: We can choose indices 1 and 3 for the first pair (6, 7) and indices 2 and 4 for the second pair (2, 4).
-The product difference is (6 * 7) - (2 * 4) = 34.
-
-
-
Example 2:
-
-
-Input: nums = [4,2,5,9,7,4,8]
-Output: 64
-Explanation: We can choose indices 3 and 6 for the first pair (9, 8) and indices 1 and 5 for the second pair (2, 4).
-The product difference is (9 * 8) - (2 * 4) = 64.
-
-
-
-
Constraints:
-
-
-
4 <= nums.length <= 104
-
1 <= nums[i] <= 104
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Hints
-
-Hint 1
-If you only had to find the maximum product of 2 numbers in an array, which 2 numbers should you choose?
-
-
-
-Hint 2
-We only need to worry about 4 numbers in the array.
-
diff --git a/problems/maximum-product-of-splitted-binary-tree/README.md b/problems/maximum-product-of-splitted-binary-tree/README.md
deleted file mode 100644
index aad097cb2..000000000
--- a/problems/maximum-product-of-splitted-binary-tree/README.md
+++ /dev/null
@@ -1,57 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../reduce-array-size-to-the-half "Reduce Array Size to The Half")
-
-[Next >](../jump-game-v "Jump Game V")
-
-## [1339. Maximum Product of Splitted Binary Tree (Medium)](https://leetcode.com/problems/maximum-product-of-splitted-binary-tree "分裂二叉树的最大乘积")
-
-
Given the root of a binary tree, split the binary tree into two subtrees by removing one edge such that the product of the sums of the subtrees is maximized.
-
-
Return the maximum product of the sums of the two subtrees. Since the answer may be too large, return it modulo109 + 7.
-
-
Note that you need to maximize the answer before taking the mod and not after taking it.
-
-
-
Example 1:
-
-
-Input: root = [1,2,3,4,5,6]
-Output: 110
-Explanation: Remove the red edge and get 2 binary trees with sum 11 and 10. Their product is 110 (11*10)
-
-
-
Example 2:
-
-
-Input: root = [1,null,2,3,4,null,null,5,6]
-Output: 90
-Explanation: Remove the red edge and get 2 binary trees with sum 15 and 6.Their product is 90 (15*6)
-
-
-
-
Constraints:
-
-
-
The number of nodes in the tree is in the range [2, 5 * 104].
-
1 <= Node.val <= 104
-
-
-### Related Topics
- [[Tree](../../tag/tree/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Binary Tree](../../tag/binary-tree/README.md)]
-
-### Similar Questions
- 1. [Count Nodes With the Highest Score](../count-nodes-with-the-highest-score) (Medium)
-
-### Hints
-
-Hint 1
-If we know the sum of a subtree, the answer is max( (total_sum - subtree_sum) * subtree_sum) in each node.
-
diff --git a/problems/maximum-product-of-the-length-of-two-palindromic-subsequences/README.md b/problems/maximum-product-of-the-length-of-two-palindromic-subsequences/README.md
deleted file mode 100644
index e882747e2..000000000
--- a/problems/maximum-product-of-the-length-of-two-palindromic-subsequences/README.md
+++ /dev/null
@@ -1,72 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../number-of-pairs-of-interchangeable-rectangles "Number of Pairs of Interchangeable Rectangles")
-
-[Next >](../smallest-missing-genetic-value-in-each-subtree "Smallest Missing Genetic Value in Each Subtree")
-
-## [2002. Maximum Product of the Length of Two Palindromic Subsequences (Medium)](https://leetcode.com/problems/maximum-product-of-the-length-of-two-palindromic-subsequences "两个回文子序列长度的最大乘积")
-
-
Given a string s, find two disjoint palindromic subsequences of s such that the product of their lengths is maximized. The two subsequences are disjoint if they do not both pick a character at the same index.
-
-
Return the maximum possible product of the lengths of the two palindromic subsequences.
-
-
A subsequence is a string that can be derived from another string by deleting some or no characters without changing the order of the remaining characters. A string is palindromic if it reads the same forward and backward.
-
-
-
Example 1:
-
-
-Input: s = "leetcodecom"
-Output: 9
-Explanation: An optimal solution is to choose "ete" for the 1st subsequence and "cdc" for the 2nd subsequence.
-The product of their lengths is: 3 * 3 = 9.
-
-
-
Example 2:
-
-
-Input: s = "bb"
-Output: 1
-Explanation: An optimal solution is to choose "b" (the first character) for the 1st subsequence and "b" (the second character) for the 2nd subsequence.
-The product of their lengths is: 1 * 1 = 1.
-
-
-
Example 3:
-
-
-Input: s = "accbcaxxcxx"
-Output: 25
-Explanation: An optimal solution is to choose "accca" for the 1st subsequence and "xxcxx" for the 2nd subsequence.
-The product of their lengths is: 5 * 5 = 25.
-
-
-
-
Constraints:
-
-
-
2 <= s.length <= 12
-
s consists of lowercase English letters only.
-
-
-### Related Topics
- [[Bit Manipulation](../../tag/bit-manipulation/README.md)]
- [[String](../../tag/string/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Backtracking](../../tag/backtracking/README.md)]
- [[Bitmask](../../tag/bitmask/README.md)]
-
-### Hints
-
-Hint 1
-Could you generate all possible pairs of disjoint subsequences?
-
-
-
-Hint 2
-Could you find the maximum length palindrome in each subsequence for a pair of disjoint subsequences?
-
diff --git a/problems/maximum-product-of-the-length-of-two-palindromic-substrings/README.md b/problems/maximum-product-of-the-length-of-two-palindromic-substrings/README.md
deleted file mode 100644
index 9cdca3f6e..000000000
--- a/problems/maximum-product-of-the-length-of-two-palindromic-substrings/README.md
+++ /dev/null
@@ -1,66 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-total-space-wasted-with-k-resizing-operations "Minimum Total Space Wasted With K Resizing Operations")
-
-[Next >](../check-if-string-is-a-prefix-of-array "Check If String Is a Prefix of Array")
-
-## [1960. Maximum Product of the Length of Two Palindromic Substrings (Hard)](https://leetcode.com/problems/maximum-product-of-the-length-of-two-palindromic-substrings "两个回文子字符串长度的最大乘积")
-
-
You are given a 0-indexed string s and are tasked with finding two non-intersecting palindromic substrings of odd length such that the product of their lengths is maximized.
-
-
More formally, you want to choose four integers i, j, k, l such that 0 <= i <= j < k <= l < s.length and both the substrings s[i...j] and s[k...l] are palindromes and have odd lengths. s[i...j] denotes a substring from index i to index jinclusive.
-
-
Return the maximum possible product of the lengths of the two non-intersecting palindromic substrings.
-
-
A palindrome is a string that is the same forward and backward. A substring is a contiguous sequence of characters in a string.
-
-
-
Example 1:
-
-
-Input: s = "ababbb"
-Output: 9
-Explanation: Substrings "aba" and "bbb" are palindromes with odd length. product = 3 * 3 = 9.
-
-
-
Example 2:
-
-
-Input: s = "zaaaxbbby"
-Output: 9
-Explanation: Substrings "aaa" and "bbb" are palindromes with odd length. product = 3 * 3 = 9.
-
-
-
-
Constraints:
-
-
-
2 <= s.length <= 105
-
s consists of lowercase English letters.
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
- [[Hash Function](../../tag/hash-function/README.md)]
- [[Rolling Hash](../../tag/rolling-hash/README.md)]
-
-### Hints
-
-Hint 1
-You can use Manacher's algorithm to get the maximum palindromic substring centered at each index
-
-
-
-Hint 2
-After using Manacher's for each center use a line sweep from the center to the left and from the center to the right to find for each index the farthest center to it with distance ≤ palin[center]
-
-
-
-Hint 3
-After that, find the maximum palindrome size for each prefix in the string and for each suffix and the answer would be max(prefix[i] * suffix[i + 1])
-
diff --git a/problems/maximum-product-of-three-numbers/README.md b/problems/maximum-product-of-three-numbers/README.md
deleted file mode 100644
index 66da498b6..000000000
--- a/problems/maximum-product-of-three-numbers/README.md
+++ /dev/null
@@ -1,41 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../swap-salary "Swap Salary")
-
-[Next >](../k-inverse-pairs-array "K Inverse Pairs Array")
-
-## [628. Maximum Product of Three Numbers (Easy)](https://leetcode.com/problems/maximum-product-of-three-numbers "三个数的最大乘积")
-
-
Given an integer array nums, find three numbers whose product is maximum and return the maximum product.
-
-
-
Example 1:
-
Input: nums = [1,2,3]
-Output: 6
-
Example 2:
-
Input: nums = [1,2,3,4]
-Output: 24
-
Example 3:
-
Input: nums = [-1,-2,-3]
-Output: -6
-
-
-
Constraints:
-
-
-
3 <= nums.length <= 104
-
-1000 <= nums[i] <= 1000
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Math](../../tag/math/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Similar Questions
- 1. [Maximum Product Subarray](../maximum-product-subarray) (Medium)
diff --git a/problems/maximum-product-of-three-numbers/maximum_product_of_three_numbers.go b/problems/maximum-product-of-three-numbers/maximum_product_of_three_numbers.go
deleted file mode 100644
index 14445e43d..000000000
--- a/problems/maximum-product-of-three-numbers/maximum_product_of_three_numbers.go
+++ /dev/null
@@ -1,27 +0,0 @@
-package problem628
-
-import "math"
-
-func maximumProduct(nums []int) int {
- min1, min2 := math.MaxInt32, math.MaxInt32
- max1, max2, max3 := math.MinInt32, math.MinInt32, math.MinInt32
- for _, n := range nums {
- if n < min1 {
- min1, min2 = n, min1
- } else if n < min2 {
- min2 = n
- }
- if n > max3 {
- max1, max2, max3 = max2, max3, n
- } else if n > max2 {
- max1, max2 = max2, n
- } else if n > max1 {
- max1 = n
- }
- }
- ans1, ans2 := min1*min2*max3, max1*max2*max3
- if ans1 > ans2 {
- return ans1
- }
- return ans2
-}
diff --git a/problems/maximum-product-of-three-numbers/maximum_product_of_three_numbers_test.go b/problems/maximum-product-of-three-numbers/maximum_product_of_three_numbers_test.go
deleted file mode 100644
index 546f836ac..000000000
--- a/problems/maximum-product-of-three-numbers/maximum_product_of_three_numbers_test.go
+++ /dev/null
@@ -1,35 +0,0 @@
-package problem628
-
-import "testing"
-
-type testType struct {
- in []int
- want int
-}
-
-func TestMaximumProduct(t *testing.T) {
- tests := [...]testType{
- {
- in: []int{1, 2, 3},
- want: 6,
- },
- {
- in: []int{1, 2, 3, 4},
- want: 24,
- },
- {
- in: []int{-2, -1, 0, 2, 3},
- want: 6,
- },
- {
- in: []int{-1, -2, -3, 5, 4, 3, 2, 1},
- want: 60,
- },
- }
- for _, tt := range tests {
- got := maximumProduct(tt.in)
- if got != tt.want {
- t.Fatalf("in: %v, got: %v, want: %v", tt.in, got, tt.want)
- }
- }
-}
diff --git a/problems/maximum-product-of-two-elements-in-an-array/README.md b/problems/maximum-product-of-two-elements-in-an-array/README.md
deleted file mode 100644
index 6780a411d..000000000
--- a/problems/maximum-product-of-two-elements-in-an-array/README.md
+++ /dev/null
@@ -1,56 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../cherry-pickup-ii "Cherry Pickup II")
-
-[Next >](../maximum-area-of-a-piece-of-cake-after-horizontal-and-vertical-cuts "Maximum Area of a Piece of Cake After Horizontal and Vertical Cuts")
-
-## [1464. Maximum Product of Two Elements in an Array (Easy)](https://leetcode.com/problems/maximum-product-of-two-elements-in-an-array "数组中两元素的最大乘积")
-
-Given the array of integers nums, you will choose two different indices i and j of that array. Return the maximum value of(nums[i]-1)*(nums[j]-1).
-
-
Example 1:
-
-
-Input: nums = [3,4,5,2]
-Output: 12
-Explanation: If you choose the indices i=1 and j=2 (indexed from 0), you will get the maximum value, that is, (nums[1]-1)*(nums[2]-1) = (4-1)*(5-1) = 3*4 = 12.
-
-
-
Example 2:
-
-
-Input: nums = [1,5,4,5]
-Output: 16
-Explanation: Choosing the indices i=1 and j=3 (indexed from 0), you will get the maximum value of (5-1)*(5-1) = 16.
-
-
-
Example 3:
-
-
-Input: nums = [3,7]
-Output: 12
-
-
-
-
Constraints:
-
-
-
2 <= nums.length <= 500
-
1 <= nums[i] <= 10^3
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
- [[Heap (Priority Queue)](../../tag/heap-priority-queue/README.md)]
-
-### Hints
-
-Hint 1
-Use brute force: two loops to select i and j, then select the maximum value of (nums[i]-1)*(nums[j]-1).
-
diff --git a/problems/maximum-product-of-word-lengths/README.md b/problems/maximum-product-of-word-lengths/README.md
deleted file mode 100644
index 40fec0598..000000000
--- a/problems/maximum-product-of-word-lengths/README.md
+++ /dev/null
@@ -1,53 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../shortest-distance-from-all-buildings "Shortest Distance from All Buildings")
-
-[Next >](../bulb-switcher "Bulb Switcher")
-
-## [318. Maximum Product of Word Lengths (Medium)](https://leetcode.com/problems/maximum-product-of-word-lengths "最大单词长度乘积")
-
-
Given a string array words, return the maximum value oflength(word[i]) * length(word[j])where the two words do not share common letters. If no such two words exist, return 0.
-
-
-
Example 1:
-
-
-Input: words = ["abcw","baz","foo","bar","xtfn","abcdef"]
-Output: 16
-Explanation: The two words can be "abcw", "xtfn".
-
-
-
Example 2:
-
-
-Input: words = ["a","ab","abc","d","cd","bcd","abcd"]
-Output: 4
-Explanation: The two words can be "ab", "cd".
-
-
-
Example 3:
-
-
-Input: words = ["a","aa","aaa","aaaa"]
-Output: 0
-Explanation: No such pair of words.
-
-
-
-
Constraints:
-
-
-
2 <= words.length <= 1000
-
1 <= words[i].length <= 1000
-
words[i] consists only of lowercase English letters.
Given an integer array nums, find a contiguous non-empty subarray within the array that has the largest product, and return the product.
-
-
It is guaranteed that the answer will fit in a 32-bit integer.
-
-
A subarray is a contiguous subsequence of the array.
-
-
-
Example 1:
-
-
-Input: nums = [2,3,-2,4]
-Output: 6
-Explanation: [2,3] has the largest product 6.
-
-
-
Example 2:
-
-
-Input: nums = [-2,0,-1]
-Output: 0
-Explanation: The result cannot be 2, because [-2,-1] is not a subarray.
-
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 2 * 104
-
-10 <= nums[i] <= 10
-
The product of any prefix or suffix of nums is guaranteed to fit in a 32-bit integer.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Similar Questions
- 1. [Maximum Subarray](../maximum-subarray) (Easy)
- 1. [House Robber](../house-robber) (Medium)
- 1. [Product of Array Except Self](../product-of-array-except-self) (Medium)
- 1. [Maximum Product of Three Numbers](../maximum-product-of-three-numbers) (Easy)
- 1. [Subarray Product Less Than K](../subarray-product-less-than-k) (Medium)
diff --git a/problems/maximum-product-subarray/maximum_product_subarray.go b/problems/maximum-product-subarray/maximum_product_subarray.go
deleted file mode 100644
index 5544f1d4c..000000000
--- a/problems/maximum-product-subarray/maximum_product_subarray.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem152
diff --git a/problems/maximum-product-subarray/maximum_product_subarray_test.go b/problems/maximum-product-subarray/maximum_product_subarray_test.go
deleted file mode 100644
index 5544f1d4c..000000000
--- a/problems/maximum-product-subarray/maximum_product_subarray_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem152
diff --git a/problems/maximum-profit-in-job-scheduling/README.md b/problems/maximum-profit-in-job-scheduling/README.md
deleted file mode 100644
index 8cb51b614..000000000
--- a/problems/maximum-profit-in-job-scheduling/README.md
+++ /dev/null
@@ -1,81 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../replace-the-substring-for-balanced-string "Replace the Substring for Balanced String")
-
-[Next >](../web-crawler "Web Crawler")
-
-## [1235. Maximum Profit in Job Scheduling (Hard)](https://leetcode.com/problems/maximum-profit-in-job-scheduling "规划兼职工作")
-
-
We have n jobs, where every job is scheduled to be done from startTime[i] to endTime[i], obtaining a profit of profit[i].
-
-
You're given the startTime, endTime and profit arrays, return the maximum profit you can take such that there are no two jobs in the subset with overlapping time range.
-
-
If you choose a job that ends at time X you will be able to start another job that starts at time X.
-
-
-
Example 1:
-
-
-
-
-Input: startTime = [1,2,3,3], endTime = [3,4,5,6], profit = [50,10,40,70]
-Output: 120
-Explanation: The subset chosen is the first and fourth job.
-Time range [1-3]+[3-6] , we get profit of 120 = 50 + 70.
-
-
-
Example 2:
-
-
-
-
-Input: startTime = [1,2,3,4,6], endTime = [3,5,10,6,9], profit = [20,20,100,70,60]
-Output: 150
-Explanation: The subset chosen is the first, fourth and fifth job.
-Profit obtained 150 = 20 + 70 + 60.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Hints
-
-Hint 1
-Think on DP.
-
-
-
-Hint 2
-Sort the elements by starting time, then define the dp[i] as the maximum profit taking elements from the suffix starting at i.
-
-
-
-Hint 3
-Use binarySearch (lower_bound/upper_bound on C++) to get the next index for the DP transition.
-
diff --git a/problems/maximum-profit-of-operating-a-centennial-wheel/README.md b/problems/maximum-profit-of-operating-a-centennial-wheel/README.md
deleted file mode 100644
index 0ef854aa3..000000000
--- a/problems/maximum-profit-of-operating-a-centennial-wheel/README.md
+++ /dev/null
@@ -1,88 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../crawler-log-folder "Crawler Log Folder")
-
-[Next >](../throne-inheritance "Throne Inheritance")
-
-## [1599. Maximum Profit of Operating a Centennial Wheel (Medium)](https://leetcode.com/problems/maximum-profit-of-operating-a-centennial-wheel "经营摩天轮的最大利润")
-
-
You are the operator of a Centennial Wheel that has four gondolas, and each gondola has room for uptofour people. You have the ability to rotate the gondolas counterclockwise, which costs you runningCost dollars.
-
-
You are given an array customers of length n where customers[i] is the number of new customers arriving just before the ith rotation (0-indexed). This means you must rotate the wheel i times before the customers[i] customers arrive. You cannot make customers wait if there is room in the gondola. Each customer pays boardingCost dollars when they board on the gondola closest to the ground and will exit once that gondola reaches the ground again.
-
-
You can stop the wheel at any time, including beforeservingallcustomers. If you decide to stop serving customers, all subsequent rotations are free in order to get all the customers down safely. Note that if there are currently more than four customers waiting at the wheel, only four will board the gondola, and the rest will wait for the next rotation.
-
-
Return the minimum number of rotations you need to perform to maximize your profit. If there is no scenario where the profit is positive, return -1.
-
-
-
Example 1:
-
-
-Input: customers = [8,3], boardingCost = 5, runningCost = 6
-Output: 3
-Explanation: The numbers written on the gondolas are the number of people currently there.
-1. 8 customers arrive, 4 board and 4 wait for the next gondola, the wheel rotates. Current profit is 4 * $5 - 1 * $6 = $14.
-2. 3 customers arrive, the 4 waiting board the wheel and the other 3 wait, the wheel rotates. Current profit is 8 * $5 - 2 * $6 = $28.
-3. The final 3 customers board the gondola, the wheel rotates. Current profit is 11 * $5 - 3 * $6 = $37.
-The highest profit was $37 after rotating the wheel 3 times.
-
-
-
Example 2:
-
-
-Input: customers = [10,9,6], boardingCost = 6, runningCost = 4
-Output: 7
-Explanation:
-1. 10 customers arrive, 4 board and 6 wait for the next gondola, the wheel rotates. Current profit is 4 * $6 - 1 * $4 = $20.
-2. 9 customers arrive, 4 board and 11 wait (2 originally waiting, 9 newly waiting), the wheel rotates. Current profit is 8 * $6 - 2 * $4 = $40.
-3. The final 6 customers arrive, 4 board and 13 wait, the wheel rotates. Current profit is 12 * $6 - 3 * $4 = $60.
-4. 4 board and 9 wait, the wheel rotates. Current profit is 16 * $6 - 4 * $4 = $80.
-5. 4 board and 5 wait, the wheel rotates. Current profit is 20 * $6 - 5 * $4 = $100.
-6. 4 board and 1 waits, the wheel rotates. Current profit is 24 * $6 - 6 * $4 = $120.
-7. 1 boards, the wheel rotates. Current profit is 25 * $6 - 7 * $4 = $122.
-The highest profit was $122 after rotating the wheel 7 times.
-
-
-
Example 3:
-
-
-Input: customers = [3,4,0,5,1], boardingCost = 1, runningCost = 92
-Output: -1
-Explanation:
-1. 3 customers arrive, 3 board and 0 wait, the wheel rotates. Current profit is 3 * $1 - 1 * $92 = -$89.
-2. 4 customers arrive, 4 board and 0 wait, the wheel rotates. Current profit is 7 * $1 - 2 * $92 = -$177.
-3. 0 customers arrive, 0 board and 0 wait, the wheel rotates. Current profit is 7 * $1 - 3 * $92 = -$269.
-4. 5 customers arrive, 4 board and 1 waits, the wheel rotates. Current profit is 11 * $1 - 4 * $92 = -$357.
-5. 1 customer arrives, 2 board and 0 wait, the wheel rotates. Current profit is 13 * $1 - 5 * $92 = -$447.
-The profit was never positive, so return -1.
-
-
-
-
Constraints:
-
-
-
n == customers.length
-
1 <= n <= 105
-
0 <= customers[i] <= 50
-
1 <= boardingCost, runningCost <= 100
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Simulation](../../tag/simulation/README.md)]
-
-### Hints
-
-Hint 1
-Think simulation
-
-
-
-Hint 2
-Note that the number of turns will never be more than 50 / 4 * n
-
diff --git a/problems/maximum-repeating-substring/README.md b/problems/maximum-repeating-substring/README.md
deleted file mode 100644
index 708d69560..000000000
--- a/problems/maximum-repeating-substring/README.md
+++ /dev/null
@@ -1,65 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../fix-names-in-a-table "Fix Names in a Table")
-
-[Next >](../merge-in-between-linked-lists "Merge In Between Linked Lists")
-
-## [1668. Maximum Repeating Substring (Easy)](https://leetcode.com/problems/maximum-repeating-substring "最大重复子字符串")
-
-
For a string sequence, a string word is k-repeating if word concatenated k times is a substring of sequence. The word's maximum k-repeating value is the highest value k where word is k-repeating in sequence. If word is not a substring of sequence, word's maximum k-repeating value is 0.
-
-
Given strings sequence and word, return the maximum k-repeating value of word in sequence.
-
-
-
Example 1:
-
-
-Input: sequence = "ababc", word = "ab"
-Output: 2
-Explanation: "abab" is a substring in "ababc".
-
-
-
Example 2:
-
-
-Input: sequence = "ababc", word = "ba"
-Output: 1
-Explanation: "ba" is a substring in "ababc". "baba" is not a substring in "ababc".
-
-
-
Example 3:
-
-
-Input: sequence = "ababc", word = "ac"
-Output: 0
-Explanation: "ac" is not a substring in "ababc".
-
-
-
-
Constraints:
-
-
-
1 <= sequence.length <= 100
-
1 <= word.length <= 100
-
sequence and word contains only lowercase English letters.
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
- [[String Matching](../../tag/string-matching/README.md)]
-
-### Hints
-
-Hint 1
-The constraints are low enough for a brute force approach.
-
-
-
-Hint 2
-Try every k value from 0 upwards until word is no longer k-repeating.
-
diff --git a/problems/maximum-running-time-of-n-computers/README.md b/problems/maximum-running-time-of-n-computers/README.md
deleted file mode 100644
index 671f8e340..000000000
--- a/problems/maximum-running-time-of-n-computers/README.md
+++ /dev/null
@@ -1,72 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../solving-questions-with-brainpower "Solving Questions With Brainpower")
-
-[Next >](../the-number-of-passengers-in-each-bus-i "The Number of Passengers in Each Bus I")
-
-## [2141. Maximum Running Time of N Computers (Hard)](https://leetcode.com/problems/maximum-running-time-of-n-computers "同时运行 N 台电脑的最长时间")
-
-
You have n computers. You are given the integer n and a 0-indexed integer array batteries where the ith battery can run a computer for batteries[i] minutes. You are interested in running alln computers simultaneously using the given batteries.
-
-
Initially, you can insert at most one battery into each computer. After that and at any integer time moment, you can remove a battery from a computer and insert another battery any number of times. The inserted battery can be a totally new battery or a battery from another computer. You may assume that the removing and inserting processes take no time.
-
-
Note that the batteries cannot be recharged.
-
-
Return the maximum number of minutes you can run all the n computers simultaneously.
-
-
-
Example 1:
-
-
-Input: n = 2, batteries = [3,3,3]
-Output: 4
-Explanation:
-Initially, insert battery 0 into the first computer and battery 1 into the second computer.
-After two minutes, remove battery 1 from the second computer and insert battery 2 instead. Note that battery 1 can still run for one minute.
-At the end of the third minute, battery 0 is drained, and you need to remove it from the first computer and insert battery 1 instead.
-By the end of the fourth minute, battery 1 is also drained, and the first computer is no longer running.
-We can run the two computers simultaneously for at most 4 minutes, so we return 4.
-
-
-
-
Example 2:
-
-
-Input: n = 2, batteries = [1,1,1,1]
-Output: 2
-Explanation:
-Initially, insert battery 0 into the first computer and battery 2 into the second computer.
-After one minute, battery 0 and battery 2 are drained so you need to remove them and insert battery 1 into the first computer and battery 3 into the second computer.
-After another minute, battery 1 and battery 3 are also drained so the first and second computers are no longer running.
-We can run the two computers simultaneously for at most 2 minutes, so we return 2.
-
-
-
-
Constraints:
-
-
-
1 <= n <= batteries.length <= 105
-
1 <= batteries[i] <= 109
-
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Hints
-
-Hint 1
-For a given running time, can you determine if it is possible to run all n computers simultaneously?
-
-
-
-Hint 2
-Try to use Binary Search to find the maximal running time
-
diff --git a/problems/maximum-score-after-splitting-a-string/README.md b/problems/maximum-score-after-splitting-a-string/README.md
deleted file mode 100644
index 589727c3a..000000000
--- a/problems/maximum-score-after-splitting-a-string/README.md
+++ /dev/null
@@ -1,68 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../npv-queries "NPV Queries")
-
-[Next >](../maximum-points-you-can-obtain-from-cards "Maximum Points You Can Obtain from Cards")
-
-## [1422. Maximum Score After Splitting a String (Easy)](https://leetcode.com/problems/maximum-score-after-splitting-a-string "分割字符串的最大得分")
-
-
Given a string s of zeros and ones, return the maximum score after splitting the string into two non-empty substrings (i.e. left substring and right substring).
-
-
The score after splitting a string is the number of zeros in the left substring plus the number of ones in the right substring.
-
-
-
Example 1:
-
-
-Input: s = "011101"
-Output: 5
-Explanation:
-All possible ways of splitting s into two non-empty substrings are:
-left = "0" and right = "11101", score = 1 + 4 = 5
-left = "01" and right = "1101", score = 1 + 3 = 4
-left = "011" and right = "101", score = 1 + 2 = 3
-left = "0111" and right = "01", score = 1 + 1 = 2
-left = "01110" and right = "1", score = 2 + 1 = 3
-
-
-
Example 2:
-
-
-Input: s = "00111"
-Output: 5
-Explanation: When left = "00" and right = "111", we get the maximum score = 2 + 3 = 5
-
-
-
Example 3:
-
-
-Input: s = "1111"
-Output: 3
-
-
-
-
Constraints:
-
-
-
2 <= s.length <= 500
-
The string s consists of characters '0' and '1' only.
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
-
-### Hints
-
-Hint 1
-Precompute a prefix sum of ones ('1').
-
-
-
-Hint 2
-Iterate from left to right counting the number of zeros ('0'), then use the precomputed prefix sum for counting ones ('1'). Update the answer.
-
diff --git a/problems/maximum-score-after-splitting-a-string/maximum_score_after_splitting_a_string.go b/problems/maximum-score-after-splitting-a-string/maximum_score_after_splitting_a_string.go
deleted file mode 100644
index d889bf61f..000000000
--- a/problems/maximum-score-after-splitting-a-string/maximum_score_after_splitting_a_string.go
+++ /dev/null
@@ -1,20 +0,0 @@
-package problem1422
-
-import "strings"
-
-func maxScore(s string) int {
- ans := 0
- n0 := 0
- n1 := strings.Count(s, "1")
- for _, v := range s[:len(s)-1] {
- if v == '1' {
- n1--
- } else {
- n0++
- }
- if ans < n0+n1 {
- ans = n0 + n1
- }
- }
- return ans
-}
diff --git a/problems/maximum-score-after-splitting-a-string/maximum_score_after_splitting_a_string_test.go b/problems/maximum-score-after-splitting-a-string/maximum_score_after_splitting_a_string_test.go
deleted file mode 100644
index 87dddd3da..000000000
--- a/problems/maximum-score-after-splitting-a-string/maximum_score_after_splitting_a_string_test.go
+++ /dev/null
@@ -1,35 +0,0 @@
-package problem1422
-
-import "testing"
-
-type testType struct {
- in string
- want int
-}
-
-func TestMaxScore(t *testing.T) {
- tests := [...]testType{
- {
- in: "011101",
- want: 5,
- },
- {
- in: "00111",
- want: 5,
- },
- {
- in: "1111",
- want: 3,
- },
- {
- in: "000000",
- want: 5,
- },
- }
- for _, tt := range tests {
- got := maxScore(tt.in)
- if got != tt.want {
- t.Fatalf("in: %v, got: %v, want: %v", tt.in, got, tt.want)
- }
- }
-}
diff --git a/problems/maximum-score-from-performing-multiplication-operations/README.md b/problems/maximum-score-from-performing-multiplication-operations/README.md
deleted file mode 100644
index 31175d357..000000000
--- a/problems/maximum-score-from-performing-multiplication-operations/README.md
+++ /dev/null
@@ -1,85 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-number-of-operations-to-move-all-balls-to-each-box "Minimum Number of Operations to Move All Balls to Each Box")
-
-[Next >](../maximize-palindrome-length-from-subsequences "Maximize Palindrome Length From Subsequences")
-
-## [1770. Maximum Score from Performing Multiplication Operations (Medium)](https://leetcode.com/problems/maximum-score-from-performing-multiplication-operations "执行乘法运算的最大分数")
-
-
You are given two integer arrays nums and multipliersof size n and m respectively, where n >= m. The arrays are 1-indexed.
-
-
You begin with a score of 0. You want to perform exactlym operations. On the ith operation (1-indexed), you will:
-
-
-
Choose one integer x from either the start or the end of the array nums.
-
Add multipliers[i] * x to your score.
-
Remove x from the array nums.
-
-
-
Return the maximum score after performing moperations.
-
-
-
Example 1:
-
-
-Input: nums = [1,2,3], multipliers = [3,2,1]
-Output: 14
-Explanation: An optimal solution is as follows:
-- Choose from the end, [1,2,3], adding 3 * 3 = 9 to the score.
-- Choose from the end, [1,2], adding 2 * 2 = 4 to the score.
-- Choose from the end, [1], adding 1 * 1 = 1 to the score.
-The total score is 9 + 4 + 1 = 14.
-
-
Example 2:
-
-
-Input: nums = [-5,-3,-3,-2,7,1], multipliers = [-10,-5,3,4,6]
-Output: 102
-Explanation: An optimal solution is as follows:
-- Choose from the start, [-5,-3,-3,-2,7,1], adding -5 * -10 = 50 to the score.
-- Choose from the start, [-3,-3,-2,7,1], adding -3 * -5 = 15 to the score.
-- Choose from the start, [-3,-2,7,1], adding -3 * 3 = -9 to the score.
-- Choose from the end, [-2,7,1], adding 1 * 4 = 4 to the score.
-- Choose from the end, [-2,7], adding 7 * 6 = 42 to the score.
-The total score is 50 + 15 - 9 + 4 + 42 = 102.
-
-
-
-
Constraints:
-
-
-
n == nums.length
-
m == multipliers.length
-
1 <= m <= 103
-
m <= n <= 105
-
-1000 <= nums[i], multipliers[i] <= 1000
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Similar Questions
- 1. [Maximum Points You Can Obtain from Cards](../maximum-points-you-can-obtain-from-cards) (Medium)
- 1. [Stone Game VII](../stone-game-vii) (Medium)
-
-### Hints
-
-Hint 1
-At first glance, the solution seems to be greedy, but if you try to greedily take the largest value from the beginning or the end, this will not be optimal.
-
-
-
-Hint 2
-You should try all scenarios but this will be costy.
-
-
-
-Hint 3
-Memoizing the pre-visited states while trying all the possible scenarios will reduce the complexity, and hence dp is a perfect choice here.
-
diff --git a/problems/maximum-score-from-removing-stones/README.md b/problems/maximum-score-from-removing-stones/README.md
deleted file mode 100644
index 01389e015..000000000
--- a/problems/maximum-score-from-removing-stones/README.md
+++ /dev/null
@@ -1,80 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../check-if-array-is-sorted-and-rotated "Check if Array Is Sorted and Rotated")
-
-[Next >](../largest-merge-of-two-strings "Largest Merge Of Two Strings")
-
-## [1753. Maximum Score From Removing Stones (Medium)](https://leetcode.com/problems/maximum-score-from-removing-stones "移除石子的最大得分")
-
-
You are playing a solitaire game with three piles of stones of sizes a, b, and c respectively. Each turn you choose two different non-empty piles, take one stone from each, and add 1 point to your score. The game stops when there are fewer than two non-empty piles (meaning there are no more available moves).
-
-
Given three integers a, b, and c, return themaximumscore you can get.
-
-
-
Example 1:
-
-
-Input: a = 2, b = 4, c = 6
-Output: 6
-Explanation: The starting state is (2, 4, 6). One optimal set of moves is:
-- Take from 1st and 3rd piles, state is now (1, 4, 5)
-- Take from 1st and 3rd piles, state is now (0, 4, 4)
-- Take from 2nd and 3rd piles, state is now (0, 3, 3)
-- Take from 2nd and 3rd piles, state is now (0, 2, 2)
-- Take from 2nd and 3rd piles, state is now (0, 1, 1)
-- Take from 2nd and 3rd piles, state is now (0, 0, 0)
-There are fewer than two non-empty piles, so the game ends. Total: 6 points.
-
-
-
Example 2:
-
-
-Input: a = 4, b = 4, c = 6
-Output: 7
-Explanation: The starting state is (4, 4, 6). One optimal set of moves is:
-- Take from 1st and 2nd piles, state is now (3, 3, 6)
-- Take from 1st and 3rd piles, state is now (2, 3, 5)
-- Take from 1st and 3rd piles, state is now (1, 3, 4)
-- Take from 1st and 3rd piles, state is now (0, 3, 3)
-- Take from 2nd and 3rd piles, state is now (0, 2, 2)
-- Take from 2nd and 3rd piles, state is now (0, 1, 1)
-- Take from 2nd and 3rd piles, state is now (0, 0, 0)
-There are fewer than two non-empty piles, so the game ends. Total: 7 points.
-
-
-
Example 3:
-
-
-Input: a = 1, b = 8, c = 8
-Output: 8
-Explanation: One optimal set of moves is to take from the 2nd and 3rd piles for 8 turns until they are empty.
-After that, there are fewer than two non-empty piles, so the game ends.
-
-
-
-
Constraints:
-
-
-
1 <= a, b, c <= 105
-
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[Math](../../tag/math/README.md)]
- [[Heap (Priority Queue)](../../tag/heap-priority-queue/README.md)]
-
-### Hints
-
-Hint 1
-It's optimal to always remove one stone from the biggest 2 piles
-
-
-
-Hint 2
-Note that the limits are small enough for simulation
-
diff --git a/problems/maximum-score-from-removing-substrings/README.md b/problems/maximum-score-from-removing-substrings/README.md
deleted file mode 100644
index 7fca866cd..000000000
--- a/problems/maximum-score-from-removing-substrings/README.md
+++ /dev/null
@@ -1,77 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../calculate-money-in-leetcode-bank "Calculate Money in Leetcode Bank")
-
-[Next >](../construct-the-lexicographically-largest-valid-sequence "Construct the Lexicographically Largest Valid Sequence")
-
-## [1717. Maximum Score From Removing Substrings (Medium)](https://leetcode.com/problems/maximum-score-from-removing-substrings "删除子字符串的最大得分")
-
-
You are given a string s and two integers x and y. You can perform two types of operations any number of times.
-
-
-
Remove substring "ab" and gain x points.
-
-
For example, when removing "ab" from "cabxbae" it becomes "cxbae".
-
-
-
Remove substring "ba" and gain y points.
-
-
For example, when removing "ba" from "cabxbae" it becomes "cabxe".
-
-
-
-
-
Return the maximum points you can gain after applying the above operations ons.
-
-
-
Example 1:
-
-
-Input: s = "cdbcbbaaabab", x = 4, y = 5
-Output: 19
-Explanation:
-- Remove the "ba" underlined in "cdbcbbaaabab". Now, s = "cdbcbbaaab" and 5 points are added to the score.
-- Remove the "ab" underlined in "cdbcbbaaab". Now, s = "cdbcbbaa" and 4 points are added to the score.
-- Remove the "ba" underlined in "cdbcbbaa". Now, s = "cdbcba" and 5 points are added to the score.
-- Remove the "ba" underlined in "cdbcba". Now, s = "cdbc" and 5 points are added to the score.
-Total score = 5 + 4 + 5 + 5 = 19.
-
-
Example 2:
-
-
-Input: s = "aabbaaxybbaabb", x = 5, y = 4
-Output: 20
-
-
-
-
Constraints:
-
-
-
1 <= s.length <= 105
-
1 <= x, y <= 104
-
s consists of lowercase English letters.
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
- [[Stack](../../tag/stack/README.md)]
- [[Greedy](../../tag/greedy/README.md)]
-
-### Similar Questions
- 1. [Count Words Obtained After Adding a Letter](../count-words-obtained-after-adding-a-letter) (Medium)
-
-### Hints
-
-Hint 1
-Note that it is always more optimal to take one type of substring before another
-
-
-
-Hint 2
-You can use a stack to handle erasures
-
diff --git a/problems/maximum-score-of-a-good-subarray/README.md b/problems/maximum-score-of-a-good-subarray/README.md
deleted file mode 100644
index 46c3d4d84..000000000
--- a/problems/maximum-score-of-a-good-subarray/README.md
+++ /dev/null
@@ -1,65 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-average-pass-ratio "Maximum Average Pass Ratio")
-
-[Next >](../count-pairs-of-equal-substrings-with-minimum-difference "Count Pairs of Equal Substrings With Minimum Difference")
-
-## [1793. Maximum Score of a Good Subarray (Hard)](https://leetcode.com/problems/maximum-score-of-a-good-subarray "好子数组的最大分数")
-
-
You are given an array of integers nums(0-indexed) and an integer k.
-
-
The score of a subarray (i, j) is defined as min(nums[i], nums[i+1], ..., nums[j]) * (j - i + 1). A good subarray is a subarray where i <= k <= j.
-
-
Return the maximum possible score of a good subarray.
-
-
-
Example 1:
-
-
-Input: nums = [1,4,3,7,4,5], k = 3
-Output: 15
-Explanation: The optimal subarray is (1, 5) with a score of min(4,3,7,4,5) * (5-1+1) = 3 * 5 = 15.
-
-
-
Example 2:
-
-
-Input: nums = [5,5,4,5,4,1,1,1], k = 0
-Output: 20
-Explanation: The optimal subarray is (0, 4) with a score of min(5,5,4,5,4) * (4-0+1) = 4 * 5 = 20.
-
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 105
-
1 <= nums[i] <= 2 * 104
-
0 <= k < nums.length
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Two Pointers](../../tag/two-pointers/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
- [[Stack](../../tag/stack/README.md)]
- [[Monotonic Stack](../../tag/monotonic-stack/README.md)]
-
-### Similar Questions
- 1. [Largest Rectangle in Histogram](../largest-rectangle-in-histogram) (Hard)
-
-### Hints
-
-Hint 1
-Try thinking about the prefix before index k and the suffix after index k as two separate arrays.
-
-
-
-Hint 2
-Using two pointers or binary search, we can find the maximum prefix of each array where the numbers are less than or equal to a certain value
-
diff --git a/problems/maximum-score-words-formed-by-letters/README.md b/problems/maximum-score-words-formed-by-letters/README.md
deleted file mode 100644
index f2d0288bb..000000000
--- a/problems/maximum-score-words-formed-by-letters/README.md
+++ /dev/null
@@ -1,77 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../number-of-closed-islands "Number of Closed Islands")
-
-[Next >](../encode-number "Encode Number")
-
-## [1255. Maximum Score Words Formed by Letters (Hard)](https://leetcode.com/problems/maximum-score-words-formed-by-letters "得分最高的单词集合")
-
-
Given a list of words, list of single letters (might be repeating) and score of every character.
-
-
Return the maximum score of any valid set of words formed by using the given letters (words[i] cannot be used two or more times).
-
-
It is not necessary to use all characters in letters and each letter can only be used once. Score of letters 'a', 'b', 'c', ... ,'z' is given by score[0], score[1], ... , score[25] respectively.
-
-
-
Example 1:
-
-
-Input: words = ["dog","cat","dad","good"], letters = ["a","a","c","d","d","d","g","o","o"], score = [1,0,9,5,0,0,3,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0]
-Output: 23
-Explanation:
-Score a=1, c=9, d=5, g=3, o=2
-Given letters, we can form the words "dad" (5+1+5) and "good" (3+2+2+5) with a score of 23.
-Words "dad" and "dog" only get a score of 21.
-
-
Example 2:
-
-
-Input: words = ["xxxz","ax","bx","cx"], letters = ["z","a","b","c","x","x","x"], score = [4,4,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,10]
-Output: 27
-Explanation:
-Score a=4, b=4, c=4, x=5, z=10
-Given letters, we can form the words "ax" (4+5), "bx" (4+5) and "cx" (4+5) with a score of 27.
-Word "xxxz" only get a score of 25.
-
-
Example 3:
-
-
-Input: words = ["leetcode"], letters = ["l","e","t","c","o","d"], score = [0,0,1,1,1,0,0,0,0,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,0,0]
-Output: 0
-Explanation:
-Letter "e" can only be used once.
-
-
-
Constraints:
-
-
-
1 <= words.length <= 14
-
1 <= words[i].length <= 15
-
1 <= letters.length <= 100
-
letters[i].length == 1
-
score.length == 26
-
0 <= score[i] <= 10
-
words[i], letters[i] contains only lower case English letters.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[String](../../tag/string/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Backtracking](../../tag/backtracking/README.md)]
- [[Bit Manipulation](../../tag/bit-manipulation/README.md)]
- [[Bitmask](../../tag/bitmask/README.md)]
-
-### Similar Questions
- 1. [Maximum Good People Based on Statements](../maximum-good-people-based-on-statements) (Hard)
-
-### Hints
-
-Hint 1
-Note that words.length is small. This means you can iterate over every subset of words (2^N).
-
diff --git a/problems/maximum-side-length-of-a-square-with-sum-less-than-or-equal-to-threshold/README.md b/problems/maximum-side-length-of-a-square-with-sum-less-than-or-equal-to-threshold/README.md
deleted file mode 100644
index 96e80a8cc..000000000
--- a/problems/maximum-side-length-of-a-square-with-sum-less-than-or-equal-to-threshold/README.md
+++ /dev/null
@@ -1,77 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../sequential-digits "Sequential Digits")
-
-[Next >](../shortest-path-in-a-grid-with-obstacles-elimination "Shortest Path in a Grid with Obstacles Elimination")
-
-## [1292. Maximum Side Length of a Square with Sum Less than or Equal to Threshold (Medium)](https://leetcode.com/problems/maximum-side-length-of-a-square-with-sum-less-than-or-equal-to-threshold "元素和小于等于阈值的正方形的最大边长")
-
-
Given a m x n matrix mat and an integer threshold. Return the maximum side-length of a square with a sum less than or equal to threshold or return 0 if there is no such square.
-
-
-
Example 1:
-
-
-Input: mat = [[1,1,3,2,4,3,2],[1,1,3,2,4,3,2],[1,1,3,2,4,3,2]], threshold = 4
-Output: 2
-Explanation: The maximum side length of square with sum less than 4 is 2 as shown.
-
-
-
Example 2:
-
-
-Input: mat = [[2,2,2,2,2],[2,2,2,2,2],[2,2,2,2,2],[2,2,2,2,2],[2,2,2,2,2]], threshold = 1
-Output: 0
-
-
-
Example 3:
-
-
-Input: mat = [[1,1,1,1],[1,0,0,0],[1,0,0,0],[1,0,0,0]], threshold = 6
-Output: 3
-
-
-
Example 4:
-
-
-Input: mat = [[18,70],[61,1],[25,85],[14,40],[11,96],[97,96],[63,45]], threshold = 40184
-Output: 2
-
-
-
-
Constraints:
-
-
-
1 <= m, n <= 300
-
m == mat.length
-
n == mat[i].length
-
0 <= mat[i][j] <= 10000
-
0 <= threshold <= 10^5
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
- [[Prefix Sum](../../tag/prefix-sum/README.md)]
-
-### Hints
-
-Hint 1
-Store prefix sum of all grids in another 2D array.
-
-
-
-Hint 2
-Try all possible solutions and if you cannot find one return -1.
-
-
-
-Hint 3
-If x is a valid answer then any y < x is also valid answer. Use binary search to find answer.
-
diff --git a/problems/maximum-size-subarray-sum-equals-k/README.md b/problems/maximum-size-subarray-sum-equals-k/README.md
deleted file mode 100644
index 0a84dae57..000000000
--- a/problems/maximum-size-subarray-sum-equals-k/README.md
+++ /dev/null
@@ -1,61 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../wiggle-sort-ii "Wiggle Sort II")
-
-[Next >](../power-of-three "Power of Three")
-
-## [325. Maximum Size Subarray Sum Equals k (Medium)](https://leetcode.com/problems/maximum-size-subarray-sum-equals-k "和等于 k 的最长子数组长度")
-
-
Given an array nums and a target value k, find the maximum length of a subarray that sums to k. If there isn't one, return 0 instead.
-
-
Note:
-The sum of the entire nums array is guaranteed to fit within the 32-bit signed integer range.
-
-
Example 1:
-
-
-Input: nums = [1, -1, 5, -2, 3], k = 3
-Output: 4
-Explanation: The subarray [1, -1, 5, -2] sums to 3 and is the longest.
-
-
-
Example 2:
-
-
-Input: nums = [-2, -1, 2, 1], k = 1
-Output: 2
-Explanation: The subarray [-1, 2] sums to 1 and is the longest.
-
-
Follow Up:
-Can you do it in O(n) time?
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
-
-### Similar Questions
- 1. [Minimum Size Subarray Sum](../minimum-size-subarray-sum) (Medium)
- 1. [Range Sum Query - Immutable](../range-sum-query-immutable) (Easy)
- 1. [Contiguous Array](../contiguous-array) (Medium)
- 1. [Subarray Product Less Than K](../subarray-product-less-than-k) (Medium)
-
-### Hints
-
-Hint 1
-Try to compute a sum of a subsequence very fast, i.e in O(1) … Think of prefix sum array.
-
-
-
-Hint 2
-Given S[i] a partial sum that starts at position 0 and ends at i, what can S[i - k] tell you ?
-
-
-
-Hint 3
-Use HashMap + prefix sum array.
-
diff --git a/problems/maximum-size-subarray-sum-equals-k/maximum_size_subarray_sum_equals_k.go b/problems/maximum-size-subarray-sum-equals-k/maximum_size_subarray_sum_equals_k.go
deleted file mode 100644
index 8ee420ff0..000000000
--- a/problems/maximum-size-subarray-sum-equals-k/maximum_size_subarray_sum_equals_k.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem325
diff --git a/problems/maximum-size-subarray-sum-equals-k/maximum_size_subarray_sum_equals_k_test.go b/problems/maximum-size-subarray-sum-equals-k/maximum_size_subarray_sum_equals_k_test.go
deleted file mode 100644
index 8ee420ff0..000000000
--- a/problems/maximum-size-subarray-sum-equals-k/maximum_size_subarray_sum_equals_k_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem325
diff --git a/problems/maximum-students-taking-exam/README.md b/problems/maximum-students-taking-exam/README.md
deleted file mode 100644
index 5b38f2519..000000000
--- a/problems/maximum-students-taking-exam/README.md
+++ /dev/null
@@ -1,83 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../tweet-counts-per-frequency "Tweet Counts Per Frequency")
-
-[Next >](../students-with-invalid-departments "Students With Invalid Departments")
-
-## [1349. Maximum Students Taking Exam (Hard)](https://leetcode.com/problems/maximum-students-taking-exam "参加考试的最大学生数")
-
-
Given a m * n matrix seats that represent seats distributions in a classroom. If a seat is broken, it is denoted by '#' character otherwise it is denoted by a '.' character.
-
-
Students can see the answers of those sitting next to the left, right, upper left and upper right, but he cannot see the answers of the student sitting directly in front or behind him. Return the maximum number of students that can take the exam together without any cheating being possible..
-
-
Students must be placed in seats in good condition.
-
-
-
Example 1:
-
-
-Input: seats = [["#",".","#","#",".","#"],
- [".","#","#","#","#","."],
- ["#",".","#","#",".","#"]]
-Output: 4
-Explanation: Teacher can place 4 students in available seats so they don't cheat on the exam.
-
-
-
Example 2:
-
-
-Input: seats = [[".","#"],
- ["#","#"],
- ["#","."],
- ["#","#"],
- [".","#"]]
-Output: 3
-Explanation: Place all students in available seats.
-
-
-
-
Example 3:
-
-
-Input: seats = [["#",".",".",".","#"],
- [".","#",".","#","."],
- [".",".","#",".","."],
- [".","#",".","#","."],
- ["#",".",".",".","#"]]
-Output: 10
-Explanation: Place students in available seats in column 1, 3 and 5.
-
-
-
-
Constraints:
-
-
-
seats contains only characters '.' and'#'.
-
m == seats.length
-
n == seats[i].length
-
1 <= m <= 8
-
1 <= n <= 8
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Bit Manipulation](../../tag/bit-manipulation/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
- [[Bitmask](../../tag/bitmask/README.md)]
-
-### Hints
-
-Hint 1
-Students in row i only can see exams in row i+1.
-
-
-
-Hint 2
-Use Dynamic programming to compute the result given a (current row, bitmask people seated in previous row).
-
diff --git a/problems/maximum-subarray-min-product/README.md b/problems/maximum-subarray-min-product/README.md
deleted file mode 100644
index 79aac2c47..000000000
--- a/problems/maximum-subarray-min-product/README.md
+++ /dev/null
@@ -1,77 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-distance-between-a-pair-of-values "Maximum Distance Between a Pair of Values")
-
-[Next >](../largest-color-value-in-a-directed-graph "Largest Color Value in a Directed Graph")
-
-## [1856. Maximum Subarray Min-Product (Medium)](https://leetcode.com/problems/maximum-subarray-min-product "子数组最小乘积的最大值")
-
-
The min-product of an array is equal to the minimum value in the array multiplied by the array's sum.
-
-
-
For example, the array [3,2,5] (minimum value is 2) has a min-product of 2 * (3+2+5) = 2 * 10 = 20.
-
-
-
Given an array of integers nums, return the maximum min-product of any non-empty subarray of nums. Since the answer may be large, return it modulo109 + 7.
-
-
Note that the min-product should be maximized before performing the modulo operation. Testcases are generated such that the maximum min-product without modulo will fit in a 64-bit signed integer.
-
-
A subarray is a contiguous part of an array.
-
-
-
Example 1:
-
-
-Input: nums = [1,2,3,2]
-Output: 14
-Explanation: The maximum min-product is achieved with the subarray [2,3,2] (minimum value is 2).
-2 * (2+3+2) = 2 * 7 = 14.
-
-
-
Example 2:
-
-
-Input: nums = [2,3,3,1,2]
-Output: 18
-Explanation: The maximum min-product is achieved with the subarray [3,3] (minimum value is 3).
-3 * (3+3) = 3 * 6 = 18.
-
-
-
Example 3:
-
-
-Input: nums = [3,1,5,6,4,2]
-Output: 60
-Explanation: The maximum min-product is achieved with the subarray [5,6,4] (minimum value is 4).
-4 * (5+6+4) = 4 * 15 = 60.
-
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 105
-
1 <= nums[i] <= 107
-
-
-### Related Topics
- [[Stack](../../tag/stack/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Prefix Sum](../../tag/prefix-sum/README.md)]
- [[Monotonic Stack](../../tag/monotonic-stack/README.md)]
-
-### Hints
-
-Hint 1
-Is there a way we can sort the elements to simplify the problem?
-
-
-
-Hint 2
-Can we find the maximum min-product for every value in the array?
-
diff --git a/problems/maximum-subarray-sum-after-one-operation/README.md b/problems/maximum-subarray-sum-after-one-operation/README.md
deleted file mode 100644
index 152758454..000000000
--- a/problems/maximum-subarray-sum-after-one-operation/README.md
+++ /dev/null
@@ -1,34 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../palindrome-partitioning-iv "Palindrome Partitioning IV")
-
-[Next >](../leetflex-banned-accounts "Leetflex Banned Accounts")
-
-## [1746. Maximum Subarray Sum After One Operation (Medium)](https://leetcode.com/problems/maximum-subarray-sum-after-one-operation "经过一次操作后的最大子数组和")
-
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Hints
-
-Hint 1
-Think about dynamic programming
-
-
-
-Hint 2
-Define an array dp[nums.length][2], where dp[i][0] is the max subarray sum including nums[i] and without squaring any element.
-
-
-
-Hint 3
-dp[i][1] is the max subarray sum including nums[i] and having only one element squared.
-
diff --git a/problems/maximum-subarray-sum-with-one-deletion/README.md b/problems/maximum-subarray-sum-with-one-deletion/README.md
deleted file mode 100644
index 3e76e709f..000000000
--- a/problems/maximum-subarray-sum-with-one-deletion/README.md
+++ /dev/null
@@ -1,68 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../day-of-the-week "Day of the Week")
-
-[Next >](../make-array-strictly-increasing "Make Array Strictly Increasing")
-
-## [1186. Maximum Subarray Sum with One Deletion (Medium)](https://leetcode.com/problems/maximum-subarray-sum-with-one-deletion "删除一次得到子数组最大和")
-
-
Given an array of integers, return the maximum sum for a non-empty subarray (contiguous elements) with at most one element deletion. In other words, you want to choose a subarray and optionally delete one element from it so that there is still at least one element left and the sum of the remaining elements is maximum possible.
-
-
Note that the subarray needs to be non-empty after deleting one element.
-
-
-
Example 1:
-
-
-Input: arr = [1,-2,0,3]
-Output: 4
-Explanation: Because we can choose [1, -2, 0, 3] and drop -2, thus the subarray [1, 0, 3] becomes the maximum value.
-
-
Example 2:
-
-
-Input: arr = [1,-2,-2,3]
-Output: 3
-Explanation: We just choose [3] and it's the maximum sum.
-
-
-
Example 3:
-
-
-Input: arr = [-1,-1,-1,-1]
-Output: -1
-Explanation: The final subarray needs to be non-empty. You can't choose [-1] and delete -1 from it, then get an empty subarray to make the sum equals to 0.
-
-
-
-
Constraints:
-
-
-
1 <= arr.length <= 105
-
-104 <= arr[i] <= 104
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Hints
-
-Hint 1
-How to solve this problem if no deletions are allowed ?
-
-
-
-Hint 2
-Try deleting each element and find the maximum subarray sum to both sides of that element.
-
-
-
-Hint 3
-To do that efficiently, use the idea of Kadane's algorithm.
-
diff --git a/problems/maximum-subarray/README.md b/problems/maximum-subarray/README.md
deleted file mode 100644
index 39cdbb54e..000000000
--- a/problems/maximum-subarray/README.md
+++ /dev/null
@@ -1,61 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../n-queens-ii "N-Queens II")
-
-[Next >](../spiral-matrix "Spiral Matrix")
-
-## [53. Maximum Subarray (Easy)](https://leetcode.com/problems/maximum-subarray "最大子序和")
-
-
Given an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and return its sum.
-
-
A subarray is a contiguous part of an array.
-
-
-
Example 1:
-
-
-Input: nums = [-2,1,-3,4,-1,2,1,-5,4]
-Output: 6
-Explanation: [4,-1,2,1] has the largest sum = 6.
-
-
-
Example 2:
-
-
-Input: nums = [1]
-Output: 1
-
-
-
Example 3:
-
-
-Input: nums = [5,4,-1,7,8]
-Output: 23
-
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 105
-
-104 <= nums[i] <= 104
-
-
-
-
Follow up: If you have figured out the O(n) solution, try coding another solution using the divide and conquer approach, which is more subtle.
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Divide and Conquer](../../tag/divide-and-conquer/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Similar Questions
- 1. [Best Time to Buy and Sell Stock](../best-time-to-buy-and-sell-stock) (Easy)
- 1. [Maximum Product Subarray](../maximum-product-subarray) (Medium)
- 1. [Degree of an Array](../degree-of-an-array) (Easy)
- 1. [Longest Turbulent Subarray](../longest-turbulent-subarray) (Medium)
diff --git a/problems/maximum-subarray/maximum_subarray.go b/problems/maximum-subarray/maximum_subarray.go
deleted file mode 100644
index 0557af338..000000000
--- a/problems/maximum-subarray/maximum_subarray.go
+++ /dev/null
@@ -1,16 +0,0 @@
-package problem53
-
-func maxSubArray(nums []int) int {
- max, current, l := nums[0], nums[0], len(nums)
- for i := 1; i < l; i++ {
- if current > 0 {
- current += nums[i]
- } else {
- current = nums[i]
- }
- if current > max {
- max = current
- }
- }
- return max
-}
diff --git a/problems/maximum-subarray/maximum_subarray_test.go b/problems/maximum-subarray/maximum_subarray_test.go
deleted file mode 100644
index d57167732..000000000
--- a/problems/maximum-subarray/maximum_subarray_test.go
+++ /dev/null
@@ -1,23 +0,0 @@
-package problem53
-
-import "testing"
-
-type testType struct {
- in []int
- want int
-}
-
-func TestMaxSubArray(t *testing.T) {
- tests := [...]testType{
- {
- in: []int{-2, 1, -3, 4, -1, 2, 1, -5, 4},
- want: 6,
- },
- }
- for _, tt := range tests {
- got := maxSubArray(tt.in)
- if got != tt.want {
- t.Fatalf("in: %v, got: %v, want: %v", tt.in, got, tt.want)
- }
- }
-}
diff --git a/problems/maximum-sum-bst-in-binary-tree/README.md b/problems/maximum-sum-bst-in-binary-tree/README.md
deleted file mode 100644
index 2cdd3f82f..000000000
--- a/problems/maximum-sum-bst-in-binary-tree/README.md
+++ /dev/null
@@ -1,77 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../longest-zigzag-path-in-a-binary-tree "Longest ZigZag Path in a Binary Tree")
-
-[Next >](../generate-a-string-with-characters-that-have-odd-counts "Generate a String With Characters That Have Odd Counts")
-
-## [1373. Maximum Sum BST in Binary Tree (Hard)](https://leetcode.com/problems/maximum-sum-bst-in-binary-tree "二叉搜索子树的最大键值和")
-
-
Given a binary treeroot, return the maximum sum of all keys of any sub-tree which is also a Binary Search Tree (BST).
-
-
Assume a BST is defined as follows:
-
-
-
The left subtree of a node contains only nodes with keys less than the node's key.
-
The right subtree of a node contains only nodes with keys greater than the node's key.
-
Both the left and right subtrees must also be binary search trees.
-
-
-
-
Example 1:
-
-
-
-
-Input: root = [1,4,3,2,4,2,5,null,null,null,null,null,null,4,6]
-Output: 20
-Explanation: Maximum sum in a valid Binary search tree is obtained in root node with key equal to 3.
-
-
-
Example 2:
-
-
-
-
-Input: root = [4,3,null,1,2]
-Output: 2
-Explanation: Maximum sum in a valid Binary search tree is obtained in a single root node with key equal to 2.
-
-
-
Example 3:
-
-
-Input: root = [-4,-2,-5]
-Output: 0
-Explanation: All values are negatives. Return an empty BST.
-
-
-
-
Constraints:
-
-
-
The number of nodes in the tree is in the range [1, 4 * 104].
-
-4 * 104 <= Node.val <= 4 * 104
-
-
-### Related Topics
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Tree](../../tag/tree/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Binary Search Tree](../../tag/binary-search-tree/README.md)]
- [[Binary Tree](../../tag/binary-tree/README.md)]
-
-### Hints
-
-Hint 1
-Create a datastructure with 4 parameters: (sum, isBST, maxLeft, minLeft).
-
-
-
-Hint 2
-In each node compute theses parameters, following the conditions of a Binary Search Tree.
-
diff --git a/problems/maximum-sum-circular-subarray/README.md b/problems/maximum-sum-circular-subarray/README.md
deleted file mode 100644
index 278c2fad3..000000000
--- a/problems/maximum-sum-circular-subarray/README.md
+++ /dev/null
@@ -1,95 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../reverse-only-letters "Reverse Only Letters")
-
-[Next >](../complete-binary-tree-inserter "Complete Binary Tree Inserter")
-
-## [918. Maximum Sum Circular Subarray (Medium)](https://leetcode.com/problems/maximum-sum-circular-subarray "环形子数组的最大和")
-
-
Given a circular integer arraynums of length n, return the maximum possible sum of a non-empty subarray of nums.
-
-
A circular array means the end of the array connects to the beginning of the array. Formally, the next element of nums[i] is nums[(i + 1) % n] and the previous element of nums[i] is nums[(i - 1 + n) % n].
-
-
A subarray may only include each element of the fixed buffer nums at most once. Formally, for a subarray nums[i], nums[i + 1], ..., nums[j], there does not exist i <= k1, k2 <= j with k1 % n == k2 % n.
-
-
-
Example 1:
-
-
-Input: nums = [1,-2,3,-2]
-Output: 3
-Explanation: Subarray [3] has maximum sum 3
-
-
-
Example 2:
-
-
-Input: nums = [5,-3,5]
-Output: 10
-Explanation: Subarray [5,5] has maximum sum 5 + 5 = 10
-
-
-
Example 3:
-
-
-Input: nums = [3,-1,2,-1]
-Output: 4
-Explanation: Subarray [2,-1,3] has maximum sum 2 + (-1) + 3 = 4
-
-
-
Example 4:
-
-
-Input: nums = [3,-2,2,-3]
-Output: 3
-Explanation: Subarray [3] and [3,-2,2] both have maximum sum 3
-
-
-
Example 5:
-
-
-Input: nums = [-2,-3,-1]
-Output: -1
-Explanation: Subarray [-1] has maximum sum -1
-
-
-
-
Constraints:
-
-
-
n == nums.length
-
1 <= n <= 3 * 104
-
-3 * 104 <= nums[i] <= 3 * 104
-
-
-### Related Topics
- [[Queue](../../tag/queue/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Divide and Conquer](../../tag/divide-and-conquer/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Monotonic Queue](../../tag/monotonic-queue/README.md)]
-
-### Hints
-
-Hint 1
-For those of you who are familiar with the Kadane's algorithm, think in terms of that. For the newbies, Kadane's algorithm is used to finding the maximum sum subarray from a given array. This problem is a twist on that idea and it is advisable to read up on that algorithm first before starting this problem. Unless you already have a great algorithm brewing up in your mind in which case, go right ahead!
-
-
-
-Hint 2
-What is an alternate way of representing a circular array so that it appears to be a straight array?
-Essentially, there are two cases of this problem that we need to take care of. Let's look at the figure below to understand those two cases:
-
-
-
-
-
-
-Hint 3
-The first case can be handled by the good old Kadane's algorithm. However, is there a smarter way of going about handling the second case as well?
-
diff --git a/problems/maximum-sum-circular-subarray/maximum_sum_circular_subarray.go b/problems/maximum-sum-circular-subarray/maximum_sum_circular_subarray.go
deleted file mode 100644
index 626f29fe9..000000000
--- a/problems/maximum-sum-circular-subarray/maximum_sum_circular_subarray.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem918
diff --git a/problems/maximum-sum-circular-subarray/maximum_sum_circular_subarray_test.go b/problems/maximum-sum-circular-subarray/maximum_sum_circular_subarray_test.go
deleted file mode 100644
index 626f29fe9..000000000
--- a/problems/maximum-sum-circular-subarray/maximum_sum_circular_subarray_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem918
diff --git a/problems/maximum-sum-obtained-of-any-permutation/README.md b/problems/maximum-sum-obtained-of-any-permutation/README.md
deleted file mode 100644
index a1d9a7bbb..000000000
--- a/problems/maximum-sum-obtained-of-any-permutation/README.md
+++ /dev/null
@@ -1,72 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../sum-of-all-odd-length-subarrays "Sum of All Odd Length Subarrays")
-
-[Next >](../make-sum-divisible-by-p "Make Sum Divisible by P")
-
-## [1589. Maximum Sum Obtained of Any Permutation (Medium)](https://leetcode.com/problems/maximum-sum-obtained-of-any-permutation "所有排列中的最大和")
-
-
We have an array of integers, nums, and an array of requests where requests[i] = [starti, endi]. The ith request asks for the sum of nums[starti] + nums[starti + 1] + ... + nums[endi - 1] + nums[endi]. Both starti and endi are 0-indexed.
-
-
Return the maximum total sum of all requests among all permutations ofnums.
-
-
Since the answer may be too large, return it modulo109 + 7.
-
-
-
Example 1:
-
-
-Input: nums = [1,2,3,4,5], requests = [[1,3],[0,1]]
-Output: 19
-Explanation: One permutation of nums is [2,1,3,4,5] with the following result:
-requests[0] -> nums[1] + nums[2] + nums[3] = 1 + 3 + 4 = 8
-requests[1] -> nums[0] + nums[1] = 2 + 1 = 3
-Total sum: 8 + 3 = 11.
-A permutation with a higher total sum is [3,5,4,2,1] with the following result:
-requests[0] -> nums[1] + nums[2] + nums[3] = 5 + 4 + 2 = 11
-requests[1] -> nums[0] + nums[1] = 3 + 5 = 8
-Total sum: 11 + 8 = 19, which is the best that you can do.
-
-
-
Example 2:
-
-
-Input: nums = [1,2,3,4,5,6], requests = [[0,1]]
-Output: 11
-Explanation: A permutation with the max total sum is [6,5,4,3,2,1] with request sums [11].
-
-
Example 3:
-
-
-Input: nums = [1,2,3,4,5,10], requests = [[0,2],[1,3],[1,1]]
-Output: 47
-Explanation: A permutation with the max total sum is [4,10,5,3,2,1] with request sums [19,18,10].
-
-
-
Constraints:
-
-
-
n == nums.length
-
1 <= n <= 105
-
0 <= nums[i] <= 105
-
1 <= requests.length <= 105
-
requests[i].length == 2
-
0 <= starti <= endi < n
-
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Prefix Sum](../../tag/prefix-sum/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Hints
-
-Hint 1
-Indexes with higher frequencies should be bound with larger values
-
diff --git a/problems/maximum-sum-of-3-non-overlapping-subarrays/README.md b/problems/maximum-sum-of-3-non-overlapping-subarrays/README.md
deleted file mode 100644
index f29094169..000000000
--- a/problems/maximum-sum-of-3-non-overlapping-subarrays/README.md
+++ /dev/null
@@ -1,49 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../knight-probability-in-chessboard "Knight Probability in Chessboard")
-
-[Next >](../employee-importance "Employee Importance")
-
-## [689. Maximum Sum of 3 Non-Overlapping Subarrays (Hard)](https://leetcode.com/problems/maximum-sum-of-3-non-overlapping-subarrays "三个无重叠子数组的最大和")
-
-
Given an integer array nums and an integer k, find three non-overlapping subarrays of length k with maximum sum and return them.
-
-
Return the result as a list of indices representing the starting position of each interval (0-indexed). If there are multiple answers, return the lexicographically smallest one.
-
-
-
Example 1:
-
-
-Input: nums = [1,2,1,2,6,7,5,1], k = 2
-Output: [0,3,5]
-Explanation: Subarrays [1, 2], [2, 6], [7, 5] correspond to the starting indices [0, 3, 5].
-We could have also taken [2, 1], but an answer of [1, 3, 5] would be lexicographically larger.
-
-
-
Example 2:
-
-
-Input: nums = [1,2,1,2,1,2,1,2,1], k = 2
-Output: [0,2,4]
-
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 2 * 104
-
1 <= nums[i] < 216
-
1 <= k <= floor(nums.length / 3)
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Similar Questions
- 1. [Best Time to Buy and Sell Stock III](../best-time-to-buy-and-sell-stock-iii) (Hard)
diff --git a/problems/maximum-sum-of-3-non-overlapping-subarrays/maximum_sum_of_3_non_overlapping_subarrays.go b/problems/maximum-sum-of-3-non-overlapping-subarrays/maximum_sum_of_3_non_overlapping_subarrays.go
deleted file mode 100644
index d8e95c634..000000000
--- a/problems/maximum-sum-of-3-non-overlapping-subarrays/maximum_sum_of_3_non_overlapping_subarrays.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem689
diff --git a/problems/maximum-sum-of-3-non-overlapping-subarrays/maximum_sum_of_3_non_overlapping_subarrays_test.go b/problems/maximum-sum-of-3-non-overlapping-subarrays/maximum_sum_of_3_non_overlapping_subarrays_test.go
deleted file mode 100644
index d8e95c634..000000000
--- a/problems/maximum-sum-of-3-non-overlapping-subarrays/maximum_sum_of_3_non_overlapping_subarrays_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem689
diff --git a/problems/maximum-sum-of-two-non-overlapping-subarrays/README.md b/problems/maximum-sum-of-two-non-overlapping-subarrays/README.md
deleted file mode 100644
index b82d688ab..000000000
--- a/problems/maximum-sum-of-two-non-overlapping-subarrays/README.md
+++ /dev/null
@@ -1,65 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../matrix-cells-in-distance-order "Matrix Cells in Distance Order")
-
-[Next >](../stream-of-characters "Stream of Characters")
-
-## [1031. Maximum Sum of Two Non-Overlapping Subarrays (Medium)](https://leetcode.com/problems/maximum-sum-of-two-non-overlapping-subarrays "两个非重叠子数组的最大和")
-
-
Given an integer array nums and two integers firstLen and secondLen, return the maximum sum of elements in two non-overlapping subarrays with lengths firstLen and secondLen.
-
-
The array with length firstLen could occur before or after the array with length secondLen, but they have to be non-overlapping.
-
-
A subarray is a contiguous part of an array.
-
-
-
Example 1:
-
-
-Input: nums = [0,6,5,2,2,5,1,9,4], firstLen = 1, secondLen = 2
-Output: 20
-Explanation: One choice of subarrays is [9] with length 1, and [6,5] with length 2.
-
-
-
Example 2:
-
-
-Input: nums = [3,8,1,3,2,1,8,9,0], firstLen = 3, secondLen = 2
-Output: 29
-Explanation: One choice of subarrays is [3,8,1] with length 3, and [8,9] with length 2.
-
-
-
Example 3:
-
-
-Input: nums = [2,1,5,6,0,9,5,0,3,8], firstLen = 4, secondLen = 3
-Output: 31
-Explanation: One choice of subarrays is [5,6,0,9] with length 4, and [3,8] with length 3.
-
-
-
-
Constraints:
-
-
-
1 <= firstLen, secondLen <= 1000
-
2 <= firstLen + secondLen <= 1000
-
firstLen + secondLen <= nums.length <= 1000
-
0 <= nums[i] <= 1000
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Sliding Window](../../tag/sliding-window/README.md)]
-
-### Hints
-
-Hint 1
-We can use prefix sums to calculate any subarray sum quickly.
-For each L length subarray, find the best possible M length subarray that occurs before and after it.
-
diff --git a/problems/maximum-sum-of-two-non-overlapping-subarrays/maximum_sum_of_two_non_overlapping_subarrays.go b/problems/maximum-sum-of-two-non-overlapping-subarrays/maximum_sum_of_two_non_overlapping_subarrays.go
deleted file mode 100644
index 64abd8116..000000000
--- a/problems/maximum-sum-of-two-non-overlapping-subarrays/maximum_sum_of_two_non_overlapping_subarrays.go
+++ /dev/null
@@ -1,25 +0,0 @@
-package problem1031
-
-func maxSumTwoNoOverlap(A []int, L int, M int) int {
- for i := 1; i < len(A); i++ {
- A[i] += A[i-1]
- }
- // assume original A is A'
- // now, A[i] = sum(A'[:i+1])
- res, lMax, mMax := A[L+M-1], A[L-1], A[M-1]
- for i := L + M; i < len(A); i++ {
- // lMax is max sum of contiguous L elements before the last M elements.
- lMax = max(lMax, A[i-M]-A[i-L-M])
- // mMax is max sum of contiguous M elements before the last L elements.
- mMax = max(mMax, A[i-L]-A[i-L-M])
- res = max(res, max(lMax+A[i]-A[i-M], mMax+A[i]-A[i-L]))
- }
- return res
-}
-
-func max(a, b int) int {
- if a > b {
- return a
- }
- return b
-}
diff --git a/problems/maximum-swap/README.md b/problems/maximum-swap/README.md
deleted file mode 100644
index 5e5f6da0c..000000000
--- a/problems/maximum-swap/README.md
+++ /dev/null
@@ -1,47 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../trim-a-binary-search-tree "Trim a Binary Search Tree")
-
-[Next >](../second-minimum-node-in-a-binary-tree "Second Minimum Node In a Binary Tree")
-
-## [670. Maximum Swap (Medium)](https://leetcode.com/problems/maximum-swap "最大交换")
-
-
You are given an integer num. You can swap two digits at most once to get the maximum valued number.
-
-
Return the maximum valued number you can get.
-
-
-
Example 1:
-
-
-Input: num = 2736
-Output: 7236
-Explanation: Swap the number 2 and the number 7.
-
-
-
Example 2:
-
-
-Input: num = 9973
-Output: 9973
-Explanation: No swap.
-
-
-
-
Constraints:
-
-
-
0 <= num <= 108
-
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[Math](../../tag/math/README.md)]
-
-### Similar Questions
- 1. [Create Maximum Number](../create-maximum-number) (Hard)
diff --git a/problems/maximum-swap/maximum_swap.go b/problems/maximum-swap/maximum_swap.go
deleted file mode 100644
index 231cc862c..000000000
--- a/problems/maximum-swap/maximum_swap.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem670
diff --git a/problems/maximum-swap/maximum_swap_test.go b/problems/maximum-swap/maximum_swap_test.go
deleted file mode 100644
index 231cc862c..000000000
--- a/problems/maximum-swap/maximum_swap_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem670
diff --git a/problems/maximum-transaction-each-day/README.md b/problems/maximum-transaction-each-day/README.md
deleted file mode 100644
index 977486d49..000000000
--- a/problems/maximum-transaction-each-day/README.md
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-number-of-operations-to-make-string-sorted "Minimum Number of Operations to Make String Sorted")
-
-[Next >](../check-if-the-sentence-is-pangram "Check if the Sentence Is Pangram")
-
-## [1831. Maximum Transaction Each Day (Medium)](https://leetcode.com/problems/maximum-transaction-each-day "每天的最大交易")
-
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/maximum-transaction-each-day/mysql_schemas.sql b/problems/maximum-transaction-each-day/mysql_schemas.sql
deleted file mode 100644
index db8df0ca0..000000000
--- a/problems/maximum-transaction-each-day/mysql_schemas.sql
+++ /dev/null
@@ -1,7 +0,0 @@
-Create table If Not Exists Transactions (transaction_id int, day datetime, amount int);
-Truncate table Transactions;
-insert into Transactions (transaction_id, day, amount) values ('8', '2021-4-3 15:57:28', '57');
-insert into Transactions (transaction_id, day, amount) values ('9', '2021-4-28 08:47:25', '21');
-insert into Transactions (transaction_id, day, amount) values ('1', '2021-4-29 13:28:30', '58');
-insert into Transactions (transaction_id, day, amount) values ('5', '2021-4-28 16:39:59', '40');
-insert into Transactions (transaction_id, day, amount) values ('6', '2021-4-29 23:39:28', '58');
diff --git a/problems/maximum-twin-sum-of-a-linked-list/README.md b/problems/maximum-twin-sum-of-a-linked-list/README.md
deleted file mode 100644
index 03df5b91f..000000000
--- a/problems/maximum-twin-sum-of-a-linked-list/README.md
+++ /dev/null
@@ -1,89 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../capitalize-the-title "Capitalize the Title")
-
-[Next >](../longest-palindrome-by-concatenating-two-letter-words "Longest Palindrome by Concatenating Two Letter Words")
-
-## [2130. Maximum Twin Sum of a Linked List (Medium)](https://leetcode.com/problems/maximum-twin-sum-of-a-linked-list "链表最大孪生和")
-
-
In a linked list of size n, where n is even, the ith node (0-indexed) of the linked list is known as the twin of the (n-1-i)th node, if 0 <= i <= (n / 2) - 1.
-
-
-
For example, if n = 4, then node 0 is the twin of node 3, and node 1 is the twin of node 2. These are the only nodes with twins for n = 4.
-
-
-
The twin sum is defined as the sum of a node and its twin.
-
-
Given the head of a linked list with even length, return the maximum twin sum of the linked list.
-
-
-
Example 1:
-
-
-Input: head = [5,4,2,1]
-Output: 6
-Explanation:
-Nodes 0 and 1 are the twins of nodes 3 and 2, respectively. All have twin sum = 6.
-There are no other nodes with twins in the linked list.
-Thus, the maximum twin sum of the linked list is 6.
-
-
-
Example 2:
-
-
-Input: head = [4,2,2,3]
-Output: 7
-Explanation:
-The nodes with twins present in this linked list are:
-- Node 0 is the twin of node 3 having a twin sum of 4 + 3 = 7.
-- Node 1 is the twin of node 2 having a twin sum of 2 + 2 = 4.
-Thus, the maximum twin sum of the linked list is max(7, 4) = 7.
-
-
-
Example 3:
-
-
-Input: head = [1,100000]
-Output: 100001
-Explanation:
-There is only one node with a twin in the linked list having twin sum of 1 + 100000 = 100001.
-
-
-
-
Constraints:
-
-
-
The number of nodes in the list is an even integer in the range [2, 105].
-
1 <= Node.val <= 105
-
-
-### Related Topics
- [[Stack](../../tag/stack/README.md)]
- [[Linked List](../../tag/linked-list/README.md)]
- [[Two Pointers](../../tag/two-pointers/README.md)]
-
-### Hints
-
-Hint 1
-How can "reversing" a part of the linked list help find the answer?
-
-
-
-Hint 2
-We know that the nodes of the first half are twins of nodes in the second half, so try dividing the linked list in half and reverse the second half.
-
-
-
-Hint 3
-How can two pointers be used to find every twin sum optimally?
-
-
-
-Hint 4
-Use two different pointers pointing to the first nodes of the two halves of the linked list. The second pointer will point to the first node of the reversed half, which is the (n-1-i)th node in the original linked list. By moving both pointers forward at the same time, we find all twin sums.
-
diff --git a/problems/maximum-units-on-a-truck/README.md b/problems/maximum-units-on-a-truck/README.md
deleted file mode 100644
index e08582c6e..000000000
--- a/problems/maximum-units-on-a-truck/README.md
+++ /dev/null
@@ -1,74 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../biggest-window-between-visits "Biggest Window Between Visits")
-
-[Next >](../count-good-meals "Count Good Meals")
-
-## [1710. Maximum Units on a Truck (Easy)](https://leetcode.com/problems/maximum-units-on-a-truck "卡车上的最大单元数")
-
-
You are assigned to put some amount of boxes onto one truck. You are given a 2D array boxTypes, where boxTypes[i] = [numberOfBoxesi, numberOfUnitsPerBoxi]:
-
-
-
numberOfBoxesi is the number of boxes of type i.
-
numberOfUnitsPerBoxiis the number of units in each box of the type i.
-
-
-
You are also given an integer truckSize, which is the maximum number of boxes that can be put on the truck. You can choose any boxes to put on the truck as long as the number of boxes does not exceed truckSize.
-
-
Return the maximum total number of units that can be put on the truck.
-
-
-
Example 1:
-
-
-Input: boxTypes = [[1,3],[2,2],[3,1]], truckSize = 4
-Output: 8
-Explanation: There are:
-- 1 box of the first type that contains 3 units.
-- 2 boxes of the second type that contain 2 units each.
-- 3 boxes of the third type that contain 1 unit each.
-You can take all the boxes of the first and second types, and one box of the third type.
-The total number of units will be = (1 * 3) + (2 * 2) + (1 * 1) = 8.
-
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Hints
-
-Hint 1
-If we have space for at least one box, it's always optimal to put the box with the most units.
-
-
-
-Hint 2
-Sort the box types with the number of units per box non-increasingly.
-
-
-
-Hint 3
-Iterate on the box types and take from each type as many as you can.
-
diff --git a/problems/maximum-vacation-days/README.md b/problems/maximum-vacation-days/README.md
deleted file mode 100644
index 6d4ea8813..000000000
--- a/problems/maximum-vacation-days/README.md
+++ /dev/null
@@ -1,96 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../permutation-in-string "Permutation in String")
-
-[Next >](../median-employee-salary "Median Employee Salary")
-
-## [568. Maximum Vacation Days (Hard)](https://leetcode.com/problems/maximum-vacation-days "最大休假天数")
-
-
-LeetCode wants to give one of its best employees the option to travel among N cities to collect algorithm problems. But all work and no play makes Jack a dull boy, you could take vacations in some particular cities and weeks. Your job is to schedule the traveling to maximize the number of vacation days you could take, but there are certain rules and restrictions you need to follow.
-
-
-
Rules and restrictions:
-
-
You can only travel among N cities, represented by indexes from 0 to N-1. Initially, you are in the city indexed 0 on Monday.
-
The cities are connected by flights. The flights are represented as a N*N matrix (not necessary symmetrical), called flights representing the airline status from the city i to the city j. If there is no flight from the city i to the city j, flights[i][j] = 0; Otherwise, flights[i][j] = 1. Also, flights[i][i] = 0 for all i.
-
You totally have K weeks (each week has 7 days) to travel. You can only take flights at most once per day and can only take flights on each week's Monday morning. Since flight time is so short, we don't consider the impact of flight time.
-
For each city, you can only have restricted vacation days in different weeks, given an N*K matrix called days representing this relationship. For the value of days[i][j], it represents the maximum days you could take vacation in the city i in the week j.
-
-
-
-
You're given the flights matrix and days matrix, and you need to output the maximum vacation days you could take during K weeks.
-
-
Example 1:
-
-Input:flights = [[0,1,1],[1,0,1],[1,1,0]], days = [[1,3,1],[6,0,3],[3,3,3]]
-Output: 12
-Explanation: Ans = 6 + 3 + 3 = 12.
-One of the best strategies is:
-1st week : fly from city 0 to city 1 on Monday, and play 6 days and work 1 day. (Although you start at city 0, we could also fly to and start at other cities since it is Monday.)
-2nd week : fly from city 1 to city 2 on Monday, and play 3 days and work 4 days.
-3rd week : stay at city 2, and play 3 days and work 4 days.
-
-
-
-
Example 2:
-
-Input:flights = [[0,0,0],[0,0,0],[0,0,0]], days = [[1,1,1],[7,7,7],[7,7,7]]
-Output: 3
-Explanation: Ans = 1 + 1 + 1 = 3.
-Since there is no flights enable you to move to another city, you have to stay at city 0 for the whole 3 weeks. For each week, you only have one day to play and six days to work. So the maximum number of vacation days is 3.
-
-
-
-
Example 3:
-
-Input:flights = [[0,1,1],[1,0,1],[1,1,0]], days = [[7,0,0],[0,7,0],[0,0,7]]
-Output: 21
-Explanation: Ans = 7 + 7 + 7 = 21
-One of the best strategies is:
-1st week : stay at city 0, and play 7 days.
-2nd week : fly from city 0 to city 1 on Monday, and play 7 days.
-3rd week : fly from city 1 to city 2 on Monday, and play 7 days.
-
-
-
-
-
Note:
-
-
N and K are positive integers, which are in the range of [1, 100].
-
In the matrix flights, all the values are integers in the range of [0, 1].
-
In the matrix days, all the values are integers in the range [0, 7].
-
You could stay at a city beyond the number of vacation days, but you should work on the extra days, which won't be counted as vacation days.
-
If you fly from the city A to the city B and take the vacation on that day, the deduction towards vacation days will count towards the vacation days of city B in that week.
-
We don't consider the impact of flight hours towards the calculation of vacation days.
-
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
-
-### Similar Questions
- 1. [Cheapest Flights Within K Stops](../cheapest-flights-within-k-stops) (Medium)
-
-### Hints
-
-Hint 1
-First try to understand the problem carefully and then take some example and solve it on a paper.
-
-
-
-Hint 2
-Can you interpret the given input as a graph? Which graph traversal technique is suitable here?
-
-
-
-Hint 3
-Can we use some space to avoid redundant function calls?
-
diff --git a/problems/maximum-vacation-days/maximum_vacation_days.go b/problems/maximum-vacation-days/maximum_vacation_days.go
deleted file mode 100644
index 1c887ad98..000000000
--- a/problems/maximum-vacation-days/maximum_vacation_days.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem568
diff --git a/problems/maximum-vacation-days/maximum_vacation_days_test.go b/problems/maximum-vacation-days/maximum_vacation_days_test.go
deleted file mode 100644
index 1c887ad98..000000000
--- a/problems/maximum-vacation-days/maximum_vacation_days_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem568
diff --git a/problems/maximum-value-after-insertion/README.md b/problems/maximum-value-after-insertion/README.md
deleted file mode 100644
index 9d453f146..000000000
--- a/problems/maximum-value-after-insertion/README.md
+++ /dev/null
@@ -1,71 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../check-if-word-equals-summation-of-two-words "Check if Word Equals Summation of Two Words")
-
-[Next >](../process-tasks-using-servers "Process Tasks Using Servers")
-
-## [1881. Maximum Value after Insertion (Medium)](https://leetcode.com/problems/maximum-value-after-insertion "插入后的最大值")
-
-
You are given a very large integer n, represented as a string, and an integer digit x. The digits in n and the digit x are in the inclusive range [1, 9], and n may represent a negative number.
-
-
You want to maximize n's numerical value by inserting x anywhere in the decimal representation of n. You cannot insert x to the left of the negative sign.
-
-
-
For example, if n = 73 and x = 6, it would be best to insert it between 7 and 3, making n = 763.
-
If n = -55 and x = 2, it would be best to insert it before the first 5, making n = -255.
-
-
-
Return a string representing the maximum value of n after the insertion.
-
-
-
Example 1:
-
-
-Input: n = "99", x = 9
-Output: "999"
-Explanation: The result is the same regardless of where you insert 9.
-
-
-
Example 2:
-
-
-Input: n = "-13", x = 2
-Output: "-123"
-Explanation: You can make n one of {-213, -123, -132}, and the largest of those three is -123.
-
-
-
-
Constraints:
-
-
-
1 <= n.length <= 105
-
1 <= x <= 9
-
The digits in n are in the range [1, 9].
-
n is a valid representation of an integer.
-
In the case of a negative n, it will begin with '-'.
-
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Hints
-
-Hint 1
-Note that if the number is negative it's the same as positive but you look for the minimum instead.
-
-
-
-Hint 2
-In the case of maximum, if s[i] < x it's optimal that x is put before s[i].
-
-
-
-Hint 3
-In the case of minimum, if s[i] > x it's optimal that x is put before s[i].
-
diff --git a/problems/maximum-value-at-a-given-index-in-a-bounded-array/README.md b/problems/maximum-value-at-a-given-index-in-a-bounded-array/README.md
deleted file mode 100644
index 885b19f5f..000000000
--- a/problems/maximum-value-at-a-given-index-in-a-bounded-array/README.md
+++ /dev/null
@@ -1,76 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../number-of-orders-in-the-backlog "Number of Orders in the Backlog")
-
-[Next >](../count-pairs-with-xor-in-a-range "Count Pairs With XOR in a Range")
-
-## [1802. Maximum Value at a Given Index in a Bounded Array (Medium)](https://leetcode.com/problems/maximum-value-at-a-given-index-in-a-bounded-array "有界数组中指定下标处的最大值")
-
-
You are given three positive integers: n, index, and maxSum. You want to construct an array nums (0-indexed)that satisfies the following conditions:
-
-
-
nums.length == n
-
nums[i] is a positive integer where 0 <= i < n.
-
abs(nums[i] - nums[i+1]) <= 1 where 0 <= i < n-1.
-
The sum of all the elements of nums does not exceed maxSum.
-
nums[index] is maximized.
-
-
-
Return nums[index] of the constructed array.
-
-
Note that abs(x) equals x if x >= 0, and -x otherwise.
-
-
-
Example 1:
-
-
-Input: n = 4, index = 2, maxSum = 6
-Output: 2
-Explanation: nums = [1,2,2,1] is one array that satisfies all the conditions.
-There are no arrays that satisfy all the conditions and have nums[2] == 3, so 2 is the maximum nums[2].
-
-
-
Example 2:
-
-
-Input: n = 6, index = 1, maxSum = 10
-Output: 3
-
-
-
-
Constraints:
-
-
-
1 <= n <= maxSum <= 109
-
0 <= index < n
-
-
-### Related Topics
- [[Binary Search](../../tag/binary-search/README.md)]
- [[Greedy](../../tag/greedy/README.md)]
-
-### Hints
-
-Hint 1
-What if the problem was instead determining if you could generate a valid array with nums[index] == target?
-
-
-
-Hint 2
-To generate the array, set nums[index] to target, nums[index-i] to target-i, and nums[index+i] to target-i. Then, this will give the minimum possible sum, so check if the sum is less than or equal to maxSum.
-
-
-
-Hint 3
-n is too large to actually generate the array, so you can use the formula 1 + 2 + ... + n = n * (n+1) / 2 to quickly find the sum of nums[0...index] and nums[index...n-1].
-
-
-
-Hint 4
-Binary search for the target. If it is possible, then move the lower bound up. Otherwise, move the upper bound down.
-
diff --git a/problems/maximum-width-of-binary-tree/README.md b/problems/maximum-width-of-binary-tree/README.md
deleted file mode 100644
index 4678761e5..000000000
--- a/problems/maximum-width-of-binary-tree/README.md
+++ /dev/null
@@ -1,67 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../image-smoother "Image Smoother")
-
-[Next >](../equal-tree-partition "Equal Tree Partition")
-
-## [662. Maximum Width of Binary Tree (Medium)](https://leetcode.com/problems/maximum-width-of-binary-tree "二叉树最大宽度")
-
-
Given the root of a binary tree, return the maximum width of the given tree.
-
-
The maximum width of a tree is the maximum width among all levels.
-
-
The width of one level is defined as the length between the end-nodes (the leftmost and rightmost non-null nodes), where the null nodes between the end-nodes are also counted into the length calculation.
-
-
It is guaranteed that the answer will in the range of 32-bit signed integer.
-
-
-
Example 1:
-
-
-Input: root = [1,3,2,5,3,null,9]
-Output: 4
-Explanation: The maximum width existing in the third level with the length 4 (5,3,null,9).
-
-
-
Example 2:
-
-
-Input: root = [1,3,null,5,3]
-Output: 2
-Explanation: The maximum width existing in the third level with the length 2 (5,3).
-
-
-
Example 3:
-
-
-Input: root = [1,3,2,5]
-Output: 2
-Explanation: The maximum width existing in the second level with the length 2 (3,2).
-
-
-
Example 4:
-
-
-Input: root = [1,3,2,5,null,null,9,6,null,null,7]
-Output: 8
-Explanation: The maximum width existing in the fourth level with the length 8 (6,null,null,null,null,null,null,7).
-
-
-
-
Constraints:
-
-
-
The number of nodes in the tree is in the range [1, 3000].
A ramp in an integer array nums is a pair (i, j) for which i < j and nums[i] <= nums[j]. The width of such a ramp is j - i.
-
-
Given an integer array nums, return the maximum width of a ramp in nums. If there is no ramp in nums, return 0.
-
-
-
Example 1:
-
-
-Input: nums = [6,0,8,2,1,5]
-Output: 4
-Explanation: The maximum width ramp is achieved at (i, j) = (1, 5): nums[1] = 0 and nums[5] = 5.
-
-
-
Example 2:
-
-
-Input: nums = [9,8,1,0,1,9,4,0,4,1]
-Output: 7
-Explanation: The maximum width ramp is achieved at (i, j) = (2, 9): nums[2] = 1 and nums[9] = 1.
-
-
-
-
Constraints:
-
-
-
2 <= nums.length <= 5 * 104
-
0 <= nums[i] <= 5 * 104
-
-
-### Related Topics
- [[Stack](../../tag/stack/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Monotonic Stack](../../tag/monotonic-stack/README.md)]
diff --git a/problems/maximum-width-ramp/maximum_width_ramp.go b/problems/maximum-width-ramp/maximum_width_ramp.go
deleted file mode 100644
index 0b918adf2..000000000
--- a/problems/maximum-width-ramp/maximum_width_ramp.go
+++ /dev/null
@@ -1,5 +0,0 @@
-package problem962
-
-func maxWidthRamp(A []int) int {
- return 0
-}
diff --git a/problems/maximum-xor-for-each-query/README.md b/problems/maximum-xor-for-each-query/README.md
deleted file mode 100644
index 77772fb9e..000000000
--- a/problems/maximum-xor-for-each-query/README.md
+++ /dev/null
@@ -1,80 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../queries-on-number-of-points-inside-a-circle "Queries on Number of Points Inside a Circle")
-
-[Next >](../minimum-number-of-operations-to-make-string-sorted "Minimum Number of Operations to Make String Sorted")
-
-## [1829. Maximum XOR for Each Query (Medium)](https://leetcode.com/problems/maximum-xor-for-each-query "每个查询的最大异或值")
-
-
You are given a sorted array nums of n non-negative integers and an integer maximumBit. You want to perform the following query ntimes:
-
-
-
Find a non-negative integer k < 2maximumBit such that nums[0] XOR nums[1] XOR ... XOR nums[nums.length-1] XOR k is maximized. k is the answer to the ith query.
-
Remove the last element from the current array nums.
-
-
-
Return an arrayanswer, where answer[i] is the answer to the ith query.
-
-
-
Example 1:
-
-
-Input: nums = [0,1,1,3], maximumBit = 2
-Output: [0,3,2,3]
-Explanation: The queries are answered as follows:
-1st query: nums = [0,1,1,3], k = 0 since 0 XOR 1 XOR 1 XOR 3 XOR 0 = 3.
-2nd query: nums = [0,1,1], k = 3 since 0 XOR 1 XOR 1 XOR 3 = 3.
-3rd query: nums = [0,1], k = 2 since 0 XOR 1 XOR 2 = 3.
-4th query: nums = [0], k = 3 since 0 XOR 3 = 3.
-
-
-
Example 2:
-
-
-Input: nums = [2,3,4,7], maximumBit = 3
-Output: [5,2,6,5]
-Explanation: The queries are answered as follows:
-1st query: nums = [2,3,4,7], k = 5 since 2 XOR 3 XOR 4 XOR 7 XOR 5 = 7.
-2nd query: nums = [2,3,4], k = 2 since 2 XOR 3 XOR 4 XOR 2 = 7.
-3rd query: nums = [2,3], k = 6 since 2 XOR 3 XOR 6 = 7.
-4th query: nums = [2], k = 5 since 2 XOR 5 = 7.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Bit Manipulation](../../tag/bit-manipulation/README.md)]
- [[Prefix Sum](../../tag/prefix-sum/README.md)]
-
-### Hints
-
-Hint 1
-Note that the maximum possible XOR result is always 2^(maximumBit) - 1
-
-
-
-Hint 2
-So the answer for a prefix is the XOR of that prefix XORed with 2^(maximumBit)-1
-
diff --git a/problems/maximum-xor-of-two-numbers-in-an-array/README.md b/problems/maximum-xor-of-two-numbers-in-an-array/README.md
deleted file mode 100644
index 2457f9950..000000000
--- a/problems/maximum-xor-of-two-numbers-in-an-array/README.md
+++ /dev/null
@@ -1,67 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../strong-password-checker "Strong Password Checker")
-
-[Next >](../valid-word-square "Valid Word Square")
-
-## [421. Maximum XOR of Two Numbers in an Array (Medium)](https://leetcode.com/problems/maximum-xor-of-two-numbers-in-an-array "数组中两个数的最大异或值")
-
-
Given an integer array nums, return the maximum result of nums[i] XOR nums[j], where 0 <= i <= j < n.
-
-
-
Example 1:
-
-
-Input: nums = [3,10,5,25,2,8]
-Output: 28
-Explanation: The maximum result is 5 XOR 25 = 28.
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Bit Manipulation](../../tag/bit-manipulation/README.md)]
- [[Trie](../../tag/trie/README.md)]
-
-### Similar Questions
- 1. [Maximum XOR With an Element From Array](../maximum-xor-with-an-element-from-array) (Hard)
diff --git a/problems/maximum-xor-of-two-numbers-in-an-array/maximum_xor_of_two_numbers_in_an_array.go b/problems/maximum-xor-of-two-numbers-in-an-array/maximum_xor_of_two_numbers_in_an_array.go
deleted file mode 100644
index 2ee713361..000000000
--- a/problems/maximum-xor-of-two-numbers-in-an-array/maximum_xor_of_two_numbers_in_an_array.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem421
diff --git a/problems/maximum-xor-of-two-numbers-in-an-array/maximum_xor_of_two_numbers_in_an_array_test.go b/problems/maximum-xor-of-two-numbers-in-an-array/maximum_xor_of_two_numbers_in_an_array_test.go
deleted file mode 100644
index 2ee713361..000000000
--- a/problems/maximum-xor-of-two-numbers-in-an-array/maximum_xor_of_two_numbers_in_an_array_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem421
diff --git a/problems/maximum-xor-with-an-element-from-array/README.md b/problems/maximum-xor-with-an-element-from-array/README.md
deleted file mode 100644
index daa3f0add..000000000
--- a/problems/maximum-xor-with-an-element-from-array/README.md
+++ /dev/null
@@ -1,76 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../where-will-the-ball-fall "Where Will the Ball Fall")
-
-[Next >](../largest-subarray-length-k "Largest Subarray Length K")
-
-## [1707. Maximum XOR With an Element From Array (Hard)](https://leetcode.com/problems/maximum-xor-with-an-element-from-array "与数组中元素的最大异或值")
-
-
You are given an array nums consisting of non-negative integers. You are also given a queries array, where queries[i] = [xi, mi].
-
-
The answer to the ith query is the maximum bitwise XOR value of xi and any element of nums that does not exceed mi. In other words, the answer is max(nums[j] XOR xi) for all j such that nums[j] <= mi. If all elements in nums are larger than mi, then the answer is -1.
-
-
Return an integer array answer where answer.length == queries.length and answer[i] is the answer to the ith query.
-
-
-
Example 1:
-
-
-Input: nums = [0,1,2,3,4], queries = [[3,1],[1,3],[5,6]]
-Output: [3,3,7]
-Explanation:
-1) 0 and 1 are the only two integers not greater than 1. 0 XOR 3 = 3 and 1 XOR 3 = 2. The larger of the two is 3.
-2) 1 XOR 2 = 3.
-3) 5 XOR 2 = 7.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Bit Manipulation](../../tag/bit-manipulation/README.md)]
- [[Trie](../../tag/trie/README.md)]
-
-### Similar Questions
- 1. [Maximum XOR of Two Numbers in an Array](../maximum-xor-of-two-numbers-in-an-array) (Medium)
- 1. [Maximum Genetic Difference Query](../maximum-genetic-difference-query) (Hard)
-
-### Hints
-
-Hint 1
-In problems involving bitwise operations, we often think on the bits level. In this problem, we can think that to maximize the result of an xor operation, we need to maximize the most significant bit, then the next one, and so on.
-
-
-
-Hint 2
-If there's some number in the array that is less than m and whose the most significant bit is different than that of x, then xoring with this number maximizes the most significant bit, so I know this bit in the answer is 1.
-
-
-
-Hint 3
-To check the existence of such numbers and narrow your scope for further bits based on your choice, you can use trie.
-
-
-
-Hint 4
-You can sort the array and the queries, and maintain the trie such that in each query the trie consists exactly of the valid elements.
-
diff --git a/problems/mean-of-array-after-removing-some-elements/README.md b/problems/mean-of-array-after-removing-some-elements/README.md
deleted file mode 100644
index a3838f31b..000000000
--- a/problems/mean-of-array-after-removing-some-elements/README.md
+++ /dev/null
@@ -1,63 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-font-to-fit-a-sentence-in-a-screen "Maximum Font to Fit a Sentence in a Screen")
-
-[Next >](../coordinate-with-maximum-network-quality "Coordinate With Maximum Network Quality")
-
-## [1619. Mean of Array After Removing Some Elements (Easy)](https://leetcode.com/problems/mean-of-array-after-removing-some-elements "删除某些元素后的数组均值")
-
-
Given an integer array arr, return the mean of the remaining integers after removing the smallest 5% and the largest 5% of the elements.
-
-
Answers within 10-5 of the actual answer will be considered accepted.
-
-
-
Example 1:
-
-
-Input: arr = [1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3]
-Output: 2.00000
-Explanation: After erasing the minimum and the maximum values of this array, all elements are equal to 2, so the mean is 2.
-
Given an array of meeting time intervals consisting of start and end times [[s1,e1],[s2,e2],...] (si < ei), find the minimum number of conference rooms required.
-
-
Example 1:
-
-
-Input:[[0, 30],[5, 10],[15, 20]]
-Output: 2
-
-
Example 2:
-
-
-Input: [[7,10],[2,4]]
-Output: 1
-
-
NOTE: input types have been changed on April 15, 2019. Please reset to default code definition to get new method signature.
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Two Pointers](../../tag/two-pointers/README.md)]
- [[Greedy](../../tag/greedy/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
- [[Heap (Priority Queue)](../../tag/heap-priority-queue/README.md)]
-
-### Similar Questions
- 1. [Merge Intervals](../merge-intervals) (Medium)
- 1. [Meeting Rooms](../meeting-rooms) (Easy)
- 1. [Minimum Number of Arrows to Burst Balloons](../minimum-number-of-arrows-to-burst-balloons) (Medium)
- 1. [Car Pooling](../car-pooling) (Medium)
-
-### Hints
-
-Hint 1
-Think about how we would approach this problem in a very simplistic way. We will allocate rooms to meetings that occur earlier in the day v/s the ones that occur later on, right?
-
-
-
-Hint 2
-If you've figured out that we have to sort the meetings by their start time, the next thing to think about is how do we do the allocation? There are two scenarios possible here for any meeting. Either there is no meeting room available and a new one has to be allocated, or a meeting room has freed up and this meeting can take place there.
-
-
-
-Hint 3
-An important thing to note is that we don't really care which room gets freed up while allocating a room for the current meeting. As long as a room is free, our job is done.
We already know the rooms we have allocated till now and we also know when are they due to get free because of the end times of the meetings going on in those rooms. We can simply check the room which is due to get vacated the earliest amongst all the allocated rooms.
-
-
-
-Hint 4
-Following up on the previous hint, we can make use of a min-heap to store the end times of the meetings in various rooms.
So, every time we want to check if any room is free or not, simply check the topmost element of the min heap as that would be the room that would get free the earliest out of all the other rooms currently occupied.
-
-
If the room we extracted from the top of the min heap isn't free, then no other room is. So, we can save time here and simply allocate a new room.
-
diff --git a/problems/meeting-rooms-ii/meeting_rooms_ii.go b/problems/meeting-rooms-ii/meeting_rooms_ii.go
deleted file mode 100644
index cc782d17b..000000000
--- a/problems/meeting-rooms-ii/meeting_rooms_ii.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem253
diff --git a/problems/meeting-rooms-ii/meeting_rooms_ii_test.go b/problems/meeting-rooms-ii/meeting_rooms_ii_test.go
deleted file mode 100644
index cc782d17b..000000000
--- a/problems/meeting-rooms-ii/meeting_rooms_ii_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem253
diff --git a/problems/meeting-rooms/README.md b/problems/meeting-rooms/README.md
deleted file mode 100644
index 7138cc5b1..000000000
--- a/problems/meeting-rooms/README.md
+++ /dev/null
@@ -1,38 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../flatten-2d-vector "Flatten 2D Vector")
-
-[Next >](../meeting-rooms-ii "Meeting Rooms II")
-
-## [252. Meeting Rooms (Easy)](https://leetcode.com/problems/meeting-rooms "会议室")
-
-
Given an array of meeting time intervals consisting of start and end times [[s1,e1],[s2,e2],...] (si < ei), determine if a person could attend all meetings.
-
-
Example 1:
-
-
-Input:[[0,30],[5,10],[15,20]]
-Output: false
-
-
-
Example 2:
-
-
-Input: [[7,10],[2,4]]
-Output: true
-
-
-
NOTE: input types have been changed on April 15, 2019. Please reset to default code definition to get new method signature.
Given the availability time slots arrays slots1 and slots2 of two people and a meeting duration duration, return the earliest time slot that works for both of them and is of duration duration.
-
-
If there is no common time slot that satisfies the requirements, return an empty array.
-
-
The format of a time slot is an array of two elements [start, end] representing an inclusive time range from start to end.
-
-
It is guaranteed that no two availability slots of the same person intersect with each other. That is, for any two time slots [start1, end1] and [start2, end2] of the same person, either start1 > end2 or start2 > end1.
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Two Pointers](../../tag/two-pointers/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Hints
-
-Hint 1
-Assume that in the solution, the selected slot from slotsA is bigger than the respectively selected slot from slotsB.
-
-
-
-Hint 2
-Use two pointers in order to try all the possible intersections, and check the length.
-
-
-
-Hint 3
-Do the same in step N° 1 but now assume that the selected slot from slotsB is bigger, return the minimum of the two options.
-
diff --git a/problems/merge-bsts-to-create-single-bst/README.md b/problems/merge-bsts-to-create-single-bst/README.md
deleted file mode 100644
index f8271915c..000000000
--- a/problems/merge-bsts-to-create-single-bst/README.md
+++ /dev/null
@@ -1,102 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../painting-a-grid-with-three-different-colors "Painting a Grid With Three Different Colors")
-
-[Next >](../check-if-string-is-decomposable-into-value-equal-substrings "Check if String Is Decomposable Into Value-Equal Substrings")
-
-## [1932. Merge BSTs to Create Single BST (Hard)](https://leetcode.com/problems/merge-bsts-to-create-single-bst "合并多棵二叉搜索树")
-
-
You are given nBST (binary search tree) root nodes for n separate BSTs stored in an array trees (0-indexed). Each BST in trees has at most 3 nodes, and no two roots have the same value. In one operation, you can:
-
-
-
Select two distinct indices i and j such that the value stored at one of the leaves of trees[i] is equal to the root value of trees[j].
-
Replace the leaf node in trees[i] with trees[j].
-
Remove trees[j] from trees.
-
-
-
Return the root of the resulting BST if it is possible to form a valid BST after performing n - 1 operations, ornullif it is impossible to create a valid BST.
-
-
A BST (binary search tree) is a binary tree where each node satisfies the following property:
-
-
-
Every node in the node's left subtree has a value strictly less than the node's value.
-
Every node in the node's right subtree has a value strictly greater than the node's value.
-
-
-
A leaf is a node that has no children.
-
-
-
Example 1:
-
-
-Input: trees = [[2,1],[3,2,5],[5,4]]
-Output: [3,2,5,1,null,4]
-Explanation:
-In the first operation, pick i=1 and j=0, and merge trees[0] into trees[1].
-Delete trees[0], so trees = [[3,2,5,1],[5,4]].
-
-In the second operation, pick i=0 and j=1, and merge trees[1] into trees[0].
-Delete trees[1], so trees = [[3,2,5,1,null,4]].
-
-The resulting tree, shown above, is a valid BST, so return its root.
-
-
Example 2:
-
-
-Input: trees = [[5,3,8],[3,2,6]]
-Output: []
-Explanation:
-Pick i=0 and j=1 and merge trees[1] into trees[0].
-Delete trees[1], so trees = [[5,3,8,2,6]].
-
-The resulting tree is shown above. This is the only valid operation that can be performed, but the resulting tree is not a valid BST, so return null.
-
-
-
Example 3:
-
-
-Input: trees = [[5,4],[3]]
-Output: []
-Explanation: It is impossible to perform any operations.
-
-
-
-
Constraints:
-
-
-
n == trees.length
-
1 <= n <= 5 * 104
-
The number of nodes in each tree is in the range [1, 3].
-
Each node in the input may have children but no grandchildren.
-
No two roots of trees have the same value.
-
All the trees in the input are valid BSTs.
-
1 <= TreeNode.val <= 5 * 104.
-
-
-### Related Topics
- [[Tree](../../tag/tree/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
- [[Binary Tree](../../tag/binary-tree/README.md)]
-
-### Hints
-
-Hint 1
-Is it possible to have multiple leaf nodes with the same values?
-
-
-
-Hint 2
-How many possible positions are there for each tree?
-
-
-
-Hint 3
-The root value of the final tree does not occur as a value in any of the leaves of the original tree.
-
diff --git a/problems/merge-in-between-linked-lists/README.md b/problems/merge-in-between-linked-lists/README.md
deleted file mode 100644
index 2206ccda2..000000000
--- a/problems/merge-in-between-linked-lists/README.md
+++ /dev/null
@@ -1,65 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-repeating-substring "Maximum Repeating Substring")
-
-[Next >](../design-front-middle-back-queue "Design Front Middle Back Queue")
-
-## [1669. Merge In Between Linked Lists (Medium)](https://leetcode.com/problems/merge-in-between-linked-lists "合并两个链表")
-
-
You are given two linked lists: list1 and list2 of sizes n and m respectively.
-
-
Remove list1's nodes from the ath node to the bth node, and put list2 in their place.
-
-
The blue edges and nodes in the following figure indicate the result:
-
-
Build the result list and return its head.
-
-
-
Example 1:
-
-
-Input: list1 = [0,1,2,3,4,5], a = 3, b = 4, list2 = [1000000,1000001,1000002]
-Output: [0,1,2,1000000,1000001,1000002,5]
-Explanation: We remove the nodes 3 and 4 and put the entire list2 in their place. The blue edges and nodes in the above figure indicate the result.
-
-
-
Example 2:
-
-
-Input: list1 = [0,1,2,3,4,5,6], a = 2, b = 5, list2 = [1000000,1000001,1000002,1000003,1000004]
-Output: [0,1,1000000,1000001,1000002,1000003,1000004,6]
-Explanation: The blue edges and nodes in the above figure indicate the result.
-
-
-
-
Constraints:
-
-
-
3 <= list1.length <= 104
-
1 <= a <= b < list1.length - 1
-
1 <= list2.length <= 104
-
-
-### Related Topics
- [[Linked List](../../tag/linked-list/README.md)]
-
-### Hints
-
-Hint 1
-Check which edges need to be changed.
-
-
-
-Hint 2
-Let the next node of the (a-1)th node of list1 be the 0-th node in list 2.
-
-
-
-Hint 3
-Let the next node of the last node of list2 be the (b+1)-th node in list 1.
-
diff --git a/problems/merge-intervals/README.md b/problems/merge-intervals/README.md
deleted file mode 100644
index 9a94b715c..000000000
--- a/problems/merge-intervals/README.md
+++ /dev/null
@@ -1,56 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../jump-game "Jump Game")
-
-[Next >](../insert-interval "Insert Interval")
-
-## [56. Merge Intervals (Medium)](https://leetcode.com/problems/merge-intervals "合并区间")
-
-
Given an array of intervals where intervals[i] = [starti, endi], merge all overlapping intervals, and return an array of the non-overlapping intervals that cover all the intervals in the input.
-
-
-
Example 1:
-
-
-Input: intervals = [[1,3],[2,6],[8,10],[15,18]]
-Output: [[1,6],[8,10],[15,18]]
-Explanation: Since intervals [1,3] and [2,6] overlaps, merge them into [1,6].
-
-
-
Example 2:
-
-
-Input: intervals = [[1,4],[4,5]]
-Output: [[1,5]]
-Explanation: Intervals [1,4] and [4,5] are considered overlapping.
-
You are given two integer arrays nums1 and nums2, sorted in non-decreasing order, and two integers m and n, representing the number of elements in nums1 and nums2 respectively.
-
-
Mergenums1 and nums2 into a single array sorted in non-decreasing order.
-
-
The final sorted array should not be returned by the function, but instead be stored inside the array nums1. To accommodate this, nums1 has a length of m + n, where the first m elements denote the elements that should be merged, and the last n elements are set to 0 and should be ignored. nums2 has a length of n.
-
-
-
Example 1:
-
-
-Input: nums1 = [1,2,3,0,0,0], m = 3, nums2 = [2,5,6], n = 3
-Output: [1,2,2,3,5,6]
-Explanation: The arrays we are merging are [1,2,3] and [2,5,6].
-The result of the merge is [1,2,2,3,5,6] with the underlined elements coming from nums1.
-
-
-
Example 2:
-
-
-Input: nums1 = [1], m = 1, nums2 = [], n = 0
-Output: [1]
-Explanation: The arrays we are merging are [1] and [].
-The result of the merge is [1].
-
-
-
Example 3:
-
-
-Input: nums1 = [0], m = 0, nums2 = [1], n = 1
-Output: [1]
-Explanation: The arrays we are merging are [] and [1].
-The result of the merge is [1].
-Note that because m = 0, there are no elements in nums1. The 0 is only there to ensure the merge result can fit in nums1.
-
-
-
-
Constraints:
-
-
-
nums1.length == m + n
-
nums2.length == n
-
0 <= m, n <= 200
-
1 <= m + n <= 200
-
-109 <= nums1[i], nums2[j] <= 109
-
-
-
-
Follow up: Can you come up with an algorithm that runs in O(m + n) time?
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Two Pointers](../../tag/two-pointers/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Similar Questions
- 1. [Merge Two Sorted Lists](../merge-two-sorted-lists) (Easy)
- 1. [Squares of a Sorted Array](../squares-of-a-sorted-array) (Easy)
- 1. [Interval List Intersections](../interval-list-intersections) (Medium)
-
-### Hints
-
-Hint 1
-You can easily solve this problem if you simply think about two elements at a time rather than two arrays. We know that each of the individual arrays is sorted. What we don't know is how they will intertwine. Can we take a local decision and arrive at an optimal solution?
-
-
-
-Hint 2
-If you simply consider one element each at a time from the two arrays and make a decision and proceed accordingly, you will arrive at the optimal solution.
-
diff --git a/problems/merge-sorted-array/merge_sorted_array.go b/problems/merge-sorted-array/merge_sorted_array.go
deleted file mode 100644
index 05b2e9970..000000000
--- a/problems/merge-sorted-array/merge_sorted_array.go
+++ /dev/null
@@ -1,14 +0,0 @@
-package problem88
-
-func merge(nums1 []int, m int, nums2 []int, n int) {
- copy(nums1[n:], nums1)
- cur, i, j := 0, n, 0
- for j < n {
- if i < m+n && nums1[i] < nums2[j] {
- nums1[cur], i = nums1[i], i+1
- } else {
- nums1[cur], j = nums2[j], j+1
- }
- cur++
- }
-}
diff --git a/problems/merge-sorted-array/merge_sorted_array_test.go b/problems/merge-sorted-array/merge_sorted_array_test.go
deleted file mode 100644
index 95dd0667d..000000000
--- a/problems/merge-sorted-array/merge_sorted_array_test.go
+++ /dev/null
@@ -1,46 +0,0 @@
-package problem88
-
-import (
- "reflect"
- "testing"
-)
-
-type testType struct {
- nums1 []int
- m int
- nums2 []int
- n int
- want []int
-}
-
-func TestMerge(t *testing.T) {
- tests := [...]testType{
- {
- nums1: []int{1, 2, 3, 0, 0, 0},
- m: 3,
- nums2: []int{2, 5, 6},
- n: 3,
- want: []int{1, 2, 2, 3, 5, 6},
- },
- {
- nums1: []int{-9, -6, -3, 0, 0, 0},
- m: 3,
- nums2: []int{-7, -5, -3},
- n: 3,
- want: []int{-9, -7, -6, -5, -3, -3},
- },
- {
- nums1: []int{1, 2, 4, 5, 6, 0},
- m: 5,
- nums2: []int{3},
- n: 1,
- want: []int{1, 2, 3, 4, 5, 6},
- },
- }
- for _, tt := range tests {
- merge(tt.nums1, tt.m, tt.nums2, tt.n)
- if !reflect.DeepEqual(tt.nums1, tt.want) {
- t.Fatalf("in: %v %v %v %v, got: %v, want: %v", tt.nums1, tt.m, tt.nums2, tt.n, tt.nums1, tt.want)
- }
- }
-}
diff --git a/problems/merge-strings-alternately/README.md b/problems/merge-strings-alternately/README.md
deleted file mode 100644
index 27cb88935..000000000
--- a/problems/merge-strings-alternately/README.md
+++ /dev/null
@@ -1,71 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../find-the-subtasks-that-did-not-execute "Find the Subtasks That Did Not Execute")
-
-[Next >](../minimum-number-of-operations-to-move-all-balls-to-each-box "Minimum Number of Operations to Move All Balls to Each Box")
-
-## [1768. Merge Strings Alternately (Easy)](https://leetcode.com/problems/merge-strings-alternately "交替合并字符串")
-
-
You are given two strings word1 and word2. Merge the strings by adding letters in alternating order, starting with word1. If a string is longer than the other, append the additional letters onto the end of the merged string.
-
-
Return the merged string.
-
-
-
Example 1:
-
-
-Input: word1 = "abc", word2 = "pqr"
-Output: "apbqcr"
-Explanation: The merged string will be merged as so:
-word1: a b c
-word2: p q r
-merged: a p b q c r
-
-
-
Example 2:
-
-
-Input: word1 = "ab", word2 = "pqrs"
-Output: "apbqrs"
-Explanation: Notice that as word2 is longer, "rs" is appended to the end.
-word1: a b
-word2: p q r s
-merged: a p b q r s
-
-
-
Example 3:
-
-
-Input: word1 = "abcd", word2 = "pq"
-Output: "apbqcd"
-Explanation: Notice that as word1 is longer, "cd" is appended to the end.
-word1: a b c d
-word2: p q
-merged: a p b q c d
-
-
-
-
Constraints:
-
-
-
1 <= word1.length, word2.length <= 100
-
word1 and word2 consist of lowercase English letters.
-
-
-### Related Topics
- [[Two Pointers](../../tag/two-pointers/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Similar Questions
- 1. [Zigzag Iterator](../zigzag-iterator) (Medium)
-
-### Hints
-
-Hint 1
-Use two pointers, one pointer for each string. Alternately choose the character from each pointer, and move the pointer upwards.
-
diff --git a/problems/merge-triplets-to-form-target-triplet/README.md b/problems/merge-triplets-to-form-target-triplet/README.md
deleted file mode 100644
index cc1c8f67d..000000000
--- a/problems/merge-triplets-to-form-target-triplet/README.md
+++ /dev/null
@@ -1,80 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-number-of-removable-characters "Maximum Number of Removable Characters")
-
-[Next >](../the-earliest-and-latest-rounds-where-players-compete "The Earliest and Latest Rounds Where Players Compete")
-
-## [1899. Merge Triplets to Form Target Triplet (Medium)](https://leetcode.com/problems/merge-triplets-to-form-target-triplet "合并若干三元组以形成目标三元组")
-
-
A triplet is an array of three integers. You are given a 2D integer array triplets, where triplets[i] = [ai, bi, ci] describes the ithtriplet. You are also given an integer array target = [x, y, z] that describes the triplet you want to obtain.
-
-
To obtain target, you may apply the following operation on tripletsany number of times (possibly zero):
-
-
-
Choose two indices (0-indexed) i and j (i != j) and updatetriplets[j] to become [max(ai, aj), max(bi, bj), max(ci, cj)].
-
-
For example, if triplets[i] = [2, 5, 3] and triplets[j] = [1, 7, 5], triplets[j] will be updated to [max(2, 1), max(5, 7), max(3, 5)] = [2, 7, 5].
-
-
-
-
-
Return trueif it is possible to obtain the targettriplet[x, y, z] as an element of triplets, or false otherwise.
-
-
-
Example 1:
-
-
-Input: triplets = [[2,5,3],[1,8,4],[1,7,5]], target = [2,7,5]
-Output: true
-Explanation: Perform the following operations:
-- Choose the first and last triplets [[2,5,3],[1,8,4],[1,7,5]]. Update the last triplet to be [max(2,1), max(5,7), max(3,5)] = [2,7,5]. triplets = [[2,5,3],[1,8,4],[2,7,5]]
-The target triplet [2,7,5] is now an element of triplets.
-
-
-
Example 2:
-
-
-Input: triplets = [[3,4,5],[4,5,6]], target = [3,2,5]
-Output: false
-Explanation: It is impossible to have [3,2,5] as an element because there is no 2 in any of the triplets.
-
-
-
Example 3:
-
-
-Input: triplets = [[2,5,3],[2,3,4],[1,2,5],[5,2,3]], target = [5,5,5]
-Output: true
-Explanation: Perform the following operations:
-- Choose the first and third triplets [[2,5,3],[2,3,4],[1,2,5],[5,2,3]]. Update the third triplet to be [max(2,1), max(5,2), max(3,5)] = [2,5,5]. triplets = [[2,5,3],[2,3,4],[2,5,5],[5,2,3]].
-- Choose the third and fourth triplets [[2,5,3],[2,3,4],[2,5,5],[5,2,3]]. Update the fourth triplet to be [max(2,5), max(5,2), max(5,3)] = [5,5,5]. triplets = [[2,5,3],[2,3,4],[2,5,5],[5,5,5]].
-The target triplet [5,5,5] is now an element of triplets.
-
-
-
-
Constraints:
-
-
-
1 <= triplets.length <= 105
-
triplets[i].length == target.length == 3
-
1 <= ai, bi, ci, x, y, z <= 1000
-
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[Array](../../tag/array/README.md)]
-
-### Hints
-
-Hint 1
-Which triplets do you actually care about?
-
-
-
-Hint 2
-What property of max can you use to solve the problem?
-
diff --git a/problems/merge-two-binary-trees/README.md b/problems/merge-two-binary-trees/README.md
deleted file mode 100644
index 330e3191b..000000000
--- a/problems/merge-two-binary-trees/README.md
+++ /dev/null
@@ -1,49 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../add-bold-tag-in-string "Add Bold Tag in String")
-
-[Next >](../students-report-by-geography "Students Report By Geography")
-
-## [617. Merge Two Binary Trees (Easy)](https://leetcode.com/problems/merge-two-binary-trees "合并二叉树")
-
-
You are given two binary trees root1 and root2.
-
-
Imagine that when you put one of them to cover the other, some nodes of the two trees are overlapped while the others are not. You need to merge the two trees into a new binary tree. The merge rule is that if two nodes overlap, then sum node values up as the new value of the merged node. Otherwise, the NOT null node will be used as the node of the new tree.
-
-
Return the merged tree.
-
-
Note: The merging process must start from the root nodes of both trees.
You are given an integer array cost where cost[i] is the cost of ith step on a staircase. Once you pay the cost, you can either climb one or two steps.
-
-
You can either start from the step with index 0, or the step with index 1.
-
-
Return the minimum cost to reach the top of the floor.
-
-
-
Example 1:
-
-
-Input: cost = [10,15,20]
-Output: 15
-Explanation: You will start at index 1.
-- Pay 15 and climb two steps to reach the top.
-The total cost is 15.
-
-
-
Example 2:
-
-
-Input: cost = [1,100,1,1,1,100,1,1,100,1]
-Output: 6
-Explanation: You will start at index 0.
-- Pay 1 and climb two steps to reach index 2.
-- Pay 1 and climb two steps to reach index 4.
-- Pay 1 and climb two steps to reach index 6.
-- Pay 1 and climb one step to reach index 7.
-- Pay 1 and climb two steps to reach index 9.
-- Pay 1 and climb one step to reach the top.
-The total cost is 6.
-
-
-
-
Constraints:
-
-
-
2 <= cost.length <= 1000
-
0 <= cost[i] <= 999
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Similar Questions
- 1. [Climbing Stairs](../climbing-stairs) (Easy)
-
-### Hints
-
-Hint 1
-Say f[i] is the final cost to climb to the top from step i. Then f[i] = cost[i] + min(f[i+1], f[i+2]).
-
diff --git a/problems/min-cost-climbing-stairs/min_cost_climbing_stairs.go b/problems/min-cost-climbing-stairs/min_cost_climbing_stairs.go
deleted file mode 100644
index fed2a2177..000000000
--- a/problems/min-cost-climbing-stairs/min_cost_climbing_stairs.go
+++ /dev/null
@@ -1,17 +0,0 @@
-package problem746
-
-func minCostClimbingStairs(cost []int) int {
- f1, f2, l := 0, 0, len(cost)-1
- for i := l; i >= 0; i-- {
- f0 := f1
- if f2 < f1 {
- f0 = f2
- }
- f0 += cost[i]
- f1, f2 = f0, f1
- }
- if f1 <= f2 {
- return f1
- }
- return f2
-}
diff --git a/problems/min-cost-climbing-stairs/min_cost_climbing_stairs_test.go b/problems/min-cost-climbing-stairs/min_cost_climbing_stairs_test.go
deleted file mode 100644
index 37d4e96a5..000000000
--- a/problems/min-cost-climbing-stairs/min_cost_climbing_stairs_test.go
+++ /dev/null
@@ -1,27 +0,0 @@
-package problem746
-
-import "testing"
-
-type testType struct {
- in []int
- want int
-}
-
-func TestMinCostClimbingStairs(t *testing.T) {
- tests := [...]testType{
- {
- in: []int{10, 15, 20},
- want: 15,
- },
- {
- in: []int{1, 100, 1, 1, 1, 100, 1, 1, 100, 1},
- want: 6,
- },
- }
- for _, tt := range tests {
- got := minCostClimbingStairs(tt.in)
- if got != tt.want {
- t.Fatalf("in: %v, got: %v, want: %v", tt.in, got, tt.want)
- }
- }
-}
diff --git a/problems/min-cost-to-connect-all-points/README.md b/problems/min-cost-to-connect-all-points/README.md
deleted file mode 100644
index 7cb2c19ad..000000000
--- a/problems/min-cost-to-connect-all-points/README.md
+++ /dev/null
@@ -1,65 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../count-unhappy-friends "Count Unhappy Friends")
-
-[Next >](../check-if-string-is-transformable-with-substring-sort-operations "Check If String Is Transformable With Substring Sort Operations")
-
-## [1584. Min Cost to Connect All Points (Medium)](https://leetcode.com/problems/min-cost-to-connect-all-points "连接所有点的最小费用")
-
-
You are given an array points representing integer coordinates of some points on a 2D-plane, where points[i] = [xi, yi].
-
-
The cost of connecting two points [xi, yi] and [xj, yj] is the manhattan distance between them: |xi - xj| + |yi - yj|, where |val| denotes the absolute value of val.
-
-
Return the minimum cost to make all points connected. All points are connected if there is exactly one simple path between any two points.
-
-
-
Example 1:
-
-
-Input: points = [[0,0],[2,2],[3,10],[5,2],[7,0]]
-Output: 20
-Explanation:
-
-We can connect the points as shown above to get the minimum cost of 20.
-Notice that there is a unique path between every pair of points.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Union Find](../../tag/union-find/README.md)]
- [[Minimum Spanning Tree](../../tag/minimum-spanning-tree/README.md)]
-
-### Similar Questions
- 1. [Minimum Number of Lines to Cover Points](../minimum-number-of-lines-to-cover-points) (Medium)
-
-### Hints
-
-Hint 1
-Connect each pair of points with a weighted edge, the weight being the manhattan distance between those points.
-
-
-
-Hint 2
-The problem is now the cost of minimum spanning tree in graph with above edges.
-
diff --git a/problems/min-stack/README.md b/problems/min-stack/README.md
deleted file mode 100644
index 13567cb2e..000000000
--- a/problems/min-stack/README.md
+++ /dev/null
@@ -1,69 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../find-minimum-in-rotated-sorted-array-ii "Find Minimum in Rotated Sorted Array II")
-
-[Next >](../binary-tree-upside-down "Binary Tree Upside Down")
-
-## [155. Min Stack (Easy)](https://leetcode.com/problems/min-stack "最小栈")
-
-
Design a stack that supports push, pop, top, and retrieving the minimum element in constant time.
-
-
Implement the MinStack class:
-
-
-
MinStack() initializes the stack object.
-
void push(int val) pushes the element val onto the stack.
-
void pop() removes the element on the top of the stack.
-
int top() gets the top element of the stack.
-
int getMin() retrieves the minimum element in the stack.
You are given an m x n char matrix board representing the game board where:
-
-
-
'M' represents an unrevealed mine,
-
'E' represents an unrevealed empty square,
-
'B' represents a revealed blank square that has no adjacent mines (i.e., above, below, left, right, and all 4 diagonals),
-
digit ('1' to '8') represents how many mines are adjacent to this revealed square, and
-
'X' represents a revealed mine.
-
-
-
You are also given an integer array click where click = [clickr, clickc] represents the next click position among all the unrevealed squares ('M' or 'E').
-
-
Return the board after revealing this position according to the following rules:
-
-
-
If a mine 'M' is revealed, then the game is over. You should change it to 'X'.
-
If an empty square 'E' with no adjacent mines is revealed, then change it to a revealed blank 'B' and all of its adjacent unrevealed squares should be revealed recursively.
-
If an empty square 'E' with at least one adjacent mine is revealed, then change it to a digit ('1' to '8') representing the number of adjacent mines.
-
Return the board when no more squares will be revealed.
Given a string s represents the serialization of a nested list, implement a parser to deserialize it and return the deserializedNestedInteger.
-
-
Each element is either an integer or a list whose elements may also be integers or other lists.
-
-
-
Example 1:
-
-
-Input: s = "324"
-Output: 324
-Explanation: You should return a NestedInteger object which contains a single integer 324.
-
-
-
Example 2:
-
-
-Input: s = "[123,[456,[789]]]"
-Output: [123,[456,[789]]]
-Explanation: Return a NestedInteger object containing a nested list with 2 elements:
-1. An integer containing value 123.
-2. A nested list containing two elements:
- i. An integer containing value 456.
- ii. A nested list with one element:
- a. An integer containing value 789
-
-
-
-
Constraints:
-
-
-
1 <= s.length <= 5 * 104
-
s consists of digits, square brackets "[]", negative sign '-', and commas ','.
-
s is the serialization of valid NestedInteger.
-
All the values in the input are in the range [-106, 106].
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
- [[Stack](../../tag/stack/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
-
-### Similar Questions
- 1. [Flatten Nested List Iterator](../flatten-nested-list-iterator) (Medium)
- 1. [Ternary Expression Parser](../ternary-expression-parser) (Medium)
- 1. [Remove Comments](../remove-comments) (Medium)
diff --git a/problems/mini-parser/mini_parser.go b/problems/mini-parser/mini_parser.go
deleted file mode 100644
index 951cf942c..000000000
--- a/problems/mini-parser/mini_parser.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem385
diff --git a/problems/mini-parser/mini_parser_test.go b/problems/mini-parser/mini_parser_test.go
deleted file mode 100644
index 951cf942c..000000000
--- a/problems/mini-parser/mini_parser_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem385
diff --git a/problems/minimize-deviation-in-array/README.md b/problems/minimize-deviation-in-array/README.md
deleted file mode 100644
index 9b41e74d4..000000000
--- a/problems/minimize-deviation-in-array/README.md
+++ /dev/null
@@ -1,88 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-moves-to-make-array-complementary "Minimum Moves to Make Array Complementary")
-
-[Next >](../lowest-common-ancestor-of-a-binary-tree-iv "Lowest Common Ancestor of a Binary Tree IV")
-
-## [1675. Minimize Deviation in Array (Hard)](https://leetcode.com/problems/minimize-deviation-in-array "数组的最小偏移量")
-
-
You are given an array nums of n positive integers.
-
-
You can perform two types of operations on any element of the array any number of times:
-
-
-
If the element is even, divide it by 2.
-
-
For example, if the array is [1,2,3,4], then you can do this operation on the last element, and the array will be [1,2,3,2].
-
-
-
If the element is odd, multiply it by 2.
-
-
For example, if the array is [1,2,3,4], then you can do this operation on the first element, and the array will be [2,2,3,4].
-
-
-
-
-
The deviation of the array is the maximum difference between any two elements in the array.
-
-
Return the minimum deviation the array can have after performing some number of operations.
-
-
-
Example 1:
-
-
-Input: nums = [1,2,3,4]
-Output: 1
-Explanation: You can transform the array to [1,2,3,2], then to [2,2,3,2], then the deviation will be 3 - 2 = 1.
-
-
-
Example 2:
-
-
-Input: nums = [4,1,5,20,3]
-Output: 3
-Explanation: You can transform the array after two operations to [4,2,5,5,3], then the deviation will be 5 - 2 = 3.
-
-
-
Example 3:
-
-
-Input: nums = [2,10,8]
-Output: 3
-
-
-
-
Constraints:
-
-
-
n == nums.length
-
2 <= n <= 105
-
1 <= nums[i] <= 109
-
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Ordered Set](../../tag/ordered-set/README.md)]
- [[Heap (Priority Queue)](../../tag/heap-priority-queue/README.md)]
-
-### Hints
-
-Hint 1
-Assume you start with the minimum possible value for each number so you can only multiply a number by 2 till it reaches its maximum possible value.
-
-
-
-Hint 2
-If there is a better solution than the current one, then it must have either its maximum value less than the current maximum value, or the minimum value larger than the current minimum value.
-
-
-
-Hint 3
-Since that we only increase numbers (multiply them by 2), we cannot decrease the current maximum value, so we must multiply the current minimum number by 2.
-
diff --git a/problems/minimize-hamming-distance-after-swap-operations/README.md b/problems/minimize-hamming-distance-after-swap-operations/README.md
deleted file mode 100644
index 9a9482090..000000000
--- a/problems/minimize-hamming-distance-after-swap-operations/README.md
+++ /dev/null
@@ -1,83 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../swapping-nodes-in-a-linked-list "Swapping Nodes in a Linked List")
-
-[Next >](../find-minimum-time-to-finish-all-jobs "Find Minimum Time to Finish All Jobs")
-
-## [1722. Minimize Hamming Distance After Swap Operations (Medium)](https://leetcode.com/problems/minimize-hamming-distance-after-swap-operations "执行交换操作后的最小汉明距离")
-
-
You are given two integer arrays, source and target, both of length n. You are also given an array allowedSwaps where each allowedSwaps[i] = [ai, bi] indicates that you are allowed to swap the elements at index ai and index bi(0-indexed) of array source. Note that you can swap elements at a specific pair of indices multiple times and in any order.
-
-
The Hamming distance of two arrays of the same length, source and target, is the number of positions where the elements are different. Formally, it is the number of indices i for 0 <= i <= n-1 where source[i] != target[i](0-indexed).
-
-
Return the minimum Hamming distance of source and target after performing any amount of swap operations on array source.
-
-
-
Example 1:
-
-
-Input: source = [1,2,3,4], target = [2,1,4,5], allowedSwaps = [[0,1],[2,3]]
-Output: 1
-Explanation: source can be transformed the following way:
-- Swap indices 0 and 1: source = [2,1,3,4]
-- Swap indices 2 and 3: source = [2,1,4,3]
-The Hamming distance of source and target is 1 as they differ in 1 position: index 3.
-
-
-
Example 2:
-
-
-Input: source = [1,2,3,4], target = [1,3,2,4], allowedSwaps = []
-Output: 2
-Explanation: There are no allowed swaps.
-The Hamming distance of source and target is 2 as they differ in 2 positions: index 1 and index 2.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Union Find](../../tag/union-find/README.md)]
-
-### Similar Questions
- 1. [Smallest String With Swaps](../smallest-string-with-swaps) (Medium)
-
-### Hints
-
-Hint 1
-The source array can be imagined as a graph where each index is a node and each allowedSwaps[i] is an edge.
-
-
-
-Hint 2
-Nodes within the same component can be freely swapped with each other.
-
-
-
-Hint 3
-For each component, find the number of common elements. The elements that are not in common will contribute to the total Hamming distance.
-
diff --git a/problems/minimize-malware-spread-ii/README.md b/problems/minimize-malware-spread-ii/README.md
deleted file mode 100644
index 47e6e4f6d..000000000
--- a/problems/minimize-malware-spread-ii/README.md
+++ /dev/null
@@ -1,55 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../three-equal-parts "Three Equal Parts")
-
-[Next >](../unique-email-addresses "Unique Email Addresses")
-
-## [928. Minimize Malware Spread II (Hard)](https://leetcode.com/problems/minimize-malware-spread-ii "尽量减少恶意软件的传播 II")
-
-
You are given a network of n nodes represented as an n x n adjacency matrix graph, where the ith node is directly connected to the jth node if graph[i][j] == 1.
-
-
Some nodes initial are initially infected by malware. Whenever two nodes are directly connected, and at least one of those two nodes is infected by malware, both nodes will be infected by malware. This spread of malware will continue until no more nodes can be infected in this manner.
-
-
Suppose M(initial) is the final number of nodes infected with malware in the entire network after the spread of malware stops.
-
-
We will remove exactly one node from initial, completely removing it and any connections from this node to any other node.
-
-
Return the node that, if removed, would minimize M(initial). If multiple nodes could be removed to minimize M(initial), return such a node with the smallest index.
You are given a network of n nodes represented as an n x n adjacency matrix graph, where the ith node is directly connected to the jth node if graph[i][j] == 1.
-
-
Some nodes initial are initially infected by malware. Whenever two nodes are directly connected, and at least one of those two nodes is infected by malware, both nodes will be infected by malware. This spread of malware will continue until no more nodes can be infected in this manner.
-
-
Suppose M(initial) is the final number of nodes infected with malware in the entire network after the spread of malware stops. We will remove exactly one node from initial.
-
-
Return the node that, if removed, would minimize M(initial). If multiple nodes could be removed to minimize M(initial), return such a node with the smallest index.
-
-
Note that if a node was removed from the initial list of infected nodes, it might still be infected later due to the malware spread.
stations.length will be an integer in range [10, 2000].
-
stations[i] will be an integer in range [0, 10^8].
-
K will be an integer in range [1, 10^6].
-
Answers within 10^-6 of the true value will be accepted as correct.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
-
-### Similar Questions
- 1. [Koko Eating Bananas](../koko-eating-bananas) (Medium)
-
-### Hints
-
-Hint 1
-Use a binary search. We'll binary search the monotone function "possible(D) = can we use K or less gas stations to ensure each adjacent distance between gas stations is at most D?"
-
diff --git a/problems/minimize-max-distance-to-gas-station/minimize_max_distance_to_gas_station.go b/problems/minimize-max-distance-to-gas-station/minimize_max_distance_to_gas_station.go
deleted file mode 100644
index 65de0eca7..000000000
--- a/problems/minimize-max-distance-to-gas-station/minimize_max_distance_to_gas_station.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem774
diff --git a/problems/minimize-max-distance-to-gas-station/minimize_max_distance_to_gas_station_test.go b/problems/minimize-max-distance-to-gas-station/minimize_max_distance_to_gas_station_test.go
deleted file mode 100644
index 65de0eca7..000000000
--- a/problems/minimize-max-distance-to-gas-station/minimize_max_distance_to_gas_station_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem774
diff --git a/problems/minimize-maximum-pair-sum-in-array/README.md b/problems/minimize-maximum-pair-sum-in-array/README.md
deleted file mode 100644
index dc7eeaccd..000000000
--- a/problems/minimize-maximum-pair-sum-in-array/README.md
+++ /dev/null
@@ -1,73 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../substrings-of-size-three-with-distinct-characters "Substrings of Size Three with Distinct Characters")
-
-[Next >](../get-biggest-three-rhombus-sums-in-a-grid "Get Biggest Three Rhombus Sums in a Grid")
-
-## [1877. Minimize Maximum Pair Sum in Array (Medium)](https://leetcode.com/problems/minimize-maximum-pair-sum-in-array "数组中最大数对和的最小值")
-
-
The pair sum of a pair (a,b) is equal to a + b. The maximum pair sum is the largest pair sum in a list of pairs.
-
-
-
For example, if we have pairs (1,5), (2,3), and (4,4), the maximum pair sum would be max(1+5, 2+3, 4+4) = max(6, 5, 8) = 8.
-
-
-
Given an array nums of even length n, pair up the elements of nums into n / 2 pairs such that:
-
-
-
Each element of nums is in exactly one pair, and
-
The maximum pair sum is minimized.
-
-
-
Return the minimized maximum pair sum after optimally pairing up the elements.
-
-
-
Example 1:
-
-
-Input: nums = [3,5,2,3]
-Output: 7
-Explanation: The elements can be paired up into pairs (3,3) and (5,2).
-The maximum pair sum is max(3+3, 5+2) = max(6, 7) = 7.
-
-
-
Example 2:
-
-
-Input: nums = [3,5,4,2,4,6]
-Output: 8
-Explanation: The elements can be paired up into pairs (3,5), (4,4), and (6,2).
-The maximum pair sum is max(3+5, 4+4, 6+2) = max(8, 8, 8) = 8.
-
-
-
-
Constraints:
-
-
-
n == nums.length
-
2 <= n <= 105
-
n is even.
-
1 <= nums[i] <= 105
-
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Two Pointers](../../tag/two-pointers/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Hints
-
-Hint 1
-Would sorting help find the optimal order?
-
-
-
-Hint 2
-Given a specific element, how would you minimize its specific pairwise sum?
-
diff --git a/problems/minimize-product-sum-of-two-arrays/README.md b/problems/minimize-product-sum-of-two-arrays/README.md
deleted file mode 100644
index deb391bad..000000000
--- a/problems/minimize-product-sum-of-two-arrays/README.md
+++ /dev/null
@@ -1,30 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../calculate-special-bonus "Calculate Special Bonus")
-
-[Next >](../group-employees-of-the-same-salary "Group Employees of the Same Salary")
-
-## [1874. Minimize Product Sum of Two Arrays (Medium)](https://leetcode.com/problems/minimize-product-sum-of-two-arrays "两个数组的最小乘积和")
-
-
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Hints
-
-Hint 1
-Is there a particular way we should order the arrays such that the product sum is minimized?
-
-
-
-Hint 2
-Would you want to multiply two numbers that are closer to one another or further?
-
diff --git a/problems/minimize-rounding-error-to-meet-target/README.md b/problems/minimize-rounding-error-to-meet-target/README.md
deleted file mode 100644
index 6dfbedfbc..000000000
--- a/problems/minimize-rounding-error-to-meet-target/README.md
+++ /dev/null
@@ -1,68 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../campus-bikes "Campus Bikes")
-
-[Next >](../all-paths-from-source-lead-to-destination "All Paths from Source Lead to Destination")
-
-## [1058. Minimize Rounding Error to Meet Target (Medium)](https://leetcode.com/problems/minimize-rounding-error-to-meet-target "最小化舍入误差以满足目标")
-
-
Given an array of prices [p1,p2...,pn] and a target, round each price pi to Roundi(pi) so that the rounded array [Round1(p1),Round2(p2)...,Roundn(pn)] sums to the given target. Each operation Roundi(pi) could be either Floor(pi) or Ceil(pi).
-
-
Return the string "-1" if the rounded array is impossible to sum to target. Otherwise, return the smallest rounding error, which is defined as Σ |Roundi(pi) - (pi)| for i from 1 to n, as a string with three places after the decimal.
-Input: prices = ["1.500","2.500","3.500"], target = 10
-Output: "-1"
-Explanation:
-It is impossible to meet the target.
-
-
-
-
-
Note:
-
-
-
1 <= prices.length <= 500.
-
Each string of prices prices[i] represents a real number which is between 0 and 1000 and has exactly 3 decimal places.
-
target is between 0 and 1000000.
-
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Math](../../tag/math/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Hints
-
-Hint 1
-If we have integer values in the array then we just need to subtract the target those integer values, so we reduced the problem.
-
-
-
-Hint 2
-Similarly if we have non integer values we have two options to put them flor(value) or ceil(value) = floor(value) + 1, so the idea is to just subtract floor(value).
-
-
-
-Hint 3
-Now the problem is different for each position we can sum just add 0 or 1 in order to sum the target, minimizing the deltas. This can be solved with DP.
-
diff --git a/problems/minimize-the-difference-between-target-and-chosen-elements/README.md b/problems/minimize-the-difference-between-target-and-chosen-elements/README.md
deleted file mode 100644
index 37fe28b71..000000000
--- a/problems/minimize-the-difference-between-target-and-chosen-elements/README.md
+++ /dev/null
@@ -1,81 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../find-unique-binary-string "Find Unique Binary String")
-
-[Next >](../find-array-given-subset-sums "Find Array Given Subset Sums")
-
-## [1981. Minimize the Difference Between Target and Chosen Elements (Medium)](https://leetcode.com/problems/minimize-the-difference-between-target-and-chosen-elements "最小化目标值与所选元素的差")
-
-
You are given an m x n integer matrix mat and an integer target.
-
-
Choose one integer from each row in the matrix such that the absolute difference between target and the sum of the chosen elements is minimized.
-
-
Return the minimum absolute difference.
-
-
The absolute difference between two numbers a and b is the absolute value of a - b.
-
-
-
Example 1:
-
-
-Input: mat = [[1,2,3],[4,5,6],[7,8,9]], target = 13
-Output: 0
-Explanation: One possible choice is to:
-- Choose 1 from the first row.
-- Choose 5 from the second row.
-- Choose 7 from the third row.
-The sum of the chosen elements is 13, which equals the target, so the absolute difference is 0.
-
-
-
Example 2:
-
-
-Input: mat = [[1],[2],[3]], target = 100
-Output: 94
-Explanation: The best possible choice is to:
-- Choose 1 from the first row.
-- Choose 2 from the second row.
-- Choose 3 from the third row.
-The sum of the chosen elements is 6, and the absolute difference is 94.
-
-
-
Example 3:
-
-
-Input: mat = [[1,2,9,8,7]], target = 6
-Output: 1
-Explanation: The best choice is to choose 7 from the first row.
-The absolute difference is 1.
-
-
-
-
Constraints:
-
-
-
m == mat.length
-
n == mat[i].length
-
1 <= m, n <= 70
-
1 <= mat[i][j] <= 70
-
1 <= target <= 800
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
-
-### Hints
-
-Hint 1
-The sum of chosen elements will not be too large. Consider using a hash set to record all possible sums while iterating each row.
-
-
-
-Hint 2
-Instead of keeping track of all possible sums, since in each row, we are adding positive numbers, only keep those that can be a candidate, not exceeding the target by too much.
-
diff --git a/problems/minimized-maximum-of-products-distributed-to-any-store/README.md b/problems/minimized-maximum-of-products-distributed-to-any-store/README.md
deleted file mode 100644
index 3f1dcfa07..000000000
--- a/problems/minimized-maximum-of-products-distributed-to-any-store/README.md
+++ /dev/null
@@ -1,86 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../vowels-of-all-substrings "Vowels of All Substrings")
-
-[Next >](../maximum-path-quality-of-a-graph "Maximum Path Quality of a Graph")
-
-## [2064. Minimized Maximum of Products Distributed to Any Store (Medium)](https://leetcode.com/problems/minimized-maximum-of-products-distributed-to-any-store "分配给商店的最多商品的最小值")
-
-
You are given an integer n indicating there are n specialty retail stores. There are m product types of varying amounts, which are given as a 0-indexed integer array quantities, where quantities[i] represents the number of products of the ith product type.
-
-
You need to distribute all products to the retail stores following these rules:
-
-
-
A store can only be given at most one product type but can be given any amount of it.
-
After distribution, each store will have been given some number of products (possibly 0). Let x represent the maximum number of products given to any store. You want x to be as small as possible, i.e., you want to minimize the maximum number of products that are given to any store.
-
-
-
Return the minimum possiblex.
-
-
-
Example 1:
-
-
-Input: n = 6, quantities = [11,6]
-Output: 3
-Explanation: One optimal way is:
-- The 11 products of type 0 are distributed to the first four stores in these amounts: 2, 3, 3, 3
-- The 6 products of type 1 are distributed to the other two stores in these amounts: 3, 3
-The maximum number of products given to any store is max(2, 3, 3, 3, 3, 3) = 3.
-
-
-
Example 2:
-
-
-Input: n = 7, quantities = [15,10,10]
-Output: 5
-Explanation: One optimal way is:
-- The 15 products of type 0 are distributed to the first three stores in these amounts: 5, 5, 5
-- The 10 products of type 1 are distributed to the next two stores in these amounts: 5, 5
-- The 10 products of type 2 are distributed to the last two stores in these amounts: 5, 5
-The maximum number of products given to any store is max(5, 5, 5, 5, 5, 5, 5) = 5.
-
-
-
Example 3:
-
-
-Input: n = 1, quantities = [100000]
-Output: 100000
-Explanation: The only optimal way is:
-- The 100000 products of type 0 are distributed to the only store.
-The maximum number of products given to any store is max(100000) = 100000.
-
-
-
-
Constraints:
-
-
-
m == quantities.length
-
1 <= m <= n <= 105
-
1 <= quantities[i] <= 105
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
-
-### Hints
-
-Hint 1
-There exists a monotonic nature such that when x is smaller than some number, there will be no way to distribute, and when x is not smaller than that number, there will always be a way to distribute.
-
-
-
-Hint 2
-If you are given a number k, where the number of products given to any store does not exceed k, could you determine if all products can be distributed?
-
-
-
-Hint 3
-Implement a function canDistribute(k), which returns true if you can distribute all products such that any store will not be given more than k products, and returns false if you cannot. Use this function to binary search for the smallest possible k.
-
diff --git a/problems/minimum-absolute-difference-in-bst/README.md b/problems/minimum-absolute-difference-in-bst/README.md
deleted file mode 100644
index 65dc1df78..000000000
--- a/problems/minimum-absolute-difference-in-bst/README.md
+++ /dev/null
@@ -1,50 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minesweeper "Minesweeper")
-
-[Next >](../lonely-pixel-i "Lonely Pixel I")
-
-## [530. Minimum Absolute Difference in BST (Easy)](https://leetcode.com/problems/minimum-absolute-difference-in-bst "二叉搜索树的最小绝对差")
-
-
Given the root of a Binary Search Tree (BST), return the minimum absolute difference between the values of any two different nodes in the tree.
The minimum absolute difference of an array a is defined as the minimum value of |a[i] - a[j]|, where 0 <= i < j < a.length and a[i] != a[j]. If all elements of a are the same, the minimum absolute difference is -1.
-
-
-
For example, the minimum absolute difference of the array [5,2,3,7,2] is |2 - 3| = 1. Note that it is not 0 because a[i] and a[j] must be different.
-
-
-
You are given an integer array nums and the array queries where queries[i] = [li, ri]. For each query i, compute the minimum absolute difference of the subarraynums[li...ri] containing the elements of nums between the 0-based indices li and ri (inclusive).
-
-
Return an arrayanswhereans[i]is the answer to theithquery.
-
-
A subarray is a contiguous sequence of elements in an array.
-
-
The value of |x| is defined as:
-
-
-
x if x >= 0.
-
-x if x < 0.
-
-
-
-
Example 1:
-
-
-Input: nums = [1,3,4,8], queries = [[0,1],[1,2],[2,3],[0,3]]
-Output: [2,1,4,1]
-Explanation: The queries are processed as follows:
-- queries[0] = [0,1]: The subarray is [1,3] and the minimum absolute difference is |1-3| = 2.
-- queries[1] = [1,2]: The subarray is [3,4] and the minimum absolute difference is |3-4| = 1.
-- queries[2] = [2,3]: The subarray is [4,8] and the minimum absolute difference is |4-8| = 4.
-- queries[3] = [0,3]: The subarray is [1,3,4,8] and the minimum absolute difference is |3-4| = 1.
-
-
-
Example 2:
-
-
-Input: nums = [4,5,2,2,7,10], queries = [[2,3],[0,2],[0,5],[3,5]]
-Output: [-1,1,1,3]
-Explanation: The queries are processed as follows:
-- queries[0] = [2,3]: The subarray is [2,2] and the minimum absolute difference is -1 because all the
- elements are the same.
-- queries[1] = [0,2]: The subarray is [4,5,2] and the minimum absolute difference is |4-5| = 1.
-- queries[2] = [0,5]: The subarray is [4,5,2,2,7,10] and the minimum absolute difference is |4-5| = 1.
-- queries[3] = [3,5]: The subarray is [2,7,10] and the minimum absolute difference is |7-10| = 3.
-
-
-
-
Constraints:
-
-
-
2 <= nums.length <= 105
-
1 <= nums[i] <= 100
-
1 <= queries.length <= 2 * 104
-
0 <= li < ri < nums.length
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
-
-### Hints
-
-Hint 1
-How does the maximum value being 100 help us?
-
-
-
-Hint 2
-How can we tell if a number exists in a given range?
-
diff --git a/problems/minimum-absolute-difference/README.md b/problems/minimum-absolute-difference/README.md
deleted file mode 100644
index a2d9fe276..000000000
--- a/problems/minimum-absolute-difference/README.md
+++ /dev/null
@@ -1,70 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-time-to-build-blocks "Minimum Time to Build Blocks")
-
-[Next >](../ugly-number-iii "Ugly Number III")
-
-## [1200. Minimum Absolute Difference (Easy)](https://leetcode.com/problems/minimum-absolute-difference "最小绝对差")
-
-
Given an array of distinct integers arr, find all pairs of elements with the minimum absolute difference of any two elements.
-
-
Return a list of pairs in ascending order(with respect to pairs), each pair [a, b] follows
-
-
-
a, b are from arr
-
a < b
-
b - a equals to the minimum absolute difference of any two elements in arr
-
-
-
-
Example 1:
-
-
-Input: arr = [4,2,1,3]
-Output: [[1,2],[2,3],[3,4]]
-Explanation: The minimum absolute difference is 1. List all pairs with difference equal to 1 in ascending order.
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Similar Questions
- 1. [Minimum Cost of Buying Candies With Discount](../minimum-cost-of-buying-candies-with-discount) (Easy)
-
-### Hints
-
-Hint 1
-Find the minimum absolute difference between two elements in the array.
-
-
-
-Hint 2
-The minimum absolute difference must be a difference between two consecutive elements in the sorted array.
-
diff --git a/problems/minimum-absolute-sum-difference/README.md b/problems/minimum-absolute-sum-difference/README.md
deleted file mode 100644
index 9fc9ca593..000000000
--- a/problems/minimum-absolute-sum-difference/README.md
+++ /dev/null
@@ -1,84 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../finding-the-users-active-minutes "Finding the Users Active Minutes")
-
-[Next >](../number-of-different-subsequences-gcds "Number of Different Subsequences GCDs")
-
-## [1818. Minimum Absolute Sum Difference (Medium)](https://leetcode.com/problems/minimum-absolute-sum-difference "绝对差值和")
-
-
You are given two positive integer arrays nums1 and nums2, both of length n.
-
-
The absolute sum difference of arrays nums1 and nums2 is defined as the sum of |nums1[i] - nums2[i]| for each 0 <= i < n (0-indexed).
-
-
You can replace at most one element of nums1 with any other element in nums1 to minimize the absolute sum difference.
-
-
Return the minimum absolute sum difference after replacing at most oneelement in the array nums1. Since the answer may be large, return it modulo109 + 7.
-
-
|x| is defined as:
-
-
-
x if x >= 0, or
-
-x if x < 0.
-
-
-
-
Example 1:
-
-
-Input: nums1 = [1,7,5], nums2 = [2,3,5]
-Output: 3
-Explanation: There are two possible optimal solutions:
-- Replace the second element with the first: [1,7,5] => [1,1,5], or
-- Replace the second element with the third: [1,7,5] => [1,5,5].
-Both will yield an absolute sum difference of |1-2| + (|1-3| or |5-3|) + |5-5| = 3.
-
-
-
Example 2:
-
-
-Input: nums1 = [2,4,6,8,10], nums2 = [2,4,6,8,10]
-Output: 0
-Explanation: nums1 is equal to nums2 so no replacement is needed. This will result in an
-absolute sum difference of 0.
-
-
-
Example 3:
-
-
-Input: nums1 = [1,10,4,4,2,7], nums2 = [9,3,5,1,7,4]
-Output: 20
-Explanation: Replace the first element with the second: [1,10,4,4,2,7] => [10,10,4,4,2,7].
-This yields an absolute sum difference of |10-9| + |10-3| + |4-5| + |4-1| + |2-7| + |7-4| = 20
-
-
-
-
Constraints:
-
-
-
n == nums1.length
-
n == nums2.length
-
1 <= n <= 105
-
1 <= nums1[i], nums2[i] <= 105
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
- [[Ordered Set](../../tag/ordered-set/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Hints
-
-Hint 1
-Go through each element and test the optimal replacements.
-
-
-
-Hint 2
-There are only 2 possible replacements for each element (higher and lower) that are optimal.
-
diff --git a/problems/minimum-add-to-make-parentheses-valid/README.md b/problems/minimum-add-to-make-parentheses-valid/README.md
deleted file mode 100644
index f22abd1a7..000000000
--- a/problems/minimum-add-to-make-parentheses-valid/README.md
+++ /dev/null
@@ -1,59 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../number-of-music-playlists "Number of Music Playlists")
-
-[Next >](../sort-array-by-parity-ii "Sort Array By Parity II")
-
-## [921. Minimum Add to Make Parentheses Valid (Medium)](https://leetcode.com/problems/minimum-add-to-make-parentheses-valid "使括号有效的最少添加")
-
-
A parentheses string is valid if and only if:
-
-
-
It is the empty string,
-
It can be written as AB (A concatenated with B), where A and B are valid strings, or
-
It can be written as (A), where A is a valid string.
-
-
-
You are given a parentheses string s. In one move, you can insert a parenthesis at any position of the string.
-
-
-
For example, if s = "()))", you can insert an opening parenthesis to be "(()))" or a closing parenthesis to be "())))".
-
-
-
Return the minimum number of moves required to make s valid.
-
-
-
Example 1:
-
-
-Input: s = "())"
-Output: 1
-
-
-
Example 2:
-
-
-Input: s = "((("
-Output: 3
-
-
-
-
Constraints:
-
-
-
1 <= s.length <= 1000
-
s[i] is either '(' or ')'.
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
- [[Stack](../../tag/stack/README.md)]
- [[Greedy](../../tag/greedy/README.md)]
-
-### Similar Questions
- 1. [Minimum Number of Swaps to Make the String Balanced](../minimum-number-of-swaps-to-make-the-string-balanced) (Medium)
diff --git a/problems/minimum-add-to-make-parentheses-valid/minimum_add_to_make_parentheses_valid.go b/problems/minimum-add-to-make-parentheses-valid/minimum_add_to_make_parentheses_valid.go
deleted file mode 100644
index a03a3f50a..000000000
--- a/problems/minimum-add-to-make-parentheses-valid/minimum_add_to_make_parentheses_valid.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem921
diff --git a/problems/minimum-add-to-make-parentheses-valid/minimum_add_to_make_parentheses_valid_test.go b/problems/minimum-add-to-make-parentheses-valid/minimum_add_to_make_parentheses_valid_test.go
deleted file mode 100644
index a03a3f50a..000000000
--- a/problems/minimum-add-to-make-parentheses-valid/minimum_add_to_make_parentheses_valid_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem921
diff --git a/problems/minimum-adjacent-swaps-for-k-consecutive-ones/README.md b/problems/minimum-adjacent-swaps-for-k-consecutive-ones/README.md
deleted file mode 100644
index 2f7a8dce0..000000000
--- a/problems/minimum-adjacent-swaps-for-k-consecutive-ones/README.md
+++ /dev/null
@@ -1,76 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-binary-string-after-change "Maximum Binary String After Change")
-
-[Next >](../determine-if-string-halves-are-alike "Determine if String Halves Are Alike")
-
-## [1703. Minimum Adjacent Swaps for K Consecutive Ones (Hard)](https://leetcode.com/problems/minimum-adjacent-swaps-for-k-consecutive-ones "得到连续 K 个 1 的最少相邻交换次数")
-
-
You are given an integer array, nums, and an integer k. nums comprises of only 0's and 1's. In one move, you can choose two adjacent indices and swap their values.
-
-
Return the minimum number of moves required so that nums has kconsecutive1's.
-
-
-
Example 1:
-
-
-Input: nums = [1,0,0,1,0,1], k = 2
-Output: 1
-Explanation: In 1 move, nums could be [1,0,0,0,1,1] and have 2 consecutive 1's.
-
-
-
Example 2:
-
-
-Input: nums = [1,0,0,0,0,0,1,1], k = 3
-Output: 5
-Explanation: In 5 moves, the leftmost 1 can be shifted right until nums = [0,0,0,0,0,1,1,1].
-
-
-
Example 3:
-
-
-Input: nums = [1,1,0,1], k = 2
-Output: 0
-Explanation: nums already has 2 consecutive 1's.
-
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 105
-
nums[i] is 0 or 1.
-
1 <= k <= sum(nums)
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Greedy](../../tag/greedy/README.md)]
- [[Sliding Window](../../tag/sliding-window/README.md)]
- [[Prefix Sum](../../tag/prefix-sum/README.md)]
-
-### Similar Questions
- 1. [Minimum Swaps to Group All 1's Together](../minimum-swaps-to-group-all-1s-together) (Medium)
- 1. [Minimum Number of Operations to Make Array Continuous](../minimum-number-of-operations-to-make-array-continuous) (Hard)
-
-### Hints
-
-Hint 1
-Choose k 1s and determine how many steps are required to move them into 1 group.
-
-
-
-Hint 2
-Maintain a sliding window of k 1s, and maintain the steps required to group them.
-
-
-
-Hint 3
-When you slide the window across, should you move the group to the right? Once you move the group to the right, it will never need to slide to the left again.
-
diff --git a/problems/minimum-adjacent-swaps-to-reach-the-kth-smallest-number/README.md b/problems/minimum-adjacent-swaps-to-reach-the-kth-smallest-number/README.md
deleted file mode 100644
index 59c7fc47c..000000000
--- a/problems/minimum-adjacent-swaps-to-reach-the-kth-smallest-number/README.md
+++ /dev/null
@@ -1,88 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../splitting-a-string-into-descending-consecutive-values "Splitting a String Into Descending Consecutive Values")
-
-[Next >](../minimum-interval-to-include-each-query "Minimum Interval to Include Each Query")
-
-## [1850. Minimum Adjacent Swaps to Reach the Kth Smallest Number (Medium)](https://leetcode.com/problems/minimum-adjacent-swaps-to-reach-the-kth-smallest-number "邻位交换的最小次数")
-
-
You are given a string num, representing a large integer, and an integer k.
-
-
We call some integer wonderful if it is a permutation of the digits in num and is greater in value than num. There can be many wonderful integers. However, we only care about the smallest-valued ones.
-
-
-
For example, when num = "5489355142":
-
-
The 1st smallest wonderful integer is "5489355214".
-
The 2nd smallest wonderful integer is "5489355241".
-
The 3rd smallest wonderful integer is "5489355412".
-
The 4th smallest wonderful integer is "5489355421".
-
-
-
-
-
Return the minimum number of adjacent digit swaps that needs to be applied to num to reach the kth smallest wonderful integer.
-
-
The tests are generated in such a way that kth smallest wonderful integer exists.
-
-
-
Example 1:
-
-
-Input: num = "5489355142", k = 4
-Output: 2
-Explanation: The 4th smallest wonderful number is "5489355421". To get this number:
-- Swap index 7 with index 8: "5489355142" -> "5489355412"
-- Swap index 8 with index 9: "5489355412" -> "5489355421"
-
-
-
Example 2:
-
-
-Input: num = "11112", k = 4
-Output: 4
-Explanation: The 4th smallest wonderful number is "21111". To get this number:
-- Swap index 3 with index 4: "11112" -> "11121"
-- Swap index 2 with index 3: "11121" -> "11211"
-- Swap index 1 with index 2: "11211" -> "12111"
-- Swap index 0 with index 1: "12111" -> "21111"
-
-
-
Example 3:
-
-
-Input: num = "00123", k = 1
-Output: 1
-Explanation: The 1st smallest wonderful number is "00132". To get this number:
-- Swap index 3 with index 4: "00123" -> "00132"
-
-
-
-
Constraints:
-
-
-
2 <= num.length <= 1000
-
1 <= k <= 1000
-
num only consists of digits.
-
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[Two Pointers](../../tag/two-pointers/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Hints
-
-Hint 1
-Find the next permutation of the given string k times.
-
-
-
-Hint 2
-Try to move each element to its correct position and calculate the number of steps.
-
diff --git a/problems/minimum-area-rectangle-ii/README.md b/problems/minimum-area-rectangle-ii/README.md
deleted file mode 100644
index c413480e8..000000000
--- a/problems/minimum-area-rectangle-ii/README.md
+++ /dev/null
@@ -1,58 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-width-ramp "Maximum Width Ramp")
-
-[Next >](../least-operators-to-express-number "Least Operators to Express Number")
-
-## [963. Minimum Area Rectangle II (Medium)](https://leetcode.com/problems/minimum-area-rectangle-ii "最小面积矩形 II")
-
-
You are given an array of points in the X-Y plane points where points[i] = [xi, yi].
-
-
Return the minimum area of any rectangle formed from these points, with sides not necessarily parallel to the X and Y axes. If there is not any such rectangle, return 0.
-
-
Answers within 10-5 of the actual answer will be accepted.
-
-
-
Example 1:
-
-
-Input: points = [[1,2],[2,1],[1,0],[0,1]]
-Output: 2.00000
-Explanation: The minimum area rectangle occurs at [1,2],[2,1],[1,0],[0,1], with an area of 2.
-
-
-
Example 2:
-
-
-Input: points = [[0,1],[2,1],[1,1],[1,0],[2,0]]
-Output: 1.00000
-Explanation: The minimum area rectangle occurs at [1,0],[1,1],[2,1],[2,0], with an area of 1.
-
-
-
Example 3:
-
-
-Input: points = [[0,3],[1,2],[3,1],[1,3],[2,1]]
-Output: 0
-Explanation: There is no possible rectangle to form from these points.
-
You are given an array of points in the X-Y plane points where points[i] = [xi, yi].
-
-
Return the minimum area of a rectangle formed from these points, with sides parallel to the X and Y axes. If there is not any such rectangle, return 0.
Given two strings s1 and s2, return the lowest ASCII sum of deleted characters to make two strings equal.
-
-
-
Example 1:
-
-
-Input: s1 = "sea", s2 = "eat"
-Output: 231
-Explanation: Deleting "s" from "sea" adds the ASCII value of "s" (115) to the sum.
-Deleting "t" from "eat" adds 116 to the sum.
-At the end, both strings are equal, and 115 + 116 = 231 is the minimum sum possible to achieve this.
-
-
-
Example 2:
-
-
-Input: s1 = "delete", s2 = "leet"
-Output: 403
-Explanation: Deleting "dee" from "delete" to turn the string into "let",
-adds 100[d] + 101[e] + 101[e] to the sum.
-Deleting "e" from "leet" adds 101[e] to the sum.
-At the end, both strings are equal to "let", and the answer is 100+101+101+101 = 403.
-If instead we turned both strings into "lee" or "eet", we would get answers of 433 or 417, which are higher.
-
-
-
-
Constraints:
-
-
-
1 <= s1.length, s2.length <= 1000
-
s1 and s2 consist of lowercase English letters.
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Similar Questions
- 1. [Edit Distance](../edit-distance) (Hard)
- 1. [Longest Increasing Subsequence](../longest-increasing-subsequence) (Medium)
- 1. [Delete Operation for Two Strings](../delete-operation-for-two-strings) (Medium)
-
-### Hints
-
-Hint 1
-Let dp(i, j) be the answer for inputs s1[i:] and s2[j:].
-
diff --git a/problems/minimum-ascii-delete-sum-for-two-strings/minimum_ascii_delete_sum_for_two_strings.go b/problems/minimum-ascii-delete-sum-for-two-strings/minimum_ascii_delete_sum_for_two_strings.go
deleted file mode 100644
index d32b0b4b0..000000000
--- a/problems/minimum-ascii-delete-sum-for-two-strings/minimum_ascii_delete_sum_for_two_strings.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem712
diff --git a/problems/minimum-ascii-delete-sum-for-two-strings/minimum_ascii_delete_sum_for_two_strings_test.go b/problems/minimum-ascii-delete-sum-for-two-strings/minimum_ascii_delete_sum_for_two_strings_test.go
deleted file mode 100644
index d32b0b4b0..000000000
--- a/problems/minimum-ascii-delete-sum-for-two-strings/minimum_ascii_delete_sum_for_two_strings_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem712
diff --git a/problems/minimum-changes-to-make-alternating-binary-string/README.md b/problems/minimum-changes-to-make-alternating-binary-string/README.md
deleted file mode 100644
index 88450664e..000000000
--- a/problems/minimum-changes-to-make-alternating-binary-string/README.md
+++ /dev/null
@@ -1,70 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../recyclable-and-low-fat-products "Recyclable and Low Fat Products")
-
-[Next >](../count-number-of-homogenous-substrings "Count Number of Homogenous Substrings")
-
-## [1758. Minimum Changes To Make Alternating Binary String (Easy)](https://leetcode.com/problems/minimum-changes-to-make-alternating-binary-string "生成交替二进制字符串的最少操作数")
-
-
You are given a string s consisting only of the characters '0' and '1'. In one operation, you can change any '0' to '1' or vice versa.
-
-
The string is called alternating if no two adjacent characters are equal. For example, the string "010" is alternating, while the string "0100" is not.
-
-
Return the minimum number of operations needed to makesalternating.
-
-
-
Example 1:
-
-
-Input: s = "0100"
-Output: 1
-Explanation: If you change the last character to '1', s will be "0101", which is alternating.
-
-
-
Example 2:
-
-
-Input: s = "10"
-Output: 0
-Explanation: s is already alternating.
-
-
-
Example 3:
-
-
-Input: s = "1111"
-Output: 2
-Explanation: You need two operations to reach "0101" or "1010".
-
-
-
-
Constraints:
-
-
-
1 <= s.length <= 104
-
s[i] is either '0' or '1'.
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
-
-### Hints
-
-Hint 1
-Think about how the final string will look like.
-
-
-
-Hint 2
-It will either start with a '0' and be like '010101010..' or with a '1' and be like '10101010..'
-
-
-
-Hint 3
-Try both ways, and check for each way, the number of changes needed to reach it from the given string. The answer is the minimum of both ways.
-
diff --git a/problems/minimum-cost-for-tickets/README.md b/problems/minimum-cost-for-tickets/README.md
deleted file mode 100644
index 3cf8ec9f0..000000000
--- a/problems/minimum-cost-for-tickets/README.md
+++ /dev/null
@@ -1,72 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../triples-with-bitwise-and-equal-to-zero "Triples with Bitwise AND Equal To Zero")
-
-[Next >](../string-without-aaa-or-bbb "String Without AAA or BBB")
-
-## [983. Minimum Cost For Tickets (Medium)](https://leetcode.com/problems/minimum-cost-for-tickets "最低票价")
-
-
You have planned some train traveling one year in advance. The days of the year in which you will travel are given as an integer array days. Each day is an integer from 1 to 365.
-
-
Train tickets are sold in three different ways:
-
-
-
a 1-day pass is sold for costs[0] dollars,
-
a 7-day pass is sold for costs[1] dollars, and
-
a 30-day pass is sold for costs[2] dollars.
-
-
-
The passes allow that many days of consecutive travel.
-
-
-
For example, if we get a 7-day pass on day 2, then we can travel for 7 days: 2, 3, 4, 5, 6, 7, and 8.
-
-
-
Return the minimum number of dollars you need to travel every day in the given list of days.
-
-
-
Example 1:
-
-
-Input: days = [1,4,6,7,8,20], costs = [2,7,15]
-Output: 11
-Explanation: For example, here is one way to buy passes that lets you travel your travel plan:
-On day 1, you bought a 1-day pass for costs[0] = $2, which covered day 1.
-On day 3, you bought a 7-day pass for costs[1] = $7, which covered days 3, 4, ..., 9.
-On day 20, you bought a 1-day pass for costs[0] = $2, which covered day 20.
-In total, you spent $11 and covered all the days of your travel.
-
-
-
Example 2:
-
-
-Input: days = [1,2,3,4,5,6,7,8,9,10,30,31], costs = [2,7,15]
-Output: 17
-Explanation: For example, here is one way to buy passes that lets you travel your travel plan:
-On day 1, you bought a 30-day pass for costs[2] = $15 which covered days 1, 2, ..., 30.
-On day 31, you bought a 1-day pass for costs[0] = $2 which covered day 31.
-In total, you spent $17 and covered all the days of your travel.
-
-
-
-
Constraints:
-
-
-
1 <= days.length <= 365
-
1 <= days[i] <= 365
-
days is in strictly increasing order.
-
costs.length == 3
-
1 <= costs[i] <= 1000
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Similar Questions
- 1. [Coin Change](../coin-change) (Medium)
diff --git a/problems/minimum-cost-for-tickets/minimum_cost_for_tickets.go b/problems/minimum-cost-for-tickets/minimum_cost_for_tickets.go
deleted file mode 100644
index d4918b0f8..000000000
--- a/problems/minimum-cost-for-tickets/minimum_cost_for_tickets.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem983
diff --git a/problems/minimum-cost-homecoming-of-a-robot-in-a-grid/README.md b/problems/minimum-cost-homecoming-of-a-robot-in-a-grid/README.md
deleted file mode 100644
index 49d80e975..000000000
--- a/problems/minimum-cost-homecoming-of-a-robot-in-a-grid/README.md
+++ /dev/null
@@ -1,75 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-number-of-buckets-required-to-collect-rainwater-from-houses "Minimum Number of Buckets Required to Collect Rainwater from Houses")
-
-[Next >](../count-fertile-pyramids-in-a-land "Count Fertile Pyramids in a Land")
-
-## [2087. Minimum Cost Homecoming of a Robot in a Grid (Medium)](https://leetcode.com/problems/minimum-cost-homecoming-of-a-robot-in-a-grid "网格图中机器人回家的最小代价")
-
-
There is an m x n grid, where (0, 0) is the top-left cell and (m - 1, n - 1) is the bottom-right cell. You are given an integer array startPos where startPos = [startrow, startcol] indicates that initially, a robot is at the cell (startrow, startcol). You are also given an integer array homePos where homePos = [homerow, homecol] indicates that its home is at the cell (homerow, homecol).
-
-
The robot needs to go to its home. It can move one cell in four directions: left, right, up, or down, and it can not move outside the boundary. Every move incurs some cost. You are further given two 0-indexed integer arrays: rowCosts of length m and colCosts of length n.
-
-
-
If the robot moves up or down into a cell whose row is r, then this move costs rowCosts[r].
-
If the robot moves left or right into a cell whose column is c, then this move costs colCosts[c].
-
-
-
Return the minimum total cost for this robot to return home.
-
-
-
Example 1:
-
-
-Input: startPos = [1, 0], homePos = [2, 3], rowCosts = [5, 4, 3], colCosts = [8, 2, 6, 7]
-Output: 18
-Explanation: One optimal path is that:
-Starting from (1, 0)
--> It goes down to (2, 0). This move costs rowCosts[2] = 3.
--> It goes right to (2, 1). This move costs colCosts[1] = 2.
--> It goes right to (2, 2). This move costs colCosts[2] = 6.
--> It goes right to (2, 3). This move costs colCosts[3] = 7.
-The total cost is 3 + 2 + 6 + 7 = 18
-
-
Example 2:
-
-
-Input: startPos = [0, 0], homePos = [0, 0], rowCosts = [5], colCosts = [26]
-Output: 0
-Explanation: The robot is already at its home. Since no moves occur, the total cost is 0.
-
-
-
-
Constraints:
-
-
-
m == rowCosts.length
-
n == colCosts.length
-
1 <= m, n <= 105
-
0 <= rowCosts[r], colCosts[c] <= 104
-
startPos.length == 2
-
homePos.length == 2
-
0 <= startrow, homerow < m
-
0 <= startcol, homecol < n
-
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
-
-### Hints
-
-Hint 1
-Irrespective of what path the robot takes, it will have to traverse all the rows between startRow and homeRow and all the columns between startCol and homeCol.
-
-
-
-Hint 2
-Hence, making any other move other than traversing the required rows and columns will potentially incur more cost which can be avoided.
-
diff --git a/problems/minimum-cost-of-buying-candies-with-discount/README.md b/problems/minimum-cost-of-buying-candies-with-discount/README.md
deleted file mode 100644
index f1b686fbd..000000000
--- a/problems/minimum-cost-of-buying-candies-with-discount/README.md
+++ /dev/null
@@ -1,100 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../choose-numbers-from-two-arrays-in-range "Choose Numbers From Two Arrays in Range")
-
-[Next >](../count-the-hidden-sequences "Count the Hidden Sequences")
-
-## [2144. Minimum Cost of Buying Candies With Discount (Easy)](https://leetcode.com/problems/minimum-cost-of-buying-candies-with-discount "打折购买糖果的最小开销")
-
-
A shop is selling candies at a discount. For every two candies sold, the shop gives a third candy for free.
-
-
The customer can choose any candy to take away for free as long as the cost of the chosen candy is less than or equal to the minimum cost of the two candies bought.
-
-
-
For example, if there are 4 candies with costs 1, 2, 3, and 4, and the customer buys candies with costs 2 and 3, they can take the candy with cost 1 for free, but not the candy with cost 4.
-
-
-
Given a 0-indexed integer array cost, where cost[i] denotes the cost of the ith candy, return the minimum cost of buying all the candies.
-
-
-
Example 1:
-
-
-Input: cost = [1,2,3]
-Output: 5
-Explanation: We buy the candies with costs 2 and 3, and take the candy with cost 1 for free.
-The total cost of buying all candies is 2 + 3 = 5. This is the only way we can buy the candies.
-Note that we cannot buy candies with costs 1 and 3, and then take the candy with cost 2 for free.
-The cost of the free candy has to be less than or equal to the minimum cost of the purchased candies.
-
-
-
Example 2:
-
-
-Input: cost = [6,5,7,9,2,2]
-Output: 23
-Explanation: The way in which we can get the minimum cost is described below:
-- Buy candies with costs 9 and 7
-- Take the candy with cost 6 for free
-- We buy candies with costs 5 and 2
-- Take the last remaining candy with cost 2 for free
-Hence, the minimum cost to buy all candies is 9 + 7 + 5 + 2 = 23.
-
-
-
Example 3:
-
-
-Input: cost = [5,5]
-Output: 10
-Explanation: Since there are only 2 candies, we buy both of them. There is not a third candy we can take for free.
-Hence, the minimum cost to buy all candies is 5 + 5 = 10.
-
-
-
-
Constraints:
-
-
-
1 <= cost.length <= 100
-
1 <= cost[i] <= 100
-
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Hints
-
-Hint 1
-If we consider costs from high to low, what is the maximum cost of a single candy that we can get for free?
-
-
-
-Hint 2
-How can we generalize this approach to maximize the costs of the candies we get for free?
-
-
-
-Hint 3
-Can “sorting” the array help us find the minimum cost?
-
-
-
-Hint 4
-If we consider costs from high to low, what is the maximum cost of a single candy that we can get for free?
-
-
-
-Hint 5
-How can we generalize this approach to maximize the costs of the candies we get for free?
-
-
-
-Hint 6
-Can “sorting” the array help us find the minimum cost?
-
diff --git a/problems/minimum-cost-to-change-the-final-value-of-expression/README.md b/problems/minimum-cost-to-change-the-final-value-of-expression/README.md
deleted file mode 100644
index 382e822b6..000000000
--- a/problems/minimum-cost-to-change-the-final-value-of-expression/README.md
+++ /dev/null
@@ -1,89 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../largest-magic-square "Largest Magic Square")
-
-[Next >](../redistribute-characters-to-make-all-strings-equal "Redistribute Characters to Make All Strings Equal")
-
-## [1896. Minimum Cost to Change the Final Value of Expression (Hard)](https://leetcode.com/problems/minimum-cost-to-change-the-final-value-of-expression "反转表达式值的最少操作次数")
-
-
You are given a valid boolean expression as a string expression consisting of the characters '1','0','&' (bitwise AND operator),'|' (bitwise OR operator),'(', and ')'.
-
-
-
For example, "()1|1" and "(1)&()" are not valid while "1", "(((1))|(0))", and "1|(0&(1))" are valid expressions.
-
-
-
Return the minimum cost to change the final value of the expression.
-
-
-
For example, if expression = "1|1|(0&0)&1", its value is 1|1|(0&0)&1 = 1|1|0&1 = 1|0&1 = 1&1 = 1. We want to apply operations so that the new expression evaluates to 0.
-
-
-
The cost of changing the final value of an expression is the number of operations performed on the expression. The types of operations are described as follows:
-
-
-
Turn a '1' into a '0'.
-
Turn a '0' into a '1'.
-
Turn a '&' into a '|'.
-
Turn a '|' into a '&'.
-
-
-
Note:'&' does not take precedence over '|' in the order of calculation. Evaluate parentheses first, then in left-to-right order.
-
-
-
Example 1:
-
-
-Input: expression = "1&(0|1)"
-Output: 1
-Explanation: We can turn "1&(0|1)" into "1&(0&1)" by changing the '|' to a '&' using 1 operation.
-The new expression evaluates to 0.
-
-
-
Example 2:
-
-
-Input: expression = "(0&0)&(0&0&0)"
-Output: 3
-Explanation: We can turn "(0&0)&(0&0&0)" into "(0|1)|(0&0&0)" using 3 operations.
-The new expression evaluates to 1.
-
-
-
Example 3:
-
-
-Input: expression = "(0|(1|0&1))"
-Output: 1
-Explanation: We can turn "(0|(1|0&1))" into "(0|(0|0&1))" using 1 operation.
-The new expression evaluates to 0.
-
-
-
Constraints:
-
-
-
1 <= expression.length <= 105
-
expression only contains '1','0','&','|','(', and ')'
-
All parentheses are properly matched.
-
There will be no empty parentheses (i.e: "()" is not a substring of expression).
-
-
-### Related Topics
- [[Stack](../../tag/stack/README.md)]
- [[Math](../../tag/math/README.md)]
- [[String](../../tag/string/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Hints
-
-Hint 1
-How many possible states are there for a given expression?
-
-
-
-Hint 2
-Is there a data structure that we can use to solve the problem optimally?
-
diff --git a/problems/minimum-cost-to-connect-sticks/README.md b/problems/minimum-cost-to-connect-sticks/README.md
deleted file mode 100644
index f2782da11..000000000
--- a/problems/minimum-cost-to-connect-sticks/README.md
+++ /dev/null
@@ -1,63 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../design-file-system "Design File System")
-
-[Next >](../optimize-water-distribution-in-a-village "Optimize Water Distribution in a Village")
-
-## [1167. Minimum Cost to Connect Sticks (Medium)](https://leetcode.com/problems/minimum-cost-to-connect-sticks "连接棒材的最低费用")
-
-
You have some sticks with positive integer lengths.
-
-
You can connect any two sticks of lengths X and Y into one stick by paying a cost of X + Y. You perform this action until there is one stick remaining.
-
-
Return the minimum cost of connecting all the given sticks into one stick in this way.
-
-
-
Example 1:
-
Input: sticks = [2,4,3]
-Output: 14
-
Example 2:
-
Input: sticks = [1,8,3,5]
-Output: 30
-
-
-
Constraints:
-
-
-
1 <= sticks.length <= 10^4
-
1 <= sticks[i] <= 10^4
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Greedy](../../tag/greedy/README.md)]
- [[Heap (Priority Queue)](../../tag/heap-priority-queue/README.md)]
-
-### Similar Questions
- 1. [Minimum Cost to Merge Stones](../minimum-cost-to-merge-stones) (Hard)
-
-### Hints
-
-Hint 1
-How many times does every stick contribute to the answer?
-
-
-
-Hint 2
-Some of the sticks will be used more than the others. Which sticks should be used the most/least?
-
-
-
-Hint 3
-The sticks with long lengths cost a lot so we should use these the least.
-
-
-
-Hint 4
-What if we keep merging the two shortest sticks?
-
diff --git a/problems/minimum-cost-to-connect-two-groups-of-points/README.md b/problems/minimum-cost-to-connect-two-groups-of-points/README.md
deleted file mode 100644
index 64c0a7e2b..000000000
--- a/problems/minimum-cost-to-connect-two-groups-of-points/README.md
+++ /dev/null
@@ -1,80 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-non-negative-product-in-a-matrix "Maximum Non Negative Product in a Matrix")
-
-[Next >](../the-most-frequently-ordered-products-for-each-customer "The Most Frequently Ordered Products for Each Customer")
-
-## [1595. Minimum Cost to Connect Two Groups of Points (Hard)](https://leetcode.com/problems/minimum-cost-to-connect-two-groups-of-points "连通两组点的最小成本")
-
-
You are given two groups of points where the first group has size1 points, the second group has size2 points, and size1 >= size2.
-
-
The cost of the connection between any two points are given in an size1 x size2 matrix where cost[i][j] is the cost of connecting point i of the first group and point j of the second group. The groups are connected if each point in both groups is connected to one or more points in the opposite group. In other words, each point in the first group must be connected to at least one point in the second group, and each point in the second group must be connected to at least one point in the first group.
-
-
Return the minimum cost it takes to connect the two groups.
-
-
-
Example 1:
-
-
-Input: cost = [[15, 96], [36, 2]]
-Output: 17
-Explanation: The optimal way of connecting the groups is:
-1--A
-2--B
-This results in a total cost of 17.
-
-
-
Example 2:
-
-
-Input: cost = [[1, 3, 5], [4, 1, 1], [1, 5, 3]]
-Output: 4
-Explanation: The optimal way of connecting the groups is:
-1--A
-2--B
-2--C
-3--A
-This results in a total cost of 4.
-Note that there are multiple points connected to point 2 in the first group and point A in the second group. This does not matter as there is no limit to the number of points that can be connected. We only care about the minimum total cost.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Bit Manipulation](../../tag/bit-manipulation/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
- [[Bitmask](../../tag/bitmask/README.md)]
-
-### Hints
-
-Hint 1
-Each point on the left would either be connected to exactly point already connected to some left node, or a subset of the nodes on the right which are not connected to any node
-
-
-
-Hint 2
-Use dynamic programming with bitmasking, where the state will be (number of points assigned in first group, bitmask of points assigned in second group).
-
diff --git a/problems/minimum-cost-to-cut-a-stick/README.md b/problems/minimum-cost-to-cut-a-stick/README.md
deleted file mode 100644
index 232a331a8..000000000
--- a/problems/minimum-cost-to-cut-a-stick/README.md
+++ /dev/null
@@ -1,70 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-number-of-non-overlapping-subarrays-with-sum-equals-target "Maximum Number of Non-Overlapping Subarrays With Sum Equals Target")
-
-[Next >](../the-most-similar-path-in-a-graph "The Most Similar Path in a Graph")
-
-## [1547. Minimum Cost to Cut a Stick (Hard)](https://leetcode.com/problems/minimum-cost-to-cut-a-stick "切棍子的最小成本")
-
-
Given a wooden stick of length n units. The stick is labelled from 0 to n. For example, a stick of length 6 is labelled as follows:
-
-
Given an integer array cuts where cuts[i] denotes a position you should perform a cut at.
-
-
You should perform the cuts in order, you can change the order of the cuts as you wish.
-
-
The cost of one cut is the length of the stick to be cut, the total cost is the sum of costs of all cuts. When you cut a stick, it will be split into two smaller sticks (i.e. the sum of their lengths is the length of the stick before the cut). Please refer to the first example for a better explanation.
-
-
Return the minimum total cost of the cuts.
-
-
-
Example 1:
-
-
-Input: n = 7, cuts = [1,3,4,5]
-Output: 16
-Explanation: Using cuts order = [1, 3, 4, 5] as in the input leads to the following scenario:
-
-The first cut is done to a rod of length 7 so the cost is 7. The second cut is done to a rod of length 6 (i.e. the second part of the first cut), the third is done to a rod of length 4 and the last cut is to a rod of length 3. The total cost is 7 + 6 + 4 + 3 = 20.
-Rearranging the cuts to be [3, 5, 1, 4] for example will lead to a scenario with total cost = 16 (as shown in the example photo 7 + 4 + 3 + 2 = 16).
-
-
Example 2:
-
-
-Input: n = 9, cuts = [5,6,1,4,2]
-Output: 22
-Explanation: If you try the given cuts ordering the cost will be 25.
-There are much ordering with total cost <= 25, for example, the order [4, 6, 5, 2, 1] has total cost = 22 which is the minimum possible.
-
-
-
-
Constraints:
-
-
-
2 <= n <= 106
-
1 <= cuts.length <= min(n - 1, 100)
-
1 <= cuts[i] <= n - 1
-
All the integers in cuts array are distinct.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Similar Questions
- 1. [Number of Ways to Divide a Long Corridor](../number-of-ways-to-divide-a-long-corridor) (Hard)
-
-### Hints
-
-Hint 1
-Build a dp array where dp[i][j] is the minimum cost to achieve all the cuts between i and j.
-
-
-
-Hint 2
-When you try to get the minimum cost between i and j, try all possible cuts k between them, dp[i][j] = min(dp[i][k] + dp[k][j]) + (j - i) for all possible cuts k between them.
-
diff --git a/problems/minimum-cost-to-hire-k-workers/README.md b/problems/minimum-cost-to-hire-k-workers/README.md
deleted file mode 100644
index 388c7e447..000000000
--- a/problems/minimum-cost-to-hire-k-workers/README.md
+++ /dev/null
@@ -1,55 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../score-of-parentheses "Score of Parentheses")
-
-[Next >](../mirror-reflection "Mirror Reflection")
-
-## [857. Minimum Cost to Hire K Workers (Hard)](https://leetcode.com/problems/minimum-cost-to-hire-k-workers "雇佣 K 名工人的最低成本")
-
-
There are n workers. You are given two integer arrays quality and wage where quality[i] is the quality of the ith worker and wage[i] is the minimum wage expectation for the ith worker.
-
-
We want to hire exactly k workers to form a paid group. To hire a group of k workers, we must pay them according to the following rules:
-
-
-
Every worker in the paid group should be paid in the ratio of their quality compared to other workers in the paid group.
-
Every worker in the paid group must be paid at least their minimum wage expectation.
-
-
-
Given the integer k, return the least amount of money needed to form a paid group satisfying the above conditions. Answers within 10-5 of the actual answer will be accepted.
-
-
-
Example 1:
-
-
-Input: quality = [10,20,5], wage = [70,50,30], k = 2
-Output: 105.00000
-Explanation: We pay 70 to 0th worker and 35 to 2nd worker.
-
-
-
Example 2:
-
-
-Input: quality = [3,1,10,10,1], wage = [4,8,2,2,7], k = 3
-Output: 30.66667
-Explanation: We pay 4 to 0th worker, 13.33333 to 2nd and 3rd workers separately.
-
-
-
-
Constraints:
-
-
-
n == quality.length == wage.length
-
1 <= k <= n <= 104
-
1 <= quality[i], wage[i] <= 104
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Greedy](../../tag/greedy/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
- [[Heap (Priority Queue)](../../tag/heap-priority-queue/README.md)]
diff --git a/problems/minimum-cost-to-hire-k-workers/minimum_cost_to_hire_k_workers.go b/problems/minimum-cost-to-hire-k-workers/minimum_cost_to_hire_k_workers.go
deleted file mode 100644
index 4a59f0940..000000000
--- a/problems/minimum-cost-to-hire-k-workers/minimum_cost_to_hire_k_workers.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem857
diff --git a/problems/minimum-cost-to-hire-k-workers/minimum_cost_to_hire_k_workers_test.go b/problems/minimum-cost-to-hire-k-workers/minimum_cost_to_hire_k_workers_test.go
deleted file mode 100644
index 4a59f0940..000000000
--- a/problems/minimum-cost-to-hire-k-workers/minimum_cost_to_hire_k_workers_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem857
diff --git a/problems/minimum-cost-to-make-at-least-one-valid-path-in-a-grid/README.md b/problems/minimum-cost-to-make-at-least-one-valid-path-in-a-grid/README.md
deleted file mode 100644
index 3a3ecc6b7..000000000
--- a/problems/minimum-cost-to-make-at-least-one-valid-path-in-a-grid/README.md
+++ /dev/null
@@ -1,96 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../linked-list-in-binary-tree "Linked List in Binary Tree")
-
-[Next >](../get-the-second-most-recent-activity "Get the Second Most Recent Activity")
-
-## [1368. Minimum Cost to Make at Least One Valid Path in a Grid (Hard)](https://leetcode.com/problems/minimum-cost-to-make-at-least-one-valid-path-in-a-grid "使网格图至少有一条有效路径的最小代价")
-
-Given a m x ngrid. Each cell of the grid has a sign pointing to the next cell you should visit if you are currently in this cell. The sign of grid[i][j] can be:
-
-
1 which means go to the cell to the right. (i.e go from grid[i][j] to grid[i][j + 1])
-
2 which means go to the cell to the left. (i.e go from grid[i][j] to grid[i][j - 1])
-
3 which means go to the lower cell. (i.e go from grid[i][j] to grid[i + 1][j])
-
4 which means go to the upper cell. (i.e go from grid[i][j] to grid[i - 1][j])
-
-
-
Notice that there could be some invalid signs on the cells of the grid which points outside the grid.
-
-
You will initially start at the upper left cell (0,0). A valid path in the grid is a path which starts from the upper left cell (0,0) and ends at the bottom-right cell (m - 1, n - 1) following the signs on the grid. The valid path doesn't have to be the shortest.
-
-
You can modify the sign on a cell with cost = 1. You can modify the sign on a cell one time only.
-
-
Return the minimum cost to make the grid have at least one valid path.
-
-
-
Example 1:
-
-
-Input: grid = [[1,1,1,1],[2,2,2,2],[1,1,1,1],[2,2,2,2]]
-Output: 3
-Explanation: You will start at point (0, 0).
-The path to (3, 3) is as follows. (0, 0) --> (0, 1) --> (0, 2) --> (0, 3) change the arrow to down with cost = 1 --> (1, 3) --> (1, 2) --> (1, 1) --> (1, 0) change the arrow to down with cost = 1 --> (2, 0) --> (2, 1) --> (2, 2) --> (2, 3) change the arrow to down with cost = 1 --> (3, 3)
-The total cost = 3.
-
-
-
Example 2:
-
-
-Input: grid = [[1,1,3],[3,2,2],[1,1,4]]
-Output: 0
-Explanation: You can follow the path from (0, 0) to (2, 2).
-
-
-
Example 3:
-
-
-Input: grid = [[1,2],[4,3]]
-Output: 1
-
-
-
Example 4:
-
-
-Input: grid = [[2,2,2],[2,2,2]]
-Output: 3
-
-
-
Example 5:
-
-
-Input: grid = [[4]]
-Output: 0
-
-
-
-
Constraints:
-
-
-
m == grid.length
-
n == grid[i].length
-
1 <= m, n <= 100
-
-
-### Related Topics
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Graph](../../tag/graph/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
- [[Shortest Path](../../tag/shortest-path/README.md)]
- [[Heap (Priority Queue)](../../tag/heap-priority-queue/README.md)]
-
-### Hints
-
-Hint 1
-Build a graph where grid[i][j] is connected to all the four side-adjacent cells with weighted edge. the weight is 0 if the sign is pointing to the adjacent cell or 1 otherwise.
-
-
-
-Hint 2
-Do BFS from (0, 0) visit all edges with weight = 0 first. the answer is the distance to (m -1, n - 1).
-
diff --git a/problems/minimum-cost-to-merge-stones/README.md b/problems/minimum-cost-to-merge-stones/README.md
deleted file mode 100644
index 8efb726aa..000000000
--- a/problems/minimum-cost-to-merge-stones/README.md
+++ /dev/null
@@ -1,68 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../available-captures-for-rook "Available Captures for Rook")
-
-[Next >](../grid-illumination "Grid Illumination")
-
-## [1000. Minimum Cost to Merge Stones (Hard)](https://leetcode.com/problems/minimum-cost-to-merge-stones "合并石头的最低成本")
-
-
There are n piles of stones arranged in a row. The ith pile has stones[i] stones.
-
-
A move consists of merging exactly k consecutive piles into one pile, and the cost of this move is equal to the total number of stones in these k piles.
-
-
Return the minimum cost to merge all piles of stones into one pile. If it is impossible, return -1.
-
-
-
Example 1:
-
-
-Input: stones = [3,2,4,1], k = 2
-Output: 20
-Explanation: We start with [3, 2, 4, 1].
-We merge [3, 2] for a cost of 5, and we are left with [5, 4, 1].
-We merge [4, 1] for a cost of 5, and we are left with [5, 5].
-We merge [5, 5] for a cost of 10, and we are left with [10].
-The total cost was 20, and this is the minimum possible.
-
-
-
Example 2:
-
-
-Input: stones = [3,2,4,1], k = 3
-Output: -1
-Explanation: After any merge operation, there are 2 piles left, and we can't merge anymore. So the task is impossible.
-
-
-
Example 3:
-
-
-Input: stones = [3,5,1,2,6], k = 3
-Output: 25
-Explanation: We start with [3, 5, 1, 2, 6].
-We merge [5, 1, 2] for a cost of 8, and we are left with [3, 8, 6].
-We merge [3, 8, 6] for a cost of 17, and we are left with [17].
-The total cost was 25, and this is the minimum possible.
-
-
-
-
Constraints:
-
-
-
n == stones.length
-
1 <= n <= 30
-
1 <= stones[i] <= 100
-
2 <= k <= 30
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Similar Questions
- 1. [Burst Balloons](../burst-balloons) (Hard)
- 1. [Minimum Cost to Connect Sticks](../minimum-cost-to-connect-sticks) (Medium)
diff --git a/problems/minimum-cost-to-merge-stones/minimum_cost_to_merge_stones.go b/problems/minimum-cost-to-merge-stones/minimum_cost_to_merge_stones.go
deleted file mode 100644
index f6499d0cd..000000000
--- a/problems/minimum-cost-to-merge-stones/minimum_cost_to_merge_stones.go
+++ /dev/null
@@ -1,48 +0,0 @@
-package problem1000
-
-func mergeStones(stones []int, K int) int {
- size := len(stones)
- if (size-1)%(K-1) != 0 {
- return -1
- }
-
- sum := [31]int{}
- for i := 0; i < size; i++ {
- sum[i+1] = sum[i] + stones[i]
- }
-
- dp := [31][31]int{}
- // dp[l][r] 的含义是,
- // stones[l:r+1] 完成**所有**合并后,所花费的最小费用。
- // 我着重强调了 **所有** 二字
- // dp[l][r] 在完成所有合并后,有两种可能
- // 1. 合并成一块石头
- // 2. 没有合并成一块石头
-
- for width := K; width <= size; width++ {
- for l := 0; l+width <= size; l++ {
- r := l + width - 1
- dp[l][r] = 1 << 32
- for m := l; m < r; m += K - 1 {
- dp[l][r] = min(dp[l][r], dp[l][m]+dp[m+1][r])
- // 把 dp[l][r] 分解成两个部分
- // dp[l][m] 代表了,能合并成一块石头的左边,
- // dp[m+1][r] 代表了,剩下的右边。
- }
- if (r-l)%(K-1) == 0 {
- // 如果 dp[l][r] 的左边和右边还能够进行合并
- // 还要加上最后一次合并的费用
- dp[l][r] += sum[r+1] - sum[l]
- }
- }
- }
-
- return dp[0][size-1]
-}
-
-func min(a, b int) int {
- if a < b {
- return a
- }
- return b
-}
diff --git a/problems/minimum-cost-to-move-chips-to-the-same-position/README.md b/problems/minimum-cost-to-move-chips-to-the-same-position/README.md
deleted file mode 100644
index 66e1937ff..000000000
--- a/problems/minimum-cost-to-move-chips-to-the-same-position/README.md
+++ /dev/null
@@ -1,86 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../valid-palindrome-iii "Valid Palindrome III")
-
-[Next >](../longest-arithmetic-subsequence-of-given-difference "Longest Arithmetic Subsequence of Given Difference")
-
-## [1217. Minimum Cost to Move Chips to The Same Position (Easy)](https://leetcode.com/problems/minimum-cost-to-move-chips-to-the-same-position "玩筹码")
-
-
We have n chips, where the position of the ith chip is position[i].
-
-
We need to move all the chips to the same position. In one step, we can change the position of the ith chip from position[i] to:
-
-
-
position[i] + 2 or position[i] - 2 with cost = 0.
-
position[i] + 1 or position[i] - 1 with cost = 1.
-
-
-
Return the minimum cost needed to move all the chips to the same position.
-
-
-
Example 1:
-
-
-Input: position = [1,2,3]
-Output: 1
-Explanation: First step: Move the chip at position 3 to position 1 with cost = 0.
-Second step: Move the chip at position 2 to position 1 with cost = 1.
-Total cost is 1.
-
-
-
Example 2:
-
-
-Input: position = [2,2,2,3,3]
-Output: 2
-Explanation: We can move the two chips at position 3 to position 2. Each move has cost = 1. The total cost = 2.
-
-
-
Example 3:
-
-
-Input: position = [1,1000000000]
-Output: 1
-
-
-
-
Constraints:
-
-
-
1 <= position.length <= 100
-
1 <= position[i] <= 10^9
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Math](../../tag/math/README.md)]
- [[Greedy](../../tag/greedy/README.md)]
-
-### Similar Questions
- 1. [Minimum Number of Operations to Move All Balls to Each Box](../minimum-number-of-operations-to-move-all-balls-to-each-box) (Medium)
-
-### 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/minimum-cost-to-reach-city-with-discounts/README.md b/problems/minimum-cost-to-reach-city-with-discounts/README.md
deleted file mode 100644
index 873df6d98..000000000
--- a/problems/minimum-cost-to-reach-city-with-discounts/README.md
+++ /dev/null
@@ -1,34 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../find-all-people-with-secret "Find All People With Secret")
-
-[Next >](../finding-3-digit-even-numbers "Finding 3-Digit Even Numbers")
-
-## [2093. Minimum Cost to Reach City With Discounts (Medium)](https://leetcode.com/problems/minimum-cost-to-reach-city-with-discounts "")
-
-
-
-### Related Topics
- [[Graph](../../tag/graph/README.md)]
- [[Shortest Path](../../tag/shortest-path/README.md)]
-
-### Hints
-
-Hint 1
-Try to construct a graph out of highways. What type of graph is this?
-
-
-
-Hint 2
-We essentially need to find the minimum distance to get from node 0 to node n - 1 in an undirected weighted graph. What algorithm should we use to do this?
-
-
-
-Hint 3
-Use Dijkstra's algorithm to find the minimum weight path. Keep track of the minimum distance to each vertex with d discounts left
-
diff --git a/problems/minimum-cost-to-reach-destination-in-time/README.md b/problems/minimum-cost-to-reach-destination-in-time/README.md
deleted file mode 100644
index d2bc9797e..000000000
--- a/problems/minimum-cost-to-reach-destination-in-time/README.md
+++ /dev/null
@@ -1,84 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../sum-game "Sum Game")
-
-[Next >](../concatenation-of-array "Concatenation of Array")
-
-## [1928. Minimum Cost to Reach Destination in Time (Hard)](https://leetcode.com/problems/minimum-cost-to-reach-destination-in-time "规定时间内到达终点的最小花费")
-
-
There is a country of n cities numbered from 0 to n - 1 where all the cities are connected by bi-directional roads. The roads are represented as a 2D integer array edges where edges[i] = [xi, yi, timei] denotes a road between cities xi and yi that takes timei minutes to travel. There may be multiple roads of differing travel times connecting the same two cities, but no road connects a city to itself.
-
-
Each time you pass through a city, you must pay a passing fee. This is represented as a 0-indexed integer array passingFees of length n where passingFees[j] is the amount of dollars you must pay when you pass through city j.
-
-
In the beginning, you are at city 0 and want to reach city n - 1 in maxTime minutes or less. The cost of your journey is the summation of passing fees for each city that you passed through at some moment of your journey (including the source and destination cities).
-
-
Given maxTime, edges, and passingFees, return the minimum cost to complete your journey, or -1 if you cannot complete it within maxTime minutes.
-
-
-
Example 1:
-
-
-
-
-Input: maxTime = 30, edges = [[0,1,10],[1,2,10],[2,5,10],[0,3,1],[3,4,10],[4,5,15]], passingFees = [5,1,2,20,20,3]
-Output: 11
-Explanation: The path to take is 0 -> 1 -> 2 -> 5, which takes 30 minutes and has $11 worth of passing fees.
-
-
-
Example 2:
-
-
-
-
-Input: maxTime = 29, edges = [[0,1,10],[1,2,10],[2,5,10],[0,3,1],[3,4,10],[4,5,15]], passingFees = [5,1,2,20,20,3]
-Output: 48
-Explanation: The path to take is 0 -> 3 -> 4 -> 5, which takes 26 minutes and has $48 worth of passing fees.
-You cannot take path 0 -> 1 -> 2 -> 5 since it would take too long.
-
-
-
Example 3:
-
-
-Input: maxTime = 25, edges = [[0,1,10],[1,2,10],[2,5,10],[0,3,1],[3,4,10],[4,5,15]], passingFees = [5,1,2,20,20,3]
-Output: -1
-Explanation: There is no way to reach city 5 from city 0 within 25 minutes.
-
-
-
-
Constraints:
-
-
-
1 <= maxTime <= 1000
-
n == passingFees.length
-
2 <= n <= 1000
-
n - 1 <= edges.length <= 1000
-
0 <= xi, yi <= n - 1
-
1 <= timei <= 1000
-
1 <= passingFees[j] <= 1000
-
The graph may contain multiple edges between two nodes.
-
The graph does not contain self loops.
-
-
-### Related Topics
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Graph](../../tag/graph/README.md)]
-
-### Similar Questions
- 1. [Maximum Path Quality of a Graph](../maximum-path-quality-of-a-graph) (Hard)
- 1. [Minimum Cost to Reach City With Discounts](../minimum-cost-to-reach-city-with-discounts) (Medium)
-
-### Hints
-
-Hint 1
-Consider a new graph where each node is one of the old nodes at a specific time. For example, node 0 at time 5.
-
-
-
-Hint 2
-You need to find the shortest path in the new graph.
-
diff --git a/problems/minimum-cost-to-separate-sentence-into-rows/README.md b/problems/minimum-cost-to-separate-sentence-into-rows/README.md
deleted file mode 100644
index 559bc0df4..000000000
--- a/problems/minimum-cost-to-separate-sentence-into-rows/README.md
+++ /dev/null
@@ -1,34 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../the-category-of-each-member-in-the-store "The Category of Each Member in the Store")
-
-[Next >](../kth-distinct-string-in-an-array "Kth Distinct String in an Array")
-
-## [2052. Minimum Cost to Separate Sentence Into Rows (Medium)](https://leetcode.com/problems/minimum-cost-to-separate-sentence-into-rows "将句子分隔成行的最低成本")
-
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Hints
-
-Hint 1
-Create an array storing all of the words in sentence separated.
-
-
-
-Hint 2
-Try dynamic programming.
-
-
-
-Hint 3
-Build a dp array where dp[i] represents the minimum total cost for the first i + 1 words.
-
diff --git a/problems/minimum-cost-to-set-cooking-time/README.md b/problems/minimum-cost-to-set-cooking-time/README.md
deleted file mode 100644
index c3235cd38..000000000
--- a/problems/minimum-cost-to-set-cooking-time/README.md
+++ /dev/null
@@ -1,98 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../partition-array-according-to-given-pivot "Partition Array According to Given Pivot")
-
-[Next >](../minimum-difference-in-sums-after-removal-of-elements "Minimum Difference in Sums After Removal of Elements")
-
-## [2162. Minimum Cost to Set Cooking Time (Medium)](https://leetcode.com/problems/minimum-cost-to-set-cooking-time "设置时间的最少代价")
-
-
A generic microwave supports cooking times for:
-
-
-
at least 1 second.
-
at most 99 minutes and 99 seconds.
-
-
-
To set the cooking time, you push at most four digits. The microwave normalizes what you push as four digits by prepending zeroes. It interprets the first two digits as the minutes and the last two digits as the seconds. It then adds them up as the cooking time. For example,
-
-
-
You push 954 (three digits). It is normalized as 0954 and interpreted as 9 minutes and 54 seconds.
-
You push 0008 (four digits). It is interpreted as 0 minutes and 8 seconds.
-
You push 8090. It is interpreted as 80 minutes and 90 seconds.
-
You push 8130. It is interpreted as 81 minutes and 30 seconds.
-
-
-
You are given integers startAt, moveCost, pushCost, and targetSeconds. Initially, your finger is on the digit startAt. Moving the finger above any specific digit costs moveCost units of fatigue. Pushing the digit below the finger once costs pushCost units of fatigue.
-
-
There can be multiple ways to set the microwave to cook for targetSeconds seconds but you are interested in the way with the minimum cost.
-
-
Return the minimum cost to settargetSecondsseconds of cooking time.
-
-
Remember that one minute consists of 60 seconds.
-
-
-
Example 1:
-
-
-Input: startAt = 1, moveCost = 2, pushCost = 1, targetSeconds = 600
-Output: 6
-Explanation: The following are the possible ways to set the cooking time.
-- 1 0 0 0, interpreted as 10 minutes and 0 seconds.
- The finger is already on digit 1, pushes 1 (with cost 1), moves to 0 (with cost 2), pushes 0 (with cost 1), pushes 0 (with cost 1), and pushes 0 (with cost 1).
- The cost is: 1 + 2 + 1 + 1 + 1 = 6. This is the minimum cost.
-- 0 9 6 0, interpreted as 9 minutes and 60 seconds. That is also 600 seconds.
- The finger moves to 0 (with cost 2), pushes 0 (with cost 1), moves to 9 (with cost 2), pushes 9 (with cost 1), moves to 6 (with cost 2), pushes 6 (with cost 1), moves to 0 (with cost 2), and pushes 0 (with cost 1).
- The cost is: 2 + 1 + 2 + 1 + 2 + 1 + 2 + 1 = 12.
-- 9 6 0, normalized as 0960 and interpreted as 9 minutes and 60 seconds.
- The finger moves to 9 (with cost 2), pushes 9 (with cost 1), moves to 6 (with cost 2), pushes 6 (with cost 1), moves to 0 (with cost 2), and pushes 0 (with cost 1).
- The cost is: 2 + 1 + 2 + 1 + 2 + 1 = 9.
-
-
-
Example 2:
-
-
-Input: startAt = 0, moveCost = 1, pushCost = 2, targetSeconds = 76
-Output: 6
-Explanation: The optimal way is to push two digits: 7 6, interpreted as 76 seconds.
-The finger moves to 7 (with cost 1), pushes 7 (with cost 2), moves to 6 (with cost 1), and pushes 6 (with cost 2). The total cost is: 1 + 2 + 1 + 2 = 6
-Note other possible ways are 0076, 076, 0116, and 116, but none of them produces the minimum cost.
-
-
-
-
Constraints:
-
-
-
0 <= startAt <= 9
-
1 <= moveCost, pushCost <= 105
-
1 <= targetSeconds <= 6039
-
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
- [[Enumeration](../../tag/enumeration/README.md)]
-
-### Hints
-
-Hint 1
-Define a separate function Cost(mm, ss) where 0 <= mm <= 99 and 0 <= ss <= 99. This function should calculate the cost of setting the cocking time to mm minutes and ss seconds
-
-
-
-Hint 2
-The range of the minutes is small (i.e., [0, 99]), how can you use that?
-
-
-
-Hint 3
-For every mm in [0, 99], calculate the needed ss to make mm:ss equal to targetSeconds and minimize the cost of setting the cocking time to mm:ss
-
-
-
-Hint 4
-Be careful in some cases when ss is not in the valid range [0, 99].
-
diff --git a/problems/minimum-cost-tree-from-leaf-values/README.md b/problems/minimum-cost-tree-from-leaf-values/README.md
deleted file mode 100644
index 35cd83444..000000000
--- a/problems/minimum-cost-tree-from-leaf-values/README.md
+++ /dev/null
@@ -1,67 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../shortest-path-with-alternating-colors "Shortest Path with Alternating Colors")
-
-[Next >](../maximum-of-absolute-value-expression "Maximum of Absolute Value Expression")
-
-## [1130. Minimum Cost Tree From Leaf Values (Medium)](https://leetcode.com/problems/minimum-cost-tree-from-leaf-values "叶值的最小代价生成树")
-
-
Given an array arr of positive integers, consider all binary trees such that:
-
-
-
Each node has either 0 or 2 children;
-
The values of arr correspond to the values of each leaf in an in-order traversal of the tree.
-
The value of each non-leaf node is equal to the product of the largest leaf value in its left and right subtree, respectively.
-
-
-
Among all possible binary trees considered, return the smallest possible sum of the values of each non-leaf node. It is guaranteed this sum fits into a 32-bit integer.
-
-
A node is a leaf if and only if it has zero children.
-
-
-
Example 1:
-
-
-Input: arr = [6,2,4]
-Output: 32
-Explanation: There are two possible trees shown.
-The first has a non-leaf node sum 36, and the second has non-leaf node sum 32.
-
-
-
Example 2:
-
-
-Input: arr = [4,11]
-Output: 44
-
-
-
-
Constraints:
-
-
-
2 <= arr.length <= 40
-
1 <= arr[i] <= 15
-
It is guaranteed that the answer fits into a 32-bit signed integer (i.e., it is less than 231).
-
-
-### Related Topics
- [[Stack](../../tag/stack/README.md)]
- [[Greedy](../../tag/greedy/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Monotonic Stack](../../tag/monotonic-stack/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-degree-of-a-connected-trio-in-a-graph/README.md b/problems/minimum-degree-of-a-connected-trio-in-a-graph/README.md
deleted file mode 100644
index 039af768b..000000000
--- a/problems/minimum-degree-of-a-connected-trio-in-a-graph/README.md
+++ /dev/null
@@ -1,66 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-limit-of-balls-in-a-bag "Minimum Limit of Balls in a Bag")
-
-[Next >](../buildings-with-an-ocean-view "Buildings With an Ocean View")
-
-## [1761. Minimum Degree of a Connected Trio in a Graph (Hard)](https://leetcode.com/problems/minimum-degree-of-a-connected-trio-in-a-graph "一个图中连通三元组的最小度数")
-
-
You are given an undirected graph. You are given an integer n which is the number of nodes in the graph and an array edges, where each edges[i] = [ui, vi] indicates that there is an undirected edge between ui and vi.
-
-
A connected trio is a set of three nodes where there is an edge between every pair of them.
-
-
The degree of a connected trio is the number of edges where one endpoint is in the trio, and the other is not.
-
-
Return the minimum degree of a connected trio in the graph, or-1if the graph has no connected trios.
-
-
-
Example 1:
-
-
-Input: n = 6, edges = [[1,2],[1,3],[3,2],[4,1],[5,2],[3,6]]
-Output: 3
-Explanation: There is exactly one trio, which is [1,2,3]. The edges that form its degree are bolded in the figure above.
-
-
-
Example 2:
-
-
-Input: n = 7, edges = [[1,3],[4,1],[4,3],[2,5],[5,6],[6,7],[7,5],[2,6]]
-Output: 0
-Explanation: There are exactly three trios:
-1) [1,4,3] with degree 0.
-2) [2,5,6] with degree 2.
-3) [5,6,7] with degree 2.
-
-
-
-
Constraints:
-
-
-
2 <= n <= 400
-
edges[i].length == 2
-
1 <= edges.length <= n * (n-1) / 2
-
1 <= ui, vi <= n
-
ui != vi
-
There are no repeated edges.
-
-
-### Related Topics
- [[Graph](../../tag/graph/README.md)]
-
-### Hints
-
-Hint 1
-Consider a trio with nodes u, v, and w. The degree of the trio is just degree(u) + degree(v) + degree(w) - 6. The -6 comes from subtracting the edges u-v, u-w, and v-w, which are counted twice each in the vertex degree calculation.
-
-
-
-Hint 2
-To get the trios (u,v,w), you can iterate on u, then iterate on each w,v such that w and v are neighbors of u and are neighbors of each other.
-
diff --git a/problems/minimum-deletion-cost-to-avoid-repeating-letters/README.md b/problems/minimum-deletion-cost-to-avoid-repeating-letters/README.md
deleted file mode 100644
index 7bcb7dda0..000000000
--- a/problems/minimum-deletion-cost-to-avoid-repeating-letters/README.md
+++ /dev/null
@@ -1,65 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../number-of-ways-where-square-of-number-is-equal-to-product-of-two-numbers "Number of Ways Where Square of Number Is Equal to Product of Two Numbers")
-
-[Next >](../remove-max-number-of-edges-to-keep-graph-fully-traversable "Remove Max Number of Edges to Keep Graph Fully Traversable")
-
-## [1578. Minimum Deletion Cost to Avoid Repeating Letters (Medium)](https://leetcode.com/problems/minimum-deletion-cost-to-avoid-repeating-letters "避免重复字母的最小删除成本")
-
-
Given a string s and an array of integers cost where cost[i] is the cost of deleting the ith character in s.
-
-
Return the minimum cost of deletions such that there are no two identical letters next to each other.
-
-
Notice that you will delete the chosen characters at the same time, in other words, after deleting a character, the costs of deleting other characters will not change.
-
-
-
Example 1:
-
-
-Input: s = "abaac", cost = [1,2,3,4,5]
-Output: 3
-Explanation: Delete the letter "a" with cost 3 to get "abac" (String without two identical letters next to each other).
-
-
-
Example 2:
-
-
-Input: s = "abc", cost = [1,2,3]
-Output: 0
-Explanation: You don't need to delete any character because there are no identical letters next to each other.
-
-
-
Example 3:
-
-
-Input: s = "aabaa", cost = [1,2,3,4,1]
-Output: 2
-Explanation: Delete the first and the last character, getting the string ("aba").
-
-
-
-
Constraints:
-
-
-
s.length == cost.length
-
1 <= s.length, cost.length <= 10^5
-
1 <= cost[i] <= 10^4
-
s contains only lowercase English letters.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[String](../../tag/string/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Greedy](../../tag/greedy/README.md)]
-
-### Hints
-
-Hint 1
-Maintain the running sum and max value for repeated letters.
-
diff --git a/problems/minimum-deletions-to-make-character-frequencies-unique/README.md b/problems/minimum-deletions-to-make-character-frequencies-unique/README.md
deleted file mode 100644
index 3fdb2db07..000000000
--- a/problems/minimum-deletions-to-make-character-frequencies-unique/README.md
+++ /dev/null
@@ -1,73 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../get-maximum-in-generated-array "Get Maximum in Generated Array")
-
-[Next >](../sell-diminishing-valued-colored-balls "Sell Diminishing-Valued Colored Balls")
-
-## [1647. Minimum Deletions to Make Character Frequencies Unique (Medium)](https://leetcode.com/problems/minimum-deletions-to-make-character-frequencies-unique "字符频次唯一的最小删除次数")
-
-
A string s is called good if there are no two different characters in s that have the same frequency.
-
-
Given a string s, return the minimum number of characters you need to delete to make sgood.
-
-
The frequency of a character in a string is the number of times it appears in the string. For example, in the string "aab", the frequency of 'a' is 2, while the frequency of 'b' is 1.
-
-
-
Example 1:
-
-
-Input: s = "aab"
-Output: 0
-Explanation:s is already good.
-
-
-
Example 2:
-
-
-Input: s = "aaabbbcc"
-Output: 2
-Explanation: You can delete two 'b's resulting in the good string "aaabcc".
-Another way it to delete one 'b' and one 'c' resulting in the good string "aaabbc".
-
-
Example 3:
-
-
-Input: s = "ceabaacb"
-Output: 2
-Explanation: You can delete both 'c's resulting in the good string "eabaab".
-Note that we only care about characters that are still in the string at the end (i.e. frequency of 0 is ignored).
-
-
-
-
Constraints:
-
-
-
1 <= s.length <= 105
-
s contains only lowercase English letters.
-
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[String](../../tag/string/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Hints
-
-Hint 1
-As we can only delete characters, if we have multiple characters having the same frequency, we must decrease all the frequencies of them, except one.
-
-
-
-Hint 2
-Sort the alphabet characters by their frequencies non-increasingly.
-
-
-
-Hint 3
-Iterate on the alphabet characters, keep decreasing the frequency of the current character until it reaches a value that has not appeared before.
-
diff --git a/problems/minimum-deletions-to-make-string-balanced/README.md b/problems/minimum-deletions-to-make-string-balanced/README.md
deleted file mode 100644
index 32083314e..000000000
--- a/problems/minimum-deletions-to-make-string-balanced/README.md
+++ /dev/null
@@ -1,64 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../defuse-the-bomb "Defuse the Bomb")
-
-[Next >](../minimum-jumps-to-reach-home "Minimum Jumps to Reach Home")
-
-## [1653. Minimum Deletions to Make String Balanced (Medium)](https://leetcode.com/problems/minimum-deletions-to-make-string-balanced "使字符串平衡的最少删除次数")
-
-
You are given a string s consisting only of characters 'a' and 'b'.
-
-
You can delete any number of characters in s to make sbalanced. s is balanced if there is no pair of indices (i,j) such that i < j and s[i] = 'b' and s[j]= 'a'.
-
-
Return the minimum number of deletions needed to make sbalanced.
-
-
-
Example 1:
-
-
-Input: s = "aababbab"
-Output: 2
-Explanation: You can either:
-Delete the characters at 0-indexed positions 2 and 6 ("aababbab" -> "aaabbb"), or
-Delete the characters at 0-indexed positions 3 and 6 ("aababbab" -> "aabbbb").
-
-
-
Example 2:
-
-
-Input: s = "bbaaaaabb"
-Output: 2
-Explanation: The only solution is to delete the first two characters.
-
-
-
-
Constraints:
-
-
-
1 <= s.length <= 105
-
s[i] is 'a' or 'b'.
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Stack](../../tag/stack/README.md)]
-
-### Similar Questions
- 1. [Check if All A's Appears Before All B's](../check-if-all-as-appears-before-all-bs) (Easy)
-
-### Hints
-
-Hint 1
-You need to find for every index the number of Bs before it and the number of A's after it
-
-
-
-Hint 2
-You can speed up the finding of A's and B's in suffix and prefix using preprocessing
-
diff --git a/problems/minimum-depth-of-binary-tree/README.md b/problems/minimum-depth-of-binary-tree/README.md
deleted file mode 100644
index 890e8b2ea..000000000
--- a/problems/minimum-depth-of-binary-tree/README.md
+++ /dev/null
@@ -1,51 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../balanced-binary-tree "Balanced Binary Tree")
-
-[Next >](../path-sum "Path Sum")
-
-## [111. Minimum Depth of Binary Tree (Easy)](https://leetcode.com/problems/minimum-depth-of-binary-tree "二叉树的最小深度")
-
-
Given a binary tree, find its minimum depth.
-
-
The minimum depth is the number of nodes along the shortest path from the root node down to the nearest leaf node.
The number of nodes in the tree is in the range [0, 105].
-
-1000 <= Node.val <= 1000
-
-
-### Related Topics
- [[Tree](../../tag/tree/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Binary Tree](../../tag/binary-tree/README.md)]
-
-### Similar Questions
- 1. [Binary Tree Level Order Traversal](../binary-tree-level-order-traversal) (Medium)
- 1. [Maximum Depth of Binary Tree](../maximum-depth-of-binary-tree) (Easy)
diff --git a/problems/minimum-depth-of-binary-tree/minimum_depth_of_binary_tree.go b/problems/minimum-depth-of-binary-tree/minimum_depth_of_binary_tree.go
deleted file mode 100644
index b1fd97022..000000000
--- a/problems/minimum-depth-of-binary-tree/minimum_depth_of_binary_tree.go
+++ /dev/null
@@ -1,29 +0,0 @@
-package problem111
-
-import "github.com/awesee/leetcode/internal/kit"
-
-// TreeNode - Definition for a binary tree node.
-type TreeNode = kit.TreeNode
-
-/**
- * Definition for a binary tree node.
- * type TreeNode struct {
- * Val int
- * Left *TreeNode
- * Right *TreeNode
- * }
- */
-func minDepth(root *TreeNode) int {
- if root == nil {
- return 0
- }
- l := minDepth(root.Left)
- r := minDepth(root.Right)
- if l == 0 || r == 0 {
- return l + r + 1
- }
- if l < r {
- return l + 1
- }
- return r + 1
-}
diff --git a/problems/minimum-depth-of-binary-tree/minimum_depth_of_binary_tree_test.go b/problems/minimum-depth-of-binary-tree/minimum_depth_of_binary_tree_test.go
deleted file mode 100644
index 9d7a07899..000000000
--- a/problems/minimum-depth-of-binary-tree/minimum_depth_of_binary_tree_test.go
+++ /dev/null
@@ -1,35 +0,0 @@
-package problem111
-
-import (
- "testing"
-
- "github.com/awesee/leetcode/internal/kit"
-)
-
-type testType struct {
- in []int
- want int
-}
-
-func TestMinDepth(t *testing.T) {
- tests := [...]testType{
- {
- in: []int{3, 9, 20, kit.NULL, kit.NULL, 15, 7},
- want: 2,
- },
- {
- in: []int{1, 2},
- want: 2,
- },
- {
- in: nil,
- want: 0,
- },
- }
- for _, tt := range tests {
- got := minDepth(kit.SliceInt2TreeNode(tt.in))
- if got != tt.want {
- t.Fatalf("in: %v, got: %v, want: %v", tt.in, got, tt.want)
- }
- }
-}
diff --git a/problems/minimum-difference-between-highest-and-lowest-of-k-scores/README.md b/problems/minimum-difference-between-highest-and-lowest-of-k-scores/README.md
deleted file mode 100644
index f53074997..000000000
--- a/problems/minimum-difference-between-highest-and-lowest-of-k-scores/README.md
+++ /dev/null
@@ -1,77 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../widest-pair-of-indices-with-equal-range-sum "Widest Pair of Indices With Equal Range Sum")
-
-[Next >](../find-the-kth-largest-integer-in-the-array "Find the Kth Largest Integer in the Array")
-
-## [1984. Minimum Difference Between Highest and Lowest of K Scores (Easy)](https://leetcode.com/problems/minimum-difference-between-highest-and-lowest-of-k-scores "学生分数的最小差值")
-
-
You are given a 0-indexed integer array nums, where nums[i] represents the score of the ith student. You are also given an integer k.
-
-
Pick the scores of any k students from the array so that the difference between the highest and the lowest of the k scores is minimized.
-
-
Return the minimum possible difference.
-
-
-
Example 1:
-
-
-Input: nums = [90], k = 1
-Output: 0
-Explanation: There is one way to pick score(s) of one student:
-- [90]. The difference between the highest and lowest score is 90 - 90 = 0.
-The minimum possible difference is 0.
-
-
-
Example 2:
-
-
-Input: nums = [9,4,1,7], k = 2
-Output: 2
-Explanation: There are six ways to pick score(s) of two students:
-- [9,4,1,7]. The difference between the highest and lowest score is 9 - 4 = 5.
-- [9,4,1,7]. The difference between the highest and lowest score is 9 - 1 = 8.
-- [9,4,1,7]. The difference between the highest and lowest score is 9 - 7 = 2.
-- [9,4,1,7]. The difference between the highest and lowest score is 4 - 1 = 3.
-- [9,4,1,7]. The difference between the highest and lowest score is 7 - 4 = 3.
-- [9,4,1,7]. The difference between the highest and lowest score is 7 - 1 = 6.
-The minimum possible difference is 2.
-
-
-
Constraints:
-
-
-
1 <= k <= nums.length <= 1000
-
0 <= nums[i] <= 105
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
- [[Sliding Window](../../tag/sliding-window/README.md)]
-
-### Hints
-
-Hint 1
-For the difference between the highest and lowest element to be minimized, the k chosen scores need to be as close to each other as possible.
-
-
-
-Hint 2
-What if the array was sorted?
-
-
-
-Hint 3
-After sorting the scores, any contiguous k scores are as close to each other as possible.
-
-
-
-Hint 4
-Apply a sliding window solution to iterate over each contiguous k scores, and find the minimum of the differences of all windows.
-
diff --git a/problems/minimum-difference-between-largest-and-smallest-value-in-three-moves/README.md b/problems/minimum-difference-between-largest-and-smallest-value-in-three-moves/README.md
deleted file mode 100644
index 4c51853a1..000000000
--- a/problems/minimum-difference-between-largest-and-smallest-value-in-three-moves/README.md
+++ /dev/null
@@ -1,54 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../range-sum-of-sorted-subarray-sums "Range Sum of Sorted Subarray Sums")
-
-[Next >](../stone-game-iv "Stone Game IV")
-
-## [1509. Minimum Difference Between Largest and Smallest Value in Three Moves (Medium)](https://leetcode.com/problems/minimum-difference-between-largest-and-smallest-value-in-three-moves "三次操作后最大值与最小值的最小差")
-
-
You are given an integer array nums. In one move, you can choose one element of nums and change it by any value.
-
-
Return the minimum difference between the largest and smallest value of nums after performing at most three moves.
-
-
-
Example 1:
-
-
-Input: nums = [5,3,2,4]
-Output: 0
-Explanation: Change the array [5,3,2,4] to [2,2,2,2].
-The difference between the maximum and minimum is 2-2 = 0.
-
-
-
Example 2:
-
-
-Input: nums = [1,5,0,10,14]
-Output: 1
-Explanation: Change the array [1,5,0,10,14] to [1,1,0,1,1].
-The difference between the maximum and minimum is 1-0 = 1.
-
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 105
-
-109 <= nums[i] <= 109
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Greedy](../../tag/greedy/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Hints
-
-Hint 1
-The minimum difference possible is is obtained by removing 3 elements between the 3 smallest and 3 largest values in the array.
-
diff --git a/problems/minimum-difference-in-sums-after-removal-of-elements/README.md b/problems/minimum-difference-in-sums-after-removal-of-elements/README.md
deleted file mode 100644
index 9daf25991..000000000
--- a/problems/minimum-difference-in-sums-after-removal-of-elements/README.md
+++ /dev/null
@@ -1,90 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-cost-to-set-cooking-time "Minimum Cost to Set Cooking Time")
-
-[Next >](../sort-even-and-odd-indices-independently "Sort Even and Odd Indices Independently")
-
-## [2163. Minimum Difference in Sums After Removal of Elements (Hard)](https://leetcode.com/problems/minimum-difference-in-sums-after-removal-of-elements "删除元素后和的最小差值")
-
-
You are given a 0-indexed integer array nums consisting of 3 * n elements.
-
-
You are allowed to remove any subsequence of elements of size exactlyn from nums. The remaining 2 * n elements will be divided into two equal parts:
-
-
-
The first n elements belonging to the first part and their sum is sumfirst.
-
The next n elements belonging to the second part and their sum is sumsecond.
-
-
-
The difference in sums of the two parts is denoted as sumfirst - sumsecond.
-
-
-
For example, if sumfirst = 3 and sumsecond = 2, their difference is 1.
-
Similarly, if sumfirst = 2 and sumsecond = 3, their difference is -1.
-
-
-
Return the minimum difference possible between the sums of the two parts after the removal of n elements.
-
-
-
Example 1:
-
-
-Input: nums = [3,1,2]
-Output: -1
-Explanation: Here, nums has 3 elements, so n = 1.
-Thus we have to remove 1 element from nums and divide the array into two equal parts.
-- If we remove nums[0] = 3, the array will be [1,2]. The difference in sums of the two parts will be 1 - 2 = -1.
-- If we remove nums[1] = 1, the array will be [3,2]. The difference in sums of the two parts will be 3 - 2 = 1.
-- If we remove nums[2] = 2, the array will be [3,1]. The difference in sums of the two parts will be 3 - 1 = 2.
-The minimum difference between sums of the two parts is min(-1,1,2) = -1.
-
-
-
Example 2:
-
-
-Input: nums = [7,9,5,8,1,3]
-Output: 1
-Explanation: Here n = 2. So we must remove 2 elements and divide the remaining array into two parts containing two elements each.
-If we remove nums[2] = 5 and nums[3] = 8, the resultant array will be [7,9,1,3]. The difference in sums will be (7+9) - (1+3) = 12.
-To obtain the minimum difference, we should remove nums[1] = 9 and nums[4] = 1. The resultant array becomes [7,5,8,3]. The difference in sums of the two parts is (7+5) - (8+3) = 1.
-It can be shown that it is not possible to obtain a difference smaller than 1.
-
-
-
-
Constraints:
-
-
-
nums.length == 3 * n
-
1 <= n <= 105
-
1 <= nums[i] <= 105
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Heap (Priority Queue)](../../tag/heap-priority-queue/README.md)]
-
-### Hints
-
-Hint 1
-The lowest possible difference can be obtained when the sum of the first n elements in the resultant array is minimum, and the sum of the next n elements is maximum.
-
-
-
-Hint 2
-For every index i, think about how you can find the minimum possible sum of n elements with indices lesser or equal to i, if possible.
-
-
-
-Hint 3
-Similarly, for every index i, try to find the maximum possible sum of n elements with indices greater or equal to i, if possible.
-
-
-
-Hint 4
-Now for all indices, check if we can consider it as the partitioning index and hence find the answer.
-
diff --git a/problems/minimum-difficulty-of-a-job-schedule/README.md b/problems/minimum-difficulty-of-a-job-schedule/README.md
deleted file mode 100644
index 7367d9f71..000000000
--- a/problems/minimum-difficulty-of-a-job-schedule/README.md
+++ /dev/null
@@ -1,71 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../find-the-city-with-the-smallest-number-of-neighbors-at-a-threshold-distance "Find the City With the Smallest Number of Neighbors at a Threshold Distance")
-
-[Next >](../number-of-transactions-per-visit "Number of Transactions per Visit")
-
-## [1335. Minimum Difficulty of a Job Schedule (Hard)](https://leetcode.com/problems/minimum-difficulty-of-a-job-schedule "工作计划的最低难度")
-
-
You want to schedule a list of jobs in d days. Jobs are dependent (i.e To work on the ith job, you have to finish all the jobs j where 0 <= j < i).
-
-
You have to finish at least one task every day. The difficulty of a job schedule is the sum of difficulties of each day of the d days. The difficulty of a day is the maximum difficulty of a job done on that day.
-
-
You are given an integer array jobDifficulty and an integer d. The difficulty of the ith job is jobDifficulty[i].
-
-
Return the minimum difficulty of a job schedule. If you cannot find a schedule for the jobs return -1.
-
-
-
Example 1:
-
-
-Input: jobDifficulty = [6,5,4,3,2,1], d = 2
-Output: 7
-Explanation: First day you can finish the first 5 jobs, total difficulty = 6.
-Second day you can finish the last job, total difficulty = 1.
-The difficulty of the schedule = 6 + 1 = 7
-
-
-
Example 2:
-
-
-Input: jobDifficulty = [9,9,9], d = 4
-Output: -1
-Explanation: If you finish a job per day you will still have a free day. you cannot find a schedule for the given jobs.
-
-
-
Example 3:
-
-
-Input: jobDifficulty = [1,1,1], d = 3
-Output: 3
-Explanation: The schedule is one job per day. total difficulty will be 3.
-
-
-
-
Constraints:
-
-
-
1 <= jobDifficulty.length <= 300
-
0 <= jobDifficulty[i] <= 1000
-
1 <= d <= 10
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Hints
-
-Hint 1
-Use DP. Try to cut the array into d non-empty sub-arrays. Try all possible cuts for the array.
-
-
-
-Hint 2
-Use dp[i][j] where DP states are i the index of the last cut and j the number of remaining cuts. Complexity is O(n * n * d).
-
diff --git a/problems/minimum-distance-between-bst-nodes/README.md b/problems/minimum-distance-between-bst-nodes/README.md
deleted file mode 100644
index 04b89d3e6..000000000
--- a/problems/minimum-distance-between-bst-nodes/README.md
+++ /dev/null
@@ -1,50 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../transform-to-chessboard "Transform to Chessboard")
-
-[Next >](../letter-case-permutation "Letter Case Permutation")
-
-## [783. Minimum Distance Between BST Nodes (Easy)](https://leetcode.com/problems/minimum-distance-between-bst-nodes "二叉搜索树节点最小距离")
-
-
Given the root of a Binary Search Tree (BST), return the minimum difference between the values of any two different nodes in the tree.
Given an integer array nums(0-indexed) and two integers target and start, find an index i such that nums[i] == target and abs(i - start) is minimized. Note that abs(x) is the absolute value of x.
-
-
Return abs(i - start).
-
-
It is guaranteed that target exists in nums.
-
-
-
Example 1:
-
-
-Input: nums = [1,2,3,4,5], target = 5, start = 3
-Output: 1
-Explanation: nums[4] = 5 is the only value equal to target, so the answer is abs(4 - 3) = 1.
-
-
-
Example 2:
-
-
-Input: nums = [1], target = 1, start = 0
-Output: 0
-Explanation: nums[0] = 1 is the only value equal to target, so the answer is abs(0 - 0) = 0.
-
-
-
Example 3:
-
-
-Input: nums = [1,1,1,1,1,1,1,1,1,1], target = 1, start = 0
-Output: 0
-Explanation: Every value of nums is 1, but nums[0] minimizes abs(i - start), which is abs(0 - 0) = 0.
-
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 1000
-
1 <= nums[i] <= 104
-
0 <= start < nums.length
-
target is in nums.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
-
-### Hints
-
-Hint 1
-Loop in both directions until you find the target element.
-
-
-
-Hint 2
-For each index i such that nums[i] == target calculate abs(i - start).
-
diff --git a/problems/minimum-distance-to-type-a-word-using-two-fingers/README.md b/problems/minimum-distance-to-type-a-word-using-two-fingers/README.md
deleted file mode 100644
index 48841f1ad..000000000
--- a/problems/minimum-distance-to-type-a-word-using-two-fingers/README.md
+++ /dev/null
@@ -1,79 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../number-of-operations-to-make-network-connected "Number of Operations to Make Network Connected")
-
-[Next >](../restaurant-growth "Restaurant Growth")
-
-## [1320. Minimum Distance to Type a Word Using Two Fingers (Hard)](https://leetcode.com/problems/minimum-distance-to-type-a-word-using-two-fingers "二指输入的的最小距离")
-
-
-
You have a keyboard layout as shown above in the X-Y plane, where each English uppercase letter is located at some coordinate.
-
-
-
For example, the letter 'A' is located at coordinate (0, 0), the letter 'B' is located at coordinate (0, 1), the letter 'P' is located at coordinate (2, 3) and the letter 'Z' is located at coordinate (4, 1).
-
-
-
Given the string word, return the minimum total distance to type such string using only two fingers.
-
-
The distance between coordinates (x1, y1) and (x2, y2) is |x1 - x2| + |y1 - y2|.
-
-
Note that the initial positions of your two fingers are considered free so do not count towards your total distance, also your two fingers do not have to start at the first letter or the first two letters.
-
-
-
Example 1:
-
-
-Input: word = "CAKE"
-Output: 3
-Explanation: Using two fingers, one optimal way to type "CAKE" is:
-Finger 1 on letter 'C' -> cost = 0
-Finger 1 on letter 'A' -> cost = Distance from letter 'C' to letter 'A' = 2
-Finger 2 on letter 'K' -> cost = 0
-Finger 2 on letter 'E' -> cost = Distance from letter 'K' to letter 'E' = 1
-Total distance = 3
-
-
-
Example 2:
-
-
-Input: word = "HAPPY"
-Output: 6
-Explanation: Using two fingers, one optimal way to type "HAPPY" is:
-Finger 1 on letter 'H' -> cost = 0
-Finger 1 on letter 'A' -> cost = Distance from letter 'H' to letter 'A' = 2
-Finger 2 on letter 'P' -> cost = 0
-Finger 2 on letter 'P' -> cost = Distance from letter 'P' to letter 'P' = 0
-Finger 1 on letter 'Y' -> cost = Distance from letter 'A' to letter 'Y' = 4
-Total distance = 6
-
-
-
-
Constraints:
-
-
-
2 <= word.length <= 300
-
word consists of uppercase English letters.
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Similar Questions
- 1. [Minimum Time to Type Word Using Special Typewriter](../minimum-time-to-type-word-using-special-typewriter) (Easy)
-
-### Hints
-
-Hint 1
-Use dynamic programming.
-
-
-
-Hint 2
-dp[i][j][k]: smallest movements when you have one finger on i-th char and the other one on j-th char already having written k first characters from word.
-
diff --git a/problems/minimum-domino-rotations-for-equal-row/README.md b/problems/minimum-domino-rotations-for-equal-row/README.md
deleted file mode 100644
index 70e13dd34..000000000
--- a/problems/minimum-domino-rotations-for-equal-row/README.md
+++ /dev/null
@@ -1,53 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../clumsy-factorial "Clumsy Factorial")
-
-[Next >](../construct-binary-search-tree-from-preorder-traversal "Construct Binary Search Tree from Preorder Traversal")
-
-## [1007. Minimum Domino Rotations For Equal Row (Medium)](https://leetcode.com/problems/minimum-domino-rotations-for-equal-row "行相等的最少多米诺旋转")
-
-
In a row of dominoes, tops[i] and bottoms[i] represent the top and bottom halves of the ith domino. (A domino is a tile with two numbers from 1 to 6 - one on each half of the tile.)
-
-
We may rotate the ith domino, so that tops[i] and bottoms[i] swap values.
-
-
Return the minimum number of rotations so that all the values in tops are the same, or all the values in bottoms are the same.
-
-
If it cannot be done, return -1.
-
-
-
Example 1:
-
-
-Input: tops = [2,1,2,4,2,2], bottoms = [5,2,6,2,3,2]
-Output: 2
-Explanation:
-The first figure represents the dominoes as given by tops and bottoms: before we do any rotations.
-If we rotate the second and fourth dominoes, we can make every value in the top row equal to 2, as indicated by the second figure.
-
-
-
Example 2:
-
-
-Input: tops = [3,5,1,2,3], bottoms = [3,6,3,3,4]
-Output: -1
-Explanation:
-In this case, it is not possible to rotate the dominoes to make one row of values equal.
-
-
-
-
Constraints:
-
-
-
2 <= tops.length <= 2 * 104
-
bottoms.length == tops.length
-
1 <= tops[i], bottoms[i] <= 6
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Greedy](../../tag/greedy/README.md)]
diff --git a/problems/minimum-domino-rotations-for-equal-row/minimum_domino_rotations_for_equal_row.go b/problems/minimum-domino-rotations-for-equal-row/minimum_domino_rotations_for_equal_row.go
deleted file mode 100644
index 08028e9f9..000000000
--- a/problems/minimum-domino-rotations-for-equal-row/minimum_domino_rotations_for_equal_row.go
+++ /dev/null
@@ -1,32 +0,0 @@
-package problem1007
-
-func minDominoRotations(A []int, B []int) int {
- if res, ok := check(A, B, A[0]); ok {
- return res
- }
- if res, ok := check(A, B, B[0]); ok {
- return res
- }
- return -1
-}
-
-func check(A, B []int, flag int) (int, bool) {
- a, b := 0, 0
- i, n := 0, len(A)
- for ; i < n && (A[i] == flag || B[i] == flag); i++ {
- if A[i] != flag { // A needs a swap to be all flag
- a++
- }
- if B[i] != flag { // B needs a swap to be all flag
- b++
- }
- }
- return min(a, b), i == n
-}
-
-func min(a, b int) int {
- if a < b {
- return a
- }
- return b
-}
diff --git a/problems/minimum-elements-to-add-to-form-a-given-sum/README.md b/problems/minimum-elements-to-add-to-form-a-given-sum/README.md
deleted file mode 100644
index 1bad5bcd5..000000000
--- a/problems/minimum-elements-to-add-to-form-a-given-sum/README.md
+++ /dev/null
@@ -1,69 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../check-if-binary-string-has-at-most-one-segment-of-ones "Check if Binary String Has at Most One Segment of Ones")
-
-[Next >](../number-of-restricted-paths-from-first-to-last-node "Number of Restricted Paths From First to Last Node")
-
-## [1785. Minimum Elements to Add to Form a Given Sum (Medium)](https://leetcode.com/problems/minimum-elements-to-add-to-form-a-given-sum "构成特定和需要添加的最少元素")
-
-
You are given an integer array nums and two integers limit and goal. The array nums has an interesting property that abs(nums[i]) <= limit.
-
-
Return the minimum number of elements you need to add to make the sum of the array equal to goal. The array must maintain its property that abs(nums[i]) <= limit.
-
-
Note that abs(x) equals x if x >= 0, and -x otherwise.
-
-
-
Example 1:
-
-
-Input: nums = [1,-1,1], limit = 3, goal = -4
-Output: 2
-Explanation: You can add -2 and -3, then the sum of the array will be 1 - 1 + 1 - 2 - 3 = -4.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Greedy](../../tag/greedy/README.md)]
-
-### Hints
-
-Hint 1
-Try thinking about the problem as if the array is empty. Then you only need to form goal using elements whose absolute value is <= limit.
-
-
-
-Hint 2
-You can greedily set all of the elements except one to limit or -limit, so the number of elements you need is ceil(abs(goal)/ limit).
-
-
-
-Hint 3
-You can "normalize" goal by offsetting it by the sum of the array. For example, if the goal is 5 and the sum is -3, then it's exactly the same as if the goal is 8 and the array is empty.
-
-
-
-Hint 4
-The answer is ceil(abs(goal-sum)/limit) = (abs(goal-sum)+limit-1) / limit.
-
diff --git a/problems/minimum-factorization/README.md b/problems/minimum-factorization/README.md
deleted file mode 100644
index 2de984add..000000000
--- a/problems/minimum-factorization/README.md
+++ /dev/null
@@ -1,38 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-distance-in-arrays "Maximum Distance in Arrays")
-
-[Next >](../exchange-seats "Exchange Seats")
-
-## [625. Minimum Factorization (Medium)](https://leetcode.com/problems/minimum-factorization "最小因式分解")
-
-
Given a positive integer a, find the smallest positive integer b whose multiplication of each digit equals to a.
-
-
-If there is no answer or the answer is not fit in 32-bit signed integer, then return 0.
-
-
-Example 1
-Input:
-
48
-Output:
-
68
-
-
-
-Example 2
-Input:
-
15
-
-Output:
-
35
-
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
- [[Greedy](../../tag/greedy/README.md)]
diff --git a/problems/minimum-factorization/minimum_factorization.go b/problems/minimum-factorization/minimum_factorization.go
deleted file mode 100644
index 87dc269fd..000000000
--- a/problems/minimum-factorization/minimum_factorization.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem625
diff --git a/problems/minimum-factorization/minimum_factorization_test.go b/problems/minimum-factorization/minimum_factorization_test.go
deleted file mode 100644
index 87dc269fd..000000000
--- a/problems/minimum-factorization/minimum_factorization_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem625
diff --git a/problems/minimum-falling-path-sum-ii/README.md b/problems/minimum-falling-path-sum-ii/README.md
deleted file mode 100644
index 446fbe15c..000000000
--- a/problems/minimum-falling-path-sum-ii/README.md
+++ /dev/null
@@ -1,70 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../remove-covered-intervals "Remove Covered Intervals")
-
-[Next >](../convert-binary-number-in-a-linked-list-to-integer "Convert Binary Number in a Linked List to Integer")
-
-## [1289. Minimum Falling Path Sum II (Hard)](https://leetcode.com/problems/minimum-falling-path-sum-ii "下降路径最小和 II")
-
-
Given an n x n integer matrix grid, return the minimum sum of a falling path with non-zero shifts.
-
-
A falling path with non-zero shifts is a choice of exactly one element from each row of grid such that no two elements chosen in adjacent rows are in the same column.
-
-
-
Example 1:
-
-
-Input: arr = [[1,2,3],[4,5,6],[7,8,9]]
-Output: 13
-Explanation:
-The possible falling paths are:
-[1,5,9], [1,5,7], [1,6,7], [1,6,8],
-[2,4,8], [2,4,9], [2,6,7], [2,6,8],
-[3,4,8], [3,4,9], [3,5,7], [3,5,9]
-The falling path with the smallest sum is [1,5,7], so the answer is 13.
-
-
-
Example 2:
-
-
-Input: grid = [[7]]
-Output: 7
-
-
-
-
Constraints:
-
-
-
n == grid.length == grid[i].length
-
1 <= n <= 200
-
-99 <= grid[i][j] <= 99
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
-
-### Similar Questions
- 1. [Minimum Falling Path Sum](../minimum-falling-path-sum) (Medium)
-
-### Hints
-
-Hint 1
-Use dynamic programming.
-
-
-
-Hint 2
-Let dp[i][j] be the answer for the first i rows such that column j is chosen from row i.
-
-
-
-Hint 3
-Use the concept of cumulative array to optimize the complexity of the solution.
-
diff --git a/problems/minimum-falling-path-sum/README.md b/problems/minimum-falling-path-sum/README.md
deleted file mode 100644
index cbd4580c6..000000000
--- a/problems/minimum-falling-path-sum/README.md
+++ /dev/null
@@ -1,50 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../binary-subarrays-with-sum "Binary Subarrays With Sum")
-
-[Next >](../beautiful-array "Beautiful Array")
-
-## [931. Minimum Falling Path Sum (Medium)](https://leetcode.com/problems/minimum-falling-path-sum "下降路径最小和")
-
-
Given an n x n array of integers matrix, return the minimum sum of any falling path throughmatrix.
-
-
A falling path starts at any element in the first row and chooses the element in the next row that is either directly below or diagonally left/right. Specifically, the next element from position (row, col) will be (row + 1, col - 1), (row + 1, col), or (row + 1, col + 1).
-
-
-
Example 1:
-
-
-Input: matrix = [[2,1,3],[6,5,4],[7,8,9]]
-Output: 13
-Explanation: There are two falling paths with a minimum sum as shown.
-
-
-
Example 2:
-
-
-Input: matrix = [[-19,57],[-40,-5]]
-Output: -59
-Explanation: The falling path with a minimum sum is shown.
-
-
-
-
Constraints:
-
-
-
n == matrix.length == matrix[i].length
-
1 <= n <= 100
-
-100 <= matrix[i][j] <= 100
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
-
-### Similar Questions
- 1. [Minimum Falling Path Sum II](../minimum-falling-path-sum-ii) (Hard)
diff --git a/problems/minimum-falling-path-sum/minimum_falling_path_sum.go b/problems/minimum-falling-path-sum/minimum_falling_path_sum.go
deleted file mode 100644
index bd5dcdca7..000000000
--- a/problems/minimum-falling-path-sum/minimum_falling_path_sum.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem931
diff --git a/problems/minimum-falling-path-sum/minimum_falling_path_sum_test.go b/problems/minimum-falling-path-sum/minimum_falling_path_sum_test.go
deleted file mode 100644
index bd5dcdca7..000000000
--- a/problems/minimum-falling-path-sum/minimum_falling_path_sum_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem931
diff --git a/problems/minimum-flips-to-make-a-or-b-equal-to-c/README.md b/problems/minimum-flips-to-make-a-or-b-equal-to-c/README.md
deleted file mode 100644
index 81c358c5a..000000000
--- a/problems/minimum-flips-to-make-a-or-b-equal-to-c/README.md
+++ /dev/null
@@ -1,57 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../convert-integer-to-the-sum-of-two-no-zero-integers "Convert Integer to the Sum of Two No-Zero Integers")
-
-[Next >](../number-of-operations-to-make-network-connected "Number of Operations to Make Network Connected")
-
-## [1318. Minimum Flips to Make a OR b Equal to c (Medium)](https://leetcode.com/problems/minimum-flips-to-make-a-or-b-equal-to-c "或运算的最小翻转次数")
-
-
Given 3 positives numbers a, b and c. Return the minimum flips required in some bits of a and b to make ( a OR b == c ). (bitwise OR operation).
-Flip operation consists of change any single bit 1 to 0 or change the bit 0 to 1 in their binary representation.
-
-
-
Example 1:
-
-
-
-
-Input: a = 2, b = 6, c = 5
-Output: 3
-Explanation: After flips a = 1 , b = 4 , c = 5 such that (a OR b == c)
-
-
Example 2:
-
-
-Input: a = 4, b = 2, c = 7
-Output: 1
-
-
-
Example 3:
-
-
-Input: a = 1, b = 2, c = 3
-Output: 0
-
-
-
-
Constraints:
-
-
-
1 <= a <= 10^9
-
1 <= b <= 10^9
-
1 <= c <= 10^9
-
-
-### Related Topics
- [[Bit Manipulation](../../tag/bit-manipulation/README.md)]
-
-### Hints
-
-Hint 1
-Check the bits one by one whether they need to be flipped.
-
diff --git a/problems/minimum-garden-perimeter-to-collect-enough-apples/README.md b/problems/minimum-garden-perimeter-to-collect-enough-apples/README.md
deleted file mode 100644
index 8b7b380b8..000000000
--- a/problems/minimum-garden-perimeter-to-collect-enough-apples/README.md
+++ /dev/null
@@ -1,72 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-number-of-weeks-for-which-you-can-work "Maximum Number of Weeks for Which You Can Work")
-
-[Next >](../count-number-of-special-subsequences "Count Number of Special Subsequences")
-
-## [1954. Minimum Garden Perimeter to Collect Enough Apples (Medium)](https://leetcode.com/problems/minimum-garden-perimeter-to-collect-enough-apples "收集足够苹果的最小花园周长")
-
-
In a garden represented as an infinite 2D grid, there is an apple tree planted at every integer coordinate. The apple tree planted at an integer coordinate (i, j) has |i| + |j| apples growing on it.
-
-
You will buy an axis-aligned square plot of land that is centered at (0, 0).
-
-
Given an integer neededApples, return the minimum perimeter of a plot such that at leastneededApplesapples are inside or on the perimeter of that plot.
-
-
The value of |x| is defined as:
-
-
-
x if x >= 0
-
-x if x < 0
-
-
-
-
Example 1:
-
-
-Input: neededApples = 1
-Output: 8
-Explanation: A square plot of side length 1 does not contain any apples.
-However, a square plot of side length 2 has 12 apples inside (as depicted in the image above).
-The perimeter is 2 * 4 = 8.
-
-
-
Example 2:
-
-
-Input: neededApples = 13
-Output: 16
-
-
-
Example 3:
-
-
-Input: neededApples = 1000000000
-Output: 5040
-
-
-
-
Constraints:
-
-
-
1 <= neededApples <= 1015
-
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
-
-### Hints
-
-Hint 1
-Find a formula for the number of apples inside a square with a side length L.
-
-
-
-Hint 2
-Iterate over the possible lengths of the square until enough apples are collected.
-
diff --git a/problems/minimum-genetic-mutation/README.md b/problems/minimum-genetic-mutation/README.md
deleted file mode 100644
index 464225609..000000000
--- a/problems/minimum-genetic-mutation/README.md
+++ /dev/null
@@ -1,67 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../all-oone-data-structure "All O`one Data Structure")
-
-[Next >](../number-of-segments-in-a-string "Number of Segments in a String")
-
-## [433. Minimum Genetic Mutation (Medium)](https://leetcode.com/problems/minimum-genetic-mutation "最小基因变化")
-
-
A gene string can be represented by an 8-character long string, with choices from 'A', 'C', 'G', and 'T'.
-
-
Suppose we need to investigate a mutation from a gene string start to a gene string end where one mutation is defined as one single character changed in the gene string.
-
-
-
For example, "AACCGGTT" --> "AACCGGTA" is one mutation.
-
-
-
There is also a gene bank bank that records all the valid gene mutations. A gene must be in bank to make it a valid gene string.
-
-
Given the two gene strings start and end and the gene bank bank, return the minimum number of mutations needed to mutate from start to end. If there is no such a mutation, return -1.
-
-
Note that the starting point is assumed to be valid, so it might not be included in the bank.
-
-
-
Example 1:
-
-
-Input: start = "AACCGGTT", end = "AACCGGTA", bank = ["AACCGGTA"]
-Output: 1
-
-
-
Example 2:
-
-
-Input: start = "AACCGGTT", end = "AAACGGTA", bank = ["AACCGGTA","AACCGCTA","AAACGGTA"]
-Output: 2
-
-
-
Example 3:
-
-
-Input: start = "AAAAACCC", end = "AACCCCCC", bank = ["AAAACCCC","AAACCCCC","AACCCCCC"]
-Output: 3
-
-
-
-
Constraints:
-
-
-
start.length == 8
-
end.length == 8
-
0 <= bank.length <= 10
-
bank[i].length == 8
-
start, end, and bank[i] consist of only the characters ['A', 'C', 'G', 'T'].
A tree is an undirected graph in which any two vertices are connected by exactly one path. In other words, any connected graph without simple cycles is a tree.
-
-
Given a tree of n nodes labelled from 0 to n - 1, and an array of n - 1edges where edges[i] = [ai, bi] indicates that there is an undirected edge between the two nodes ai and bi in the tree, you can choose any node of the tree as the root. When you select a node x as the root, the result tree has height h. Among all possible rooted trees, those with minimum height (i.e. min(h)) are called minimum height trees (MHTs).
-
-
Return a list of all MHTs' root labels. You can return the answer in any order.
-
-
The height of a rooted tree is the number of edges on the longest downward path between the root and a leaf.
-
-
-
Example 1:
-
-
-Input: n = 4, edges = [[1,0],[1,2],[1,3]]
-Output: [1]
-Explanation: As shown, the height of the tree is 1 when the root is the node with label 1 which is the only MHT.
-
-
-
Example 2:
-
-
-Input: n = 6, edges = [[3,0],[3,1],[3,2],[3,4],[5,4]]
-Output: [3,4]
-
-
-
Example 3:
-
-
-Input: n = 1, edges = []
-Output: [0]
-
-
-
Example 4:
-
-
-Input: n = 2, edges = [[0,1]]
-Output: [0,1]
-
-
-
-
Constraints:
-
-
-
1 <= n <= 2 * 104
-
edges.length == n - 1
-
0 <= ai, bi < n
-
ai != bi
-
All the pairs (ai, bi) are distinct.
-
The given input is guaranteed to be a tree and there will be no repeated edges.
You are given an integer array nums and an integer k. You are asked to distribute this array into k subsets of equal size such that there are no two equal elements in the same subset.
-
-
A subset's incompatibility is the difference between the maximum and minimum elements in that array.
-
-
Return the minimum possible sum of incompatibilities of the ksubsets after distributing the array optimally, or return -1 if it is not possible.
-
-
A subset is a group integers that appear in the array with no particular order.
-
-
-
Example 1:
-
-
-Input: nums = [1,2,1,4], k = 2
-Output: 4
-Explanation: The optimal distribution of subsets is [1,2] and [1,4].
-The incompatibility is (2-1) + (4-1) = 4.
-Note that [1,1] and [2,4] would result in a smaller sum, but the first subset contains 2 equal elements.
-
-
Example 2:
-
-
-Input: nums = [6,3,8,1,3,1,2,2], k = 4
-Output: 6
-Explanation: The optimal distribution of subsets is [1,2], [2,3], [6,8], and [1,3].
-The incompatibility is (2-1) + (3-2) + (8-6) + (3-1) = 6.
-
-
-
Example 3:
-
-
-Input: nums = [5,3,3,6,3,3], k = 3
-Output: -1
-Explanation: It is impossible to distribute nums into 3 subsets where no two elements are equal in the same subset.
-
-
-
-
Constraints:
-
-
-
1 <= k <= nums.length <= 16
-
nums.length is divisible by k
-
1 <= nums[i] <= nums.length
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Bit Manipulation](../../tag/bit-manipulation/README.md)]
- [[Bitmask](../../tag/bitmask/README.md)]
-
-### Hints
-
-Hint 1
-The constraints are small enough for a backtrack solution but not any backtrack solution
-
-
-
-Hint 2
-If we use a naive n^k don't you think it can be optimized
-
diff --git a/problems/minimum-increment-to-make-array-unique/README.md b/problems/minimum-increment-to-make-array-unique/README.md
deleted file mode 100644
index 27f098950..000000000
--- a/problems/minimum-increment-to-make-array-unique/README.md
+++ /dev/null
@@ -1,48 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../delete-columns-to-make-sorted "Delete Columns to Make Sorted")
-
-[Next >](../validate-stack-sequences "Validate Stack Sequences")
-
-## [945. Minimum Increment to Make Array Unique (Medium)](https://leetcode.com/problems/minimum-increment-to-make-array-unique "使数组唯一的最小增量")
-
-
You are given an integer array nums. In one move, you can pick an index i where 0 <= i < nums.length and increment nums[i] by 1.
-
-
Return the minimum number of moves to make every value in numsunique.
-
-
-
Example 1:
-
-
-Input: nums = [1,2,2]
-Output: 1
-Explanation: After 1 move, the array could be [1, 2, 3].
-
-
-
Example 2:
-
-
-Input: nums = [3,2,1,2,1,7]
-Output: 6
-Explanation: After 6 moves, the array could be [3, 4, 1, 2, 5, 7].
-It can be shown with 5 or less moves that it is impossible for the array to have all unique values.
-
Suppose Andy and Doris want to choose a restaurant for dinner, and they both have a list of favorite restaurants represented by strings.
-
-
You need to help them find out their common interest with the least list index sum. If there is a choice tie between answers, output all of them with no order requirement. You could assume there always exists an answer.
-
-
-
Example 1:
-
-
-Input: list1 = ["Shogun","Tapioca Express","Burger King","KFC"], list2 = ["Piatti","The Grill at Torrey Pines","Hungry Hunter Steakhouse","Shogun"]
-Output: ["Shogun"]
-Explanation: The only restaurant they both like is "Shogun".
-
-
-
Example 2:
-
-
-Input: list1 = ["Shogun","Tapioca Express","Burger King","KFC"], list2 = ["KFC","Shogun","Burger King"]
-Output: ["Shogun"]
-Explanation: The restaurant they both like and have the least index sum is "Shogun" with index sum 1 (0+1).
-
list1[i] and list2[i] consist of spaces ' ' and English letters.
-
All the stings of list1 are unique.
-
All the stings of list2 are unique.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Similar Questions
- 1. [Intersection of Two Linked Lists](../intersection-of-two-linked-lists) (Easy)
diff --git a/problems/minimum-index-sum-of-two-lists/minimum_index_sum_of_two_lists.go b/problems/minimum-index-sum-of-two-lists/minimum_index_sum_of_two_lists.go
deleted file mode 100644
index d84e3e167..000000000
--- a/problems/minimum-index-sum-of-two-lists/minimum_index_sum_of_two_lists.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem599
diff --git a/problems/minimum-index-sum-of-two-lists/minimum_index_sum_of_two_lists_test.go b/problems/minimum-index-sum-of-two-lists/minimum_index_sum_of_two_lists_test.go
deleted file mode 100644
index d84e3e167..000000000
--- a/problems/minimum-index-sum-of-two-lists/minimum_index_sum_of_two_lists_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem599
diff --git a/problems/minimum-initial-energy-to-finish-tasks/README.md b/problems/minimum-initial-energy-to-finish-tasks/README.md
deleted file mode 100644
index c8593ac98..000000000
--- a/problems/minimum-initial-energy-to-finish-tasks/README.md
+++ /dev/null
@@ -1,90 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../ways-to-make-a-fair-array "Ways to Make a Fair Array")
-
-[Next >](../change-the-root-of-a-binary-tree "Change the Root of a Binary Tree")
-
-## [1665. Minimum Initial Energy to Finish Tasks (Hard)](https://leetcode.com/problems/minimum-initial-energy-to-finish-tasks "完成所有任务的最少初始能量")
-
-
You are given an array tasks where tasks[i] = [actuali, minimumi]:
-
-
-
actuali is the actual amount of energy you spend to finish the ith task.
-
minimumi is the minimum amount of energy you require to begin the ith task.
-
-
-
For example, if the task is [10, 12] and your current energy is 11, you cannot start this task. However, if your current energy is 13, you can complete this task, and your energy will be 3 after finishing it.
-
-
You can finish the tasks in any order you like.
-
-
Return the minimum initial amount of energy you will needto finish all the tasks.
-
-
-
Example 1:
-
-
-Input: tasks = [[1,2],[2,4],[4,8]]
-Output: 8
-Explanation:
-Starting with 8 energy, we finish the tasks in the following order:
- - 3rd task. Now energy = 8 - 4 = 4.
- - 2nd task. Now energy = 4 - 2 = 2.
- - 1st task. Now energy = 2 - 1 = 1.
-Notice that even though we have leftover energy, starting with 7 energy does not work because we cannot do the 3rd task.
-
-
Example 2:
-
-
-Input: tasks = [[1,3],[2,4],[10,11],[10,12],[8,9]]
-Output: 32
-Explanation:
-Starting with 32 energy, we finish the tasks in the following order:
- - 1st task. Now energy = 32 - 1 = 31.
- - 2nd task. Now energy = 31 - 2 = 29.
- - 3rd task. Now energy = 29 - 10 = 19.
- - 4th task. Now energy = 19 - 10 = 9.
- - 5th task. Now energy = 9 - 8 = 1.
-
-
Example 3:
-
-
-Input: tasks = [[1,7],[2,8],[3,9],[4,10],[5,11],[6,12]]
-Output: 27
-Explanation:
-Starting with 27 energy, we finish the tasks in the following order:
- - 5th task. Now energy = 27 - 5 = 22.
- - 2nd task. Now energy = 22 - 2 = 20.
- - 3rd task. Now energy = 20 - 3 = 17.
- - 1st task. Now energy = 17 - 1 = 16.
- - 4th task. Now energy = 16 - 4 = 12.
- - 6th task. Now energy = 12 - 6 = 6.
-
-
-
-
Constraints:
-
-
-
1 <= tasks.length <= 105
-
1 <= actuali <= minimumi <= 104
-
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Hints
-
-Hint 1
-We can easily figure that the f(x) : does x solve this array is monotonic so binary Search is doable
-
-
-
-Hint 2
-Figure a sorting pattern
-
diff --git a/problems/minimum-insertion-steps-to-make-a-string-palindrome/README.md b/problems/minimum-insertion-steps-to-make-a-string-palindrome/README.md
deleted file mode 100644
index 4dea8e463..000000000
--- a/problems/minimum-insertion-steps-to-make-a-string-palindrome/README.md
+++ /dev/null
@@ -1,66 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../get-watched-videos-by-your-friends "Get Watched Videos by Your Friends")
-
-[Next >](../decompress-run-length-encoded-list "Decompress Run-Length Encoded List")
-
-## [1312. Minimum Insertion Steps to Make a String Palindrome (Hard)](https://leetcode.com/problems/minimum-insertion-steps-to-make-a-string-palindrome "让字符串成为回文串的最少插入次数")
-
-
Given a string s. In one step you can insert any character at any index of the string.
-
-
Return the minimum number of steps to make s palindrome.
-
-
A Palindrome String is one that reads the same backward as well as forward.
-
-
-
Example 1:
-
-
-Input: s = "zzazz"
-Output: 0
-Explanation: The string "zzazz" is already palindrome we don't need any insertions.
-
-
-
Example 2:
-
-
-Input: s = "mbadm"
-Output: 2
-Explanation: String can be "mbdadbm" or "mdbabdm".
-
-
-
Example 3:
-
-
-Input: s = "leetcode"
-Output: 5
-Explanation: Inserting 5 characters the string becomes "leetcodocteel".
-
-
-
-
Constraints:
-
-
-
1 <= s.length <= 500
-
s consists of lowercase English letters.
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Hints
-
-Hint 1
-Is dynamic programming suitable for this problem ?
-
-
-
-Hint 2
-If we know the longest palindromic sub-sequence is x and the length of the string is n then, what is the answer to this problem? It is n - x as we need n - x insertions to make the remaining characters also palindrome.
-
diff --git a/problems/minimum-insertions-to-balance-a-parentheses-string/README.md b/problems/minimum-insertions-to-balance-a-parentheses-string/README.md
deleted file mode 100644
index ee880867b..000000000
--- a/problems/minimum-insertions-to-balance-a-parentheses-string/README.md
+++ /dev/null
@@ -1,81 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../can-convert-string-in-k-moves "Can Convert String in K Moves")
-
-[Next >](../find-longest-awesome-substring "Find Longest Awesome Substring")
-
-## [1541. Minimum Insertions to Balance a Parentheses String (Medium)](https://leetcode.com/problems/minimum-insertions-to-balance-a-parentheses-string "平衡括号字符串的最少插入次数")
-
-
Given a parentheses string s containing only the characters '(' and ')'. A parentheses string is balanced if:
-
-
-
Any left parenthesis '(' must have a corresponding two consecutive right parenthesis '))'.
-
Left parenthesis '(' must go before the corresponding two consecutive right parenthesis '))'.
-
-
-
In other words, we treat '(' as an opening parenthesis and '))' as a closing parenthesis.
-
-
-
For example, "())", "())(())))" and "(())())))" are balanced, ")()", "()))" and "(()))" are not balanced.
-
-
-
You can insert the characters '(' and ')' at any position of the string to balance it if needed.
-
-
Return the minimum number of insertions needed to make s balanced.
-
-
-
Example 1:
-
-
-Input: s = "(()))"
-Output: 1
-Explanation: The second '(' has two matching '))', but the first '(' has only ')' matching. We need to to add one more ')' at the end of the string to be "(())))" which is balanced.
-
-
-
Example 2:
-
-
-Input: s = "())"
-Output: 0
-Explanation: The string is already balanced.
-
-
-
Example 3:
-
-
-Input: s = "))())("
-Output: 3
-Explanation: Add '(' to match the first '))', Add '))' to match the last '('.
-
-
-
-
Constraints:
-
-
-
1 <= s.length <= 105
-
s consists of '(' and ')' only.
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
- [[Stack](../../tag/stack/README.md)]
- [[Greedy](../../tag/greedy/README.md)]
-
-### Similar Questions
- 1. [Minimum Number of Swaps to Make the String Balanced](../minimum-number-of-swaps-to-make-the-string-balanced) (Medium)
-
-### Hints
-
-Hint 1
-Use a stack to keep opening brackets. If you face single closing ')' add 1 to the answer and consider it as '))'.
-
-
-
-Hint 2
-If you have '))' with empty stack, add 1 to the answer, If after finishing you have x opening remaining in the stack, add 2x to the answer.
-
diff --git a/problems/minimum-interval-to-include-each-query/README.md b/problems/minimum-interval-to-include-each-query/README.md
deleted file mode 100644
index f9a6134b5..000000000
--- a/problems/minimum-interval-to-include-each-query/README.md
+++ /dev/null
@@ -1,72 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-adjacent-swaps-to-reach-the-kth-smallest-number "Minimum Adjacent Swaps to Reach the Kth Smallest Number")
-
-[Next >](../distinct-numbers-in-each-subarray "Distinct Numbers in Each Subarray")
-
-## [1851. Minimum Interval to Include Each Query (Hard)](https://leetcode.com/problems/minimum-interval-to-include-each-query "包含每个查询的最小区间")
-
-
You are given a 2D integer array intervals, where intervals[i] = [lefti, righti] describes the ith interval starting at lefti and ending at righti(inclusive). The size of an interval is defined as the number of integers it contains, or more formally righti - lefti + 1.
-
-
You are also given an integer array queries. The answer to the jth query is the size of the smallest intervali such that lefti <= queries[j] <= righti. If no such interval exists, the answer is -1.
-
-
Return an array containing the answers to the queries.
-
-
-
Example 1:
-
-
-Input: intervals = [[1,4],[2,4],[3,6],[4,4]], queries = [2,3,4,5]
-Output: [3,3,1,4]
-Explanation: The queries are processed as follows:
-- Query = 2: The interval [2,4] is the smallest interval containing 2. The answer is 4 - 2 + 1 = 3.
-- Query = 3: The interval [2,4] is the smallest interval containing 3. The answer is 4 - 2 + 1 = 3.
-- Query = 4: The interval [4,4] is the smallest interval containing 4. The answer is 4 - 4 + 1 = 1.
-- Query = 5: The interval [3,6] is the smallest interval containing 5. The answer is 6 - 3 + 1 = 4.
-
-
-
Example 2:
-
-
-Input: intervals = [[2,3],[2,5],[1,8],[20,25]], queries = [2,19,5,22]
-Output: [2,-1,4,6]
-Explanation: The queries are processed as follows:
-- Query = 2: The interval [2,3] is the smallest interval containing 2. The answer is 3 - 2 + 1 = 2.
-- Query = 19: None of the intervals contain 19. The answer is -1.
-- Query = 5: The interval [2,5] is the smallest interval containing 5. The answer is 5 - 2 + 1 = 4.
-- Query = 22: The interval [20,25] is the smallest interval containing 22. The answer is 25 - 20 + 1 = 6.
-
-
-
-
Constraints:
-
-
-
1 <= intervals.length <= 105
-
1 <= queries.length <= 105
-
intervals[i].length == 2
-
1 <= lefti <= righti <= 107
-
1 <= queries[j] <= 107
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
- [[Line Sweep](../../tag/line-sweep/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
- [[Heap (Priority Queue)](../../tag/heap-priority-queue/README.md)]
-
-### Hints
-
-Hint 1
-Is there a way to order the intervals and queries such that it takes less time to query?
-
-
-
-Hint 2
-Is there a way to add and remove intervals by going from the smallest query to the largest query to find the minimum size?
-
diff --git a/problems/minimum-jumps-to-reach-home/README.md b/problems/minimum-jumps-to-reach-home/README.md
deleted file mode 100644
index 5f74939af..000000000
--- a/problems/minimum-jumps-to-reach-home/README.md
+++ /dev/null
@@ -1,78 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-deletions-to-make-string-balanced "Minimum Deletions to Make String Balanced")
-
-[Next >](../distribute-repeating-integers "Distribute Repeating Integers")
-
-## [1654. Minimum Jumps to Reach Home (Medium)](https://leetcode.com/problems/minimum-jumps-to-reach-home "到家的最少跳跃次数")
-
-
A certain bug's home is on the x-axis at position x. Help them get there from position 0.
-
-
The bug jumps according to the following rules:
-
-
-
It can jump exactly a positions forward (to the right).
-
It can jump exactly b positions backward (to the left).
-
It cannot jump backward twice in a row.
-
It cannot jump to any forbidden positions.
-
-
-
The bug may jump forward beyond its home, but it cannot jump to positions numbered with negative integers.
-
-
Given an array of integers forbidden, where forbidden[i] means that the bug cannot jump to the position forbidden[i], and integers a, b, and x, return the minimum number of jumps needed for the bug to reach its home. If there is no possible sequence of jumps that lands the bug on position x, return -1.
-
-
-
Example 1:
-
-
-Input: forbidden = [14,4,18,1,15], a = 3, b = 15, x = 9
-Output: 3
-Explanation: 3 jumps forward (0 -> 3 -> 6 -> 9) will get the bug home.
-
-
-
Example 2:
-
-
-Input: forbidden = [8,3,16,6,12,20], a = 15, b = 13, x = 11
-Output: -1
-
-
-
Example 3:
-
-
-Input: forbidden = [1,6,2,14,5,17,4], a = 16, b = 9, x = 7
-Output: 2
-Explanation: One jump forward (0 -> 16) then one jump backward (16 -> 7) will get the bug home.
-
-
-
-
Constraints:
-
-
-
1 <= forbidden.length <= 1000
-
1 <= a, b, forbidden[i] <= 2000
-
0 <= x <= 2000
-
All the elements in forbidden are distinct.
-
Position x is not forbidden.
-
-
-### Related Topics
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Hints
-
-Hint 1
-Think of the line as a graph
-
-
-
-Hint 2
-to handle the no double back jumps condition you can handle it by holding the state of your previous jump
-
diff --git a/problems/minimum-knight-moves/README.md b/problems/minimum-knight-moves/README.md
deleted file mode 100644
index 6b6aae821..000000000
--- a/problems/minimum-knight-moves/README.md
+++ /dev/null
@@ -1,63 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../how-many-apples-can-you-put-into-the-basket "How Many Apples Can You Put into the Basket")
-
-[Next >](../find-smallest-common-element-in-all-rows "Find Smallest Common Element in All Rows")
-
-## [1197. Minimum Knight Moves (Medium)](https://leetcode.com/problems/minimum-knight-moves "进击的骑士")
-
-
In an infinite chess board with coordinates from -infinity to +infinity, you have a knight at square [0, 0].
-
-
A knight has 8 possible moves it can make, as illustrated below. Each move is two squares in a cardinal direction, then one square in an orthogonal direction.
-
-
-
-
Return the minimum number of steps needed to move the knight to the square [x, y]. It is guaranteed the answer exists.
-
-
-
Example 1:
-
-
-Input: x = 2, y = 1
-Output: 1
-Explanation: [0, 0] → [2, 1]
-
-
-### Related Topics
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
-
-### Hints
-
-Hint 1
-You can simulate the movements since the limits are low.
-
-
-
-Hint 2
-Is there a search algorithm applicable to this problem?
-
-
-
-Hint 3
-Since we want the minimum number of moves, we can use Breadth First Search.
-
diff --git a/problems/minimum-length-of-string-after-deleting-similar-ends/README.md b/problems/minimum-length-of-string-after-deleting-similar-ends/README.md
deleted file mode 100644
index 83de2d6e8..000000000
--- a/problems/minimum-length-of-string-after-deleting-similar-ends/README.md
+++ /dev/null
@@ -1,77 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-absolute-sum-of-any-subarray "Maximum Absolute Sum of Any Subarray")
-
-[Next >](../maximum-number-of-events-that-can-be-attended-ii "Maximum Number of Events That Can Be Attended II")
-
-## [1750. Minimum Length of String After Deleting Similar Ends (Medium)](https://leetcode.com/problems/minimum-length-of-string-after-deleting-similar-ends "删除字符串两端相同字符后的最短长度")
-
-
Given a string s consisting only of characters 'a', 'b', and 'c'. You are asked to apply the following algorithm on the string any number of times:
-
-
-
Pick a non-empty prefix from the string s where all the characters in the prefix are equal.
-
Pick a non-empty suffix from the string s where all the characters in this suffix are equal.
-
The prefix and the suffix should not intersect at any index.
-
The characters from the prefix and suffix must be the same.
-
Delete both the prefix and the suffix.
-
-
-
Return the minimum length of safter performing the above operation any number of times (possibly zero times).
-
-
-
Example 1:
-
-
-Input: s = "ca"
-Output: 2
-Explanation: You can't remove any characters, so the string stays as is.
-
-
-
Example 2:
-
-
-Input: s = "cabaabac"
-Output: 0
-Explanation: An optimal sequence of operations is:
-- Take prefix = "c" and suffix = "c" and remove them, s = "abaaba".
-- Take prefix = "a" and suffix = "a" and remove them, s = "baab".
-- Take prefix = "b" and suffix = "b" and remove them, s = "aa".
-- Take prefix = "a" and suffix = "a" and remove them, s = "".
-
-
Example 3:
-
-
-Input: s = "aabccabba"
-Output: 3
-Explanation: An optimal sequence of operations is:
-- Take prefix = "aa" and suffix = "a" and remove them, s = "bccabb".
-- Take prefix = "b" and suffix = "bb" and remove them, s = "cca".
-
-
-
-
Constraints:
-
-
-
1 <= s.length <= 105
-
s only consists of characters 'a', 'b', and 'c'.
-
-
-### Related Topics
- [[Two Pointers](../../tag/two-pointers/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Hints
-
-Hint 1
-If both ends have distinct characters, no more operations can be made. Otherwise, the only operation is to remove all of the same characters from both ends. We will do this as many times as we can.
-
-
-
-Hint 2
-Note that if the length is equal 1 the answer is 1
-
diff --git a/problems/minimum-limit-of-balls-in-a-bag/README.md b/problems/minimum-limit-of-balls-in-a-bag/README.md
deleted file mode 100644
index 85b5b54ac..000000000
--- a/problems/minimum-limit-of-balls-in-a-bag/README.md
+++ /dev/null
@@ -1,83 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../count-number-of-homogenous-substrings "Count Number of Homogenous Substrings")
-
-[Next >](../minimum-degree-of-a-connected-trio-in-a-graph "Minimum Degree of a Connected Trio in a Graph")
-
-## [1760. Minimum Limit of Balls in a Bag (Medium)](https://leetcode.com/problems/minimum-limit-of-balls-in-a-bag "袋子里最少数目的球")
-
-
You are given an integer array nums where the ith bag contains nums[i] balls. You are also given an integer maxOperations.
-
-
You can perform the following operation at most maxOperations times:
-
-
-
Take any bag of balls and divide it into two new bags with a positive number of balls.
-
-
For example, a bag of 5 balls can become two new bags of 1 and 4 balls, or two new bags of 2 and 3 balls.
-
-
-
-
-
Your penalty is the maximum number of balls in a bag. You want to minimize your penalty after the operations.
-
-
Return the minimum possible penalty after performing the operations.
-
-
-
Example 1:
-
-
-Input: nums = [9], maxOperations = 2
-Output: 3
-Explanation:
-- Divide the bag with 9 balls into two bags of sizes 6 and 3. [9] -> [6,3].
-- Divide the bag with 6 balls into two bags of sizes 3 and 3. [6,3] -> [3,3,3].
-The bag with the most number of balls has 3 balls, so your penalty is 3 and you should return 3.
-
-
-
Example 2:
-
-
-Input: nums = [2,4,8,2], maxOperations = 4
-Output: 2
-Explanation:
-- Divide the bag with 8 balls into two bags of sizes 4 and 4. [2,4,8,2] -> [2,4,4,4,2].
-- Divide the bag with 4 balls into two bags of sizes 2 and 2. [2,4,4,4,2] -> [2,2,2,4,4,2].
-- Divide the bag with 4 balls into two bags of sizes 2 and 2. [2,2,2,4,4,2] -> [2,2,2,2,2,4,2].
-- Divide the bag with 4 balls into two bags of sizes 2 and 2. [2,2,2,2,2,4,2] -> [2,2,2,2,2,2,2,2].
-The bag with the most number of balls has 2 balls, so your penalty is 2 an you should return 2.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
-
-### Hints
-
-Hint 1
-Let's change the question if we know the maximum size of a bag what is the minimum number of bags you can make
-
-
-
-Hint 2
-note that as the maximum size increases the minimum number of bags decreases so we can binary search the maximum size
-
diff --git a/problems/minimum-moves-to-convert-string/README.md b/problems/minimum-moves-to-convert-string/README.md
deleted file mode 100644
index b05b55634..000000000
--- a/problems/minimum-moves-to-convert-string/README.md
+++ /dev/null
@@ -1,68 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../low-quality-problems "Low-Quality Problems")
-
-[Next >](../find-missing-observations "Find Missing Observations")
-
-## [2027. Minimum Moves to Convert String (Easy)](https://leetcode.com/problems/minimum-moves-to-convert-string "转换字符串的最少操作次数")
-
-
You are given a string s consisting of n characters which are either 'X' or 'O'.
-
-
A move is defined as selecting threeconsecutive characters of s and converting them to 'O'. Note that if a move is applied to the character 'O', it will stay the same.
-
-
Return the minimum number of moves required so that all the characters of s are converted to 'O'.
-
-
-
Example 1:
-
-
-Input: s = "XXX"
-Output: 1
-Explanation:XXX -> OOO
-We select all the 3 characters and convert them in one move.
-
-
-
Example 2:
-
-
-Input: s = "XXOX"
-Output: 2
-Explanation:XXOX -> OOOX -> OOOO
-We select the first 3 characters in the first move, and convert them to 'O'.
-Then we select the last 3 characters and convert them so that the final string contains all 'O's.
-
-
Example 3:
-
-
-Input: s = "OOOO"
-Output: 0
-Explanation: There are no 'X's in s to convert.
-
-
-
-
Constraints:
-
-
-
3 <= s.length <= 1000
-
s[i] is either 'X' or 'O'.
-
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Hints
-
-Hint 1
-Find the smallest substring you need to consider at a time.
-
-
-
-Hint 2
-Try delaying a move as long as possible.
-
diff --git a/problems/minimum-moves-to-equal-array-elements-ii/README.md b/problems/minimum-moves-to-equal-array-elements-ii/README.md
deleted file mode 100644
index 93facd4a6..000000000
--- a/problems/minimum-moves-to-equal-array-elements-ii/README.md
+++ /dev/null
@@ -1,54 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../hamming-distance "Hamming Distance")
-
-[Next >](../island-perimeter "Island Perimeter")
-
-## [462. Minimum Moves to Equal Array Elements II (Medium)](https://leetcode.com/problems/minimum-moves-to-equal-array-elements-ii "最少移动次数使数组元素相等 II")
-
-
Given an integer array nums of size n, return the minimum number of moves required to make all array elements equal.
-
-
In one move, you can increment or decrement an element of the array by 1.
-
-
Test cases are designed so that the answer will fit in a 32-bit integer.
-
-
-
Example 1:
-
-
-Input: nums = [1,2,3]
-Output: 2
-Explanation:
-Only two moves are needed (remember each move increments or decrements one element):
-[1,2,3] => [2,2,3] => [2,2,2]
-
Given an integer array nums of size n, return the minimum number of moves required to make all array elements equal.
-
-
In one move, you can increment n - 1 elements of the array by 1.
-
-
-
Example 1:
-
-
-Input: nums = [1,2,3]
-Output: 3
-Explanation: Only three moves are needed (remember each move increments two elements):
-[1,2,3] => [2,3,3] => [3,4,3] => [4,4,4]
-
-
-
Example 2:
-
-
-Input: nums = [1,1,1]
-Output: 0
-
-
-
-
Constraints:
-
-
-
n == nums.length
-
1 <= nums.length <= 105
-
-109 <= nums[i] <= 109
-
The answer is guaranteed to fit in a 32-bit integer.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Math](../../tag/math/README.md)]
-
-### Similar Questions
- 1. [Minimum Moves to Equal Array Elements II](../minimum-moves-to-equal-array-elements-ii) (Medium)
diff --git a/problems/minimum-moves-to-equal-array-elements/minimum_moves_to_equal_array_elements.go b/problems/minimum-moves-to-equal-array-elements/minimum_moves_to_equal_array_elements.go
deleted file mode 100644
index c8f837ede..000000000
--- a/problems/minimum-moves-to-equal-array-elements/minimum_moves_to_equal_array_elements.go
+++ /dev/null
@@ -1,12 +0,0 @@
-package problem453
-
-func minMoves(nums []int) int {
- sum, min, n := 0, nums[0], len(nums)
- for _, num := range nums {
- sum += num
- if min > num {
- min = num
- }
- }
- return sum - n*min
-}
diff --git a/problems/minimum-moves-to-equal-array-elements/minimum_moves_to_equal_array_elements_test.go b/problems/minimum-moves-to-equal-array-elements/minimum_moves_to_equal_array_elements_test.go
deleted file mode 100644
index e98692c00..000000000
--- a/problems/minimum-moves-to-equal-array-elements/minimum_moves_to_equal_array_elements_test.go
+++ /dev/null
@@ -1,27 +0,0 @@
-package problem453
-
-import "testing"
-
-type testType struct {
- in []int
- want int
-}
-
-func TestMinMoves(t *testing.T) {
- tests := [...]testType{
- {
- in: []int{1, 2, 3},
- want: 3,
- },
- {
- in: []int{5, 3, 1},
- want: 6,
- },
- }
- for _, tt := range tests {
- got := minMoves(tt.in)
- if got != tt.want {
- t.Fatalf("in: %v, got: %v, want: %v", tt.in, got, tt.want)
- }
- }
-}
diff --git a/problems/minimum-moves-to-make-array-complementary/README.md b/problems/minimum-moves-to-make-array-complementary/README.md
deleted file mode 100644
index bac1b8a62..000000000
--- a/problems/minimum-moves-to-make-array-complementary/README.md
+++ /dev/null
@@ -1,79 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../find-the-most-competitive-subsequence "Find the Most Competitive Subsequence")
-
-[Next >](../minimize-deviation-in-array "Minimize Deviation in Array")
-
-## [1674. Minimum Moves to Make Array Complementary (Medium)](https://leetcode.com/problems/minimum-moves-to-make-array-complementary "使数组互补的最少操作次数")
-
-
You are given an integer array nums of even length n and an integer limit. In one move, you can replace any integer from nums with another integer between 1 and limit, inclusive.
-
-
The array nums is complementary if for all indices i (0-indexed), nums[i] + nums[n - 1 - i] equals the same number. For example, the array [1,2,3,4] is complementary because for all indices i, nums[i] + nums[n - 1 - i] = 5.
-
-
Return the minimum number of moves required to make numscomplementary.
-
-
-
Example 1:
-
-
-Input: nums = [1,2,4,3], limit = 4
-Output: 1
-Explanation: In 1 move, you can change nums to [1,2,2,3] (underlined elements are changed).
-nums[0] + nums[3] = 1 + 3 = 4.
-nums[1] + nums[2] = 2 + 2 = 4.
-nums[2] + nums[1] = 2 + 2 = 4.
-nums[3] + nums[0] = 3 + 1 = 4.
-Therefore, nums[i] + nums[n-1-i] = 4 for every i, so nums is complementary.
-
-
-
Example 2:
-
-
-Input: nums = [1,2,2,1], limit = 2
-Output: 2
-Explanation: In 2 moves, you can change nums to [2,2,2,2]. You cannot change any number to 3 since 3 > limit.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Prefix Sum](../../tag/prefix-sum/README.md)]
-
-### Hints
-
-Hint 1
-Given a target sum x, each pair of nums[i] and nums[n-1-i] would either need 0, 1, or 2 modifications.
-
-
-
-Hint 2
-Can you find the optimal target sum x value such that the sum of modifications is minimized?
-
-
-
-Hint 3
-Create a difference array to efficiently sum all the modifications.
-
diff --git a/problems/minimum-moves-to-move-a-box-to-their-target-location/README.md b/problems/minimum-moves-to-move-a-box-to-their-target-location/README.md
deleted file mode 100644
index 34b543908..000000000
--- a/problems/minimum-moves-to-move-a-box-to-their-target-location/README.md
+++ /dev/null
@@ -1,95 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../greatest-sum-divisible-by-three "Greatest Sum Divisible by Three")
-
-[Next >](../page-recommendations "Page Recommendations")
-
-## [1263. Minimum Moves to Move a Box to Their Target Location (Hard)](https://leetcode.com/problems/minimum-moves-to-move-a-box-to-their-target-location "推箱子")
-
-
A storekeeper is a game in which the player pushes boxes around in a warehouse trying to get them to target locations.
-
-
The game is represented by an m x n grid of characters grid where each element is a wall, floor, or box.
-
-
Your task is to move the box 'B' to the target position 'T' under the following rules:
-
-
-
The character 'S' represents the player. The player can move up, down, left, right in grid if it is a floor (empty cell).
-
The character '.' represents the floor which means a free cell to walk.
-
The character '#' represents the wall which means an obstacle (impossible to walk there).
-
There is only one box 'B' and one target cell 'T' in the grid.
-
The box can be moved to an adjacent free cell by standing next to the box and then moving in the direction of the box. This is a push.
-
The player cannot walk through the box.
-
-
-
Return the minimum number of pushes to move the box to the target. If there is no way to reach the target, return -1.
-
-
-
Example 1:
-
-
-Input: grid = [["#","#","#","#","#","#"],
- ["#","T","#","#","#","#"],
- ["#",".",".","B",".","#"],
- ["#",".","#","#",".","#"],
- ["#",".",".",".","S","#"],
- ["#","#","#","#","#","#"]]
-Output: 3
-Explanation: We return only the number of times the box is pushed.
-Input: grid = [["#","#","#","#","#","#"],
- ["#","T",".",".","#","#"],
- ["#",".","#","B",".","#"],
- ["#",".",".",".",".","#"],
- ["#",".",".",".","S","#"],
- ["#","#","#","#","#","#"]]
-Output: 5
-Explanation: push the box down, left, left, up and up.
-
-
-
-
Constraints:
-
-
-
m == grid.length
-
n == grid[i].length
-
1 <= m, n <= 20
-
grid contains only characters '.', '#', 'S', 'T', or 'B'.
-
There is only one character 'S', 'B', and 'T' in the grid.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Heap (Priority Queue)](../../tag/heap-priority-queue/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
-
-### Hints
-
-Hint 1
-We represent the search state as (player_row, player_col, box_row, box_col).
-
-
-
-Hint 2
-You need to count only the number of pushes. Then inside of your BFS check if the box could be pushed (in any direction) given the current position of the player.
-
diff --git a/problems/minimum-moves-to-reach-target-score/README.md b/problems/minimum-moves-to-reach-target-score/README.md
deleted file mode 100644
index 03f9395f4..000000000
--- a/problems/minimum-moves-to-reach-target-score/README.md
+++ /dev/null
@@ -1,82 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../divide-a-string-into-groups-of-size-k "Divide a String Into Groups of Size k")
-
-[Next >](../solving-questions-with-brainpower "Solving Questions With Brainpower")
-
-## [2139. Minimum Moves to Reach Target Score (Medium)](https://leetcode.com/problems/minimum-moves-to-reach-target-score "得到目标值的最少行动次数")
-
-
You are playing a game with integers. You start with the integer 1 and you want to reach the integer target.
-
-
In one move, you can either:
-
-
-
Increment the current integer by one (i.e., x = x + 1).
-
Double the current integer (i.e., x = 2 * x).
-
-
-
You can use the increment operation any number of times, however, you can only use the double operation at mostmaxDoubles times.
-
-
Given the two integers target and maxDoubles, return the minimum number of moves needed to reach target starting with 1.
-
-
-
Example 1:
-
-
-Input: target = 5, maxDoubles = 0
-Output: 4
-Explanation: Keep incrementing by 1 until you reach target.
-
-
-
Example 2:
-
-
-Input: target = 19, maxDoubles = 2
-Output: 7
-Explanation: Initially, x = 1
-Increment 3 times so x = 4
-Double once so x = 8
-Increment once so x = 9
-Double again so x = 18
-Increment once so x = 19
-
-
-
Example 3:
-
-
-Input: target = 10, maxDoubles = 4
-Output: 4
-Explanation:Initially, x = 1
-Increment once so x = 2
-Double once so x = 4
-Increment once so x = 5
-Double again so x = 10
-
-
-
-
Constraints:
-
-
-
1 <= target <= 109
-
0 <= maxDoubles <= 100
-
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[Math](../../tag/math/README.md)]
-
-### Hints
-
-Hint 1
-Solve the opposite problem: start at the given score and move to 1.
-
-
-
-Hint 2
-It is better to use the move of the second type once we can to lose more scores fast.
-
diff --git a/problems/minimum-moves-to-reach-target-with-rotations/README.md b/problems/minimum-moves-to-reach-target-with-rotations/README.md
deleted file mode 100644
index afdb6a02c..000000000
--- a/problems/minimum-moves-to-reach-target-with-rotations/README.md
+++ /dev/null
@@ -1,83 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../remove-all-adjacent-duplicates-in-string-ii "Remove All Adjacent Duplicates in String II")
-
-[Next >](../queries-quality-and-percentage "Queries Quality and Percentage")
-
-## [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).
-
-
In one move the snake can:
-
-
-
Move one cell to the right if there are no blocked cells there. This move keeps the horizontal/vertical position of the snake as it is.
-
Move down one cell if there are no blocked cells there. This move keeps the horizontal/vertical position of the snake as it is.
-
Rotate clockwise if it's in a horizontal position and the two cells under it are both empty. In that case the snake moves from (r, c) and (r, c+1) to (r, c) and (r+1, c).
-
-
Rotate counterclockwise if it's in a vertical position and the two cells to its right are both empty. In that case the snake moves from (r, c) and (r+1, c) to (r, c) and (r, c+1).
-
-
-
-
Return the minimum number of moves to reach the target.
-
-
If there is no way to reach the target, return -1.
It is guaranteed that the snake starts at empty cells.
-
-
-### Related Topics
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
-
-### Hints
-
-Hint 1
-Use BFS to find the answer.
-
-
-
-Hint 2
-The state of the BFS is the position (x, y) along with a binary value that specifies if the position is horizontal or vertical.
-
diff --git a/problems/minimum-non-zero-product-of-the-array-elements/README.md b/problems/minimum-non-zero-product-of-the-array-elements/README.md
deleted file mode 100644
index 9652b9b39..000000000
--- a/problems/minimum-non-zero-product-of-the-array-elements/README.md
+++ /dev/null
@@ -1,81 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../array-with-elements-not-equal-to-average-of-neighbors "Array With Elements Not Equal to Average of Neighbors")
-
-[Next >](../last-day-where-you-can-still-cross "Last Day Where You Can Still Cross")
-
-## [1969. Minimum Non-Zero Product of the Array Elements (Medium)](https://leetcode.com/problems/minimum-non-zero-product-of-the-array-elements "数组元素的最小非零乘积")
-
-
You are given a positive integer p. Consider an array nums (1-indexed) that consists of the integers in the inclusive range [1, 2p - 1] in their binary representations. You are allowed to do the following operation any number of times:
-
-
-
Choose two elements x and y from nums.
-
Choose a bit in x and swap it with its corresponding bit in y. Corresponding bit refers to the bit that is in the same position in the other integer.
-
-
-
For example, if x = 1101 and y = 0011, after swapping the 2nd bit from the right, we have x = 1111 and y = 0001.
-
-
Find the minimum non-zero product of nums after performing the above operation any number of times. Return this productmodulo109 + 7.
-
-
Note: The answer should be the minimum product before the modulo operation is done.
-
-
-
Example 1:
-
-
-Input: p = 1
-Output: 1
-Explanation: nums = [1].
-There is only one element, so the product equals that element.
-
-
-
Example 2:
-
-
-Input: p = 2
-Output: 6
-Explanation: nums = [01, 10, 11].
-Any swap would either make the product 0 or stay the same.
-Thus, the array product of 1 * 2 * 3 = 6 is already minimized.
-
-
-
Example 3:
-
-
-Input: p = 3
-Output: 1512
-Explanation: nums = [001, 010, 011, 100, 101, 110, 111]
-- In the first operation we can swap the leftmost bit of the second and fifth elements.
- - The resulting array is [001, 110, 011, 100, 001, 110, 111].
-- In the second operation we can swap the middle bit of the third and fourth elements.
- - The resulting array is [001, 110, 001, 110, 001, 110, 111].
-The array product is 1 * 6 * 1 * 6 * 1 * 6 * 7 = 1512, which is the minimum possible product.
-
-
-
-
Constraints:
-
-
-
1 <= p <= 60
-
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[Recursion](../../tag/recursion/README.md)]
- [[Math](../../tag/math/README.md)]
-
-### Hints
-
-Hint 1
-Try to minimize each element by swapping bits with any of the elements after it.
-
-
-
-Hint 2
-If you swap out all the 1s in some element, this will lead to a product of zero.
-
diff --git a/problems/minimum-number-of-arrows-to-burst-balloons/README.md b/problems/minimum-number-of-arrows-to-burst-balloons/README.md
deleted file mode 100644
index 592359a87..000000000
--- a/problems/minimum-number-of-arrows-to-burst-balloons/README.md
+++ /dev/null
@@ -1,65 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../sort-characters-by-frequency "Sort Characters By Frequency")
-
-[Next >](../minimum-moves-to-equal-array-elements "Minimum Moves to Equal Array Elements")
-
-## [452. Minimum Number of Arrows to Burst Balloons (Medium)](https://leetcode.com/problems/minimum-number-of-arrows-to-burst-balloons "用最少数量的箭引爆气球")
-
-
There are some spherical balloons taped onto a flat wall that represents the XY-plane. The balloons are represented as a 2D integer array points where points[i] = [xstart, xend] denotes a balloon whose horizontal diameter stretches between xstart and xend. You do not know the exact y-coordinates of the balloons.
-
-
Arrows can be shot up directly vertically (in the positive y-direction) from different points along the x-axis. A balloon with xstart and xend is burst by an arrow shot at x if xstart <= x <= xend. There is no limit to the number of arrows that can be shot. A shot arrow keeps traveling up infinitely, bursting any balloons in its path.
-
-
Given the array points, return the minimum number of arrows that must be shot to burst all balloons.
-
-
-
Example 1:
-
-
-Input: points = [[10,16],[2,8],[1,6],[7,12]]
-Output: 2
-Explanation: The balloons can be burst by 2 arrows:
-- Shoot an arrow at x = 6, bursting the balloons [2,8] and [1,6].
-- Shoot an arrow at x = 11, bursting the balloons [10,16] and [7,12].
-
-
-
Example 2:
-
-
-Input: points = [[1,2],[3,4],[5,6],[7,8]]
-Output: 4
-Explanation: One arrow needs to be shot for each balloon for a total of 4 arrows.
-
-
-
Example 3:
-
-
-Input: points = [[1,2],[2,3],[3,4],[4,5]]
-Output: 2
-Explanation: The balloons can be burst by 2 arrows:
-- Shoot an arrow at x = 2, bursting the balloons [1,2] and [2,3].
-- Shoot an arrow at x = 4, bursting the balloons [3,4] and [4,5].
-
-
-
-
Constraints:
-
-
-
1 <= points.length <= 105
-
points[i].length == 2
-
-231 <= xstart < xend <= 231 - 1
-
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Similar Questions
- 1. [Meeting Rooms II](../meeting-rooms-ii) (Medium)
- 1. [Non-overlapping Intervals](../non-overlapping-intervals) (Medium)
diff --git a/problems/minimum-number-of-arrows-to-burst-balloons/minimum_number_of_arrows_to_burst_balloons.go b/problems/minimum-number-of-arrows-to-burst-balloons/minimum_number_of_arrows_to_burst_balloons.go
deleted file mode 100644
index c83237294..000000000
--- a/problems/minimum-number-of-arrows-to-burst-balloons/minimum_number_of_arrows_to_burst_balloons.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem452
diff --git a/problems/minimum-number-of-arrows-to-burst-balloons/minimum_number_of_arrows_to_burst_balloons_test.go b/problems/minimum-number-of-arrows-to-burst-balloons/minimum_number_of_arrows_to_burst_balloons_test.go
deleted file mode 100644
index c83237294..000000000
--- a/problems/minimum-number-of-arrows-to-burst-balloons/minimum_number_of_arrows_to_burst_balloons_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem452
diff --git a/problems/minimum-number-of-buckets-required-to-collect-rainwater-from-houses/README.md b/problems/minimum-number-of-buckets-required-to-collect-rainwater-from-houses/README.md
deleted file mode 100644
index 8a0798f2f..000000000
--- a/problems/minimum-number-of-buckets-required-to-collect-rainwater-from-houses/README.md
+++ /dev/null
@@ -1,87 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../count-common-words-with-one-occurrence "Count Common Words With One Occurrence")
-
-[Next >](../minimum-cost-homecoming-of-a-robot-in-a-grid "Minimum Cost Homecoming of a Robot in a Grid")
-
-## [2086. Minimum Number of Buckets Required to Collect Rainwater from Houses (Medium)](https://leetcode.com/problems/minimum-number-of-buckets-required-to-collect-rainwater-from-houses "从房屋收集雨水需要的最少水桶数")
-
-
You are given a 0-indexed string street. Each character in street is either 'H' representing a house or '.' representing an empty space.
-
-
You can place buckets on the empty spaces to collect rainwater that falls from the adjacent houses. The rainwater from a house at index i is collected if a bucket is placed at index i - 1and/or index i + 1. A single bucket, if placed adjacent to two houses, can collect the rainwater from both houses.
-
-
Return the minimum number of buckets needed so that for every house, there is at least one bucket collecting rainwater from it, or -1 if it is impossible.
-
-
-
Example 1:
-
-
-Input: street = "H..H"
-Output: 2
-Explanation:
-We can put buckets at index 1 and index 2.
-"H..H" -> "HBBH" ('B' denotes where a bucket is placed).
-The house at index 0 has a bucket to its right, and the house at index 3 has a bucket to its left.
-Thus, for every house, there is at least one bucket collecting rainwater from it.
-
-
-
Example 2:
-
-
-Input: street = ".H.H."
-Output: 1
-Explanation:
-We can put a bucket at index 2.
-".H.H." -> ".HBH." ('B' denotes where a bucket is placed).
-The house at index 1 has a bucket to its right, and the house at index 3 has a bucket to its left.
-Thus, for every house, there is at least one bucket collecting rainwater from it.
-
-
-
Example 3:
-
-
-Input: street = ".HHH."
-Output: -1
-Explanation:
-There is no empty space to place a bucket to collect the rainwater from the house at index 2.
-Thus, it is impossible to collect the rainwater from all the houses.
-
-
-
-
Constraints:
-
-
-
1 <= street.length <= 105
-
street[i] is either'H' or '.'.
-
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[String](../../tag/string/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Hints
-
-Hint 1
-When is it impossible to collect the rainwater from all the houses?
-
-
-
-Hint 2
-When one or more houses do not have an empty space adjacent to it.
-
-
-
-Hint 3
-Assuming the rainwater from all previous houses is collected. If there is a house at index i and you are able to place a bucket at index i - 1 or i + 1, where should you put it?
-
-
-
-Hint 4
-It is always better to place a bucket at index i + 1 because it can collect the rainwater from the next house as well.
-
diff --git a/problems/minimum-number-of-days-to-disconnect-island/README.md b/problems/minimum-number-of-days-to-disconnect-island/README.md
deleted file mode 100644
index 2f96201d0..000000000
--- a/problems/minimum-number-of-days-to-disconnect-island/README.md
+++ /dev/null
@@ -1,77 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-length-of-subarray-with-positive-product "Maximum Length of Subarray With Positive Product")
-
-[Next >](../number-of-ways-to-reorder-array-to-get-same-bst "Number of Ways to Reorder Array to Get Same BST")
-
-## [1568. Minimum Number of Days to Disconnect Island (Hard)](https://leetcode.com/problems/minimum-number-of-days-to-disconnect-island "使陆地分离的最少天数")
-
-
You are given an m x n binary grid grid where 1 represents land and 0 represents water. An island is a maximal 4-directionally (horizontal or vertical) connected group of 1's.
-
-
The grid is said to be connected if we have exactly one island, otherwise is said disconnected.
-
-
In one day, we are allowed to change any single land cell (1) into a water cell (0).
-
-
Return the minimum number of days to disconnect the grid.
-
-
-
Example 1:
-
-
-Input: grid = [[0,1,1,0],[0,1,1,0],[0,0,0,0]]
-
-Output: 2
-Explanation: We need at least 2 days to get a disconnected grid.
-Change land grid[1][1] and grid[0][2] to water and get 2 disconnected island.
-
-
-
Example 2:
-
-
-Input: grid = [[1,1]]
-Output: 2
-Explanation: Grid of full water is also disconnected ([[1,1]] -> [[0,0]]), 0 islands.
-
-
-
-
Constraints:
-
-
-
m == grid.length
-
n == grid[i].length
-
1 <= m, n <= 30
-
grid[i][j] is either 0 or 1.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
- [[Strongly Connected Component](../../tag/strongly-connected-component/README.md)]
-
-### Hints
-
-Hint 1
-Return 0 if the grid is already disconnected.
-
-
-
-Hint 2
-Return 1 if changing a single land to water disconnect the island.
-
-
-
-Hint 3
-Otherwise return 2.
-
-
-
-Hint 4
-We can disconnect the grid within at most 2 days.
-
diff --git a/problems/minimum-number-of-days-to-eat-n-oranges/README.md b/problems/minimum-number-of-days-to-eat-n-oranges/README.md
deleted file mode 100644
index ef9a3d0c3..000000000
--- a/problems/minimum-number-of-days-to-eat-n-oranges/README.md
+++ /dev/null
@@ -1,69 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../magnetic-force-between-two-balls "Magnetic Force Between Two Balls")
-
-[Next >](../strings-differ-by-one-character "Strings Differ by One Character")
-
-## [1553. Minimum Number of Days to Eat N Oranges (Hard)](https://leetcode.com/problems/minimum-number-of-days-to-eat-n-oranges "吃掉 N 个橘子的最少天数")
-
-
There are n oranges in the kitchen and you decided to eat some of these oranges every day as follows:
-
-
-
Eat one orange.
-
If the number of remaining oranges n is divisible by 2 then you can eat n / 2 oranges.
-
If the number of remaining oranges n is divisible by 3 then you can eat 2 * (n / 3) oranges.
-
-
-
You can only choose one of the actions per day.
-
-
Given the integer n, return the minimum number of days to eatnoranges.
-
-
-
Example 1:
-
-
-Input: n = 10
-Output: 4
-Explanation: You have 10 oranges.
-Day 1: Eat 1 orange, 10 - 1 = 9.
-Day 2: Eat 6 oranges, 9 - 2*(9/3) = 9 - 6 = 3. (Since 9 is divisible by 3)
-Day 3: Eat 2 oranges, 3 - 2*(3/3) = 3 - 2 = 1.
-Day 4: Eat the last orange 1 - 1 = 0.
-You need at least 4 days to eat the 10 oranges.
-
-
-
Example 2:
-
-
-Input: n = 6
-Output: 3
-Explanation: You have 6 oranges.
-Day 1: Eat 3 oranges, 6 - 6/2 = 6 - 3 = 3. (Since 6 is divisible by 2).
-Day 2: Eat 2 oranges, 3 - 2*(3/3) = 3 - 2 = 1. (Since 3 is divisible by 3)
-Day 3: Eat the last orange 1 - 1 = 0.
-You need at least 3 days to eat the 6 oranges.
-
-
-
-
Constraints:
-
-
-
1 <= n <= 2 * 109
-
-
-### Related Topics
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Memoization](../../tag/memoization/README.md)]
-
-### Hints
-
-Hint 1
-In each step, choose between 2 options:
-minOranges = 1 + min( (n%2) + f(n/2), (n%3) + f(n/3) )
-where f(n) is the minimum number of days to eat n oranges.
-
diff --git a/problems/minimum-number-of-days-to-make-m-bouquets/README.md b/problems/minimum-number-of-days-to-make-m-bouquets/README.md
deleted file mode 100644
index 23c7493b3..000000000
--- a/problems/minimum-number-of-days-to-make-m-bouquets/README.md
+++ /dev/null
@@ -1,84 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../least-number-of-unique-integers-after-k-removals "Least Number of Unique Integers after K Removals")
-
-[Next >](../kth-ancestor-of-a-tree-node "Kth Ancestor of a Tree Node")
-
-## [1482. Minimum Number of Days to Make m Bouquets (Medium)](https://leetcode.com/problems/minimum-number-of-days-to-make-m-bouquets "制作 m 束花所需的最少天数")
-
-
You are given an integer array bloomDay, an integer m and an integer k.
-
-
You want to make m bouquets. To make a bouquet, you need to use kadjacent flowers from the garden.
-
-
The garden consists of n flowers, the ith flower will bloom in the bloomDay[i] and then can be used in exactly one bouquet.
-
-
Return the minimum number of days you need to wait to be able to make m bouquets from the garden. If it is impossible to make m bouquets return -1.
-
-
-
Example 1:
-
-
-Input: bloomDay = [1,10,3,10,2], m = 3, k = 1
-Output: 3
-Explanation: Let us see what happened in the first three days. x means flower bloomed and _ means flower did not bloom in the garden.
-We need 3 bouquets each should contain 1 flower.
-After day 1: [x, _, _, _, _] // we can only make one bouquet.
-After day 2: [x, _, _, _, x] // we can only make two bouquets.
-After day 3: [x, _, x, _, x] // we can make 3 bouquets. The answer is 3.
-
-
-
Example 2:
-
-
-Input: bloomDay = [1,10,3,10,2], m = 3, k = 2
-Output: -1
-Explanation: We need 3 bouquets each has 2 flowers, that means we need 6 flowers. We only have 5 flowers so it is impossible to get the needed bouquets and we return -1.
-
-
-
Example 3:
-
-
-Input: bloomDay = [7,7,7,7,12,7,7], m = 2, k = 3
-Output: 12
-Explanation: We need 2 bouquets each should have 3 flowers.
-Here is the garden after the 7 and 12 days:
-After day 7: [x, x, x, x, _, x, x]
-We can make one bouquet of the first three flowers that bloomed. We cannot make another bouquet from the last three flowers that bloomed because they are not adjacent.
-After day 12: [x, x, x, x, x, x, x]
-It is obvious that we can make two bouquets in different ways.
-
-
-
-
Constraints:
-
-
-
bloomDay.length == n
-
1 <= n <= 105
-
1 <= bloomDay[i] <= 109
-
1 <= m <= 106
-
1 <= k <= n
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
-
-### Similar Questions
- 1. [Maximize the Confusion of an Exam](../maximize-the-confusion-of-an-exam) (Medium)
- 1. [Earliest Possible Day of Full Bloom](../earliest-possible-day-of-full-bloom) (Hard)
-
-### Hints
-
-Hint 1
-If we can make m or more bouquets at day x, then we can still make m or more bouquets at any day y > x.
-
-
-
-Hint 2
-We can check easily if we can make enough bouquets at day x if we can get group adjacent flowers at day x.
-
diff --git a/problems/minimum-number-of-flips-to-convert-binary-matrix-to-zero-matrix/README.md b/problems/minimum-number-of-flips-to-convert-binary-matrix-to-zero-matrix/README.md
deleted file mode 100644
index 1dc73d265..000000000
--- a/problems/minimum-number-of-flips-to-convert-binary-matrix-to-zero-matrix/README.md
+++ /dev/null
@@ -1,71 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../find-the-smallest-divisor-given-a-threshold "Find the Smallest Divisor Given a Threshold")
-
-[Next >](../find-the-start-and-end-number-of-continuous-ranges "Find the Start and End Number of Continuous Ranges")
-
-## [1284. Minimum Number of Flips to Convert Binary Matrix to Zero Matrix (Hard)](https://leetcode.com/problems/minimum-number-of-flips-to-convert-binary-matrix-to-zero-matrix "转化为全零矩阵的最少反转次数")
-
-
Given a m x n binary matrix mat. In one step, you can choose one cell and flip it and all the four neighbors of it if they exist (Flip is changing 1 to 0 and 0 to 1). A pair of cells are called neighbors if they share one edge.
-
-
Return the minimum number of steps required to convert mat to a zero matrix or -1 if you cannot.
-
-
A binary matrix is a matrix with all cells equal to 0 or 1 only.
-
-
A zero matrix is a matrix with all cells equal to 0.
-
-
-
Example 1:
-
-
-Input: mat = [[0,0],[0,1]]
-Output: 3
-Explanation: One possible solution is to flip (1, 0) then (0, 1) and finally (1, 1) as shown.
-
-
-
Example 2:
-
-
-Input: mat = [[0]]
-Output: 0
-Explanation: Given matrix is a zero matrix. We do not need to change it.
-
-
-
Example 3:
-
-
-Input: mat = [[1,0,0],[1,0,0]]
-Output: -1
-Explanation: Given matrix cannot be a zero matrix.
-
-
-
-
Constraints:
-
-
-
m == mat.length
-
n == mat[i].length
-
1 <= m, n <= 3
-
mat[i][j] is either 0 or 1.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Bit Manipulation](../../tag/bit-manipulation/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
-
-### Similar Questions
- 1. [Minimum Operations to Remove Adjacent Ones in Matrix](../minimum-operations-to-remove-adjacent-ones-in-matrix) (Hard)
- 1. [Remove All Ones With Row and Column Flips](../remove-all-ones-with-row-and-column-flips) (Medium)
-
-### Hints
-
-Hint 1
-Flipping same index two times is like not flipping it at all. Each index can be flipped one time. Try all possible combinations. O(2^(n*m)).
-
diff --git a/problems/minimum-number-of-flips-to-make-the-binary-string-alternating/README.md b/problems/minimum-number-of-flips-to-make-the-binary-string-alternating/README.md
deleted file mode 100644
index b039c7179..000000000
--- a/problems/minimum-number-of-flips-to-make-the-binary-string-alternating/README.md
+++ /dev/null
@@ -1,76 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../reduction-operations-to-make-the-array-elements-equal "Reduction Operations to Make the Array Elements Equal")
-
-[Next >](../minimum-space-wasted-from-packaging "Minimum Space Wasted From Packaging")
-
-## [1888. Minimum Number of Flips to Make the Binary String Alternating (Medium)](https://leetcode.com/problems/minimum-number-of-flips-to-make-the-binary-string-alternating "使二进制字符串字符交替的最少反转次数")
-
-
You are given a binary string s. You are allowed to perform two types of operations on the string in any sequence:
-
-
-
Type-1: Remove the character at the start of the string s and append it to the end of the string.
-
Type-2: Pick any character in s and flip its value, i.e., if its value is '0' it becomes '1' and vice-versa.
-
-
-
Return the minimum number of type-2 operations you need to performsuch that sbecomes alternating.
-
-
The string is called alternating if no two adjacent characters are equal.
-
-
-
For example, the strings "010" and "1010" are alternating, while the string "0100" is not.
-
-
-
-
Example 1:
-
-
-Input: s = "111000"
-Output: 2
-Explanation: Use the first operation two times to make s = "100011".
-Then, use the second operation on the third and sixth elements to make s = "101010".
-
-
-
Example 2:
-
-
-Input: s = "010"
-Output: 0
-Explanation: The string is already alternating.
-
-
-
Example 3:
-
-
-Input: s = "1110"
-Output: 1
-Explanation: Use the second operation on the second element to make s = "1010".
-
-
-
-
Constraints:
-
-
-
1 <= s.length <= 105
-
s[i] is either '0' or '1'.
-
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Hints
-
-Hint 1
-Note what actually matters is how many 0s and 1s are in odd and even positions
-
-
-
-Hint 2
-For every cyclic shift we need to count how many 0s and 1s are at each parity and convert the minimum between them for each parity
-
diff --git a/problems/minimum-number-of-frogs-croaking/README.md b/problems/minimum-number-of-frogs-croaking/README.md
deleted file mode 100644
index 55866e125..000000000
--- a/problems/minimum-number-of-frogs-croaking/README.md
+++ /dev/null
@@ -1,68 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../display-table-of-food-orders-in-a-restaurant "Display Table of Food Orders in a Restaurant")
-
-[Next >](../build-array-where-you-can-find-the-maximum-exactly-k-comparisons "Build Array Where You Can Find The Maximum Exactly K Comparisons")
-
-## [1419. Minimum Number of Frogs Croaking (Medium)](https://leetcode.com/problems/minimum-number-of-frogs-croaking "数青蛙")
-
-
You are given the string croakOfFrogs, which represents a combination of the string "croak" from different frogs, that is, multiple frogs can croak at the same time, so multiple "croak" are mixed.
-
-
Return the minimum number of different frogs to finish all the croaks in the given string.
-
-
A valid "croak" means a frog is printing five letters 'c', 'r', 'o', 'a', and 'k'sequentially. The frogs have to print all five letters to finish a croak. If the given string is not a combination of a valid "croak" return -1.
-Input: croakOfFrogs = "crcoakroak"
-Output: 2
-Explanation: The minimum number of frogs is two.
-The first frog could yell "crcoakroak".
-The second frog could yell later "crcoakroak".
-
-
-
Example 3:
-
-
-Input: croakOfFrogs = "croakcrook"
-Output: -1
-Explanation: The given string is an invalid combination of "croak" from different frogs.
-
-
-
-
Constraints:
-
-
-
1 <= croakOfFrogs.length <= 105
-
croakOfFrogs is either 'c', 'r', 'o', 'a', or 'k'.
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
- [[Counting](../../tag/counting/README.md)]
-
-### Hints
-
-Hint 1
-keep the frequency of all characters from "croak" using a hashmap.
-
-
-
-Hint 2
-For each character in the given string, greedily match it to a possible "croak".
-
diff --git a/problems/minimum-number-of-increments-on-subarrays-to-form-a-target-array/README.md b/problems/minimum-number-of-increments-on-subarrays-to-form-a-target-array/README.md
deleted file mode 100644
index 48368b32a..000000000
--- a/problems/minimum-number-of-increments-on-subarrays-to-form-a-target-array/README.md
+++ /dev/null
@@ -1,70 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../number-of-good-ways-to-split-a-string "Number of Good Ways to Split a String")
-
-[Next >](../patients-with-a-condition "Patients With a Condition")
-
-## [1526. Minimum Number of Increments on Subarrays to Form a Target Array (Hard)](https://leetcode.com/problems/minimum-number-of-increments-on-subarrays-to-form-a-target-array "形成目标数组的子数组最少增加次数")
-
-
You are given an integer array target. You have an integer array initial of the same size as target with all elements initially zeros.
-
-
In one operation you can choose any subarray from initial and increment each value by one.
-
-
Return the minimum number of operations to form a target array from initial.
-
-
The test cases are generated so that the answer fits in a 32-bit integer.
-
-
-
Example 1:
-
-
-Input: target = [1,2,3,2,1]
-Output: 3
-Explanation: We need at least 3 operations to form the target array from the initial array.
-[0,0,0,0,0] increment 1 from index 0 to 4 (inclusive).
-[1,1,1,1,1] increment 1 from index 1 to 3 (inclusive).
-[1,2,2,2,1] increment 1 at index 2.
-[1,2,3,2,1] target array is formed.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Stack](../../tag/stack/README.md)]
- [[Greedy](../../tag/greedy/README.md)]
- [[Monotonic Stack](../../tag/monotonic-stack/README.md)]
-
-### Hints
-
-Hint 1
-For a given range of values in target, an optimal strategy is to increment the entire range by the minimum value. The minimum in a range could be obtained with Range minimum query or Segment trees algorithm.
-
diff --git a/problems/minimum-number-of-k-consecutive-bit-flips/README.md b/problems/minimum-number-of-k-consecutive-bit-flips/README.md
deleted file mode 100644
index 79f2de9f5..000000000
--- a/problems/minimum-number-of-k-consecutive-bit-flips/README.md
+++ /dev/null
@@ -1,65 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../rotting-oranges "Rotting Oranges")
-
-[Next >](../number-of-squareful-arrays "Number of Squareful Arrays")
-
-## [995. Minimum Number of K Consecutive Bit Flips (Hard)](https://leetcode.com/problems/minimum-number-of-k-consecutive-bit-flips "K 连续位的最小翻转次数")
-
-
You are given a binary array nums and an integer k.
-
-
A k-bit flip is choosing a subarray of length k from nums and simultaneously changing every 0 in the subarray to 1, and every 1 in the subarray to 0.
-
-
Return the minimum number of k-bit flips required so that there is no 0 in the array. If it is not possible, return -1.
-
-
A subarray is a contiguous part of an array.
-
-
-
Example 1:
-
-
-Input: nums = [0,1,0], k = 1
-Output: 2
-Explanation: Flip nums[0], then flip nums[2].
-
-
-
Example 2:
-
-
-Input: nums = [1,1,0], k = 2
-Output: -1
-Explanation: No matter how we flip subarrays of size 2, we cannot make the array become [1,1,1].
-
-
-### Related Topics
- [[Bit Manipulation](../../tag/bit-manipulation/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Prefix Sum](../../tag/prefix-sum/README.md)]
- [[Sliding Window](../../tag/sliding-window/README.md)]
-
-### Similar Questions
- 1. [Bulb Switcher](../bulb-switcher) (Medium)
diff --git a/problems/minimum-number-of-k-consecutive-bit-flips/minimum_number_of_k_consecutive_bit_flips.go b/problems/minimum-number-of-k-consecutive-bit-flips/minimum_number_of_k_consecutive_bit_flips.go
deleted file mode 100644
index a0b7b0095..000000000
--- a/problems/minimum-number-of-k-consecutive-bit-flips/minimum_number_of_k_consecutive_bit_flips.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem995
diff --git a/problems/minimum-number-of-lines-to-cover-points/README.md b/problems/minimum-number-of-lines-to-cover-points/README.md
deleted file mode 100644
index 582bba6e1..000000000
--- a/problems/minimum-number-of-lines-to-cover-points/README.md
+++ /dev/null
@@ -1,45 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-good-people-based-on-statements "Maximum Good People Based on Statements")
-
-[Next >](../the-number-of-passengers-in-each-bus-ii "The Number of Passengers in Each Bus II")
-
-## [2152. Minimum Number of Lines to Cover Points (Medium)](https://leetcode.com/problems/minimum-number-of-lines-to-cover-points "")
-
-
-
-### Related Topics
- [[Bit Manipulation](../../tag/bit-manipulation/README.md)]
- [[Geometry](../../tag/geometry/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Math](../../tag/math/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Backtracking](../../tag/backtracking/README.md)]
- [[Bitmask](../../tag/bitmask/README.md)]
-
-### Hints
-
-Hint 1
-What is the highest possible answer for a set of n points?
-
-
-
-Hint 2
-The highest possible answer is n / 2 (rounded up). This is because you can cover at least two points with a line, and if n is odd, you need to add one extra line to cover the last point.
-
-
-
-Hint 3
-Suppose you have a line covering two points, how can you quickly check if a third point is also covered by that line?
-
-
-
-Hint 4
-Calculate the slope from the first point to the second point. If the slope from the first point to the third point is the same, then it is also covered by that line.
-
diff --git a/problems/minimum-number-of-moves-to-seat-everyone/README.md b/problems/minimum-number-of-moves-to-seat-everyone/README.md
deleted file mode 100644
index 16ab9e64b..000000000
--- a/problems/minimum-number-of-moves-to-seat-everyone/README.md
+++ /dev/null
@@ -1,93 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-alternating-subarray-sum "Maximum Alternating Subarray Sum")
-
-[Next >](../remove-colored-pieces-if-both-neighbors-are-the-same-color "Remove Colored Pieces if Both Neighbors are the Same Color")
-
-## [2037. Minimum Number of Moves to Seat Everyone (Easy)](https://leetcode.com/problems/minimum-number-of-moves-to-seat-everyone "使每位学生都有座位的最少移动次数")
-
-
There are n seats and n students in a room. You are given an array seats of length n, where seats[i] is the position of the ith seat. You are also given the array students of length n, where students[j] is the position of the jth student.
-
-
You may perform the following move any number of times:
-
-
-
Increase or decrease the position of the ith student by 1 (i.e., moving the ith student from position x to x + 1 or x - 1)
-
-
-
Return the minimum number of moves required to move each student to a seat such that no two students are in the same seat.
-
-
Note that there may be multiple seats or students in the same position at the beginning.
-
-
-
Example 1:
-
-
-Input: seats = [3,1,5], students = [2,7,4]
-Output: 4
-Explanation: The students are moved as follows:
-- The first student is moved from from position 2 to position 1 using 1 move.
-- The second student is moved from from position 7 to position 5 using 2 moves.
-- The third student is moved from from position 4 to position 3 using 1 move.
-In total, 1 + 2 + 1 = 4 moves were used.
-
-
-
Example 2:
-
-
-Input: seats = [4,1,5,9], students = [1,3,2,6]
-Output: 7
-Explanation: The students are moved as follows:
-- The first student is not moved.
-- The second student is moved from from position 3 to position 4 using 1 move.
-- The third student is moved from from position 2 to position 5 using 3 moves.
-- The fourth student is moved from from position 6 to position 9 using 3 moves.
-In total, 0 + 1 + 3 + 3 = 7 moves were used.
-
-
-
Example 3:
-
-
-Input: seats = [2,2,6,6], students = [1,3,2,6]
-Output: 4
-Explanation: Note that there are two seats at position 2 and two seats at position 6.
-The students are moved as follows:
-- The first student is moved from from position 1 to position 2 using 1 move.
-- The second student is moved from from position 3 to position 6 using 3 moves.
-- The third student is not moved.
-- The fourth student is not moved.
-In total, 1 + 3 + 0 + 0 = 4 moves were used.
-
-
-
-
Constraints:
-
-
-
n == seats.length == students.length
-
1 <= n <= 100
-
1 <= seats[i], students[j] <= 100
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Hints
-
-Hint 1
-Can we sort the arrays to help solve the problem?
-
-
-
-Hint 2
-Can we greedily match each student to a seat?
-
-
-
-Hint 3
-The smallest positioned student will go to the smallest positioned chair, and then the next smallest positioned student will go to the next smallest positioned chair, and so on.
-
diff --git a/problems/minimum-number-of-operations-to-make-array-continuous/README.md b/problems/minimum-number-of-operations-to-make-array-continuous/README.md
deleted file mode 100644
index 93bc9000d..000000000
--- a/problems/minimum-number-of-operations-to-make-array-continuous/README.md
+++ /dev/null
@@ -1,78 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-earnings-from-taxi "Maximum Earnings From Taxi")
-
-[Next >](../the-number-of-seniors-and-juniors-to-join-the-company-ii "The Number of Seniors and Juniors to Join the Company II")
-
-## [2009. Minimum Number of Operations to Make Array Continuous (Hard)](https://leetcode.com/problems/minimum-number-of-operations-to-make-array-continuous "使数组连续的最少操作数")
-
-
You are given an integer array nums. In one operation, you can replace any element in nums with any integer.
-
-
nums is considered continuous if both of the following conditions are fulfilled:
-
-
-
All elements in nums are unique.
-
The difference between the maximum element and the minimum element in nums equals nums.length - 1.
-
-
-
For example, nums = [4, 2, 5, 3] is continuous, but nums = [1, 2, 3, 5, 6] is not continuous.
-
-
Return the minimum number of operations to make numscontinuous.
-Input: nums = [1,2,3,5,6]
-Output: 1
-Explanation: One possible solution is to change the last element to 4.
-The resulting array is [1,2,3,5,4], which is continuous.
-
-
-
Example 3:
-
-
-Input: nums = [1,10,100,1000]
-Output: 3
-Explanation: One possible solution is to:
-- Change the second element to 2.
-- Change the third element to 3.
-- Change the fourth element to 4.
-The resulting array is [1,2,3,4], which is continuous.
-
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 105
-
1 <= nums[i] <= 109
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
-
-### Hints
-
-Hint 1
-Sort the array.
-
-
-
-Hint 2
-For every index do a binary search to get the possible right end of the window and calculate the possible answer.
-
diff --git a/problems/minimum-number-of-operations-to-make-string-sorted/README.md b/problems/minimum-number-of-operations-to-make-string-sorted/README.md
deleted file mode 100644
index 60c4203fb..000000000
--- a/problems/minimum-number-of-operations-to-make-string-sorted/README.md
+++ /dev/null
@@ -1,71 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-xor-for-each-query "Maximum XOR for Each Query")
-
-[Next >](../maximum-transaction-each-day "Maximum Transaction Each Day")
-
-## [1830. Minimum Number of Operations to Make String Sorted (Hard)](https://leetcode.com/problems/minimum-number-of-operations-to-make-string-sorted "使字符串有序的最少操作次数")
-
-
You are given a string s (0-indexed). You are asked to perform the following operation on s until you get a sorted string:
-
-
-
Find the largest indexi such that 1 <= i < s.length and s[i] < s[i - 1].
-
Find the largest indexj such that i <= j < s.length and s[k] < s[i - 1] for all the possible values of k in the range [i, j] inclusive.
-
Swap the two characters at indices i - 1 and j.
-
Reverse the suffix starting at index i.
-
-
-
Return the number of operations needed to make the string sorted. Since the answer can be too large, return it modulo109 + 7.
-
-
-
Example 1:
-
-
-Input: s = "cba"
-Output: 5
-Explanation: The simulation goes as follows:
-Operation 1: i=2, j=2. Swap s[1] and s[2] to get s="cab", then reverse the suffix starting at 2. Now, s="cab".
-Operation 2: i=1, j=2. Swap s[0] and s[2] to get s="bac", then reverse the suffix starting at 1. Now, s="bca".
-Operation 3: i=2, j=2. Swap s[1] and s[2] to get s="bac", then reverse the suffix starting at 2. Now, s="bac".
-Operation 4: i=1, j=1. Swap s[0] and s[1] to get s="abc", then reverse the suffix starting at 1. Now, s="acb".
-Operation 5: i=2, j=2. Swap s[1] and s[2] to get s="abc", then reverse the suffix starting at 2. Now, s="abc".
-
-
-
Example 2:
-
-
-Input: s = "aabaa"
-Output: 2
-Explanation: The simulation goes as follows:
-Operation 1: i=3, j=4. Swap s[2] and s[4] to get s="aaaab", then reverse the substring starting at 3. Now, s="aaaba".
-Operation 2: i=4, j=4. Swap s[3] and s[4] to get s="aaaab", then reverse the substring starting at 4. Now, s="aaaab".
-
-
-
-
Constraints:
-
-
-
1 <= s.length <= 3000
-
s consists only of lowercase English letters.
-
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
- [[String](../../tag/string/README.md)]
- [[Combinatorics](../../tag/combinatorics/README.md)]
-
-### Hints
-
-Hint 1
-Note that the operations given describe getting the previous permutation of s
-
-
-
-Hint 2
-To solve this problem you need to solve every suffix separately
-
diff --git a/problems/minimum-number-of-operations-to-move-all-balls-to-each-box/README.md b/problems/minimum-number-of-operations-to-move-all-balls-to-each-box/README.md
deleted file mode 100644
index 42d3cc5e1..000000000
--- a/problems/minimum-number-of-operations-to-move-all-balls-to-each-box/README.md
+++ /dev/null
@@ -1,70 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../merge-strings-alternately "Merge Strings Alternately")
-
-[Next >](../maximum-score-from-performing-multiplication-operations "Maximum Score from Performing Multiplication Operations")
-
-## [1769. Minimum Number of Operations to Move All Balls to Each Box (Medium)](https://leetcode.com/problems/minimum-number-of-operations-to-move-all-balls-to-each-box "移动所有球到每个盒子所需的最小操作数")
-
-
You have n boxes. You are given a binary string boxes of length n, where boxes[i] is '0' if the ith box is empty, and '1' if it contains one ball.
-
-
In one operation, you can move one ball from a box to an adjacent box. Box i is adjacent to box j if abs(i - j) == 1. Note that after doing so, there may be more than one ball in some boxes.
-
-
Return an array answer of size n, where answer[i] is the minimum number of operations needed to move all the balls to the ith box.
-
-
Each answer[i] is calculated considering the initial state of the boxes.
-
-
-
Example 1:
-
-
-Input: boxes = "110"
-Output: [1,1,3]
-Explanation: The answer for each box is as follows:
-1) First box: you will have to move one ball from the second box to the first box in one operation.
-2) Second box: you will have to move one ball from the first box to the second box in one operation.
-3) Third box: you will have to move one ball from the first box to the third box in two operations, and move one ball from the second box to the third box in one operation.
-
-
-
Example 2:
-
-
-Input: boxes = "001011"
-Output: [11,8,5,4,3,4]
-
-
-
Constraints:
-
-
-
n == boxes.length
-
1 <= n <= 2000
-
boxes[i] is either '0' or '1'.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Similar Questions
- 1. [Minimum Cost to Move Chips to The Same Position](../minimum-cost-to-move-chips-to-the-same-position) (Easy)
-
-### Hints
-
-Hint 1
-If you want to move a ball from box i to box j, you'll need abs(i-j) moves.
-
-
-
-Hint 2
-To move all balls to some box, you can move them one by one.
-
-
-
-Hint 3
-For each box i, iterate on each ball in a box j, and add abs(i-j) to answers[i].
-
diff --git a/problems/minimum-number-of-operations-to-reinitialize-a-permutation/README.md b/problems/minimum-number-of-operations-to-reinitialize-a-permutation/README.md
deleted file mode 100644
index ed5e1cc09..000000000
--- a/problems/minimum-number-of-operations-to-reinitialize-a-permutation/README.md
+++ /dev/null
@@ -1,78 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../number-of-different-integers-in-a-string "Number of Different Integers in a String")
-
-[Next >](../evaluate-the-bracket-pairs-of-a-string "Evaluate the Bracket Pairs of a String")
-
-## [1806. Minimum Number of Operations to Reinitialize a Permutation (Medium)](https://leetcode.com/problems/minimum-number-of-operations-to-reinitialize-a-permutation "还原排列的最少操作步数")
-
-
You are given an even integer n. You initially have a permutation perm of size n where perm[i] == i (0-indexed).
-
-
In one operation, you will create a new array arr, and for each i:
-
-
-
If i % 2 == 0, then arr[i] = perm[i / 2].
-
If i % 2 == 1, then arr[i] = perm[n / 2 + (i - 1) / 2].
-
-
-
You will then assign arr to perm.
-
-
Return the minimum non-zero number of operations you need to perform on perm to return the permutation to its initial value.
-
-
-
Example 1:
-
-
-Input: n = 2
-Output: 1
-Explanation: perm = [0,1] initially.
-After the 1st operation, perm = [0,1]
-So it takes only 1 operation.
-
-
-
Example 2:
-
-
-Input: n = 4
-Output: 2
-Explanation: perm = [0,1,2,3] initially.
-After the 1st operation, perm = [0,2,1,3]
-After the 2nd operation, perm = [0,1,2,3]
-So it takes only 2 operations.
-
-
-
Example 3:
-
-
-Input: n = 6
-Output: 4
-
-
-
-
Constraints:
-
-
-
2 <= n <= 1000
-
n is even.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Math](../../tag/math/README.md)]
- [[Simulation](../../tag/simulation/README.md)]
-
-### Hints
-
-Hint 1
-It is safe to assume the number of operations isn't more than n
-
-
-
-Hint 2
-The number is small enough to apply a brute force solution.
-
diff --git a/problems/minimum-number-of-people-to-teach/README.md b/problems/minimum-number-of-people-to-teach/README.md
deleted file mode 100644
index 7dd7bea79..000000000
--- a/problems/minimum-number-of-people-to-teach/README.md
+++ /dev/null
@@ -1,71 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../find-the-highest-altitude "Find the Highest Altitude")
-
-[Next >](../decode-xored-permutation "Decode XORed Permutation")
-
-## [1733. Minimum Number of People to Teach (Medium)](https://leetcode.com/problems/minimum-number-of-people-to-teach "需要教语言的最少人数")
-
-
On a social network consisting of m users and some friendships between users, two users can communicate with each other if they know a common language.
-
-
You are given an integer n, an array languages, and an array friendships where:
-
-
-
There are n languages numbered 1 through n,
-
languages[i] is the set of languages the ith user knows, and
-
friendships[i] = [ui, vi] denotes a friendship between the users ui and vi.
-
-
-
You can choose one language and teach it to some users so that all friends can communicate with each other. Return theminimumnumber of users you need to teach.
-Note that friendships are not transitive, meaning if x is a friend of y and y is a friend of z, this doesn't guarantee that x is a friend of z.
-
-
Example 1:
-
-
-Input: n = 2, languages = [[1],[2],[1,2]], friendships = [[1,2],[1,3],[2,3]]
-Output: 1
-Explanation: You can either teach user 1 the second language or user 2 the first language.
-
-
-
Example 2:
-
-
-Input: n = 3, languages = [[2],[1,3],[1,2],[3]], friendships = [[1,4],[1,2],[3,4],[2,3]]
-Output: 2
-Explanation: Teach the third language to users 1 and 3, yielding two users to teach.
-
-
-
-
Constraints:
-
-
-
2 <= n <= 500
-
languages.length == m
-
1 <= m <= 500
-
1 <= languages[i].length <= n
-
1 <= languages[i][j] <= n
-
1 <= ui < vi <= languages.length
-
1 <= friendships.length <= 500
-
All tuples (ui, vi) are unique
-
languages[i] contains only unique values
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Greedy](../../tag/greedy/README.md)]
-
-### Hints
-
-Hint 1
-You can just use brute force and find out for each language the number of users you need to teach
-
-
-
-Hint 2
-Note that a user can appear in multiple friendships but you need to teach that user only once
-
diff --git a/problems/minimum-number-of-refueling-stops/README.md b/problems/minimum-number-of-refueling-stops/README.md
deleted file mode 100644
index 1cc8c8b1f..000000000
--- a/problems/minimum-number-of-refueling-stops/README.md
+++ /dev/null
@@ -1,67 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../advantage-shuffle "Advantage Shuffle")
-
-[Next >](../leaf-similar-trees "Leaf-Similar Trees")
-
-## [871. Minimum Number of Refueling Stops (Hard)](https://leetcode.com/problems/minimum-number-of-refueling-stops "最低加油次数")
-
-
A car travels from a starting position to a destination which is target miles east of the starting position.
-
-
There are gas stations along the way. The gas stations are represented as an array stations where stations[i] = [positioni, fueli] indicates that the ith gas station is positioni miles east of the starting position and has fueli liters of gas.
-
-
The car starts with an infinite tank of gas, which initially has startFuel liters of fuel in it. It uses one liter of gas per one mile that it drives. When the car reaches a gas station, it may stop and refuel, transferring all the gas from the station into the car.
-
-
Return the minimum number of refueling stops the car must make in order to reach its destination. If it cannot reach the destination, return -1.
-
-
Note that if the car reaches a gas station with 0 fuel left, the car can still refuel there. If the car reaches the destination with 0 fuel left, it is still considered to have arrived.
-
-
-
Example 1:
-
-
-Input: target = 1, startFuel = 1, stations = []
-Output: 0
-Explanation: We can reach the target without refueling.
-
-
-
Example 2:
-
-
-Input: target = 100, startFuel = 1, stations = [[10,100]]
-Output: -1
-Explanation: We can not reach the target (or even the first gas station).
-
-
-
Example 3:
-
-
-Input: target = 100, startFuel = 10, stations = [[10,60],[20,30],[30,30],[60,40]]
-Output: 2
-Explanation: We start with 10 liters of fuel.
-We drive to position 10, expending 10 liters of fuel. We refuel from 0 liters to 60 liters of gas.
-Then, we drive from position 10 to position 60 (expending 50 liters of fuel),
-and refuel from 10 liters to 50 liters of gas. We then drive to and reach the target.
-We made 2 refueling stops along the way, so we return 2.
-
You may recall that an array arr is a mountain array if and only if:
-
-
-
arr.length >= 3
-
There exists some index i (0-indexed) with 0 < i < arr.length - 1 such that:
-
-
arr[0] < arr[1] < ... < arr[i - 1] < arr[i]
-
arr[i] > arr[i + 1] > ... > arr[arr.length - 1]
-
-
-
-
-
Given an integer array nums, return the minimum number of elements to remove to make numsa mountain array.
-
-
-
Example 1:
-
-
-Input: nums = [1,3,1]
-Output: 0
-Explanation: The array itself is a mountain array so we do not need to remove any elements.
-
-
-
Example 2:
-
-
-Input: nums = [2,1,1,5,6,2,3,1]
-Output: 3
-Explanation: One solution is to remove the elements at indices 0, 1, and 5, making the array nums = [1,5,6,3,1].
-
-
-
-
Constraints:
-
-
-
3 <= nums.length <= 1000
-
1 <= nums[i] <= 109
-
It is guaranteed that you can make a mountain array out of nums.
-
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Hints
-
-Hint 1
-Think the opposite direction instead of minimum elements to remove the maximum mountain subsequence
-
-
-
-Hint 2
-Think of LIS it's kind of close
-
diff --git a/problems/minimum-number-of-steps-to-make-two-strings-anagram/README.md b/problems/minimum-number-of-steps-to-make-two-strings-anagram/README.md
deleted file mode 100644
index 22618114e..000000000
--- a/problems/minimum-number-of-steps-to-make-two-strings-anagram/README.md
+++ /dev/null
@@ -1,70 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../check-if-n-and-its-double-exist "Check If N and Its Double Exist")
-
-[Next >](../tweet-counts-per-frequency "Tweet Counts Per Frequency")
-
-## [1347. Minimum Number of Steps to Make Two Strings Anagram (Medium)](https://leetcode.com/problems/minimum-number-of-steps-to-make-two-strings-anagram "制造字母异位词的最小步骤数")
-
-
You are given two strings of the same length s and t. In one step you can choose any character of t and replace it with another character.
-
-
Return the minimum number of steps to make t an anagram of s.
-
-
An Anagram of a string is a string that contains the same characters with a different (or the same) ordering.
-
-
-
Example 1:
-
-
-Input: s = "bab", t = "aba"
-Output: 1
-Explanation: Replace the first 'a' in t with b, t = "bba" which is anagram of s.
-
-
-
Example 2:
-
-
-Input: s = "leetcode", t = "practice"
-Output: 5
-Explanation: Replace 'p', 'r', 'a', 'i' and 'c' from t with proper characters to make t anagram of s.
-
-
-
Example 3:
-
-
-Input: s = "anagram", t = "mangaar"
-Output: 0
-Explanation: "anagram" and "mangaar" are anagrams.
-
-
-
-
Constraints:
-
-
-
1 <= s.length <= 5 * 104
-
s.length == t.length
-
s and t consist of lowercase English letters only.
-
-
-### Related Topics
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Similar Questions
- 1. [Determine if Two Strings Are Close](../determine-if-two-strings-are-close) (Medium)
-
-### Hints
-
-Hint 1
-Count the frequency of characters of each string.
-
-
-
-Hint 2
-Loop over all characters if the frequency of a character in t is less than the frequency of the same character in s then add the difference between the frequencies to the answer.
-
diff --git a/problems/minimum-number-of-swaps-to-make-the-binary-string-alternating/README.md b/problems/minimum-number-of-swaps-to-make-the-binary-string-alternating/README.md
deleted file mode 100644
index 51d236eaa..000000000
--- a/problems/minimum-number-of-swaps-to-make-the-binary-string-alternating/README.md
+++ /dev/null
@@ -1,66 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../sum-of-all-subset-xor-totals "Sum of All Subset XOR Totals")
-
-[Next >](../finding-pairs-with-a-certain-sum "Finding Pairs With a Certain Sum")
-
-## [1864. Minimum Number of Swaps to Make the Binary String Alternating (Medium)](https://leetcode.com/problems/minimum-number-of-swaps-to-make-the-binary-string-alternating "构成交替字符串需要的最小交换次数")
-
-
Given a binary string s, return the minimum number of character swaps to make it alternating, or -1 if it is impossible.
-
-
The string is called alternating if no two adjacent characters are equal. For example, the strings "010" and "1010" are alternating, while the string "0100" is not.
-
-
Any two characters may be swapped, even if they are not adjacent.
-
-
-
Example 1:
-
-
-Input: s = "111000"
-Output: 1
-Explanation: Swap positions 1 and 4: "111000" -> "101010"
-The string is now alternating.
-
-
-
Example 2:
-
-
-Input: s = "010"
-Output: 0
-Explanation: The string is already alternating, no swaps are needed.
-
-
-
Example 3:
-
-
-Input: s = "1110"
-Output: -1
-
-
-
-
Constraints:
-
-
-
1 <= s.length <= 1000
-
s[i] is either '0' or '1'.
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
- [[Greedy](../../tag/greedy/README.md)]
-
-### Hints
-
-Hint 1
-Think about all valid strings of length n.
-
-
-
-Hint 2
-Try to count the mismatched positions with each valid string of length n.
-
diff --git a/problems/minimum-number-of-swaps-to-make-the-string-balanced/README.md b/problems/minimum-number-of-swaps-to-make-the-string-balanced/README.md
deleted file mode 100644
index 04944ffd0..000000000
--- a/problems/minimum-number-of-swaps-to-make-the-string-balanced/README.md
+++ /dev/null
@@ -1,88 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../remove-stones-to-minimize-the-total "Remove Stones to Minimize the Total")
-
-[Next >](../find-the-longest-valid-obstacle-course-at-each-position "Find the Longest Valid Obstacle Course at Each Position")
-
-## [1963. Minimum Number of Swaps to Make the String Balanced (Medium)](https://leetcode.com/problems/minimum-number-of-swaps-to-make-the-string-balanced "使字符串平衡的最小交换次数")
-
-
You are given a 0-indexed string s of even length n. The string consists of exactlyn / 2 opening brackets '[' and n / 2 closing brackets ']'.
-
-
A string is called balanced if and only if:
-
-
-
It is the empty string, or
-
It can be written as AB, where both A and B are balanced strings, or
-
It can be written as [C], where C is a balanced string.
-
-
-
You may swap the brackets at any two indices any number of times.
-
-
Return the minimum number of swaps to make sbalanced.
-
-
-
Example 1:
-
-
-Input: s = "][]["
-Output: 1
-Explanation: You can make the string balanced by swapping index 0 with index 3.
-The resulting string is "[[]]".
-
-
-
Example 2:
-
-
-Input: s = "]]][[["
-Output: 2
-Explanation: You can do the following to make the string balanced:
-- Swap index 0 with index 4. s = "[]][][".
-- Swap index 1 with index 5. s = "[[][]]".
-The resulting string is "[[][]]".
-
-
-
Example 3:
-
-
-Input: s = "[]"
-Output: 0
-Explanation: The string is already balanced.
-
-
-
-
Constraints:
-
-
-
n == s.length
-
2 <= n <= 106
-
n is even.
-
s[i] is either '[' or ']'.
-
The number of opening brackets '[' equals n / 2, and the number of closing brackets ']' equals n / 2.
-
-
-### Related Topics
- [[Stack](../../tag/stack/README.md)]
- [[Greedy](../../tag/greedy/README.md)]
- [[Two Pointers](../../tag/two-pointers/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Hints
-
-Hint 1
-Iterate over the string and keep track of the number of opening and closing brackets on each step.
-
-
-
-Hint 2
-If the number of closing brackets is ever larger, you need to make a swap.
-
-
-
-Hint 3
-Swap it with the opening bracket closest to the end of s.
-
diff --git a/problems/minimum-number-of-taps-to-open-to-water-a-garden/README.md b/problems/minimum-number-of-taps-to-open-to-water-a-garden/README.md
deleted file mode 100644
index c44128242..000000000
--- a/problems/minimum-number-of-taps-to-open-to-water-a-garden/README.md
+++ /dev/null
@@ -1,73 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../delete-leaves-with-a-given-value "Delete Leaves With a Given Value")
-
-[Next >](../list-the-products-ordered-in-a-period "List the Products Ordered in a Period")
-
-## [1326. Minimum Number of Taps to Open to Water a Garden (Hard)](https://leetcode.com/problems/minimum-number-of-taps-to-open-to-water-a-garden "灌溉花园的最少水龙头数目")
-
-
There is a one-dimensional garden on the x-axis. The garden starts at the point 0 and ends at the point n. (i.e The length of the garden is n).
-
-
There are n + 1 taps located at points [0, 1, ..., n] in the garden.
-
-
Given an integer n and an integer array ranges of length n + 1 where ranges[i] (0-indexed) means the i-th tap can water the area [i - ranges[i], i + ranges[i]] if it was open.
-
-
Return the minimum number of taps that should be open to water the whole garden, If the garden cannot be watered return -1.
-
-
-
Example 1:
-
-
-Input: n = 5, ranges = [3,4,1,1,0,0]
-Output: 1
-Explanation: The tap at point 0 can cover the interval [-3,3]
-The tap at point 1 can cover the interval [-3,5]
-The tap at point 2 can cover the interval [1,3]
-The tap at point 3 can cover the interval [2,4]
-The tap at point 4 can cover the interval [4,4]
-The tap at point 5 can cover the interval [5,5]
-Opening Only the second tap will water the whole garden [0,5]
-
-
-
Example 2:
-
-
-Input: n = 3, ranges = [0,0,0,0]
-Output: -1
-Explanation: Even if you activate all the four taps you cannot water the whole garden.
-
-
-
-
Constraints:
-
-
-
1 <= n <= 104
-
ranges.length == n + 1
-
0 <= ranges[i] <= 100
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Greedy](../../tag/greedy/README.md)]
-
-### Hints
-
-Hint 1
-Create intervals of the area covered by each tap, sort intervals by the left end.
-
-
-
-Hint 2
-We need to cover the interval [0, n]. we can start with the first interval and out of all intervals that intersect with it we choose the one that covers the farthest point to the right.
-
-
-
-Hint 3
-What if there is a gap between intervals that is not covered ? we should stop and return -1 as there is some interval that cannot be covered.
-
diff --git a/problems/minimum-number-of-vertices-to-reach-all-nodes/README.md b/problems/minimum-number-of-vertices-to-reach-all-nodes/README.md
deleted file mode 100644
index 0732e0be0..000000000
--- a/problems/minimum-number-of-vertices-to-reach-all-nodes/README.md
+++ /dev/null
@@ -1,68 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../thousand-separator "Thousand Separator")
-
-[Next >](../minimum-numbers-of-function-calls-to-make-target-array "Minimum Numbers of Function Calls to Make Target Array")
-
-## [1557. Minimum Number of Vertices to Reach All Nodes (Medium)](https://leetcode.com/problems/minimum-number-of-vertices-to-reach-all-nodes "可以到达所有点的最少点数目")
-
-
Given a directed acyclic graph, with n vertices numbered from 0 to n-1, and an array edges where edges[i] = [fromi, toi] represents a directed edge from node fromi to node toi.
-
-
Find the smallest set of vertices from which all nodes in the graph are reachable. It's guaranteed that a unique solution exists.
-
-
Notice that you can return the vertices in any order.
-
-
-
Example 1:
-
-
-
-
-Input: n = 6, edges = [[0,1],[0,2],[2,5],[3,4],[4,2]]
-Output: [0,3]
-Explanation: It's not possible to reach all the nodes from a single vertex. From 0 we can reach [0,1,2,5]. From 3 we can reach [3,4,2,5]. So we output [0,3].
-
-
Example 2:
-
-
-
-
-Input: n = 5, edges = [[0,1],[2,1],[3,1],[1,4],[2,4]]
-Output: [0,2,3]
-Explanation: Notice that vertices 0, 3 and 2 are not reachable from any other node, so we must include them. Also any of these vertices can reach nodes 1 and 4.
-
-
-
-
Constraints:
-
-
-
2 <= n <= 10^5
-
1 <= edges.length <= min(10^5, n * (n - 1) / 2)
-
edges[i].length == 2
-
0 <= fromi, toi < n
-
All pairs (fromi, toi) are distinct.
-
-
-### Related Topics
- [[Graph](../../tag/graph/README.md)]
-
-### Hints
-
-Hint 1
-A node that does not have any incoming edge can only be reached by itself.
-
-
-
-Hint 2
-Any other node with incoming edges can be reached from some other node.
-
-
-
-Hint 3
-We only have to count the number of nodes with zero incoming edges.
-
diff --git a/problems/minimum-number-of-work-sessions-to-finish-the-tasks/README.md b/problems/minimum-number-of-work-sessions-to-finish-the-tasks/README.md
deleted file mode 100644
index 7062502be..000000000
--- a/problems/minimum-number-of-work-sessions-to-finish-the-tasks/README.md
+++ /dev/null
@@ -1,83 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../find-the-kth-largest-integer-in-the-array "Find the Kth Largest Integer in the Array")
-
-[Next >](../number-of-unique-good-subsequences "Number of Unique Good Subsequences")
-
-## [1986. Minimum Number of Work Sessions to Finish the Tasks (Medium)](https://leetcode.com/problems/minimum-number-of-work-sessions-to-finish-the-tasks "完成任务的最少工作时间段")
-
-
There are n tasks assigned to you. The task times are represented as an integer array tasks of length n, where the ith task takes tasks[i] hours to finish. A work session is when you work for at mostsessionTime consecutive hours and then take a break.
-
-
You should finish the given tasks in a way that satisfies the following conditions:
-
-
-
If you start a task in a work session, you must complete it in the same work session.
-
You can start a new task immediately after finishing the previous one.
-
You may complete the tasks in any order.
-
-
-
Given tasks and sessionTime, return the minimum number of work sessions needed to finish all the tasks following the conditions above.
-
-
The tests are generated such that sessionTime is greater than or equal to the maximum element in tasks[i].
-
-
-
Example 1:
-
-
-Input: tasks = [1,2,3], sessionTime = 3
-Output: 2
-Explanation: You can finish the tasks in two work sessions.
-- First work session: finish the first and the second tasks in 1 + 2 = 3 hours.
-- Second work session: finish the third task in 3 hours.
-
-
-
Example 2:
-
-
-Input: tasks = [3,1,3,1,1], sessionTime = 8
-Output: 2
-Explanation: You can finish the tasks in two work sessions.
-- First work session: finish all the tasks except the last one in 3 + 1 + 3 + 1 = 8 hours.
-- Second work session: finish the last task in 1 hour.
-
-
-
Example 3:
-
-
-Input: tasks = [1,2,3,4,5], sessionTime = 15
-Output: 1
-Explanation: You can finish all the tasks in one work session.
-
-
-
-
Constraints:
-
-
-
n == tasks.length
-
1 <= n <= 14
-
1 <= tasks[i] <= 10
-
max(tasks[i]) <= sessionTime <= 15
-
-
-### Related Topics
- [[Bit Manipulation](../../tag/bit-manipulation/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Backtracking](../../tag/backtracking/README.md)]
- [[Bitmask](../../tag/bitmask/README.md)]
-
-### Hints
-
-Hint 1
-Try all possible ways of assignment.
-
-
-
-Hint 2
-If we can store the assignments in form of a state then we can reuse that state and solve the problem in a faster way.
-
diff --git a/problems/minimum-numbers-of-function-calls-to-make-target-array/README.md b/problems/minimum-numbers-of-function-calls-to-make-target-array/README.md
deleted file mode 100644
index 78c2033c8..000000000
--- a/problems/minimum-numbers-of-function-calls-to-make-target-array/README.md
+++ /dev/null
@@ -1,73 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-number-of-vertices-to-reach-all-nodes "Minimum Number of Vertices to Reach All Nodes")
-
-[Next >](../detect-cycles-in-2d-grid "Detect Cycles in 2D Grid")
-
-## [1558. Minimum Numbers of Function Calls to Make Target Array (Medium)](https://leetcode.com/problems/minimum-numbers-of-function-calls-to-make-target-array "得到目标数组的最少函数调用次数")
-
-
You are given an integer array nums. You have an integer array arr of the same length with all values set to 0 initially. You also have the following modify function:
-
-
You want to use the modify function to covert arr to nums using the minimum number of calls.
-
-
Return the minimum number of function calls to make nums from arr.
-
-
The test cases are generated so that the answer fits in a 32-bit signed integer.
-
-
-
Example 1:
-
-
-Input: nums = [1,5]
-Output: 5
-Explanation: Increment by 1 (second element): [0, 0] to get [0, 1] (1 operation).
-Double all the elements: [0, 1] -> [0, 2] -> [0, 4] (2 operations).
-Increment by 1 (both elements) [0, 4] -> [1, 4] -> [1, 5] (2 operations).
-Total of operations: 1 + 2 + 2 = 5.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Greedy](../../tag/greedy/README.md)]
-
-### Hints
-
-Hint 1
-Work backwards: try to go from nums to arr.
-
-
-
-Hint 2
-You should try to divide by 2 as much as possible, but you can only divide by 2 if everything is even.
-
diff --git a/problems/minimum-one-bit-operations-to-make-integers-zero/README.md b/problems/minimum-one-bit-operations-to-make-integers-zero/README.md
deleted file mode 100644
index 8051fc22e..000000000
--- a/problems/minimum-one-bit-operations-to-make-integers-zero/README.md
+++ /dev/null
@@ -1,70 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-number-of-visible-points "Maximum Number of Visible Points")
-
-[Next >](../check-if-two-expression-trees-are-equivalent "Check If Two Expression Trees are Equivalent")
-
-## [1611. Minimum One Bit Operations to Make Integers Zero (Hard)](https://leetcode.com/problems/minimum-one-bit-operations-to-make-integers-zero "使整数变为 0 的最少操作次数")
-
-
Given an integer n, you must transform it into 0 using the following operations any number of times:
-
-
-
Change the rightmost (0th) bit in the binary representation of n.
-
Change the ith bit in the binary representation of n if the (i-1)th bit is set to 1 and the (i-2)th through 0th bits are set to 0.
-
-
-
Return the minimum number of operations to transform n into 0.
-
-
-
Example 1:
-
-
-Input: n = 3
-Output: 2
-Explanation: The binary representation of 3 is "11".
-"11" -> "01" with the 2nd operation since the 0th bit is 1.
-"01" -> "00" with the 1st operation.
-
-
-
Example 2:
-
-
-Input: n = 6
-Output: 4
-Explanation: The binary representation of 6 is "110".
-"110" -> "010" with the 2nd operation since the 1st bit is 1 and 0th through 0th bits are 0.
-"010" -> "011" with the 1st operation.
-"011" -> "001" with the 2nd operation since the 0th bit is 1.
-"001" -> "000" with the 1st operation.
-
-
-
-
Constraints:
-
-
-
0 <= n <= 109
-
-
-### Related Topics
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Bit Manipulation](../../tag/bit-manipulation/README.md)]
- [[Memoization](../../tag/memoization/README.md)]
-
-### Similar Questions
- 1. [Minimum Number of Operations to Make Array Continuous](../minimum-number-of-operations-to-make-array-continuous) (Hard)
-
-### Hints
-
-Hint 1
-The fastest way to convert n to zero is to remove all set bits starting from the leftmost one. Try some simple examples to learn the rule of how many steps are needed to remove one set bit.
-
-
-
-Hint 2
-consider n=2^k case first, then solve for all n.
-
diff --git a/problems/minimum-operations-to-convert-number/README.md b/problems/minimum-operations-to-convert-number/README.md
deleted file mode 100644
index dbf649ccb..000000000
--- a/problems/minimum-operations-to-convert-number/README.md
+++ /dev/null
@@ -1,82 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../find-the-minimum-and-maximum-number-of-nodes-between-critical-points "Find the Minimum and Maximum Number of Nodes Between Critical Points")
-
-[Next >](../check-if-an-original-string-exists-given-two-encoded-strings "Check if an Original String Exists Given Two Encoded Strings")
-
-## [2059. Minimum Operations to Convert Number (Medium)](https://leetcode.com/problems/minimum-operations-to-convert-number "转化数字的最小运算数")
-
-
You are given a 0-indexed integer array nums containing distinct numbers, an integer start, and an integer goal. There is an integer x that is initially set to start, and you want to perform operations on x such that it is converted to goal. You can perform the following operation repeatedly on the number x:
-
-
If 0 <= x <= 1000, then for any index i in the array (0 <= i < nums.length), you can set x to any of the following:
-
-
-
x + nums[i]
-
x - nums[i]
-
x ^ nums[i] (bitwise-XOR)
-
-
-
Note that you can use each nums[i] any number of times in any order. Operations that set x to be out of the range 0 <= x <= 1000 are valid, but no more operations can be done afterward.
-
-
Return the minimum number of operations needed to convert x = start into goal, and -1 if it is not possible.
-
-
-
Example 1:
-
-
-Input: nums = [2,4,12], start = 2, goal = 12
-Output: 2
-Explanation: We can go from 2 → 14 → 12 with the following 2 operations.
-- 2 + 12 = 14
-- 14 - 2 = 12
-
-
-
Example 2:
-
-
-Input: nums = [3,5,7], start = 0, goal = -4
-Output: 2
-Explanation: We can go from 0 → 3 → -4 with the following 2 operations.
-- 0 + 3 = 3
-- 3 - 7 = -4
-Note that the last operation sets x out of the range 0 <= x <= 1000, which is valid.
-
-
-
Example 3:
-
-
-Input: nums = [2,8,16], start = 0, goal = 1
-Output: -1
-Explanation: There is no way to convert 0 into 1.
-
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 1000
-
-109 <= nums[i], goal <= 109
-
0 <= start <= 1000
-
start != goal
-
All the integers in nums are distinct.
-
-
-### Related Topics
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Array](../../tag/array/README.md)]
-
-### Hints
-
-Hint 1
-Once x drops below 0 or goes above 1000, is it possible to continue performing operations on x?
-
-
-
-Hint 2
-How can you use BFS to find the minimum operations?
-
diff --git a/problems/minimum-operations-to-make-a-subsequence/README.md b/problems/minimum-operations-to-make-a-subsequence/README.md
deleted file mode 100644
index 2284fd92b..000000000
--- a/problems/minimum-operations-to-make-a-subsequence/README.md
+++ /dev/null
@@ -1,67 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../ways-to-split-array-into-three-subarrays "Ways to Split Array Into Three Subarrays")
-
-[Next >](../sum-of-special-evenly-spaced-elements-in-array "Sum Of Special Evenly-Spaced Elements In Array")
-
-## [1713. Minimum Operations to Make a Subsequence (Hard)](https://leetcode.com/problems/minimum-operations-to-make-a-subsequence "得到子序列的最少操作次数")
-
-
You are given an array target that consists of distinct integers and another integer array arr that can have duplicates.
-
-
In one operation, you can insert any integer at any position in arr. For example, if arr = [1,4,1,2], you can add 3 in the middle and make it [1,4,3,1,2]. Note that you can insert the integer at the very beginning or end of the array.
-
-
Return the minimum number of operations needed to make target a subsequence of arr.
-
-
A subsequence of an array is a new array generated from the original array by deleting some elements (possibly none) without changing the remaining elements' relative order. For example, [2,7,4] is a subsequence of [4,2,3,7,2,1,4] (the underlined elements), while [2,4,2] is not.
-
-
-
Example 1:
-
-
-Input: target = [5,1,3], arr = [9,4,2,3,4]
-Output: 2
-Explanation: You can add 5 and 1 in such a way that makes arr = [5,9,4,1,2,3,4], then target will be a subsequence of arr.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
- [[Greedy](../../tag/greedy/README.md)]
-
-### Hints
-
-Hint 1
-The problem can be reduced to computing Longest Common Subsequence between both arrays.
-
-
-
-Hint 2
-Since one of the arrays has distinct elements, we can consider that these elements describe an arrangement of numbers, and we can replace each element in the other array with the index it appeared at in the first array.
-
-
-
-Hint 3
-Then the problem is converted to finding Longest Increasing Subsequence in the second array, which can be done in O(n log n).
-
diff --git a/problems/minimum-operations-to-make-a-uni-value-grid/README.md b/problems/minimum-operations-to-make-a-uni-value-grid/README.md
deleted file mode 100644
index e0b204b83..000000000
--- a/problems/minimum-operations-to-make-a-uni-value-grid/README.md
+++ /dev/null
@@ -1,80 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../two-out-of-three "Two Out of Three")
-
-[Next >](../stock-price-fluctuation "Stock Price Fluctuation ")
-
-## [2033. Minimum Operations to Make a Uni-Value Grid (Medium)](https://leetcode.com/problems/minimum-operations-to-make-a-uni-value-grid "获取单值网格的最小操作数")
-
-
You are given a 2D integer grid of size m x n and an integer x. In one operation, you can addx to or subtractx from any element in the grid.
-
-
A uni-value grid is a grid where all the elements of it are equal.
-
-
Return the minimum number of operations to make the grid uni-value. If it is not possible, return -1.
-
-
-
Example 1:
-
-
-Input: grid = [[2,4],[6,8]], x = 2
-Output: 4
-Explanation: We can make every element equal to 4 by doing the following:
-- Add x to 2 once.
-- Subtract x from 6 once.
-- Subtract x from 8 twice.
-A total of 4 operations were used.
-
-
-
Example 2:
-
-
-Input: grid = [[1,5],[2,3]], x = 1
-Output: 5
-Explanation: We can make every element equal to 3.
-
-
-
Example 3:
-
-
-Input: grid = [[1,2],[3,4]], x = 2
-Output: -1
-Explanation: It is impossible to make every element equal.
-
-
-
-
Constraints:
-
-
-
m == grid.length
-
n == grid[i].length
-
1 <= m, n <= 105
-
1 <= m * n <= 105
-
1 <= x, grid[i][j] <= 104
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Math](../../tag/math/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Hints
-
-Hint 1
-Is it possible to make two integers a and b equal if they have different remainders dividing by x?
-
-
-
-Hint 2
-If it is possible, which number should you select to minimize the number of operations?
-
-
-
-Hint 3
-What if the elements are sorted?
-
diff --git a/problems/minimum-operations-to-make-array-equal/README.md b/problems/minimum-operations-to-make-array-equal/README.md
deleted file mode 100644
index 6b184beb4..000000000
--- a/problems/minimum-operations-to-make-array-equal/README.md
+++ /dev/null
@@ -1,57 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../three-consecutive-odds "Three Consecutive Odds")
-
-[Next >](../magnetic-force-between-two-balls "Magnetic Force Between Two Balls")
-
-## [1551. Minimum Operations to Make Array Equal (Medium)](https://leetcode.com/problems/minimum-operations-to-make-array-equal "使数组中所有元素相等的最小操作数")
-
-
You have an array arr of length n where arr[i] = (2 * i) + 1 for all valid values of i (i.e., 0 <= i < n).
-
-
In one operation, you can select two indices x and y where 0 <= x, y < n and subtract 1 from arr[x] and add 1 to arr[y] (i.e., perform arr[x] -=1 and arr[y] += 1). The goal is to make all the elements of the array equal. It is guaranteed that all the elements of the array can be made equal using some operations.
-
-
Given an integer n, the length of the array, return the minimum number of operations needed to make all the elements of arr equal.
-
-
-
Example 1:
-
-
-Input: n = 3
-Output: 2
-Explanation: arr = [1, 3, 5]
-First operation choose x = 2 and y = 0, this leads arr to be [2, 3, 4]
-In the second operation choose x = 2 and y = 0 again, thus arr = [3, 3, 3].
-
-
-
Example 2:
-
-
-Input: n = 6
-Output: 9
-
-
-
-
Constraints:
-
-
-
1 <= n <= 104
-
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
-
-### Hints
-
-Hint 1
-Build the array arr using the given formula, define target = sum(arr) / n
-
-
-
-Hint 2
-What is the number of operations needed to convert arr so that all elements equal target ?
-
diff --git a/problems/minimum-operations-to-make-the-array-alternating/README.md b/problems/minimum-operations-to-make-the-array-alternating/README.md
deleted file mode 100644
index 8b1fec07d..000000000
--- a/problems/minimum-operations-to-make-the-array-alternating/README.md
+++ /dev/null
@@ -1,78 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../count-operations-to-obtain-zero "Count Operations to Obtain Zero")
-
-[Next >](../removing-minimum-number-of-magic-beans "Removing Minimum Number of Magic Beans")
-
-## [2170. Minimum Operations to Make the Array Alternating (Medium)](https://leetcode.com/problems/minimum-operations-to-make-the-array-alternating "使数组变成交替数组的最少操作数")
-
-
You are given a 0-indexed array nums consisting of n positive integers.
-
-
The array nums is called alternating if:
-
-
-
nums[i - 2] == nums[i], where 2 <= i <= n - 1.
-
nums[i - 1] != nums[i], where 1 <= i <= n - 1.
-
-
-
In one operation, you can choose an index i and changenums[i] into any positive integer.
-
-
Return the minimum number of operations required to make the array alternating.
-
-
-
Example 1:
-
-
-Input: nums = [3,1,3,2,4,3]
-Output: 3
-Explanation:
-One way to make the array alternating is by converting it to [3,1,3,1,3,1].
-The number of operations required in this case is 3.
-It can be proven that it is not possible to make the array alternating in less than 3 operations.
-
-
-
Example 2:
-
-
-Input: nums = [1,2,2,2,2]
-Output: 2
-Explanation:
-One way to make the array alternating is by converting it to [1,2,1,2,1].
-The number of operations required in this case is 2.
-Note that the array cannot be converted to [2,2,2,2,2] because in this case nums[0] == nums[1] which violates the conditions of an alternating array.
-
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 105
-
1 <= nums[i] <= 105
-
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Counting](../../tag/counting/README.md)]
-
-### Hints
-
-Hint 1
-Count the frequency of each element in odd positions in the array. Do the same for elements in even positions.
-
-
-
-Hint 2
-To minimize the number of operations we need to maximize the number of elements we keep from the original array.
-
-
-
-Hint 3
-What are the possible combinations of elements we can choose from odd indices and even indices so that the number of unchanged elements is maximized?
-
diff --git a/problems/minimum-operations-to-make-the-array-increasing/README.md b/problems/minimum-operations-to-make-the-array-increasing/README.md
deleted file mode 100644
index ea365b974..000000000
--- a/problems/minimum-operations-to-make-the-array-increasing/README.md
+++ /dev/null
@@ -1,76 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../faulty-sensor "Faulty Sensor")
-
-[Next >](../queries-on-number-of-points-inside-a-circle "Queries on Number of Points Inside a Circle")
-
-## [1827. Minimum Operations to Make the Array Increasing (Easy)](https://leetcode.com/problems/minimum-operations-to-make-the-array-increasing "最少操作使数组递增")
-
-
You are given an integer array nums (0-indexed). In one operation, you can choose an element of the array and increment it by 1.
-
-
-
For example, if nums = [1,2,3], you can choose to increment nums[1] to make nums = [1,3,3].
-
-
-
Return the minimum number of operations needed to makenumsstrictlyincreasing.
-
-
An array nums is strictly increasing if nums[i] < nums[i+1] for all 0 <= i < nums.length - 1. An array of length 1 is trivially strictly increasing.
-
-
-
Example 1:
-
-
-Input: nums = [1,1,1]
-Output: 3
-Explanation: You can do the following operations:
-1) Increment nums[2], so nums becomes [1,1,2].
-2) Increment nums[1], so nums becomes [1,2,2].
-3) Increment nums[2], so nums becomes [1,2,3].
-
-
-
Example 2:
-
-
-Input: nums = [1,5,2,4,1]
-Output: 14
-
-
-
Example 3:
-
-
-Input: nums = [8]
-Output: 0
-
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 5000
-
1 <= nums[i] <= 104
-
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[Array](../../tag/array/README.md)]
-
-### Hints
-
-Hint 1
-nums[i+1] must be at least equal to nums[i] + 1.
-
-
-
-Hint 2
-Think greedily. You don't have to increase nums[i+1] beyond nums[i]+1.
-
-
-
-Hint 3
-Iterate on i and set nums[i] = max(nums[i-1]+1, nums[i]) .
-
diff --git a/problems/minimum-operations-to-make-the-array-k-increasing/README.md b/problems/minimum-operations-to-make-the-array-k-increasing/README.md
deleted file mode 100644
index 3ecfaec2b..000000000
--- a/problems/minimum-operations-to-make-the-array-k-increasing/README.md
+++ /dev/null
@@ -1,100 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../number-of-smooth-descent-periods-of-a-stock "Number of Smooth Descent Periods of a Stock")
-
-[Next >](../the-airport-with-the-most-traffic "The Airport With the Most Traffic")
-
-## [2111. Minimum Operations to Make the Array K-Increasing (Hard)](https://leetcode.com/problems/minimum-operations-to-make-the-array-k-increasing "使数组 K 递增的最少操作次数")
-
-
You are given a 0-indexed array arr consisting of n positive integers, and a positive integer k.
-
-
The array arr is called K-increasing if arr[i-k] <= arr[i] holds for every index i, where k <= i <= n-1.
-
-
-
For example, arr = [4, 1, 5, 2, 6, 2] is K-increasing for k = 2 because:
-
-
arr[0] <= arr[2] (4 <= 5)
-
arr[1] <= arr[3] (1 <= 2)
-
arr[2] <= arr[4] (5 <= 6)
-
arr[3] <= arr[5] (2 <= 2)
-
-
-
However, the same arr is not K-increasing for k = 1 (because arr[0] > arr[1]) or k = 3 (because arr[0] > arr[3]).
-
-
-
In one operation, you can choose an index i and changearr[i] into any positive integer.
-
-
Return the minimum number of operations required to make the array K-increasing for the given k.
-
-
-
Example 1:
-
-
-Input: arr = [5,4,3,2,1], k = 1
-Output: 4
-Explanation:
-For k = 1, the resultant array has to be non-decreasing.
-Some of the K-increasing arrays that can be formed are [5,6,7,8,9], [1,1,1,1,1], [2,2,3,4,4]. All of them require 4 operations.
-It is suboptimal to change the array to, for example, [6,7,8,9,10] because it would take 5 operations.
-It can be shown that we cannot make the array K-increasing in less than 4 operations.
-
-
-
Example 2:
-
-
-Input: arr = [4,1,5,2,6,2], k = 2
-Output: 0
-Explanation:
-This is the same example as the one in the problem description.
-Here, for every index i where 2 <= i <= 5, arr[i-2] <=arr[i].
-Since the given array is already K-increasing, we do not need to perform any operations.
-
-
Example 3:
-
-
-Input: arr = [4,1,5,2,6,2], k = 3
-Output: 2
-Explanation:
-Indices 3 and 5 are the only ones not satisfying arr[i-3] <= arr[i] for 3 <= i <= 5.
-One of the ways we can make the array K-increasing is by changing arr[3] to 4 and arr[5] to 5.
-The array will now be [4,1,5,4,6,5].
-Note that there can be other ways to make the array K-increasing, but none of them require less than 2 operations.
-
-
-
-
Constraints:
-
-
-
1 <= arr.length <= 105
-
1 <= arr[i], k <= arr.length
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
-
-### Hints
-
-Hint 1
-Can we divide the array into non-overlapping subsequences and simplify the problem?
-
-
-
-Hint 2
-In the final array, arr[i-k] ≤ arr[i] should hold. We can use this to divide the array into at most k non-overlapping sequences, where arr[i] will belong to the (i%k)th sequence.
-
-
-
-Hint 3
-Now our problem boils down to performing the minimum operations on each sequence such that it becomes non-decreasing. Our answer will be the sum of operations on each sequence.
-
-
-
-Hint 4
-Which indices of a sequence should we not change in order to count the minimum operations? Can finding the longest non-decreasing subsequence of the sequence help?
-
diff --git a/problems/minimum-operations-to-reduce-x-to-zero/README.md b/problems/minimum-operations-to-reduce-x-to-zero/README.md
deleted file mode 100644
index a3e83af42..000000000
--- a/problems/minimum-operations-to-reduce-x-to-zero/README.md
+++ /dev/null
@@ -1,67 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../determine-if-two-strings-are-close "Determine if Two Strings Are Close")
-
-[Next >](../maximize-grid-happiness "Maximize Grid Happiness")
-
-## [1658. Minimum Operations to Reduce X to Zero (Medium)](https://leetcode.com/problems/minimum-operations-to-reduce-x-to-zero "将 x 减到 0 的最小操作数")
-
-
You are given an integer array nums and an integer x. In one operation, you can either remove the leftmost or the rightmost element from the array nums and subtract its value from x. Note that this modifies the array for future operations.
-
-
Return the minimum number of operations to reduce xto exactly0if it is possible, otherwise, return -1.
-
-
-
Example 1:
-
-
-Input: nums = [1,1,4,2,3], x = 5
-Output: 2
-Explanation: The optimal solution is to remove the last two elements to reduce x to zero.
-
-
-
Example 2:
-
-
-Input: nums = [5,6,7,8,9], x = 4
-Output: -1
-
-
-
Example 3:
-
-
-Input: nums = [3,2,20,1,1,3], x = 10
-Output: 5
-Explanation: The optimal solution is to remove the last three elements and the first two elements (5 operations in total) to reduce x to zero.
-
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 105
-
1 <= nums[i] <= 104
-
1 <= x <= 109
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
- [[Prefix Sum](../../tag/prefix-sum/README.md)]
- [[Sliding Window](../../tag/sliding-window/README.md)]
-
-### Hints
-
-Hint 1
-Think in reverse; instead of finding the minimum prefix + suffix, find the maximum subarray.
-
-
-
-Hint 2
-Finding the maximum subarray is standard and can be done greedily.
-
diff --git a/problems/minimum-operations-to-remove-adjacent-ones-in-matrix/README.md b/problems/minimum-operations-to-remove-adjacent-ones-in-matrix/README.md
deleted file mode 100644
index 1d0824208..000000000
--- a/problems/minimum-operations-to-remove-adjacent-ones-in-matrix/README.md
+++ /dev/null
@@ -1,40 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../recover-the-original-array "Recover the Original Array")
-
-[Next >](../check-if-all-as-appears-before-all-bs "Check if All A's Appears Before All B's")
-
-## [2123. Minimum Operations to Remove Adjacent Ones in Matrix (Hard)](https://leetcode.com/problems/minimum-operations-to-remove-adjacent-ones-in-matrix "")
-
-
-
-### Related Topics
- [[Graph](../../tag/graph/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
-
-### Hints
-
-Hint 1
-Consider each cell containing a 1 as a vertex whose neighbors are the cells 4-directionally connected to it. The grid then becomes a bipartite graph.
-
-
-
-Hint 2
-You want to find the smallest set of vertices such that every edge in the graph has an endpoint in this set. If you remove every vertex in this set from the graph, then all the 1’s will be disconnected. Are there any well-known algorithms for finding this set?
-
-
-
-Hint 3
-This set of vertices is called a minimum vertex cover. You can find the size of a minimum vertex cover by finding the size of a maximum matching (Konig’s theorem).
-
-
-
-Hint 4
-There are well-known algorithms such as Kuhn’s algorithm and Hopcroft-Karp-Karzanov algorithm which can find a maximum matching in a bipartite graph quickly.
-
diff --git a/problems/minimum-path-cost-in-a-hidden-grid/README.md b/problems/minimum-path-cost-in-a-hidden-grid/README.md
deleted file mode 100644
index cfccec590..000000000
--- a/problems/minimum-path-cost-in-a-hidden-grid/README.md
+++ /dev/null
@@ -1,37 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../ad-free-sessions "Ad-Free Sessions")
-
-[Next >](../find-interview-candidates "Find Interview Candidates")
-
-## [1810. Minimum Path Cost in a Hidden Grid (Medium)](https://leetcode.com/problems/minimum-path-cost-in-a-hidden-grid "隐藏网格下的最小消耗路径")
-
-
-
-### Related Topics
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Graph](../../tag/graph/README.md)]
- [[Interactive](../../tag/interactive/README.md)]
- [[Heap (Priority Queue)](../../tag/heap-priority-queue/README.md)]
-
-### Hints
-
-Hint 1
-The grid is at a maximum 100 x 100, so it is clever to assume that the robot's initial cell is grid[101][101]
-
-
-
-Hint 2
-Run a DFS from the robot's position to make sure that you can reach the target, otherwise you should return -1.
-
-
-
-Hint 3
-Now that you are sure you can reach the target and that you know the grid, run Dijkstra to find the minimum cost.
-
diff --git a/problems/minimum-path-sum/README.md b/problems/minimum-path-sum/README.md
deleted file mode 100644
index 082231679..000000000
--- a/problems/minimum-path-sum/README.md
+++ /dev/null
@@ -1,52 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../unique-paths-ii "Unique Paths II")
-
-[Next >](../valid-number "Valid Number")
-
-## [64. Minimum Path Sum (Medium)](https://leetcode.com/problems/minimum-path-sum "最小路径和")
-
-
Given a m x ngrid filled with non-negative numbers, find a path from top left to bottom right, which minimizes the sum of all numbers along its path.
-
-
Note: You can only move either down or right at any point in time.
-
-
-
Example 1:
-
-
-Input: grid = [[1,3,1],[1,5,1],[4,2,1]]
-Output: 7
-Explanation: Because the path 1 → 3 → 1 → 1 → 1 minimizes the sum.
-
-
-
Example 2:
-
-
-Input: grid = [[1,2,3],[4,5,6]]
-Output: 12
-
-
-
-
Constraints:
-
-
-
m == grid.length
-
n == grid[i].length
-
1 <= m, n <= 200
-
0 <= grid[i][j] <= 100
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
-
-### Similar Questions
- 1. [Unique Paths](../unique-paths) (Medium)
- 1. [Dungeon Game](../dungeon-game) (Hard)
- 1. [Cherry Pickup](../cherry-pickup) (Hard)
diff --git a/problems/minimum-path-sum/minimum_path_sum.go b/problems/minimum-path-sum/minimum_path_sum.go
deleted file mode 100644
index be02ea9e9..000000000
--- a/problems/minimum-path-sum/minimum_path_sum.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem64
diff --git a/problems/minimum-path-sum/minimum_path_sum_test.go b/problems/minimum-path-sum/minimum_path_sum_test.go
deleted file mode 100644
index be02ea9e9..000000000
--- a/problems/minimum-path-sum/minimum_path_sum_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem64
diff --git a/problems/minimum-possible-integer-after-at-most-k-adjacent-swaps-on-digits/README.md b/problems/minimum-possible-integer-after-at-most-k-adjacent-swaps-on-digits/README.md
deleted file mode 100644
index 2bf5130bc..000000000
--- a/problems/minimum-possible-integer-after-at-most-k-adjacent-swaps-on-digits/README.md
+++ /dev/null
@@ -1,67 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../count-submatrices-with-all-ones "Count Submatrices With All Ones")
-
-[Next >](../find-root-of-n-ary-tree "Find Root of N-Ary Tree")
-
-## [1505. Minimum Possible Integer After at Most K Adjacent Swaps On Digits (Hard)](https://leetcode.com/problems/minimum-possible-integer-after-at-most-k-adjacent-swaps-on-digits "最多 K 次交换相邻数位后得到的最小整数")
-
-
You are given a string num representing the digits of a very large integer and an integer k. You are allowed to swap any two adjacent digits of the integer at mostk times.
-
-
Return the minimum integer you can obtain also as a string.
-
-
-
Example 1:
-
-
-Input: num = "4321", k = 4
-Output: "1342"
-Explanation: The steps to obtain the minimum integer from 4321 with 4 adjacent swaps are shown.
-
-
-
Example 2:
-
-
-Input: num = "100", k = 1
-Output: "010"
-Explanation: It's ok for the output to have leading zeros, but the input is guaranteed not to have any leading zeros.
-
-
-
Example 3:
-
-
-Input: num = "36789", k = 1000
-Output: "36789"
-Explanation: We can keep the number without any swaps.
-
-
-
-
Constraints:
-
-
-
1 <= num.length <= 3 * 104
-
num consists of only digits and does not contain leading zeros.
-
1 <= k <= 104
-
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[Binary Indexed Tree](../../tag/binary-indexed-tree/README.md)]
- [[Segment Tree](../../tag/segment-tree/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Hints
-
-Hint 1
-We want to make the smaller digits the most significant digits in the number.
-
-
-
-Hint 2
-For each index i, check the smallest digit in a window of size k and append it to the answer. Update the indices of all digits in this range accordingly.
-
diff --git a/problems/minimum-remove-to-make-valid-parentheses/README.md b/problems/minimum-remove-to-make-valid-parentheses/README.md
deleted file mode 100644
index 3dc52b55e..000000000
--- a/problems/minimum-remove-to-make-valid-parentheses/README.md
+++ /dev/null
@@ -1,71 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../count-number-of-nice-subarrays "Count Number of Nice Subarrays")
-
-[Next >](../check-if-it-is-a-good-array "Check If It Is a Good Array")
-
-## [1249. Minimum Remove to Make Valid Parentheses (Medium)](https://leetcode.com/problems/minimum-remove-to-make-valid-parentheses "移除无效的括号")
-
-
Given a string s of '(' , ')' and lowercase English characters.
-
-
Your task is to remove the minimum number of parentheses ( '(' or ')', in any positions ) so that the resulting parentheses string is valid and return any valid string.
-
-
Formally, a parentheses string is valid if and only if:
-
-
-
It is the empty string, contains only lowercase characters, or
-
It can be written as AB (A concatenated with B), where A and B are valid strings, or
-
It can be written as (A), where A is a valid string.
-
-
-
-
Example 1:
-
-
-Input: s = "lee(t(c)o)de)"
-Output: "lee(t(c)o)de"
-Explanation: "lee(t(co)de)" , "lee(t(c)ode)" would also be accepted.
-
-
-
Example 2:
-
-
-Input: s = "a)b(c)d"
-Output: "ab(c)d"
-
-
-
Example 3:
-
-
-Input: s = "))(("
-Output: ""
-Explanation: An empty string is also valid.
-
-
-
-
Constraints:
-
-
-
1 <= s.length <= 105
-
s[i] is either'(' , ')', or lowercase English letter.
-
-
-### Related Topics
- [[Stack](../../tag/stack/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Hints
-
-Hint 1
-Each prefix of a balanced parentheses has a number of open parentheses greater or equal than closed parentheses, similar idea with each suffix.
-
-
-
-Hint 2
-Check the array from left to right, remove characters that do not meet the property mentioned above, same idea in backward way.
-
diff --git a/problems/minimum-score-triangulation-of-polygon/README.md b/problems/minimum-score-triangulation-of-polygon/README.md
deleted file mode 100644
index 66ec63aa7..000000000
--- a/problems/minimum-score-triangulation-of-polygon/README.md
+++ /dev/null
@@ -1,63 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../binary-search-tree-to-greater-sum-tree "Binary Search Tree to Greater Sum Tree")
-
-[Next >](../moving-stones-until-consecutive-ii "Moving Stones Until Consecutive II")
-
-## [1039. Minimum Score Triangulation of Polygon (Medium)](https://leetcode.com/problems/minimum-score-triangulation-of-polygon "多边形三角剖分的最低得分")
-
-
You have a convex n-sided polygon where each vertex has an integer value. You are given an integer array values where values[i] is the value of the ith vertex (i.e., clockwise order).
-
-
You will triangulate the polygon into n - 2 triangles. For each triangle, the value of that triangle is the product of the values of its vertices, and the total score of the triangulation is the sum of these values over all n - 2 triangles in the triangulation.
-
-
Return the smallest possible total score that you can achieve with some triangulation of the polygon.
-
-
-
Example 1:
-
-
-Input: values = [1,2,3]
-Output: 6
-Explanation: The polygon is already triangulated, and the score of the only triangle is 6.
-
-
-
Example 2:
-
-
-Input: values = [3,7,4,5]
-Output: 144
-Explanation: There are two triangulations, with possible scores: 3*7*5 + 4*5*7 = 245, or 3*4*5 + 3*4*7 = 144.
-The minimum score is 144.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Hints
-
-Hint 1
-Without loss of generality, there is a triangle that uses adjacent vertices A[0] and A[N-1] (where N = A.length). Depending on your choice K of it, this breaks down the triangulation into two subproblems A[1:K] and A[K+1:N-1].
-
diff --git a/problems/minimum-score-triangulation-of-polygon/minimum_score_triangulation_of_polygon.go b/problems/minimum-score-triangulation-of-polygon/minimum_score_triangulation_of_polygon.go
deleted file mode 100644
index 218d93dec..000000000
--- a/problems/minimum-score-triangulation-of-polygon/minimum_score_triangulation_of_polygon.go
+++ /dev/null
@@ -1,23 +0,0 @@
-package problem1039
-
-func minScoreTriangulation(A []int) int {
- n := len(A)
- dp := [50][50]int{}
- for d := 2; d < n; d++ {
- for i := 0; i+d < n; i++ {
- k := i + d
- dp[i][k] = 1 << 30
- for j := i + 1; j < k; j++ {
- dp[i][k] = min(dp[i][k], dp[i][j]+dp[j][k]+A[i]*A[j]*A[k])
- }
- }
- }
- return dp[0][n-1]
-}
-
-func min(a, b int) int {
- if a < b {
- return a
- }
- return b
-}
diff --git a/problems/minimum-sideway-jumps/README.md b/problems/minimum-sideway-jumps/README.md
deleted file mode 100644
index e3df8214b..000000000
--- a/problems/minimum-sideway-jumps/README.md
+++ /dev/null
@@ -1,85 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../find-the-winner-of-the-circular-game "Find the Winner of the Circular Game")
-
-[Next >](../finding-mk-average "Finding MK Average")
-
-## [1824. Minimum Sideway Jumps (Medium)](https://leetcode.com/problems/minimum-sideway-jumps "最少侧跳次数")
-
-
There is a 3 lane road of length n that consists of n + 1points labeled from 0 to n. A frog starts at point 0 in the second laneand wants to jump to point n. However, there could be obstacles along the way.
-
-
You are given an array obstacles of length n + 1 where each obstacles[i] (ranging from 0 to 3) describes an obstacle on the lane obstacles[i] at point i. If obstacles[i] == 0, there are no obstacles at point i. There will be at most one obstacle in the 3 lanes at each point.
-
-
-
For example, if obstacles[2] == 1, then there is an obstacle on lane 1 at point 2.
-
-
-
The frog can only travel from point i to point i + 1 on the same lane if there is not an obstacle on the lane at point i + 1. To avoid obstacles, the frog can also perform a side jump to jump to another lane (even if they are not adjacent) at the same point if there is no obstacle on the new lane.
-
-
-
For example, the frog can jump from lane 3 at point 3 to lane 1 at point 3.
-
-
-
Return the minimum number of side jumps the frog needs to reach any lane at point n starting from lane 2 at point 0.
-
-
Note: There will be no obstacles on points 0 and n.
-
-
-
Example 1:
-
-
-Input: obstacles = [0,1,2,3,0]
-Output: 2
-Explanation: The optimal solution is shown by the arrows above. There are 2 side jumps (red arrows).
-Note that the frog can jump over obstacles only when making side jumps (as shown at point 2).
-
-
-
Example 2:
-
-
-Input: obstacles = [0,1,1,3,3,0]
-Output: 0
-Explanation: There are no obstacles on lane 2. No side jumps are required.
-
-
-
Example 3:
-
-
-Input: obstacles = [0,2,1,0,3,0]
-Output: 2
-Explanation: The optimal solution is shown by the arrows above. There are 2 side jumps.
-
-
-
-
Constraints:
-
-
-
obstacles.length == n + 1
-
1 <= n <= 5 * 105
-
0 <= obstacles[i] <= 3
-
obstacles[0] == obstacles[n] == 0
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Greedy](../../tag/greedy/README.md)]
-
-### Similar Questions
- 1. [Frog Jump](../frog-jump) (Hard)
-
-### Hints
-
-Hint 1
-At a given point, there are only 3 possible states for where the frog can be.
-
-
-
-Hint 2
-Check all the ways to move from one point to the next and update the minimum side jumps for each lane.
-
diff --git a/problems/minimum-size-subarray-sum/README.md b/problems/minimum-size-subarray-sum/README.md
deleted file mode 100644
index 431ecc096..000000000
--- a/problems/minimum-size-subarray-sum/README.md
+++ /dev/null
@@ -1,60 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../implement-trie-prefix-tree "Implement Trie (Prefix Tree)")
-
-[Next >](../course-schedule-ii "Course Schedule II")
-
-## [209. Minimum Size Subarray Sum (Medium)](https://leetcode.com/problems/minimum-size-subarray-sum "长度最小的子数组")
-
-
Given an array of positive integers nums and a positive integer target, return the minimal length of a contiguous subarray[numsl, numsl+1, ..., numsr-1, numsr] of which the sum is greater than or equal to target. If there is no such subarray, return 0 instead.
-
-
-
Example 1:
-
-
-Input: target = 7, nums = [2,3,1,2,4,3]
-Output: 2
-Explanation: The subarray [4,3] has the minimal length under the problem constraint.
-
-Follow up: If you have figured out the O(n) solution, try coding another solution of which the time complexity is O(n log(n)).
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
- [[Prefix Sum](../../tag/prefix-sum/README.md)]
- [[Sliding Window](../../tag/sliding-window/README.md)]
-
-### Similar Questions
- 1. [Minimum Window Substring](../minimum-window-substring) (Hard)
- 1. [Maximum Size Subarray Sum Equals k](../maximum-size-subarray-sum-equals-k) (Medium)
- 1. [Maximum Length of Repeated Subarray](../maximum-length-of-repeated-subarray) (Medium)
diff --git a/problems/minimum-size-subarray-sum/minimum_size_subarray_sum.go b/problems/minimum-size-subarray-sum/minimum_size_subarray_sum.go
deleted file mode 100644
index 97f51037d..000000000
--- a/problems/minimum-size-subarray-sum/minimum_size_subarray_sum.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem209
diff --git a/problems/minimum-size-subarray-sum/minimum_size_subarray_sum_test.go b/problems/minimum-size-subarray-sum/minimum_size_subarray_sum_test.go
deleted file mode 100644
index 97f51037d..000000000
--- a/problems/minimum-size-subarray-sum/minimum_size_subarray_sum_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem209
diff --git a/problems/minimum-skips-to-arrive-at-meeting-on-time/README.md b/problems/minimum-skips-to-arrive-at-meeting-on-time/README.md
deleted file mode 100644
index 788e77637..000000000
--- a/problems/minimum-skips-to-arrive-at-meeting-on-time/README.md
+++ /dev/null
@@ -1,87 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../process-tasks-using-servers "Process Tasks Using Servers")
-
-[Next >](../egg-drop-with-2-eggs-and-n-floors "Egg Drop With 2 Eggs and N Floors")
-
-## [1883. Minimum Skips to Arrive at Meeting On Time (Hard)](https://leetcode.com/problems/minimum-skips-to-arrive-at-meeting-on-time "准时抵达会议现场的最小跳过休息次数")
-
-
You are given an integer hoursBefore, the number of hours you have to travel to your meeting. To arrive at your meeting, you have to travel through n roads. The road lengths are given as an integer array dist of length n, where dist[i] describes the length of the ith road in kilometers. In addition, you are given an integer speed, which is the speed (in km/h) you will travel at.
-
-
After you travel road i, you must rest and wait for the next integer hour before you can begin traveling on the next road. Note that you do not have to rest after traveling the last road because you are already at the meeting.
-
-
-
For example, if traveling a road takes 1.4 hours, you must wait until the 2 hour mark before traveling the next road. If traveling a road takes exactly 2 hours, you do not need to wait.
-
-
-
However, you are allowed to skip some rests to be able to arrive on time, meaning you do not need to wait for the next integer hour. Note that this means you may finish traveling future roads at different hour marks.
-
-
-
For example, suppose traveling the first road takes 1.4 hours and traveling the second road takes 0.6 hours. Skipping the rest after the first road will mean you finish traveling the second road right at the 2 hour mark, letting you start traveling the third road immediately.
-
-
-
Return the minimum number of skips required to arrive at the meeting on time, or-1 if it is impossible.
-
-
-
Example 1:
-
-
-Input: dist = [1,3,2], speed = 4, hoursBefore = 2
-Output: 1
-Explanation:
-Without skipping any rests, you will arrive in (1/4 + 3/4) + (3/4 + 1/4) + (2/4) = 2.5 hours.
-You can skip the first rest to arrive in ((1/4 + 0) + (3/4 + 0)) + (2/4) = 1.5 hours.
-Note that the second rest is shortened because you finish traveling the second road at an integer hour due to skipping the first rest.
-
-
-
Example 2:
-
-
-Input: dist = [7,3,5,5], speed = 2, hoursBefore = 10
-Output: 2
-Explanation:
-Without skipping any rests, you will arrive in (7/2 + 1/2) + (3/2 + 1/2) + (5/2 + 1/2) + (5/2) = 11.5 hours.
-You can skip the first and third rest to arrive in ((7/2 + 0) + (3/2 + 0)) + ((5/2 + 0) + (5/2)) = 10 hours.
-
-
-
Example 3:
-
-
-Input: dist = [7,3,5,5], speed = 1, hoursBefore = 10
-Output: -1
-Explanation: It is impossible to arrive at the meeting on time even if you skip all the rests.
-
-
-
-
Constraints:
-
-
-
n == dist.length
-
1 <= n <= 1000
-
1 <= dist[i] <= 105
-
1 <= speed <= 106
-
1 <= hoursBefore <= 107
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Similar Questions
- 1. [Minimum Speed to Arrive on Time](../minimum-speed-to-arrive-on-time) (Medium)
-
-### Hints
-
-Hint 1
-Is there something you can keep track of from one road to another?
-
-
-
-Hint 2
-How would knowing the start time for each state help us solve the problem?
-
diff --git a/problems/minimum-space-wasted-from-packaging/README.md b/problems/minimum-space-wasted-from-packaging/README.md
deleted file mode 100644
index 5dc48480a..000000000
--- a/problems/minimum-space-wasted-from-packaging/README.md
+++ /dev/null
@@ -1,83 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-number-of-flips-to-make-the-binary-string-alternating "Minimum Number of Flips to Make the Binary String Alternating")
-
-[Next >](../the-latest-login-in-2020 "The Latest Login in 2020")
-
-## [1889. Minimum Space Wasted From Packaging (Hard)](https://leetcode.com/problems/minimum-space-wasted-from-packaging "装包裹的最小浪费空间")
-
-
You have n packages that you are trying to place in boxes, one package in each box. There are m suppliers that each produce boxes of different sizes (with infinite supply). A package can be placed in a box if the size of the package is less than or equal to the size of the box.
-
-
The package sizes are given as an integer array packages, where packages[i] is the size of the ith package. The suppliers are given as a 2D integer array boxes, where boxes[j] is an array of box sizes that the jth supplier produces.
-
-
You want to choose a single supplier and use boxes from them such that the total wasted space is minimized. For each package in a box, we define the space wasted to be size of the box - size of the package. The total wasted space is the sum of the space wasted in all the boxes.
-
-
-
For example, if you have to fit packages with sizes [2,3,5] and the supplier offers boxes of sizes [4,8], you can fit the packages of size-2 and size-3 into two boxes of size-4 and the package with size-5 into a box of size-8. This would result in a waste of (4-2) + (4-3) + (8-5) = 6.
-
-
-
Return the minimum total wasted space by choosing the box supplier optimally, or -1if it is impossible to fit all the packages inside boxes. Since the answer may be large, return it modulo 109 + 7.
-
-
-
Example 1:
-
-
-Input: packages = [2,3,5], boxes = [[4,8],[2,8]]
-Output: 6
-Explanation: It is optimal to choose the first supplier, using two size-4 boxes and one size-8 box.
-The total waste is (4-2) + (4-3) + (8-5) = 6.
-
-
-
Example 2:
-
-
-Input: packages = [2,3,5], boxes = [[1,4],[2,3],[3,4]]
-Output: -1
-Explanation: There is no box that the package of size 5 can fit in.
-
-
-
Example 3:
-
-
-Input: packages = [3,5,8,10,11,12], boxes = [[12],[11,9],[10,5,14]]
-Output: 9
-Explanation: It is optimal to choose the third supplier, using two size-5 boxes, two size-10 boxes, and two size-14 boxes.
-The total waste is (5-3) + (5-5) + (10-8) + (10-10) + (14-11) + (14-12) = 9.
-
-
-
-
Constraints:
-
-
-
n == packages.length
-
m == boxes.length
-
1 <= n <= 105
-
1 <= m <= 105
-
1 <= packages[i] <= 105
-
1 <= boxes[j].length <= 105
-
1 <= boxes[j][k] <= 105
-
sum(boxes[j].length) <= 105
-
The elements in boxes[j] are distinct.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
- [[Prefix Sum](../../tag/prefix-sum/README.md)]
-
-### Hints
-
-Hint 1
-Given a fixed size box, is there a way to quickly query which packages (i.e., count and sizes) should end up in that box size?
-
-
-
-Hint 2
-Do we have to order the boxes a certain way to allow us to answer the query quickly?
-
diff --git a/problems/minimum-speed-to-arrive-on-time/README.md b/problems/minimum-speed-to-arrive-on-time/README.md
deleted file mode 100644
index c9ecb7bc8..000000000
--- a/problems/minimum-speed-to-arrive-on-time/README.md
+++ /dev/null
@@ -1,83 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../longer-contiguous-segments-of-ones-than-zeros "Longer Contiguous Segments of Ones than Zeros")
-
-[Next >](../jump-game-vii "Jump Game VII")
-
-## [1870. Minimum Speed to Arrive on Time (Medium)](https://leetcode.com/problems/minimum-speed-to-arrive-on-time "准时到达的列车最小时速")
-
-
You are given a floating-point number hour, representing the amount of time you have to reach the office. To commute to the office, you must take n trains in sequential order. You are also given an integer array dist of length n, where dist[i] describes the distance (in kilometers) of the ith train ride.
-
-
Each train can only depart at an integer hour, so you may need to wait in between each train ride.
-
-
-
For example, if the 1st train ride takes 1.5 hours, you must wait for an additional 0.5 hours before you can depart on the 2nd train ride at the 2 hour mark.
-
-
-
Return the minimum positive integer speed (in kilometers per hour) that all the trains must travel at for you to reach the office on time, or -1 if it is impossible to be on time.
-
-
Tests are generated such that the answer will not exceed 107 and hour will have at most two digits after the decimal point.
-
-
-
Example 1:
-
-
-Input: dist = [1,3,2], hour = 6
-Output: 1
-Explanation: At speed 1:
-- The first train ride takes 1/1 = 1 hour.
-- Since we are already at an integer hour, we depart immediately at the 1 hour mark. The second train takes 3/1 = 3 hours.
-- Since we are already at an integer hour, we depart immediately at the 4 hour mark. The third train takes 2/1 = 2 hours.
-- You will arrive at exactly the 6 hour mark.
-
-
-
Example 2:
-
-
-Input: dist = [1,3,2], hour = 2.7
-Output: 3
-Explanation: At speed 3:
-- The first train ride takes 1/3 = 0.33333 hours.
-- Since we are not at an integer hour, we wait until the 1 hour mark to depart. The second train ride takes 3/3 = 1 hour.
-- Since we are already at an integer hour, we depart immediately at the 2 hour mark. The third train takes 2/3 = 0.66667 hours.
-- You will arrive at the 2.66667 hour mark.
-
-
-
Example 3:
-
-
-Input: dist = [1,3,2], hour = 1.9
-Output: -1
-Explanation: It is impossible because the earliest the third train can depart is at the 2 hour mark.
-
-
-
-
Constraints:
-
-
-
n == dist.length
-
1 <= n <= 105
-
1 <= dist[i] <= 105
-
1 <= hour <= 109
-
There will be at most two digits after the decimal point in hour.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
-
-### Hints
-
-Hint 1
-Given the speed the trains are traveling at, can you find the total time it takes for you to arrive?
-
-
-
-Hint 2
-Is there a cutoff where any speeds larger will always allow you to arrive on time?
-
diff --git a/problems/minimum-subsequence-in-non-increasing-order/README.md b/problems/minimum-subsequence-in-non-increasing-order/README.md
deleted file mode 100644
index d9e699479..000000000
--- a/problems/minimum-subsequence-in-non-increasing-order/README.md
+++ /dev/null
@@ -1,61 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../reducing-dishes "Reducing Dishes")
-
-[Next >](../number-of-steps-to-reduce-a-number-in-binary-representation-to-one "Number of Steps to Reduce a Number in Binary Representation to One")
-
-## [1403. Minimum Subsequence in Non-Increasing Order (Easy)](https://leetcode.com/problems/minimum-subsequence-in-non-increasing-order "非递增顺序的最小子序列")
-
-
Given the array nums, obtain a subsequence of the array whose sum of elements is strictly greater than the sum of the non included elements in such subsequence.
-
-
If there are multiple solutions, return the subsequence with minimum size and if there still exist multiple solutions, return the subsequence with the maximum total sum of all its elements. A subsequence of an array can be obtained by erasing some (possibly zero) elements from the array.
-
-
Note that the solution with the given constraints is guaranteed to be unique. Also return the answer sorted in non-increasing order.
-
-
-
Example 1:
-
-
-Input: nums = [4,3,10,9,8]
-Output: [10,9]
-Explanation: The subsequences [10,9] and [10,8] are minimal such that the sum of their elements is strictly greater than the sum of elements not included, however, the subsequence [10,9] has the maximum total sum of its elements.
-
-
-
Example 2:
-
-
-Input: nums = [4,4,7,6,7]
-Output: [7,7,6]
-Explanation: The subsequence [7,7] has the sum of its elements equal to 14 which is not strictly greater than the sum of elements not included (14 = 4 + 4 + 6). Therefore, the subsequence [7,6,7] is the minimal satisfying the conditions. Note the subsequence has to returned in non-decreasing order.
-
-
-
Example 3:
-
-
-Input: nums = [6]
-Output: [6]
-
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 500
-
1 <= nums[i] <= 100
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Greedy](../../tag/greedy/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Hints
-
-Hint 1
-Sort elements and take each element from the largest until accomplish the conditions.
-
diff --git a/problems/minimum-suffix-flips/README.md b/problems/minimum-suffix-flips/README.md
deleted file mode 100644
index 2208589ce..000000000
--- a/problems/minimum-suffix-flips/README.md
+++ /dev/null
@@ -1,70 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../shuffle-string "Shuffle String")
-
-[Next >](../number-of-good-leaf-nodes-pairs "Number of Good Leaf Nodes Pairs")
-
-## [1529. Minimum Suffix Flips (Medium)](https://leetcode.com/problems/minimum-suffix-flips "最少的后缀翻转次数")
-
-
You are given a 0-indexed binary string target of length n. You have another binary string s of length n that is initially set to all zeros. You want to make s equal to target.
-
-
In one operation, you can pick an index i where 0 <= i < n and flip all bits in the inclusive range [i, n - 1]. Flip means changing '0' to '1' and '1' to '0'.
-
-
Return the minimum number of operations needed to make s equal to target.
-
-
-
Example 1:
-
-
-Input: target = "10111"
-Output: 3
-Explanation: Initially, s = "00000".
-Choose index i = 2: "00000" -> "00111"
-Choose index i = 0: "00111" -> "11000"
-Choose index i = 1: "11000" -> "10111"
-We need at least 3 flip operations to form target.
-
-
-
Example 2:
-
-
-Input: target = "101"
-Output: 3
-Explanation: Initially, s = "000".
-Choose index i = 0: "000" -> "111"
-Choose index i = 1: "111" -> "100"
-Choose index i = 2: "100" -> "101"
-We need at least 3 flip operations to form target.
-
-
-
Example 3:
-
-
-Input: target = "00000"
-Output: 0
-Explanation: We do not need any operations since the initial s already equals target.
-
-
-
-
Constraints:
-
-
-
n == target.length
-
1 <= n <= 105
-
target[i] is either '0' or '1'.
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
- [[Greedy](../../tag/greedy/README.md)]
-
-### Hints
-
-Hint 1
-Consider a strategy where the choice of bulb with number i is increasing. In such a strategy, you no longer need to worry about bulbs that have been set to the left.
-
diff --git a/problems/minimum-sum-of-four-digit-number-after-splitting-digits/README.md b/problems/minimum-sum-of-four-digit-number-after-splitting-digits/README.md
deleted file mode 100644
index a961edf68..000000000
--- a/problems/minimum-sum-of-four-digit-number-after-splitting-digits/README.md
+++ /dev/null
@@ -1,67 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../order-two-columns-independently "Order Two Columns Independently")
-
-[Next >](../partition-array-according-to-given-pivot "Partition Array According to Given Pivot")
-
-## [2160. Minimum Sum of Four Digit Number After Splitting Digits (Easy)](https://leetcode.com/problems/minimum-sum-of-four-digit-number-after-splitting-digits "拆分数位后四位数字的最小和")
-
-
You are given a positive integer num consisting of exactly four digits. Split num into two new integers new1 and new2 by using the digits found in num. Leading zeros are allowed in new1 and new2, and all the digits found in num must be used.
-
-
-
For example, given num = 2932, you have the following digits: two 2's, one 9 and one 3. Some of the possible pairs [new1, new2] are [22, 93], [23, 92], [223, 9] and [2, 329].
-
-
-
Return the minimum possible sum of new1 and new2.
-
-
-
Example 1:
-
-
-Input: num = 2932
-Output: 52
-Explanation: Some possible pairs [new1, new2] are [29, 23], [223, 9], etc.
-The minimum sum can be obtained by the pair [29, 23]: 29 + 23 = 52.
-
-
-
Example 2:
-
-
-Input: num = 4009
-Output: 13
-Explanation: Some possible pairs [new1, new2] are [0, 49], [490, 0], etc.
-The minimum sum can be obtained by the pair [4, 9]: 4 + 9 = 13.
-
-
-
-
Constraints:
-
-
-
1000 <= num <= 9999
-
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[Math](../../tag/math/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Hints
-
-Hint 1
-Notice that the most optimal way to obtain the minimum possible sum using 4 digits is by summing up two 2-digit numbers.
-
-
-
-Hint 2
-We can use the two smallest digits out of the four as the digits found in the tens place respectively.
-
-
-
-Hint 3
-Similarly, we use the final 2 larger digits as the digits found in the ones place.
-
diff --git a/problems/minimum-swaps-to-arrange-a-binary-grid/README.md b/problems/minimum-swaps-to-arrange-a-binary-grid/README.md
deleted file mode 100644
index 9a67343eb..000000000
--- a/problems/minimum-swaps-to-arrange-a-binary-grid/README.md
+++ /dev/null
@@ -1,73 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../find-the-winner-of-an-array-game "Find the Winner of an Array Game")
-
-[Next >](../get-the-maximum-score "Get the Maximum Score")
-
-## [1536. Minimum Swaps to Arrange a Binary Grid (Medium)](https://leetcode.com/problems/minimum-swaps-to-arrange-a-binary-grid "排布二进制网格的最少交换次数")
-
-
Given an n x n binary grid, in one step you can choose two adjacent rows of the grid and swap them.
-
-
A grid is said to be valid if all the cells above the main diagonal are zeros.
-
-
Return the minimum number of steps needed to make the grid valid, or -1 if the grid cannot be valid.
-
-
The main diagonal of a grid is the diagonal that starts at cell (1, 1) and ends at cell (n, n).
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Greedy](../../tag/greedy/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
-
-### Hints
-
-Hint 1
-For each row of the grid calculate the most right 1 in the grid in the array maxRight.
-
-
-
-Hint 2
-To check if there exist answer, sort maxRight and check if maxRight[i] ≤ i for all possible i's.
-
-
-
-Hint 3
-If there exist an answer, simulate the swaps.
-
diff --git a/problems/minimum-swaps-to-group-all-1s-together-ii/README.md b/problems/minimum-swaps-to-group-all-1s-together-ii/README.md
deleted file mode 100644
index f254b9dd9..000000000
--- a/problems/minimum-swaps-to-group-all-1s-together-ii/README.md
+++ /dev/null
@@ -1,91 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../check-if-every-row-and-column-contains-all-numbers "Check if Every Row and Column Contains All Numbers")
-
-[Next >](../count-words-obtained-after-adding-a-letter "Count Words Obtained After Adding a Letter")
-
-## [2134. Minimum Swaps to Group All 1's Together II (Medium)](https://leetcode.com/problems/minimum-swaps-to-group-all-1s-together-ii "最少交换次数来组合所有的 1 II")
-
-
A swap is defined as taking two distinct positions in an array and swapping the values in them.
-
-
A circular array is defined as an array where we consider the first element and the last element to be adjacent.
-
-
Given a binarycircular array nums, return the minimum number of swaps required to group all 1's present in the array together at any location.
-
-
-
Example 1:
-
-
-Input: nums = [0,1,0,1,1,0,0]
-Output: 1
-Explanation: Here are a few of the ways to group all the 1's together:
-[0,0,1,1,1,0,0] using 1 swap.
-[0,1,1,1,0,0,0] using 1 swap.
-[1,1,0,0,0,0,1] using 2 swaps (using the circular property of the array).
-There is no way to group all 1's together with 0 swaps.
-Thus, the minimum number of swaps required is 1.
-
-
-
Example 2:
-
-
-Input: nums = [0,1,1,1,0,0,1,1,0]
-Output: 2
-Explanation: Here are a few of the ways to group all the 1's together:
-[1,1,1,0,0,0,0,1,1] using 2 swaps (using the circular property of the array).
-[1,1,1,1,1,0,0,0,0] using 2 swaps.
-There is no way to group all 1's together with 0 or 1 swaps.
-Thus, the minimum number of swaps required is 2.
-
-
-
Example 3:
-
-
-Input: nums = [1,1,0,0,1]
-Output: 0
-Explanation: All the 1's are already grouped together due to the circular property of the array.
-Thus, the minimum number of swaps required is 0.
-
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 105
-
nums[i] is either 0 or 1.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Sliding Window](../../tag/sliding-window/README.md)]
-
-### Hints
-
-Hint 1
-Notice that the number of 1’s to be grouped together is fixed. It is the number of 1's the whole array has.
-
-
-
-Hint 2
-Call this number total. We should then check for every subarray of size total (possibly wrapped around), how many swaps are required to have the subarray be all 1’s.
-
-
-
-Hint 3
-The number of swaps required is the number of 0’s in the subarray.
-
-
-
-Hint 4
-To eliminate the circular property of the array, we can append the original array to itself. Then, we check each subarray of length total.
-
-
-
-Hint 5
-How do we avoid recounting the number of 0’s in the subarray each time? The Sliding Window technique can help.
-
diff --git a/problems/minimum-swaps-to-group-all-1s-together/README.md b/problems/minimum-swaps-to-group-all-1s-together/README.md
deleted file mode 100644
index 7709f2917..000000000
--- a/problems/minimum-swaps-to-group-all-1s-together/README.md
+++ /dev/null
@@ -1,94 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../check-if-a-number-is-majority-element-in-a-sorted-array "Check If a Number Is Majority Element in a Sorted Array")
-
-[Next >](../analyze-user-website-visit-pattern "Analyze User Website Visit Pattern")
-
-## [1151. Minimum Swaps to Group All 1's Together (Medium)](https://leetcode.com/problems/minimum-swaps-to-group-all-1s-together "最少交换次数来组合所有的 1")
-
-
Given a binary array data, return the minimum number of swaps required to group all 1’s present in the array together in any place in the array.
-
-
-
-
Example 1:
-
-
-Input: [1,0,1,0,1]
-Output: 1
-Explanation:
-There are 3 ways to group all 1's together:
-[1,1,1,0,0] using 1 swap.
-[0,1,1,1,0] using 2 swaps.
-[0,0,1,1,1] using 1 swap.
-The minimum is 1.
-
-
-
Example 2:
-
-
-Input: [0,0,0,1,0]
-Output: 0
-Explanation:
-Since there is only one 1 in the array, no swaps needed.
-
-
-
Example 3:
-
-
-Input: [1,0,1,0,1,0,0,1,1,0,1]
-Output: 3
-Explanation:
-One possible solution that uses 3 swaps is [0,0,0,0,0,1,1,1,1,1,1].
-
-
-
-
-
Note:
-
-
-
1 <= data.length <= 10^5
-
0 <= data[i] <= 1
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Sliding Window](../../tag/sliding-window/README.md)]
-
-### Similar Questions
- 1. [Minimum Adjacent Swaps for K Consecutive Ones](../minimum-adjacent-swaps-for-k-consecutive-ones) (Hard)
-
-### Hints
-
-Hint 1
-How many 1's should be grouped together ? Is not a fixed number?
-
-
-
-Hint 2
-Yeah it's just the number of 1's the whole array has. Let's name this number as ones
-
-
-
-Hint 3
-Every subarray of size of ones, needs some number of swaps to reach, Can you find the number of swaps needed to group all 1's in this subarray?
-
-
-
-Hint 4
-It's the number of zeros in that subarray.
-
-
-
-Hint 5
-Do you need to count the number of zeros all over again for every position ?
-
-
-
-Hint 6
-Use Sliding Window technique.
-
diff --git a/problems/minimum-swaps-to-make-sequences-increasing/README.md b/problems/minimum-swaps-to-make-sequences-increasing/README.md
deleted file mode 100644
index 81ce68ef8..000000000
--- a/problems/minimum-swaps-to-make-sequences-increasing/README.md
+++ /dev/null
@@ -1,57 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../similar-rgb-color "Similar RGB Color")
-
-[Next >](../find-eventual-safe-states "Find Eventual Safe States")
-
-## [801. Minimum Swaps To Make Sequences Increasing (Hard)](https://leetcode.com/problems/minimum-swaps-to-make-sequences-increasing "使序列递增的最小交换次数")
-
-
You are given two integer arrays of the same length nums1 and nums2. In one operation, you are allowed to swap nums1[i] with nums2[i].
-
-
-
For example, if nums1 = [1,2,3,8], and nums2 = [5,6,7,4], you can swap the element at i = 3 to obtain nums1 = [1,2,3,4] and nums2 = [5,6,7,8].
-
-
-
Return the minimum number of needed operations to make nums1 and nums2strictly increasing. The test cases are generated so that the given input always makes it possible.
-
-
An array arr is strictly increasing if and only if arr[0] < arr[1] < arr[2] < ... < arr[arr.length - 1].
-
-
-
Example 1:
-
-
-Input: nums1 = [1,3,5,4], nums2 = [1,2,3,7]
-Output: 1
-Explanation:
-Swap nums1[3] and nums2[3]. Then the sequences are:
-nums1 = [1, 3, 5, 7] and nums2 = [1, 2, 3, 4]
-which are both strictly increasing.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Similar Questions
- 1. [Minimum Operations to Make the Array K-Increasing](../minimum-operations-to-make-the-array-k-increasing) (Hard)
diff --git a/problems/minimum-swaps-to-make-sequences-increasing/minimum_swaps_to_make_sequences_increasing.go b/problems/minimum-swaps-to-make-sequences-increasing/minimum_swaps_to_make_sequences_increasing.go
deleted file mode 100644
index bf53c2335..000000000
--- a/problems/minimum-swaps-to-make-sequences-increasing/minimum_swaps_to_make_sequences_increasing.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem801
diff --git a/problems/minimum-swaps-to-make-sequences-increasing/minimum_swaps_to_make_sequences_increasing_test.go b/problems/minimum-swaps-to-make-sequences-increasing/minimum_swaps_to_make_sequences_increasing_test.go
deleted file mode 100644
index bf53c2335..000000000
--- a/problems/minimum-swaps-to-make-sequences-increasing/minimum_swaps_to_make_sequences_increasing_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem801
diff --git a/problems/minimum-swaps-to-make-strings-equal/README.md b/problems/minimum-swaps-to-make-strings-equal/README.md
deleted file mode 100644
index efa4ee8ed..000000000
--- a/problems/minimum-swaps-to-make-strings-equal/README.md
+++ /dev/null
@@ -1,74 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../palindrome-removal "Palindrome Removal")
-
-[Next >](../count-number-of-nice-subarrays "Count Number of Nice Subarrays")
-
-## [1247. Minimum Swaps to Make Strings Equal (Medium)](https://leetcode.com/problems/minimum-swaps-to-make-strings-equal "交换字符使得字符串相同")
-
-
You are given two strings s1 and s2 of equal length consisting of letters "x" and "y"only. Your task is to make these two strings equal to each other. You can swap any two characters that belong to different strings, which means: swap s1[i] and s2[j].
-
-
Return the minimum number of swaps required to make s1 and s2 equal, or return -1 if it is impossible to do so.
-Input: s1 = "xy", s2 = "yx"
-Output: 2
-Explanation: Swap s1[0] and s2[0], s1 = "yy", s2 = "xx".
-Swap s1[0] and s2[1], s1 = "xy", s2 = "xy".
-Note that you cannot swap s1[0] and s1[1] to make s1 equal to "yx", cause we can only swap chars in different strings.
-
-
-
Example 3:
-
-
-Input: s1 = "xx", s2 = "xy"
-Output: -1
-
-
-
-
Constraints:
-
-
-
1 <= s1.length, s2.length <= 1000
-
s1, s2 only contain 'x' or 'y'.
-
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
- [[String](../../tag/string/README.md)]
- [[Greedy](../../tag/greedy/README.md)]
-
-### Similar Questions
- 1. [Determine if Two Strings Are Close](../determine-if-two-strings-are-close) (Medium)
-
-### Hints
-
-Hint 1
-First, ignore all the already matched positions, they don't affect the answer at all. For the unmatched positions, there are three basic cases (already given in the examples):
-
-
-
-Hint 2
-("xx", "yy") => 1 swap, ("xy", "yx") => 2 swaps
-
-
-
-Hint 3
-So the strategy is, apply case 1 as much as possible, then apply case 2 if the last two unmatched are in this case, or fall into impossible if only one pair of unmatched left. This can be done via a simple math.
-
diff --git a/problems/minimum-time-difference/README.md b/problems/minimum-time-difference/README.md
deleted file mode 100644
index de160e58a..000000000
--- a/problems/minimum-time-difference/README.md
+++ /dev/null
@@ -1,35 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../convert-bst-to-greater-tree "Convert BST to Greater Tree")
-
-[Next >](../single-element-in-a-sorted-array "Single Element in a Sorted Array")
-
-## [539. Minimum Time Difference (Medium)](https://leetcode.com/problems/minimum-time-difference "最小时间差")
-
-Given a list of 24-hour clock time points in "HH:MM" format, return the minimum minutes difference between any two time-points in the list.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Math](../../tag/math/README.md)]
- [[String](../../tag/string/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
diff --git a/problems/minimum-time-difference/minimum_time_difference.go b/problems/minimum-time-difference/minimum_time_difference.go
deleted file mode 100644
index 83a1e5c49..000000000
--- a/problems/minimum-time-difference/minimum_time_difference.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem539
diff --git a/problems/minimum-time-difference/minimum_time_difference_test.go b/problems/minimum-time-difference/minimum_time_difference_test.go
deleted file mode 100644
index 83a1e5c49..000000000
--- a/problems/minimum-time-difference/minimum_time_difference_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem539
diff --git a/problems/minimum-time-for-k-virus-variants-to-spread/README.md b/problems/minimum-time-for-k-virus-variants-to-spread/README.md
deleted file mode 100644
index c288759ed..000000000
--- a/problems/minimum-time-for-k-virus-variants-to-spread/README.md
+++ /dev/null
@@ -1,32 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../count-number-of-special-subsequences "Count Number of Special Subsequences")
-
-[Next >](../delete-characters-to-make-fancy-string "Delete Characters to Make Fancy String")
-
-## [1956. Minimum Time For K Virus Variants to Spread (Hard)](https://leetcode.com/problems/minimum-time-for-k-virus-variants-to-spread "感染 K 种病毒所需的最短时间")
-
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Math](../../tag/math/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
- [[Geometry](../../tag/geometry/README.md)]
- [[Enumeration](../../tag/enumeration/README.md)]
-
-### Hints
-
-Hint 1
-n is very small, how can we use that?
-
-
-
-Hint 2
-What shape is the region when two viruses intersect?
-
diff --git a/problems/minimum-time-to-build-blocks/README.md b/problems/minimum-time-to-build-blocks/README.md
deleted file mode 100644
index 9dc94ff90..000000000
--- a/problems/minimum-time-to-build-blocks/README.md
+++ /dev/null
@@ -1,94 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../find-smallest-common-element-in-all-rows "Find Smallest Common Element in All Rows")
-
-[Next >](../minimum-absolute-difference "Minimum Absolute Difference")
-
-## [1199. Minimum Time to Build Blocks (Hard)](https://leetcode.com/problems/minimum-time-to-build-blocks "建造街区的最短时间")
-
-
You are given a list of blocks, where blocks[i] = t means that the i-th block needs t units of time to be built. A block can only be built by exactly one worker.
-
-
A worker can either split into two workers (number of workers increases by one) or build a block then go home. Both decisions cost some time.
-
-
The time cost of spliting one worker into two workers is given as an integer split. Note that if two workers split at the same time, they split in parallel so the cost would be split.
-
-
Output the minimum time needed to build all blocks.
-
-
Initially, there is only one worker.
-
-
-
Example 1:
-
-
-Input: blocks = [1], split = 1
-Output: 1
-Explanation: We use 1 worker to build 1 block in 1 time unit.
-
-
-
Example 2:
-
-
-Input: blocks = [1,2], split = 5
-Output: 7
-Explanation: We split the worker into 2 workers in 5 time units then assign each of them to a block so the cost is 5 + max(1, 2) = 7.
-
-
-
Example 3:
-
-
-Input: blocks = [1,2,3], split = 1
-Output: 4
-Explanation: Split 1 worker into 2, then assign the first worker to the last block and split the second worker into 2.
-Then, use the two unassigned workers to build the first two blocks.
-The cost is 1 + max(3, 1 + max(1, 2)) = 4.
-
-
-
-
Constraints:
-
-
-
1 <= blocks.length <= 1000
-
1 <= blocks[i] <= 10^5
-
1 <= split <= 100
-
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[Math](../../tag/math/README.md)]
- [[Heap (Priority Queue)](../../tag/heap-priority-queue/README.md)]
-
-### Hints
-
-Hint 1
-A greedy approach will not work as the examples show.
-
-
-
-Hint 2
-Try all possible moves using DP.
-
-
-
-Hint 3
-For the DP state, dp[i][j] is the minimum time cost to build the first i blocks using j workers.
-
-
-
-Hint 4
-In one step you can either assign a worker to a block or choose a number of workers to split.
-
-
-
-Hint 5
-If you choose to assign a worker to a block it is always better to assign him to the block with the maximum time so we sort the array before using DP.
-
-
-
-Hint 6
-To optimize the solution from O(n^3) to O(n^2) notice that if you choose to split, it is always better to split all the workers you have.
-
diff --git a/problems/minimum-time-to-collect-all-apples-in-a-tree/README.md b/problems/minimum-time-to-collect-all-apples-in-a-tree/README.md
deleted file mode 100644
index 7572aba8c..000000000
--- a/problems/minimum-time-to-collect-all-apples-in-a-tree/README.md
+++ /dev/null
@@ -1,69 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../count-triplets-that-can-form-two-arrays-of-equal-xor "Count Triplets That Can Form Two Arrays of Equal XOR")
-
-[Next >](../number-of-ways-of-cutting-a-pizza "Number of Ways of Cutting a Pizza")
-
-## [1443. Minimum Time to Collect All Apples in a Tree (Medium)](https://leetcode.com/problems/minimum-time-to-collect-all-apples-in-a-tree "收集树上所有苹果的最少时间")
-
-
Given an undirected tree consisting of n vertices numbered from 0 to n-1, which has some apples in their vertices. You spend 1 second to walk over one edge of the tree. Return the minimum time in seconds you have to spend to collect all apples in the tree, starting at vertex 0 and coming back to this vertex.
-
-
The edges of the undirected tree are given in the array edges, where edges[i] = [ai, bi] means that exists an edge connecting the vertices ai and bi. Additionally, there is a boolean array hasApple, where hasApple[i] = true means that vertex i has an apple; otherwise, it does not have any apple.
-
-
-
Example 1:
-
-
-Input: n = 7, edges = [[0,1],[0,2],[1,4],[1,5],[2,3],[2,6]], hasApple = [false,false,true,false,true,true,false]
-Output: 8
-Explanation: The figure above represents the given tree where red vertices have an apple. One optimal path to collect all apples is shown by the green arrows.
-
-
-
Example 2:
-
-
-Input: n = 7, edges = [[0,1],[0,2],[1,4],[1,5],[2,3],[2,6]], hasApple = [false,false,true,false,false,true,false]
-Output: 6
-Explanation: The figure above represents the given tree where red vertices have an apple. One optimal path to collect all apples is shown by the green arrows.
-
-
-### Related Topics
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Tree](../../tag/tree/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
-
-### Hints
-
-Hint 1
-Note that if a node u contains an apple then all edges in the path from the root to the node u have to be used forward and backward (2 times).
-
-
-
-Hint 2
-Therefore use a depth-first search (DFS) to check if an edge will be used or not.
-
diff --git a/problems/minimum-time-to-make-rope-colorful/README.md b/problems/minimum-time-to-make-rope-colorful/README.md
deleted file mode 100644
index 0bbeb08a5..000000000
--- a/problems/minimum-time-to-make-rope-colorful/README.md
+++ /dev/null
@@ -1,67 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../number-of-ways-where-square-of-number-is-equal-to-product-of-two-numbers "Number of Ways Where Square of Number Is Equal to Product of Two Numbers")
-
-[Next >](../remove-max-number-of-edges-to-keep-graph-fully-traversable "Remove Max Number of Edges to Keep Graph Fully Traversable")
-
-## [1578. Minimum Time to Make Rope Colorful (Medium)](https://leetcode.com/problems/minimum-time-to-make-rope-colorful "使绳子变成彩色的最短时间")
-
-
Alice has n balloons arranged on a rope. You are given a 0-indexed string colors where colors[i] is the color of the ith balloon.
-
-
Alice wants the rope to be colorful. She does not want two consecutive balloons to be of the same color, so she asks Bob for help. Bob can remove some balloons from the rope to make it colorful. You are given a 0-indexed integer array neededTime where neededTime[i] is the time (in seconds) that Bob needs to remove the ith balloon from the rope.
-
-
Return the minimum time Bob needs to make the rope colorful.
-
-
-
Example 1:
-
-
-Input: colors = "abaac", neededTime = [1,2,3,4,5]
-Output: 3
-Explanation: In the above image, 'a' is blue, 'b' is red, and 'c' is green.
-Bob can remove the blue balloon at index 2. This takes 3 seconds.
-There are no longer two consecutive balloons of the same color. Total time = 3.
-
-
Example 2:
-
-
-Input: colors = "abc", neededTime = [1,2,3]
-Output: 0
-Explanation: The rope is already colorful. Bob does not need to remove any balloons from the rope.
-
-
-
Example 3:
-
-
-Input: colors = "aabaa", neededTime = [1,2,3,4,1]
-Output: 2
-Explanation: Bob will remove the ballons at indices 0 and 4. Each ballon takes 1 second to remove.
-There are no longer two consecutive balloons of the same color. Total time = 1 + 1 = 2.
-
-
-
-
Constraints:
-
-
-
n == colors.length == neededTime.length
-
1 <= n <= 105
-
1 <= neededTime[i] <= 104
-
colors contains only lowercase English letters.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[String](../../tag/string/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Greedy](../../tag/greedy/README.md)]
-
-### Hints
-
-Hint 1
-Maintain the running sum and max value for repeated letters.
-
diff --git a/problems/minimum-time-to-remove-all-cars-containing-illegal-goods/README.md b/problems/minimum-time-to-remove-all-cars-containing-illegal-goods/README.md
deleted file mode 100644
index 2d0a1ba6c..000000000
--- a/problems/minimum-time-to-remove-all-cars-containing-illegal-goods/README.md
+++ /dev/null
@@ -1,97 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../design-bitset "Design Bitset")
-
-[Next >](../unique-substrings-with-equal-digit-frequency "Unique Substrings With Equal Digit Frequency")
-
-## [2167. Minimum Time to Remove All Cars Containing Illegal Goods (Hard)](https://leetcode.com/problems/minimum-time-to-remove-all-cars-containing-illegal-goods "移除所有载有违禁货物车厢所需的最少时间")
-
-
You are given a 0-indexed binary string s which represents a sequence of train cars. s[i] = '0' denotes that the ith car does not contain illegal goods and s[i] = '1' denotes that the ith car does contain illegal goods.
-
-
As the train conductor, you would like to get rid of all the cars containing illegal goods. You can do any of the following three operations any number of times:
-
-
-
Remove a train car from the left end (i.e., remove s[0]) which takes 1 unit of time.
-
Remove a train car from the right end (i.e., remove s[s.length - 1]) which takes 1 unit of time.
-
Remove a train car from anywhere in the sequence which takes 2 units of time.
-
-
-
Return the minimum time to remove all the cars containing illegal goods.
-
-
Note that an empty sequence of cars is considered to have no cars containing illegal goods.
-
-
-
Example 1:
-
-
-Input: s = "1100101"
-Output: 5
-Explanation:
-One way to remove all the cars containing illegal goods from the sequence is to
-- remove a car from the left end 2 times. Time taken is 2 * 1 = 2.
-- remove a car from the right end. Time taken is 1.
-- remove the car containing illegal goods found in the middle. Time taken is 2.
-This obtains a total time of 2 + 1 + 2 = 5.
-
-An alternative way is to
-- remove a car from the left end 2 times. Time taken is 2 * 1 = 2.
-- remove a car from the right end 3 times. Time taken is 3 * 1 = 3.
-This also obtains a total time of 2 + 3 = 5.
-
-5 is the minimum time taken to remove all the cars containing illegal goods.
-There are no other ways to remove them with less time.
-
-
-
Example 2:
-
-
-Input: s = "0010"
-Output: 2
-Explanation:
-One way to remove all the cars containing illegal goods from the sequence is to
-- remove a car from the left end 3 times. Time taken is 3 * 1 = 3.
-This obtains a total time of 3.
-
-Another way to remove all the cars containing illegal goods from the sequence is to
-- remove the car containing illegal goods found in the middle. Time taken is 2.
-This obtains a total time of 2.
-
-Another way to remove all the cars containing illegal goods from the sequence is to
-- remove a car from the right end 2 times. Time taken is 2 * 1 = 2.
-This obtains a total time of 2.
-
-2 is the minimum time taken to remove all the cars containing illegal goods.
-There are no other ways to remove them with less time.
-
-
-
Constraints:
-
-
-
1 <= s.length <= 2 * 105
-
s[i] is either '0' or '1'.
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Hints
-
-Hint 1
-Build an array withoutFirst where withoutFirst[i] stores the minimum time to remove all the cars containing illegal goods from the ‘suffix’ of the sequence starting from the ith car without using any type 1 operations.
-
-
-
-Hint 2
-Next, build an array onlyFirst where onlyFirst[i] stores the minimum time to remove all the cars containing illegal goods from the ‘prefix’ of the sequence ending on the ith car using only type 1 operations.
-
-
-
-Hint 3
-Finally, we can compare the best way to split the operations amongst these two types by finding the minimum time across all onlyFirst[i] + withoutFirst[i + 1].
-
diff --git a/problems/minimum-time-to-type-word-using-special-typewriter/README.md b/problems/minimum-time-to-type-word-using-special-typewriter/README.md
deleted file mode 100644
index 3fb98afb0..000000000
--- a/problems/minimum-time-to-type-word-using-special-typewriter/README.md
+++ /dev/null
@@ -1,93 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../count-nodes-equal-to-sum-of-descendants "Count Nodes Equal to Sum of Descendants")
-
-[Next >](../maximum-matrix-sum "Maximum Matrix Sum")
-
-## [1974. Minimum Time to Type Word Using Special Typewriter (Easy)](https://leetcode.com/problems/minimum-time-to-type-word-using-special-typewriter "使用特殊打字机键入单词的最少时间")
-
-
There is a special typewriter with lowercase English letters 'a' to 'z' arranged in a circle with a pointer. A character can only be typed if the pointer is pointing to that character. The pointer is initially pointing to the character 'a'.
-
-
Each second, you may perform one of the following operations:
-
-
-
Move the pointer one character counterclockwise or clockwise.
-
Type the character the pointer is currently on.
-
-
-
Given a string word, return the minimum number of seconds to type out the characters in word.
-
-
-
Example 1:
-
-
-Input: word = "abc"
-Output: 5
-Explanation:
-The characters are printed as follows:
-- Type the character 'a' in 1 second since the pointer is initially on 'a'.
-- Move the pointer clockwise to 'b' in 1 second.
-- Type the character 'b' in 1 second.
-- Move the pointer clockwise to 'c' in 1 second.
-- Type the character 'c' in 1 second.
-
-
-
Example 2:
-
-
-Input: word = "bza"
-Output: 7
-Explanation:
-The characters are printed as follows:
-- Move the pointer clockwise to 'b' in 1 second.
-- Type the character 'b' in 1 second.
-- Move the pointer counterclockwise to 'z' in 2 seconds.
-- Type the character 'z' in 1 second.
-- Move the pointer clockwise to 'a' in 1 second.
-- Type the character 'a' in 1 second.
-
-
-
Example 3:
-
-
-Input: word = "zjpc"
-Output: 34
-Explanation:
-The characters are printed as follows:
-- Move the pointer counterclockwise to 'z' in 1 second.
-- Type the character 'z' in 1 second.
-- Move the pointer clockwise to 'j' in 10 seconds.
-- Type the character 'j' in 1 second.
-- Move the pointer clockwise to 'p' in 6 seconds.
-- Type the character 'p' in 1 second.
-- Move the pointer counterclockwise to 'c' in 13 seconds.
-- Type the character 'c' in 1 second.
-
-
-
-
Constraints:
-
-
-
1 <= word.length <= 100
-
word consists of lowercase English letters.
-
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Hints
-
-Hint 1
-There are only two possible directions you can go when you move to the next letter.
-
-
-
-Hint 2
-When moving to the next letter, you will always go in the direction that takes the least amount of time.
-
diff --git a/problems/minimum-time-visiting-all-points/README.md b/problems/minimum-time-visiting-all-points/README.md
deleted file mode 100644
index 8182cda1a..000000000
--- a/problems/minimum-time-visiting-all-points/README.md
+++ /dev/null
@@ -1,77 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../print-immutable-linked-list-in-reverse "Print Immutable Linked List in Reverse")
-
-[Next >](../count-servers-that-communicate "Count Servers that Communicate")
-
-## [1266. Minimum Time Visiting All Points (Easy)](https://leetcode.com/problems/minimum-time-visiting-all-points "访问所有点的最小时间")
-
-
On a 2D plane, there are n points with integer coordinates points[i] = [xi, yi]. Return the minimum time in seconds to visit all the points in the order given by points.
-
-
You can move according to these rules:
-
-
-
In 1 second, you can either:
-
-
move vertically by one unit,
-
move horizontally by one unit, or
-
move diagonally sqrt(2) units (in other words, move one unit vertically then one unit horizontally in 1 second).
-
-
-
You have to visit the points in the same order as they appear in the array.
-
You are allowed to pass through points that appear later in the order, but these do not count as visits.
-
-
-
-
Example 1:
-
-
-Input: points = [[1,1],[3,4],[-1,0]]
-Output: 7
-Explanation: One optimal path is [1,1] -> [2,2] -> [3,3] -> [3,4] -> [2,3] -> [1,2] -> [0,1] -> [-1,0]
-Time from [1,1] to [3,4] = 3 seconds
-Time from [3,4] to [-1,0] = 4 seconds
-Total time = 7 seconds
-
-
Example 2:
-
-
-Input: points = [[3,2],[-2,2]]
-Output: 5
-
-
-
-
Constraints:
-
-
-
points.length == n
-
1 <= n <= 100
-
points[i].length == 2
-
-1000 <= points[i][0], points[i][1] <= 1000
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Math](../../tag/math/README.md)]
- [[Geometry](../../tag/geometry/README.md)]
-
-### Hints
-
-Hint 1
-To walk from point A to point B there will be an optimal strategy to walk ?
-
-
-
-Hint 2
-Advance in diagonal as possible then after that go in straight line.
-
-
-
-Hint 3
-Repeat the process until visiting all the points.
-
diff --git a/problems/minimum-total-space-wasted-with-k-resizing-operations/README.md b/problems/minimum-total-space-wasted-with-k-resizing-operations/README.md
deleted file mode 100644
index 38cc07a1b..000000000
--- a/problems/minimum-total-space-wasted-with-k-resizing-operations/README.md
+++ /dev/null
@@ -1,75 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../check-if-move-is-legal "Check if Move is Legal")
-
-[Next >](../maximum-product-of-the-length-of-two-palindromic-substrings "Maximum Product of the Length of Two Palindromic Substrings")
-
-## [1959. Minimum Total Space Wasted With K Resizing Operations (Medium)](https://leetcode.com/problems/minimum-total-space-wasted-with-k-resizing-operations "K 次调整数组大小浪费的最小总空间")
-
-
You are currently designing a dynamic array. You are given a 0-indexed integer array nums, where nums[i] is the number of elements that will be in the array at time i. In addition, you are given an integer k, the maximum number of times you can resize the array (to any size).
-
-
The size of the array at time t, sizet, must be at least nums[t] because there needs to be enough space in the array to hold all the elements. The space wasted at time t is defined as sizet - nums[t], and the total space wasted is the sum of the space wasted across every time t where 0 <= t < nums.length.
-
-
Return the minimumtotal space wasted if you can resize the array at mostktimes.
-
-
Note: The array can have any size at the start and does not count towards the number of resizing operations.
-
-
-
Example 1:
-
-
-Input: nums = [10,20], k = 0
-Output: 10
-Explanation: size = [20,20].
-We can set the initial size to be 20.
-The total wasted space is (20 - 10) + (20 - 20) = 10.
-
-
-
Example 2:
-
-
-Input: nums = [10,20,30], k = 1
-Output: 10
-Explanation: size = [20,20,30].
-We can set the initial size to be 20 and resize to 30 at time 2.
-The total wasted space is (20 - 10) + (20 - 20) + (30 - 30) = 10.
-
-
-
Example 3:
-
-
-Input: nums = [10,20,15,30,20], k = 2
-Output: 15
-Explanation: size = [10,20,20,30,30].
-We can set the initial size to 10, resize to 20 at time 1, and resize to 30 at time 3.
-The total wasted space is (10 - 10) + (20 - 20) + (20 - 15) + (30 - 30) + (30 - 20) = 15.
-
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 200
-
1 <= nums[i] <= 106
-
0 <= k <= nums.length - 1
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Hints
-
-Hint 1
-Given a range, how can you find the minimum waste if you can't perform any resize operations?
-
-
-
-Hint 2
-Can we build our solution using dynamic programming using the current index and the number of resizing operations performed as the states?
-
diff --git a/problems/minimum-unique-word-abbreviation/README.md b/problems/minimum-unique-word-abbreviation/README.md
deleted file mode 100644
index a92e70f32..000000000
--- a/problems/minimum-unique-word-abbreviation/README.md
+++ /dev/null
@@ -1,46 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../split-array-largest-sum "Split Array Largest Sum")
-
-[Next >](../fizz-buzz "Fizz Buzz")
-
-## [411. Minimum Unique Word Abbreviation (Hard)](https://leetcode.com/problems/minimum-unique-word-abbreviation "最短独占单词缩写")
-
-
A string such as "word" contains the following abbreviations:
Given a target string and a set of strings in a dictionary, find an abbreviation of this target string with the smallest possible length such that it does not conflict with abbreviations of the strings in the dictionary.
-
-
Each number or letter in the abbreviation is considered length = 1. For example, the abbreviation "a32bc" has length = 4.
-
-
Note:
-
-
In the case of multiple answers as shown in the second example below, you may return any one of them.
-
Assume length of target string = m, and dictionary size = n. You may assume that m ≤ 21, n ≤ 1000, and log2(n) + m ≤ 20.
-
-
-
-
Examples:
-
-"apple", ["blade"] -> "a4" (because "5" or "4e" conflicts with "blade")
-
-"apple", ["plain", "amber", "blade"] -> "1p3" (other valid answers include "ap3", "a3e", "2p2", "3le", "3l1").
-
-
-
-### Related Topics
- [[Bit Manipulation](../../tag/bit-manipulation/README.md)]
- [[String](../../tag/string/README.md)]
- [[Backtracking](../../tag/backtracking/README.md)]
-
-### Similar Questions
- 1. [Generalized Abbreviation](../generalized-abbreviation) (Medium)
- 1. [Valid Word Abbreviation](../valid-word-abbreviation) (Easy)
- 1. [Word Abbreviation](../word-abbreviation) (Hard)
diff --git a/problems/minimum-unique-word-abbreviation/minimum_unique_word_abbreviation.go b/problems/minimum-unique-word-abbreviation/minimum_unique_word_abbreviation.go
deleted file mode 100644
index 8468f6bda..000000000
--- a/problems/minimum-unique-word-abbreviation/minimum_unique_word_abbreviation.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem411
diff --git a/problems/minimum-unique-word-abbreviation/minimum_unique_word_abbreviation_test.go b/problems/minimum-unique-word-abbreviation/minimum_unique_word_abbreviation_test.go
deleted file mode 100644
index 8468f6bda..000000000
--- a/problems/minimum-unique-word-abbreviation/minimum_unique_word_abbreviation_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem411
diff --git a/problems/minimum-value-to-get-positive-step-by-step-sum/README.md b/problems/minimum-value-to-get-positive-step-by-step-sum/README.md
deleted file mode 100644
index 9d3ae86dc..000000000
--- a/problems/minimum-value-to-get-positive-step-by-step-sum/README.md
+++ /dev/null
@@ -1,67 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../find-the-quiet-students-in-all-exams "Find the Quiet Students in All Exams")
-
-[Next >](../find-the-minimum-number-of-fibonacci-numbers-whose-sum-is-k "Find the Minimum Number of Fibonacci Numbers Whose Sum Is K")
-
-## [1413. Minimum Value to Get Positive Step by Step Sum (Easy)](https://leetcode.com/problems/minimum-value-to-get-positive-step-by-step-sum "逐步求和得到正数的最小值")
-
-
Given an array of integers nums, you start with an initial positive value startValue.
-
-
In each iteration, you calculate the step by step sum of startValue plus elements in nums (from left to right).
-
-
Return the minimum positive value of startValue such that the step by step sum is never less than 1.
-
-
-
Example 1:
-
-
-Input: nums = [-3,2,-3,4,2]
-Output: 5
-Explanation: If you choose startValue = 4, in the third iteration your step by step sum is less than 1.
-step by step sum
-startValue = 4 | startValue = 5 | nums
- (4 -3 ) = 1 | (5 -3 ) = 2 | -3
- (1 +2 ) = 3 | (2 +2 ) = 4 | 2
- (3 -3 ) = 0 | (4 -3 ) = 1 | -3
- (0 +4 ) = 4 | (1 +4 ) = 5 | 4
- (4 +2 ) = 6 | (5 +2 ) = 7 | 2
-
-
-
Example 2:
-
-
-Input: nums = [1,2]
-Output: 1
-Explanation: Minimum start value should be positive.
-
Given strings S and T, find the minimum (contiguous) substringW of S, so that T is a subsequence of W.
-
-
If there is no such window in S that covers all characters in T, return the empty string "". If there are multiple such minimum-length windows, return the one with the left-most starting index.
-
-
Example 1:
-
-
-Input:
-S = "abcdebdde", T = "bde"
-Output: "bcde"
-Explanation:
-"bcde" is the answer because it occurs before "bdde" which has the same length.
-"deb" is not a smaller window because the elements of T in the window must occur in order.
-
-
-
-
-
Note:
-
-
-
All the strings in the input will only contain lowercase letters.
-
The length of S will be in the range [1, 20000].
-
The length of T will be in the range [1, 100].
-
-
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Sliding Window](../../tag/sliding-window/README.md)]
-
-### Similar Questions
- 1. [Minimum Window Substring](../minimum-window-substring) (Hard)
- 1. [Longest Continuous Increasing Subsequence](../longest-continuous-increasing-subsequence) (Easy)
-
-### Hints
-
-Hint 1
-Let dp[j][e] = s be the largest index for which S[s:e+1] has T[:j] as a substring.
-
diff --git a/problems/minimum-window-subsequence/minimum_window_subsequence.go b/problems/minimum-window-subsequence/minimum_window_subsequence.go
deleted file mode 100644
index 5d5b50741..000000000
--- a/problems/minimum-window-subsequence/minimum_window_subsequence.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem727
diff --git a/problems/minimum-window-subsequence/minimum_window_subsequence_test.go b/problems/minimum-window-subsequence/minimum_window_subsequence_test.go
deleted file mode 100644
index 5d5b50741..000000000
--- a/problems/minimum-window-subsequence/minimum_window_subsequence_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem727
diff --git a/problems/minimum-window-substring/README.md b/problems/minimum-window-substring/README.md
deleted file mode 100644
index 8fd505163..000000000
--- a/problems/minimum-window-substring/README.md
+++ /dev/null
@@ -1,89 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../sort-colors "Sort Colors")
-
-[Next >](../combinations "Combinations")
-
-## [76. Minimum Window Substring (Hard)](https://leetcode.com/problems/minimum-window-substring "最小覆盖子串")
-
-
Given two strings s and t of lengths m and n respectively, return the minimum window substring of s such that every character in t (including duplicates) is included in the window. If there is no such substring, return the empty string "".
-
-
The testcases will be generated such that the answer is unique.
-
-
A substring is a contiguous sequence of characters within the string.
-
-
-
Example 1:
-
-
-Input: s = "ADOBECODEBANC", t = "ABC"
-Output: "BANC"
-Explanation: The minimum window substring "BANC" includes 'A', 'B', and 'C' from string t.
-
-
-
Example 2:
-
-
-Input: s = "a", t = "a"
-Output: "a"
-Explanation: The entire string s is the minimum window.
-
-
-
Example 3:
-
-
-Input: s = "a", t = "aa"
-Output: ""
-Explanation: Both 'a's from t must be included in the window.
-Since the largest window of s only has one 'a', return empty string.
-
-
-
-
Constraints:
-
-
-
m == s.length
-
n == t.length
-
1 <= m, n <= 105
-
s and t consist of uppercase and lowercase English letters.
-
-
-
-Follow up: Could you find an algorithm that runs in O(m + n) time?
-
-### Related Topics
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
- [[Sliding Window](../../tag/sliding-window/README.md)]
-
-### Similar Questions
- 1. [Substring with Concatenation of All Words](../substring-with-concatenation-of-all-words) (Hard)
- 1. [Minimum Size Subarray Sum](../minimum-size-subarray-sum) (Medium)
- 1. [Sliding Window Maximum](../sliding-window-maximum) (Hard)
- 1. [Permutation in String](../permutation-in-string) (Medium)
- 1. [Smallest Range Covering Elements from K Lists](../smallest-range-covering-elements-from-k-lists) (Hard)
- 1. [Minimum Window Subsequence](../minimum-window-subsequence) (Hard)
-
-### Hints
-
-Hint 1
-Use two pointers to create a window of letters in S, which would have all the characters from T.
-
-
-
-Hint 2
-Since you have to find the minimum window in S which has all the characters from T, you need to expand and contract the window using the two pointers and keep checking the window for all the characters. This approach is also called Sliding Window Approach.
-
-
-
-L ------------------------ R , Suppose this is the window that contains all characters of T
-
-        L----------------- R , this is the contracted window. We found a smaller window that still contains all the characters in T
-
-When the window is no longer valid, start expanding again using the right pointer.
-
diff --git a/problems/minimum-window-substring/minimum_window_substring.go b/problems/minimum-window-substring/minimum_window_substring.go
deleted file mode 100644
index 74ba15354..000000000
--- a/problems/minimum-window-substring/minimum_window_substring.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem76
diff --git a/problems/minimum-window-substring/minimum_window_substring_test.go b/problems/minimum-window-substring/minimum_window_substring_test.go
deleted file mode 100644
index 74ba15354..000000000
--- a/problems/minimum-window-substring/minimum_window_substring_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem76
diff --git a/problems/minimum-xor-sum-of-two-arrays/README.md b/problems/minimum-xor-sum-of-two-arrays/README.md
deleted file mode 100644
index e2aefc089..000000000
--- a/problems/minimum-xor-sum-of-two-arrays/README.md
+++ /dev/null
@@ -1,69 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../get-biggest-three-rhombus-sums-in-a-grid "Get Biggest Three Rhombus Sums in a Grid")
-
-[Next >](../check-if-word-equals-summation-of-two-words "Check if Word Equals Summation of Two Words")
-
-## [1879. Minimum XOR Sum of Two Arrays (Hard)](https://leetcode.com/problems/minimum-xor-sum-of-two-arrays "两个数组最小的异或值之和")
-
-
You are given two integer arrays nums1 and nums2 of length n.
-
-
The XOR sum of the two integer arrays is (nums1[0] XOR nums2[0]) + (nums1[1] XOR nums2[1]) + ... + (nums1[n - 1] XOR nums2[n - 1]) (0-indexed).
-
-
-
For example, the XOR sum of [1,2,3] and [3,2,1] is equal to (1 XOR 3) + (2 XOR 2) + (3 XOR 1) = 2 + 0 + 2 = 4.
-
-
-
Rearrange the elements of nums2 such that the resulting XOR sum is minimized.
-
-
Return the XOR sum after the rearrangement.
-
-
-
Example 1:
-
-
-Input: nums1 = [1,2], nums2 = [2,3]
-Output: 2
-Explanation: Rearrange nums2 so that it becomes [3,2].
-The XOR sum is (1 XOR 3) + (2 XOR 2) = 2 + 0 = 2.
-
-
Example 2:
-
-
-Input: nums1 = [1,0,3], nums2 = [5,3,4]
-Output: 8
-Explanation: Rearrange nums2 so that it becomes [5,4,3].
-The XOR sum is (1 XOR 5) + (0 XOR 4) + (3 XOR 3) = 4 + 4 + 0 = 8.
-
-
-
-
Constraints:
-
-
-
n == nums1.length
-
n == nums2.length
-
1 <= n <= 14
-
0 <= nums1[i], nums2[i] <= 107
-
-
-### Related Topics
- [[Bit Manipulation](../../tag/bit-manipulation/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Bitmask](../../tag/bitmask/README.md)]
-
-### Hints
-
-Hint 1
-Since n <= 14, we can consider every subset of nums2.
-
-
-
-Hint 2
-We can represent every subset of nums2 using bitmasks.
-
diff --git a/problems/mirror-reflection/README.md b/problems/mirror-reflection/README.md
deleted file mode 100644
index df9c98dfa..000000000
--- a/problems/mirror-reflection/README.md
+++ /dev/null
@@ -1,47 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-cost-to-hire-k-workers "Minimum Cost to Hire K Workers")
-
-[Next >](../buddy-strings "Buddy Strings")
-
-## [858. Mirror Reflection (Medium)](https://leetcode.com/problems/mirror-reflection "镜面反射")
-
-
There is a special square room with mirrors on each of the four walls. Except for the southwest corner, there are receptors on each of the remaining corners, numbered 0, 1, and 2.
-
-
The square room has walls of length p and a laser ray from the southwest corner first meets the east wall at a distance q from the 0th receptor.
-
-
Given the two integers p and q, return the number of the receptor that the ray meets first.
-
-
The test cases are guaranteed so that the ray will meet a receptor eventually.
-
-
-
Example 1:
-
-
-Input: p = 2, q = 1
-Output: 2
-Explanation: The ray meets receptor 2 the first time it gets reflected back to the left wall.
-
Given a sorted array A of unique numbers, find the K-th missing number starting from the leftmost number of the array.
-
-
-
-
Example 1:
-
-
-Input: A = [4,7,9,10], K = 1
-Output: 5
-Explanation:
-The first missing number is 5.
-
-
-
Example 2:
-
-
-Input: A = [4,7,9,10], K = 3
-Output: 8
-Explanation:
-The missing numbers are [5,6,8,...], hence the third missing number is 8.
-
-
-
Example 3:
-
-
-Input: A = [1,2,4], K = 3
-Output: 6
-Explanation:
-The missing numbers are [3,5,6,7,...], hence the third missing number is 6.
-
-
-
-
-
Note:
-
-
-
1 <= A.length <= 50000
-
1 <= A[i] <= 1e7
-
1 <= K <= 1e8
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
-
-### Hints
-
-Hint 1
-First define a function f(x) that counts the number of missing elements until x.
-
-
-
-Hint 2
-Then use binary search with the given function f(x) to find the kth missing element.
-
diff --git a/problems/missing-number-in-arithmetic-progression/README.md b/problems/missing-number-in-arithmetic-progression/README.md
deleted file mode 100644
index 26c0e9499..000000000
--- a/problems/missing-number-in-arithmetic-progression/README.md
+++ /dev/null
@@ -1,62 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../airplane-seat-assignment-probability "Airplane Seat Assignment Probability")
-
-[Next >](../meeting-scheduler "Meeting Scheduler")
-
-## [1228. Missing Number In Arithmetic Progression (Easy)](https://leetcode.com/problems/missing-number-in-arithmetic-progression "等差数列中缺失的数字")
-
-
In some array arr, the values were in arithmetic progression: the values arr[i+1] - arr[i] are all equal for every 0 <= i < arr.length - 1.
-
-
Then, a value from arr was removed that was not the first or last value in the array.
-
-
Return the removed value.
-
-
-
Example 1:
-
-
-Input: arr = [5,7,11,13]
-Output: 9
-Explanation: The previous array was [5,7,9,11,13].
-
-
-
Example 2:
-
-
-Input: arr = [15,13,12]
-Output: 14
-Explanation: The previous array was [15,14,13,12].
-
-
-
Constraints:
-
-
-
3 <= arr.length <= 1000
-
0 <= arr[i] <= 10^5
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Math](../../tag/math/README.md)]
-
-### Hints
-
-Hint 1
-Assume the sequence is increasing, what if we find the largest consecutive difference?
-
-
-
-Hint 2
-Is the missing element in the middle of the segment with the largest consecutive difference?
-
-
-
-Hint 3
-For decreasing sequences, just reverse the array and do a similar process.
-
diff --git a/problems/missing-number/README.md b/problems/missing-number/README.md
deleted file mode 100644
index 6c6174e60..000000000
--- a/problems/missing-number/README.md
+++ /dev/null
@@ -1,66 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../palindrome-permutation-ii "Palindrome Permutation II")
-
-[Next >](../alien-dictionary "Alien Dictionary")
-
-## [268. Missing Number (Easy)](https://leetcode.com/problems/missing-number "丢失的数字")
-
-
Given an array nums containing n distinct numbers in the range [0, n], return the only number in the range that is missing from the array.
-
-
-
Example 1:
-
-
-Input: nums = [3,0,1]
-Output: 2
-Explanation: n = 3 since there are 3 numbers, so all numbers are in the range [0,3]. 2 is the missing number in the range since it does not appear in nums.
-
-
-
Example 2:
-
-
-Input: nums = [0,1]
-Output: 2
-Explanation: n = 2 since there are 2 numbers, so all numbers are in the range [0,2]. 2 is the missing number in the range since it does not appear in nums.
-
-
-
Example 3:
-
-
-Input: nums = [9,6,4,2,3,5,7,0,1]
-Output: 8
-Explanation: n = 9 since there are 9 numbers, so all numbers are in the range [0,9]. 8 is the missing number in the range since it does not appear in nums.
-
-
-
-
Constraints:
-
-
-
n == nums.length
-
1 <= n <= 104
-
0 <= nums[i] <= n
-
All the numbers of nums are unique.
-
-
-
-
Follow up: Could you implement a solution using only O(1) extra space complexity and O(n) runtime complexity?
An integer has monotone increasing digits if and only if each pair of adjacent digits x and y satisfy x <= y.
-
-
Given an integer n, return the largest number that is less than or equal to n with monotone increasing digits.
-
-
-
Example 1:
-
-
-Input: n = 10
-Output: 9
-
-
-
Example 2:
-
-
-Input: n = 1234
-Output: 1234
-
-
-
Example 3:
-
-
-Input: n = 332
-Output: 299
-
-
-
-
Constraints:
-
-
-
0 <= n <= 109
-
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[Math](../../tag/math/README.md)]
-
-### Similar Questions
- 1. [Remove K Digits](../remove-k-digits) (Medium)
-
-### Hints
-
-Hint 1
-Build the answer digit by digit, adding the largest possible one that would make the number still less than or equal to N.
-
diff --git a/problems/monotone-increasing-digits/monotone_increasing_digits.go b/problems/monotone-increasing-digits/monotone_increasing_digits.go
deleted file mode 100644
index 5083ea4d6..000000000
--- a/problems/monotone-increasing-digits/monotone_increasing_digits.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem738
diff --git a/problems/monotone-increasing-digits/monotone_increasing_digits_test.go b/problems/monotone-increasing-digits/monotone_increasing_digits_test.go
deleted file mode 100644
index 5083ea4d6..000000000
--- a/problems/monotone-increasing-digits/monotone_increasing_digits_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem738
diff --git a/problems/monotonic-array/README.md b/problems/monotonic-array/README.md
deleted file mode 100644
index 4c0ca297e..000000000
--- a/problems/monotonic-array/README.md
+++ /dev/null
@@ -1,46 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-frequency-stack "Maximum Frequency Stack")
-
-[Next >](../increasing-order-search-tree "Increasing Order Search Tree")
-
-## [896. Monotonic Array (Easy)](https://leetcode.com/problems/monotonic-array "单调数列")
-
-
An array is monotonic if it is either monotone increasing or monotone decreasing.
-
-
An array nums is monotone increasing if for all i <= j, nums[i] <= nums[j]. An array nums is monotone decreasing if for all i <= j, nums[i] >= nums[j].
-
-
Given an integer array nums, return true if the given array is monotonic, or false otherwise.
-+---------------+---------+
-| Column Name | Type |
-+---------------+---------+
-| id | int |
-| country | varchar |
-| state | enum |
-| amount | int |
-| trans_date | date |
-+---------------+---------+
-id is the primary key of this table.
-The table has information about incoming transactions.
-The state column is an enum of type ["approved", "declined"].
-
-
-
-
-
Write an SQL query to find for each month and country, the number of transactions and their total amount, the number of approved transactions and their total amount.
-
-
The query result format is in the following example:
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/monthly-transactions-i/mysql_schemas.sql b/problems/monthly-transactions-i/mysql_schemas.sql
deleted file mode 100644
index f46d70e2f..000000000
--- a/problems/monthly-transactions-i/mysql_schemas.sql
+++ /dev/null
@@ -1,6 +0,0 @@
-Create table If Not Exists Transactions (id int, country varchar(4), state enum('approved', 'declined'), amount int, trans_date date);
-Truncate table Transactions;
-insert into Transactions (id, country, state, amount, trans_date) values ('121', 'US', 'approved', '1000', '2018-12-18');
-insert into Transactions (id, country, state, amount, trans_date) values ('122', 'US', 'declined', '2000', '2018-12-19');
-insert into Transactions (id, country, state, amount, trans_date) values ('123', 'US', 'approved', '2000', '2019-01-01');
-insert into Transactions (id, country, state, amount, trans_date) values ('124', 'DE', 'approved', '2000', '2019-01-07');
diff --git a/problems/monthly-transactions-ii/README.md b/problems/monthly-transactions-ii/README.md
deleted file mode 100644
index 8662b3c72..000000000
--- a/problems/monthly-transactions-ii/README.md
+++ /dev/null
@@ -1,87 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../last-person-to-fit-in-the-bus "Last Person to Fit in the Bus")
-
-[Next >](../design-skiplist "Design Skiplist")
-
-## [1205. Monthly Transactions II (Medium)](https://leetcode.com/problems/monthly-transactions-ii "每月交易II")
-
-
Table: Transactions
-
-
-+----------------+---------+
-| Column Name | Type |
-+----------------+---------+
-| id | int |
-| country | varchar |
-| state | enum |
-| amount | int |
-| trans_date | date |
-+----------------+---------+
-id is the primary key of this table.
-The table has information about incoming transactions.
-The state column is an enum of type ["approved", "declined"].
-
-
-
Table: Chargebacks
-
-
-+----------------+---------+
-| Column Name | Type |
-+----------------+---------+
-| trans_id | int |
-| charge_date | date |
-+----------------+---------+
-Chargebacks contains basic information regarding incoming chargebacks from some transactions placed in Transactions table.
-trans_id is a foreign key to the id column of Transactions table.
-Each chargeback corresponds to a transaction made previously even if they were not approved.
-
-
-
-
Write an SQL query to find for each month and country, the number of approved transactions and their total amount, the number of chargebacks and their total amount.
-
-
Note: In your query, given the month and country, ignore rows with all zeros.
-
-
The query result format is in the following example:
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
-
-### Similar Questions
- 1. [Monthly Transactions I](../monthly-transactions-i) (Medium)
diff --git a/problems/monthly-transactions-ii/mysql_schemas.sql b/problems/monthly-transactions-ii/mysql_schemas.sql
deleted file mode 100644
index d73b157c0..000000000
--- a/problems/monthly-transactions-ii/mysql_schemas.sql
+++ /dev/null
@@ -1,14 +0,0 @@
-Create table If Not Exists Transactions (id int, country varchar(4), state enum('approved', 'declined'), amount int, trans_date date)
-;
-Create table If Not Exists Chargebacks (trans_id int, trans_date date)
-;
-Truncate table Transactions;
-insert into Transactions (id, country, state, amount, trans_date) values ('101', 'US', 'approved', '1000', '2019-05-18');
-insert into Transactions (id, country, state, amount, trans_date) values ('102', 'US', 'declined', '2000', '2019-05-19');
-insert into Transactions (id, country, state, amount, trans_date) values ('103', 'US', 'approved', '3000', '2019-06-10');
-insert into Transactions (id, country, state, amount, trans_date) values ('104', 'US', 'declined', '4000', '2019-06-13');
-insert into Transactions (id, country, state, amount, trans_date) values ('105', 'US', 'approved', '5000', '2019-06-15');
-Truncate table Chargebacks;
-insert into Chargebacks (trans_id, trans_date) values ('102', '2019-05-29');
-insert into Chargebacks (trans_id, trans_date) values ('101', '2019-06-30');
-insert into Chargebacks (trans_id, trans_date) values ('105', '2019-09-18');
diff --git a/problems/most-beautiful-item-for-each-query/README.md b/problems/most-beautiful-item-for-each-query/README.md
deleted file mode 100644
index 4322b3b80..000000000
--- a/problems/most-beautiful-item-for-each-query/README.md
+++ /dev/null
@@ -1,79 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../walking-robot-simulation-ii "Walking Robot Simulation II")
-
-[Next >](../maximum-number-of-tasks-you-can-assign "Maximum Number of Tasks You Can Assign")
-
-## [2070. Most Beautiful Item for Each Query (Medium)](https://leetcode.com/problems/most-beautiful-item-for-each-query "每一个查询的最大美丽值")
-
-
You are given a 2D integer array items where items[i] = [pricei, beautyi] denotes the price and beauty of an item respectively.
-
-
You are also given a 0-indexed integer array queries. For each queries[j], you want to determine the maximum beauty of an item whose price is less than or equal to queries[j]. If no such item exists, then the answer to this query is 0.
-
-
Return an array answer of the same length as queries where answer[j] is the answer to the jth query.
-
-
-
Example 1:
-
-
-Input: items = [[1,2],[3,2],[2,4],[5,6],[3,5]], queries = [1,2,3,4,5,6]
-Output: [2,4,5,5,6,6]
-Explanation:
-- For queries[0]=1, [1,2] is the only item which has price <= 1. Hence, the answer for this query is 2.
-- For queries[1]=2, the items which can be considered are [1,2] and [2,4].
- The maximum beauty among them is 4.
-- For queries[2]=3 and queries[3]=4, the items which can be considered are [1,2], [3,2], [2,4], and [3,5].
- The maximum beauty among them is 5.
-- For queries[4]=5 and queries[5]=6, all items can be considered.
- Hence, the answer for them is the maximum beauty of all items, i.e., 6.
-
-
-
Example 2:
-
-
-Input: items = [[1,2],[1,2],[1,3],[1,4]], queries = [1]
-Output: [4]
-Explanation:
-The price of every item is equal to 1, so we choose the item with the maximum beauty 4.
-Note that multiple items can have the same price and/or beauty.
-
-
-
Example 3:
-
-
-Input: items = [[10,1000]], queries = [5]
-Output: [0]
-Explanation:
-No item has a price less than or equal to 5, so no item can be chosen.
-Hence, the answer to the query is 0.
-
-
-
-
Constraints:
-
-
-
1 <= items.length, queries.length <= 105
-
items[i].length == 2
-
1 <= pricei, beautyi, queries[j] <= 109
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Hints
-
-Hint 1
-Can we process the queries in a smart order to avoid repeatedly checking the same items?
-
-
-
-Hint 2
-How can we use the answer to a query for other queries?
-
diff --git a/problems/most-common-word/README.md b/problems/most-common-word/README.md
deleted file mode 100644
index 2d6aeb918..000000000
--- a/problems/most-common-word/README.md
+++ /dev/null
@@ -1,52 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../race-car "Race Car")
-
-[Next >](../short-encoding-of-words "Short Encoding of Words")
-
-## [819. Most Common Word (Easy)](https://leetcode.com/problems/most-common-word "最常见的单词")
-
-
Given a string paragraph and a string array of the banned words banned, return the most frequent word that is not banned. It is guaranteed there is at least one word that is not banned, and that the answer is unique.
-
-
The words in paragraph are case-insensitive and the answer should be returned in lowercase.
-
-
-
Example 1:
-
-
-Input: paragraph = "Bob hit a ball, the hit BALL flew far after it was hit.", banned = ["hit"]
-Output: "ball"
-Explanation:
-"hit" occurs 3 times, but it is a banned word.
-"ball" occurs twice (and no other word does), so it is the most frequent non-banned word in the paragraph.
-Note that words in the paragraph are not case sensitive,
-that punctuation is ignored (even if adjacent to words, such as "ball,"),
-and that "hit" isn't the answer even though it occurs more because it is banned.
-
-
-
Example 2:
-
-
-Input: paragraph = "a.", banned = []
-Output: "a"
-
-
-
-
Constraints:
-
-
-
1 <= paragraph.length <= 1000
-
paragraph consists of English letters, space ' ', or one of the symbols: "!?',;.".
-
0 <= banned.length <= 100
-
1 <= banned[i].length <= 10
-
banned[i] consists of only lowercase English letters.
-
-
-### Related Topics
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
diff --git a/problems/most-common-word/most_common_word.go b/problems/most-common-word/most_common_word.go
deleted file mode 100644
index f8f4aa9af..000000000
--- a/problems/most-common-word/most_common_word.go
+++ /dev/null
@@ -1,30 +0,0 @@
-package problem819
-
-import (
- "regexp"
- "strings"
-)
-
-func mostCommonWord(paragraph string, banned []string) string {
- words := make([]string, 0)
- paragraph = strings.ToLower(paragraph)
- reg := regexp.MustCompile(`[a-z]+`)
- for _, word := range reg.FindAllString(paragraph, -1) {
- words = append(words, word)
- }
- mb := make(map[string]bool)
- for _, ban := range banned {
- mb[ban] = true
- }
- ans, max, count := "", 0, make(map[string]int)
- for _, word := range words {
- if !mb[word] {
- count[word]++
- if count[word] > max {
- max = count[word]
- ans = word
- }
- }
- }
- return ans
-}
diff --git a/problems/most-common-word/most_common_word_test.go b/problems/most-common-word/most_common_word_test.go
deleted file mode 100644
index 25437752f..000000000
--- a/problems/most-common-word/most_common_word_test.go
+++ /dev/null
@@ -1,35 +0,0 @@
-package problem819
-
-import "testing"
-
-type testType struct {
- paragraph string
- banned []string
- want string
-}
-
-func TestMostCommonWord(t *testing.T) {
- tests := [...]testType{
- {
- paragraph: "Bob hit a ball, the hit BALL flew far after it was hit.",
- banned: []string{"hit"},
- want: "ball",
- },
- {
- paragraph: "a, a, a, a, b,b,b,c, c",
- banned: []string{"a"},
- want: "b",
- },
- {
- paragraph: "Bob",
- banned: []string{},
- want: "bob",
- },
- }
- for _, tt := range tests {
- got := mostCommonWord(tt.paragraph, tt.banned)
- if got != tt.want {
- t.Fatalf("in: %v %v, got: %v, want: %v", tt.paragraph, tt.banned, got, tt.want)
- }
- }
-}
diff --git a/problems/most-frequent-subtree-sum/README.md b/problems/most-frequent-subtree-sum/README.md
deleted file mode 100644
index be2cc3453..000000000
--- a/problems/most-frequent-subtree-sum/README.md
+++ /dev/null
@@ -1,49 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../perfect-number "Perfect Number")
-
-[Next >](../fibonacci-number "Fibonacci Number")
-
-## [508. Most Frequent Subtree Sum (Medium)](https://leetcode.com/problems/most-frequent-subtree-sum "出现次数最多的子树元素和")
-
-
Given the root of a binary tree, return the most frequent subtree sum. If there is a tie, return all the values with the highest frequency in any order.
-
-
The subtree sum of a node is defined as the sum of all the node values formed by the subtree rooted at that node (including the node itself).
-
-
-
Example 1:
-
-
-Input: root = [5,2,-3]
-Output: [2,-3,4]
-
-
-
Example 2:
-
-
-Input: root = [5,2,-5]
-Output: [2]
-
-
-
-
Constraints:
-
-
-
The number of nodes in the tree is in the range [1, 104].
-
-105 <= Node.val <= 105
-
-
-### Related Topics
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Tree](../../tag/tree/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Binary Tree](../../tag/binary-tree/README.md)]
-
-### Similar Questions
- 1. [Subtree of Another Tree](../subtree-of-another-tree) (Easy)
- 1. [Count Nodes Equal to Sum of Descendants](../count-nodes-equal-to-sum-of-descendants) (Medium)
diff --git a/problems/most-frequent-subtree-sum/most_frequent_subtree_sum.go b/problems/most-frequent-subtree-sum/most_frequent_subtree_sum.go
deleted file mode 100644
index 7a96419af..000000000
--- a/problems/most-frequent-subtree-sum/most_frequent_subtree_sum.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem508
diff --git a/problems/most-frequent-subtree-sum/most_frequent_subtree_sum_test.go b/problems/most-frequent-subtree-sum/most_frequent_subtree_sum_test.go
deleted file mode 100644
index 7a96419af..000000000
--- a/problems/most-frequent-subtree-sum/most_frequent_subtree_sum_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem508
diff --git a/problems/most-profit-assigning-work/README.md b/problems/most-profit-assigning-work/README.md
deleted file mode 100644
index ff6912b7e..000000000
--- a/problems/most-profit-assigning-work/README.md
+++ /dev/null
@@ -1,61 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../friends-of-appropriate-ages "Friends Of Appropriate Ages")
-
-[Next >](../making-a-large-island "Making A Large Island")
-
-## [826. Most Profit Assigning Work (Medium)](https://leetcode.com/problems/most-profit-assigning-work "安排工作以达到最大收益")
-
-
You have n jobs and m workers. You are given three arrays: difficulty, profit, and worker where:
-
-
-
difficulty[i] and profit[i] are the difficulty and the profit of the ith job, and
-
worker[j] is the ability of jth worker (i.e., the jth worker can only complete a job with difficulty at most worker[j]).
-
-
-
Every worker can be assigned at most one job, but one job can be completed multiple times.
-
-
-
For example, if three workers attempt the same job that pays $1, then the total profit will be $3. If a worker cannot complete any job, their profit is $0.
-
-
-
Return the maximum profit we can achieve after assigning the workers to the jobs.
-
-
-
Example 1:
-
-
-Input: difficulty = [2,4,6,8,10], profit = [10,20,30,40,50], worker = [4,5,6,7]
-Output: 100
-Explanation: Workers are assigned jobs of difficulty [4,4,6,6] and they get a profit of [20,20,30,30] separately.
-
On a 2D plane, we place n stones at some integer coordinate points. Each coordinate point may have at most one stone.
-
-
A stone can be removed if it shares either the same row or the same column as another stone that has not been removed.
-
-
Given an array stones of length n where stones[i] = [xi, yi] represents the location of the ith stone, return the largest possible number of stones that can be removed.
-
-
-
Example 1:
-
-
-Input: stones = [[0,0],[0,1],[1,0],[1,2],[2,1],[2,2]]
-Output: 5
-Explanation: One way to remove 5 stones is as follows:
-1. Remove stone [2,2] because it shares the same row as [2,1].
-2. Remove stone [2,1] because it shares the same column as [0,1].
-3. Remove stone [1,2] because it shares the same row as [1,0].
-4. Remove stone [1,0] because it shares the same column as [0,0].
-5. Remove stone [0,1] because it shares the same row as [0,0].
-Stone [0,0] cannot be removed since it does not share a row/column with another stone still on the plane.
-
-
-
Example 2:
-
-
-Input: stones = [[0,0],[0,2],[1,1],[2,0],[2,2]]
-Output: 3
-Explanation: One way to make 3 moves is as follows:
-1. Remove stone [2,2] because it shares the same row as [2,0].
-2. Remove stone [2,0] because it shares the same column as [0,0].
-3. Remove stone [0,2] because it shares the same row as [0,0].
-Stones [0,0] and [1,1] cannot be removed since they do not share a row/column with another stone still on the plane.
-
-
-
Example 3:
-
-
-Input: stones = [[0,0]]
-Output: 0
-Explanation: [0,0] is the only stone on the plane, so you cannot remove it.
-
-
-
-
Constraints:
-
-
-
1 <= stones.length <= 1000
-
0 <= xi, yi <= 104
-
No two stones are at the same coordinate point.
-
-
-### Related Topics
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Union Find](../../tag/union-find/README.md)]
- [[Graph](../../tag/graph/README.md)]
diff --git a/problems/most-stones-removed-with-same-row-or-column/most_stones_removed_with_same_row_or_column.go b/problems/most-stones-removed-with-same-row-or-column/most_stones_removed_with_same_row_or_column.go
deleted file mode 100644
index 3af3ac94e..000000000
--- a/problems/most-stones-removed-with-same-row-or-column/most_stones_removed_with_same_row_or_column.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem947
diff --git a/problems/most-stones-removed-with-same-row-or-column/most_stones_removed_with_same_row_or_column_test.go b/problems/most-stones-removed-with-same-row-or-column/most_stones_removed_with_same_row_or_column_test.go
deleted file mode 100644
index 3af3ac94e..000000000
--- a/problems/most-stones-removed-with-same-row-or-column/most_stones_removed_with_same_row_or_column_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem947
diff --git a/problems/most-visited-sector-in-a-circular-track/README.md b/problems/most-visited-sector-in-a-circular-track/README.md
deleted file mode 100644
index dde19d99c..000000000
--- a/problems/most-visited-sector-in-a-circular-track/README.md
+++ /dev/null
@@ -1,68 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../detect-cycles-in-2d-grid "Detect Cycles in 2D Grid")
-
-[Next >](../maximum-number-of-coins-you-can-get "Maximum Number of Coins You Can Get")
-
-## [1560. Most Visited Sector in a Circular Track (Easy)](https://leetcode.com/problems/most-visited-sector-in-a-circular-track "圆形赛道上经过次数最多的扇区")
-
-
Given an integer n and an integer array rounds. We have a circular track which consists of n sectors labeled from 1 to n. A marathon will be held on this track, the marathon consists of m rounds. The ith round starts at sector rounds[i - 1] and ends at sector rounds[i]. For example, round 1 starts at sector rounds[0] and ends at sector rounds[1]
-
-
Return an array of the most visited sectors sorted in ascending order.
-
-
Notice that you circulate the track in ascending order of sector numbers in the counter-clockwise direction (See the first example).
-
-
-
Example 1:
-
-
-Input: n = 4, rounds = [1,3,1,2]
-Output: [1,2]
-Explanation: The marathon starts at sector 1. The order of the visited sectors is as follows:
-1 --> 2 --> 3 (end of round 1) --> 4 --> 1 (end of round 2) --> 2 (end of round 3 and the marathon)
-We can see that both sectors 1 and 2 are visited twice and they are the most visited sectors. Sectors 3 and 4 are visited only once.
-
-
Example 2:
-
-
-Input: n = 2, rounds = [2,1,2,1,2,1,2,1,2]
-Output: [2]
-
-
-
Example 3:
-
-
-Input: n = 7, rounds = [1,3,5,7]
-Output: [1,2,3,4,5,6,7]
-
-
-
-
Constraints:
-
-
-
2 <= n <= 100
-
1 <= m <= 100
-
rounds.length == m + 1
-
1 <= rounds[i] <= n
-
rounds[i] != rounds[i + 1] for 0 <= i < m
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Simulation](../../tag/simulation/README.md)]
-
-### Hints
-
-Hint 1
-For each round increment the visits of the sectors visited during the marathon with 1.
-
-
-
-Hint 2
-Determine the max number of visits, and return any sector visited the max number of visits.
-
diff --git a/problems/move-sub-tree-of-n-ary-tree/README.md b/problems/move-sub-tree-of-n-ary-tree/README.md
deleted file mode 100644
index a6afdc459..000000000
--- a/problems/move-sub-tree-of-n-ary-tree/README.md
+++ /dev/null
@@ -1,37 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../best-position-for-a-service-centre "Best Position for a Service Centre")
-
-[Next >](../find-users-with-valid-e-mails "Find Users With Valid E-Mails")
-
-## [1516. Move Sub-Tree of N-Ary Tree (Hard)](https://leetcode.com/problems/move-sub-tree-of-n-ary-tree "移动 N 叉树的子树")
-
-
-
-### Related Topics
- [[Tree](../../tag/tree/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
-
-### Similar Questions
- 1. [Find Root of N-Ary Tree](../find-root-of-n-ary-tree) (Medium)
-
-### Hints
-
-Hint 1
-Disconnect node p from its parent and append it to the children list of node q.
-
-
-
-Hint 2
-If q was in the sub-tree of node p (case 1), get the parent node of p and replace p in its children list with q.
-
-
-
-Hint 3
-If p was the root of the tree, make q the root of the tree.
-
diff --git a/problems/move-zeroes/README.md b/problems/move-zeroes/README.md
deleted file mode 100644
index 78420e9e4..000000000
--- a/problems/move-zeroes/README.md
+++ /dev/null
@@ -1,53 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../expression-add-operators "Expression Add Operators")
-
-[Next >](../peeking-iterator "Peeking Iterator")
-
-## [283. Move Zeroes (Easy)](https://leetcode.com/problems/move-zeroes "移动零")
-
-
Given an integer array nums, move all 0's to the end of it while maintaining the relative order of the non-zero elements.
-
-
Note that you must do this in-place without making a copy of the array.
-Follow up: Could you minimize the total number of operations done?
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Two Pointers](../../tag/two-pointers/README.md)]
-
-### Similar Questions
- 1. [Remove Element](../remove-element) (Easy)
-
-### Hints
-
-Hint 1
-In-place means we should not be allocating any space for extra array. But we are allowed to modify the existing array. However, as a first step, try coming up with a solution that makes use of additional space. For this problem as well, first apply the idea discussed using an additional array and the in-place solution will pop up eventually.
-
-
-
-Hint 2
-A two-pointer approach could be helpful here. The idea would be to have one pointer for iterating the array and another pointer that just works on the non-zero elements of the array.
-
diff --git a/problems/move-zeroes/move_zeroes.go b/problems/move-zeroes/move_zeroes.go
deleted file mode 100644
index f170ed9bc..000000000
--- a/problems/move-zeroes/move_zeroes.go
+++ /dev/null
@@ -1,14 +0,0 @@
-package problem283
-
-func moveZeroes(nums []int) {
- insertAt := 0
- for i, v := range nums {
- if v != 0 {
- if i != insertAt {
- nums[insertAt] = v
- nums[i] = 0
- }
- insertAt++
- }
- }
-}
diff --git a/problems/move-zeroes/move_zeroes_test.go b/problems/move-zeroes/move_zeroes_test.go
deleted file mode 100644
index 56f5ea626..000000000
--- a/problems/move-zeroes/move_zeroes_test.go
+++ /dev/null
@@ -1,37 +0,0 @@
-package problem283
-
-import (
- "reflect"
- "testing"
-)
-
-type testType struct {
- in []int
- want []int
-}
-
-func TestMoveZeroes(t *testing.T) {
- tests := [...]testType{
- {
- in: []int{0, 1, 0, 3, 12},
- want: []int{1, 3, 12, 0, 0},
- },
- {
- in: []int{0, 1, 0, 2, 3, 3, 0, 7, 8},
- want: []int{1, 2, 3, 3, 7, 8, 0, 0, 0},
- },
- {
- in: []int{1, 2, 3, 4, 5},
- want: []int{1, 2, 3, 4, 5},
- },
- }
-
- for _, tt := range tests {
- got := make([]int, len(tt.in))
- copy(got, tt.in)
- moveZeroes(got)
- if !reflect.DeepEqual(got, tt.want) {
- t.Fatalf("in: %v, got: %v, want: %v", tt.in, got, tt.want)
- }
- }
-}
diff --git a/problems/movie-rating/README.md b/problems/movie-rating/README.md
deleted file mode 100644
index 92060fa44..000000000
--- a/problems/movie-rating/README.md
+++ /dev/null
@@ -1,109 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../jump-game-v "Jump Game V")
-
-[Next >](../number-of-steps-to-reduce-a-number-to-zero "Number of Steps to Reduce a Number to Zero")
-
-## [1341. Movie Rating (Medium)](https://leetcode.com/problems/movie-rating "电影评分")
-
-
Table: Movies
-
-+---------------+---------+
-| Column Name | Type |
-+---------------+---------+
-| movie_id | int |
-| title | varchar |
-+---------------+---------+
-movie_id is the primary key for this table.
-title is the name of the movie.
-
-
-
Table: Users
-
-+---------------+---------+
-| Column Name | Type |
-+---------------+---------+
-| user_id | int |
-| name | varchar |
-+---------------+---------+
-user_id is the primary key for this table.
-
-
-
Table: Movie_Rating
-
-+---------------+---------+
-| Column Name | Type |
-+---------------+---------+
-| movie_id | int |
-| user_id | int |
-| rating | int |
-| created_at | date |
-+---------------+---------+
-(movie_id, user_id) is the primary key for this table.
-This table contains the rating of a movie by a user in their review.
-created_at is the user's review date.
-
-
-Write the following SQL query:
-
-- Find the name of the user who has rated the greatest number of the movies.
- In case of a tie, return lexicographically smaller user name.
-
-- Find the movie name with the highest average rating as of Feb 2020.
- In case of a tie, return lexicographically smaller movie name..
-
-Query is returned in 2 rows, the query result format is in the folowing example:
-
-Movie table:
-+-------------+--------------+
-| movie_id | title |
-+-------------+--------------+
-| 1 | Avengers |
-| 2 | Frozen 2 |
-| 3 | Joker |
-+-------------+--------------+
-
-Users table:
-+-------------+--------------+
-| user_id | name |
-+-------------+--------------+
-| 1 | Daniel |
-| 2 | Monica |
-| 3 | Maria |
-| 4 | James |
-+-------------+--------------+
-
-Movie_Rating table:
-+-------------+--------------+--------------+-------------+
-| movie_id | user_id | rating | created_at |
-+-------------+--------------+--------------+-------------+
-| 1 | 1 | 3 | 2020-01-12 |
-| 1 | 2 | 4 | 2020-02-11 |
-| 1 | 3 | 2 | 2020-02-12 |
-| 1 | 4 | 1 | 2020-01-01 |
-| 2 | 1 | 5 | 2020-02-17 |
-| 2 | 2 | 2 | 2020-02-01 |
-| 2 | 3 | 2 | 2020-03-01 |
-| 3 | 1 | 3 | 2020-02-22 |
-| 3 | 2 | 4 | 2020-02-25 |
-+-------------+--------------+--------------+-------------+
-
-Result table:
-+--------------+
-| results |
-+--------------+
-| Daniel |
-| Frozen 2 |
-+--------------+
-
-Daniel and Maria have rated 3 movies ("Avengers", "Frozen 2" and "Joker") but Daniel is smaller lexicographically.
-Frozen 2 and Joker have a rating average of 3.5 in February but Frozen 2 is smaller lexicographically.
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/movie-rating/mysql_schemas.sql b/problems/movie-rating/mysql_schemas.sql
deleted file mode 100644
index 7f1cf7c36..000000000
--- a/problems/movie-rating/mysql_schemas.sql
+++ /dev/null
@@ -1,22 +0,0 @@
-Create table If Not Exists Movies (movie_id int, title varchar(30));
-Create table If Not Exists Users (user_id int, name varchar(30));
-Create table If Not Exists MovieRating (movie_id int, user_id int, rating int, created_at date);
-Truncate table Movies;
-insert into Movies (movie_id, title) values ('1', 'Avengers');
-insert into Movies (movie_id, title) values ('2', 'Frozen 2');
-insert into Movies (movie_id, title) values ('3', 'Joker');
-Truncate table Users;
-insert into Users (user_id, name) values ('1', 'Daniel');
-insert into Users (user_id, name) values ('2', 'Monica');
-insert into Users (user_id, name) values ('3', 'Maria');
-insert into Users (user_id, name) values ('4', 'James');
-Truncate table MovieRating;
-insert into MovieRating (movie_id, user_id, rating, created_at) values ('1', '1', '3', '2020-01-12');
-insert into MovieRating (movie_id, user_id, rating, created_at) values ('1', '2', '4', '2020-02-11');
-insert into MovieRating (movie_id, user_id, rating, created_at) values ('1', '3', '2', '2020-02-12');
-insert into MovieRating (movie_id, user_id, rating, created_at) values ('1', '4', '1', '2020-01-01');
-insert into MovieRating (movie_id, user_id, rating, created_at) values ('2', '1', '5', '2020-02-17');
-insert into MovieRating (movie_id, user_id, rating, created_at) values ('2', '2', '2', '2020-02-01');
-insert into MovieRating (movie_id, user_id, rating, created_at) values ('2', '3', '2', '2020-03-01');
-insert into MovieRating (movie_id, user_id, rating, created_at) values ('3', '1', '3', '2020-02-22');
-insert into MovieRating (movie_id, user_id, rating, created_at) values ('3', '2', '4', '2020-02-25');
diff --git a/problems/moving-average-from-data-stream/README.md b/problems/moving-average-from-data-stream/README.md
deleted file mode 100644
index d114871ff..000000000
--- a/problems/moving-average-from-data-stream/README.md
+++ /dev/null
@@ -1,32 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../reverse-vowels-of-a-string "Reverse Vowels of a String")
-
-[Next >](../top-k-frequent-elements "Top K Frequent Elements")
-
-## [346. Moving Average from Data Stream (Easy)](https://leetcode.com/problems/moving-average-from-data-stream "数据流中的移动平均值")
-
-
Given a stream of integers and a window size, calculate the moving average of all integers in the sliding window.
There are some stones in different positions on the X-axis. You are given an integer array stones, the positions of the stones.
-
-
Call a stone an endpoint stone if it has the smallest or largest position. In one move, you pick up an endpoint stone and move it to an unoccupied position so that it is no longer an endpoint stone.
-
-
-
In particular, if the stones are at say, stones = [1,2,5], you cannot move the endpoint stone at position 5, since moving it to any position (such as 0, or 3) will still keep that stone as an endpoint stone.
-
-
-
The game ends when you cannot make any more moves (i.e., the stones are in three consecutive positions).
-
-
Return an integer array answer of length 2 where:
-
-
-
answer[0]is the minimum number of moves you can play, and
-
answer[1]is the maximum number of moves you can play.
-
-
-
-
Example 1:
-
-
-Input: stones = [7,4,9]
-Output: [1,2]
-Explanation: We can move 4 -> 8 for one move to finish the game.
-Or, we can move 9 -> 5, 4 -> 6 for two moves to finish the game.
-
-
-
Example 2:
-
-
-Input: stones = [6,5,4,3,10]
-Output: [2,3]
-Explanation: We can move 3 -> 8 then 10 -> 7 to finish the game.
-Or, we can move 3 -> 7, 4 -> 8, 5 -> 9 to finish the game.
-Notice we cannot move 10 -> 2 to finish the game, because that would be an illegal move.
-
-
-
-
Constraints:
-
-
-
3 <= stones.length <= 104
-
1 <= stones[i] <= 109
-
All the values of stones are unique.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Math](../../tag/math/README.md)]
- [[Two Pointers](../../tag/two-pointers/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Hints
-
-Hint 1
-For the minimum, how many cows are already in place?
-For the maximum, we have to lose either the gap A[1] - A[0] or A[N-1] - A[N-2] (where N = A.length), but every other space can be occupied.
-
diff --git a/problems/moving-stones-until-consecutive-ii/moving_stones_until_consecutive_ii.go b/problems/moving-stones-until-consecutive-ii/moving_stones_until_consecutive_ii.go
deleted file mode 100644
index 542543e1c..000000000
--- a/problems/moving-stones-until-consecutive-ii/moving_stones_until_consecutive_ii.go
+++ /dev/null
@@ -1,42 +0,0 @@
-package problem1040
-
-import "sort"
-
-func numMovesStonesII(stones []int) []int {
- sort.Ints(stones)
- return []int{low(stones), high(stones)}
-}
-
-func high(s []int) int {
- n := len(s)
- return max(s[n-1]-s[1], s[n-2]-s[0]) - n + 2
-}
-
-func low(s []int) int {
- n := len(s)
- // corner case
- if (s[n-2]-s[0] == n-2 && s[n-1]-s[n-2] > 2) ||
- (s[n-1]-s[1] == n-2 && s[1]-s[0] > 2) {
- return 2
- }
- // sliding window is s[i:j]
- width, i, j := 0, 0, 1
- for ; j < n; j++ {
- if s[j]-s[i] < n {
- continue
- }
- width = max(width, j-i)
- i = j
- }
- width = max(width, j-i)
- // finally, all stone move into maxWidth windows
- // so need move n-width stones
- return n - width
-}
-
-func max(a, b int) int {
- if a > b {
- return a
- }
- return b
-}
diff --git a/problems/moving-stones-until-consecutive/README.md b/problems/moving-stones-until-consecutive/README.md
deleted file mode 100644
index ed4929f36..000000000
--- a/problems/moving-stones-until-consecutive/README.md
+++ /dev/null
@@ -1,70 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../stream-of-characters "Stream of Characters")
-
-[Next >](../coloring-a-border "Coloring A Border")
-
-## [1033. Moving Stones Until Consecutive (Medium)](https://leetcode.com/problems/moving-stones-until-consecutive "移动石子直到连续")
-
-
There are three stones in different positions on the X-axis. You are given three integers a, b, and c, the positions of the stones.
-
-
In one move, you pick up a stone at an endpoint (i.e., either the lowest or highest position stone), and move it to an unoccupied position between those endpoints. Formally, let's say the stones are currently at positions x, y, and z with x < y < z. You pick up the stone at either position x or position z, and move that stone to an integer position k, with x < k < z and k != y.
-
-
The game ends when you cannot make any more moves (i.e., the stones are in three consecutive positions).
-
-
Return an integer array answer of length 2 where:
-
-
-
answer[0]is the minimum number of moves you can play, and
-
answer[1]is the maximum number of moves you can play.
-
-
-
-
Example 1:
-
-
-Input: a = 1, b = 2, c = 5
-Output: [1,2]
-Explanation: Move the stone from 5 to 3, or move the stone from 5 to 4 to 3.
-
-
-
Example 2:
-
-
-Input: a = 4, b = 3, c = 2
-Output: [0,0]
-Explanation: We cannot make any moves.
-
-
-
Example 3:
-
-
-Input: a = 3, b = 5, c = 1
-Output: [1,2]
-Explanation: Move the stone from 1 to 4; or move the stone from 1 to 2 to 4.
-
-
-
-
Constraints:
-
-
-
1 <= a, b, c <= 100
-
a, b, and c have different values.
-
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
- [[Brainteaser](../../tag/brainteaser/README.md)]
-
-### Hints
-
-Hint 1
-For the minimum: We can always do it in at most 2 moves, by moving one stone next to another, then the third stone next to the other two. When can we do it in 1 move? 0 moves?
-
-For the maximum: Every move, the maximum position minus the minimum position must decrease by at least 1.
-
diff --git a/problems/moving-stones-until-consecutive/moving_stones_until_consecutive.go b/problems/moving-stones-until-consecutive/moving_stones_until_consecutive.go
deleted file mode 100644
index a703f9756..000000000
--- a/problems/moving-stones-until-consecutive/moving_stones_until_consecutive.go
+++ /dev/null
@@ -1,35 +0,0 @@
-package problem1033
-
-var zerozero = []int{0, 0}
-
-func numMovesStones(a, b, c int) []int {
- a, b, c = sort(a, b, c)
- if c-a == 2 {
- return zerozero
- }
- minM, maxM := 2, c-a-2
- if min(b-a, c-b) <= 2 {
- minM = 1
- }
- return []int{minM, maxM}
-}
-
-func sort(a, b, c int) (int, int, int) {
- if a > b {
- a, b = b, a
- }
- if a > c {
- a, c = c, a
- }
- if b > c {
- b, c = c, b
- }
- return a, b, c
-}
-
-func min(a, b int) int {
- if a < b {
- return a
- }
- return b
-}
diff --git a/problems/multiply-strings/README.md b/problems/multiply-strings/README.md
deleted file mode 100644
index 0a72f5fdf..000000000
--- a/problems/multiply-strings/README.md
+++ /dev/null
@@ -1,44 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../trapping-rain-water "Trapping Rain Water")
-
-[Next >](../wildcard-matching "Wildcard Matching")
-
-## [43. Multiply Strings (Medium)](https://leetcode.com/problems/multiply-strings "字符串相乘")
-
-
Given two non-negative integers num1 and num2 represented as strings, return the product of num1 and num2, also represented as a string.
-
-
Note: You must not use any built-in BigInteger library or convert the inputs to integer directly.
You are implementing a program to use as your calendar. We can add a new event if adding the event will not cause a double booking.
-
-
A double booking happens when two events have some non-empty intersection (i.e., some moment is common to both events.).
-
-
The event can be represented as a pair of integers start and end that represents a booking on the half-open interval [start, end), the range of real numbers x such that start <= x < end.
-
-
Implement the MyCalendar class:
-
-
-
MyCalendar() Initializes the calendar object.
-
boolean book(int start, int end) Returns true if the event can be added to the calendar successfully without causing a double booking. Otherwise, return false and do not add the event to the calendar.
-
-
-
-
Example 1:
-
-
-Input
-["MyCalendar", "book", "book", "book"]
-[[], [10, 20], [15, 25], [20, 30]]
-Output
-[null, true, false, true]
-
-Explanation
-MyCalendar myCalendar = new MyCalendar();
-myCalendar.book(10, 20); // return True
-myCalendar.book(15, 25); // return False, It can not be booked because time 15 is already booked by another event.
-myCalendar.book(20, 30); // return True, The event can be booked, as the first event takes every time less than 20, but not including 20.
-
-
-
Constraints:
-
-
-
0 <= start < end <= 109
-
At most 1000 calls will be made to book.
-
-
-### Related Topics
- [[Design](../../tag/design/README.md)]
- [[Segment Tree](../../tag/segment-tree/README.md)]
- [[Ordered Set](../../tag/ordered-set/README.md)]
-
-### Similar Questions
- 1. [My Calendar II](../my-calendar-ii) (Medium)
- 1. [My Calendar III](../my-calendar-iii) (Hard)
-
-### Hints
-
-Hint 1
-Store the events as a sorted list of intervals. If none of the events conflict, then the new event can be added.
-
diff --git a/problems/my-calendar-i/my_calendar_i.go b/problems/my-calendar-i/my_calendar_i.go
deleted file mode 100644
index 51b295a00..000000000
--- a/problems/my-calendar-i/my_calendar_i.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem729
diff --git a/problems/my-calendar-i/my_calendar_i_test.go b/problems/my-calendar-i/my_calendar_i_test.go
deleted file mode 100644
index 51b295a00..000000000
--- a/problems/my-calendar-i/my_calendar_i_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem729
diff --git a/problems/my-calendar-ii/README.md b/problems/my-calendar-ii/README.md
deleted file mode 100644
index 07f53d2b3..000000000
--- a/problems/my-calendar-ii/README.md
+++ /dev/null
@@ -1,68 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../count-different-palindromic-subsequences "Count Different Palindromic Subsequences")
-
-[Next >](../my-calendar-iii "My Calendar III")
-
-## [731. My Calendar II (Medium)](https://leetcode.com/problems/my-calendar-ii "我的日程安排表 II")
-
-
You are implementing a program to use as your calendar. We can add a new event if adding the event will not cause a triple booking.
-
-
A triple booking happens when three events have some non-empty intersection (i.e., some moment is common to all the three events.).
-
-
The event can be represented as a pair of integers start and end that represents a booking on the half-open interval [start, end), the range of real numbers x such that start <= x < end.
-
-
Implement the MyCalendarTwo class:
-
-
-
MyCalendarTwo() Initializes the calendar object.
-
boolean book(int start, int end) Returns true if the event can be added to the calendar successfully without causing a triple booking. Otherwise, return false and do not add the event to the calendar.
-
-
-
-
Example 1:
-
-
-Input
-["MyCalendarTwo", "book", "book", "book", "book", "book", "book"]
-[[], [10, 20], [50, 60], [10, 40], [5, 15], [5, 10], [25, 55]]
-Output
-[null, true, true, true, false, true, true]
-
-Explanation
-MyCalendarTwo myCalendarTwo = new MyCalendarTwo();
-myCalendarTwo.book(10, 20); // return True, The event can be booked.
-myCalendarTwo.book(50, 60); // return True, The event can be booked.
-myCalendarTwo.book(10, 40); // return True, The event can be double booked.
-myCalendarTwo.book(5, 15); // return False, The event cannot be booked, because it would result in a triple booking.
-myCalendarTwo.book(5, 10); // return True, The event can be booked, as it does not use time 10 which is already double booked.
-myCalendarTwo.book(25, 55); // return True, The event can be booked, as the time in [25, 40) will be double booked with the third event, the time [40, 50) will be single booked, and the time [50, 55) will be double booked with the second event.
-
-
-
-
Constraints:
-
-
-
0 <= start < end <= 109
-
At most 1000 calls will be made to book.
-
-
-### Related Topics
- [[Design](../../tag/design/README.md)]
- [[Segment Tree](../../tag/segment-tree/README.md)]
- [[Ordered Set](../../tag/ordered-set/README.md)]
-
-### Similar Questions
- 1. [My Calendar I](../my-calendar-i) (Medium)
- 1. [My Calendar III](../my-calendar-iii) (Hard)
-
-### Hints
-
-Hint 1
-Store two sorted lists of intervals: one list will be all times that are at least single booked, and another list will be all times that are definitely double booked. If none of the double bookings conflict, then the booking will succeed, and you should update your single and double bookings accordingly.
-
diff --git a/problems/my-calendar-ii/my_calendar_ii.go b/problems/my-calendar-ii/my_calendar_ii.go
deleted file mode 100644
index ff68788d3..000000000
--- a/problems/my-calendar-ii/my_calendar_ii.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem731
diff --git a/problems/my-calendar-ii/my_calendar_ii_test.go b/problems/my-calendar-ii/my_calendar_ii_test.go
deleted file mode 100644
index ff68788d3..000000000
--- a/problems/my-calendar-ii/my_calendar_ii_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem731
diff --git a/problems/my-calendar-iii/README.md b/problems/my-calendar-iii/README.md
deleted file mode 100644
index 16d2e1309..000000000
--- a/problems/my-calendar-iii/README.md
+++ /dev/null
@@ -1,66 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../my-calendar-ii "My Calendar II")
-
-[Next >](../flood-fill "Flood Fill")
-
-## [732. My Calendar III (Hard)](https://leetcode.com/problems/my-calendar-iii "我的日程安排表 III")
-
-
A k-booking happens when k events have some non-empty intersection (i.e., there is some time that is common to all k events.)
-
-
You are given some events [start, end), after each given event, return an integer k representing the maximum k-booking between all the previous events.
-
-
Implement the MyCalendarThree class:
-
-
-
MyCalendarThree() Initializes the object.
-
int book(int start, int end) Returns an integer k representing the largest integer such that there exists a k-booking in the calendar.
-
-
-
-
Example 1:
-
-
-Input
-["MyCalendarThree", "book", "book", "book", "book", "book", "book"]
-[[], [10, 20], [50, 60], [10, 40], [5, 15], [5, 10], [25, 55]]
-Output
-[null, 1, 1, 2, 3, 3, 3]
-
-Explanation
-MyCalendarThree myCalendarThree = new MyCalendarThree();
-myCalendarThree.book(10, 20); // return 1, The first event can be booked and is disjoint, so the maximum k-booking is a 1-booking.
-myCalendarThree.book(50, 60); // return 1, The second event can be booked and is disjoint, so the maximum k-booking is a 1-booking.
-myCalendarThree.book(10, 40); // return 2, The third event [10, 40) intersects the first event, and the maximum k-booking is a 2-booking.
-myCalendarThree.book(5, 15); // return 3, The remaining events cause the maximum K-booking to be only a 3-booking.
-myCalendarThree.book(5, 10); // return 3
-myCalendarThree.book(25, 55); // return 3
-
-
-
-
Constraints:
-
-
-
0 <= start < end <= 109
-
At most 400 calls will be made to book.
-
-
-### Related Topics
- [[Design](../../tag/design/README.md)]
- [[Segment Tree](../../tag/segment-tree/README.md)]
- [[Ordered Set](../../tag/ordered-set/README.md)]
-
-### Similar Questions
- 1. [My Calendar I](../my-calendar-i) (Medium)
- 1. [My Calendar II](../my-calendar-ii) (Medium)
-
-### Hints
-
-Hint 1
-Treat each interval [start, end) as two events "start" and "end", and process them in sorted order.
-
diff --git a/problems/my-calendar-iii/my_calendar_iii.go b/problems/my-calendar-iii/my_calendar_iii.go
deleted file mode 100644
index af2f8d25a..000000000
--- a/problems/my-calendar-iii/my_calendar_iii.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem732
diff --git a/problems/my-calendar-iii/my_calendar_iii_test.go b/problems/my-calendar-iii/my_calendar_iii_test.go
deleted file mode 100644
index af2f8d25a..000000000
--- a/problems/my-calendar-iii/my_calendar_iii_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem732
diff --git a/problems/n-ary-tree-level-order-traversal/README.md b/problems/n-ary-tree-level-order-traversal/README.md
deleted file mode 100644
index cf206b66c..000000000
--- a/problems/n-ary-tree-level-order-traversal/README.md
+++ /dev/null
@@ -1,52 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../serialize-and-deserialize-n-ary-tree "Serialize and Deserialize N-ary Tree")
-
-[Next >](../flatten-a-multilevel-doubly-linked-list "Flatten a Multilevel Doubly Linked List")
-
-## [429. N-ary Tree Level Order Traversal (Medium)](https://leetcode.com/problems/n-ary-tree-level-order-traversal "N 叉树的层序遍历")
-
-
Given an n-ary tree, return the level order traversal of its nodes' values.
-
-
Nary-Tree input serialization is represented in their level order traversal, each group of children is separated by the null value (See examples).
The n-queens puzzle is the problem of placing n queens on an n x n chessboard such that no two queens attack each other.
-
-
Given an integer n, return all distinct solutions to the n-queens puzzle. You may return the answer in any order.
-
-
Each solution contains a distinct board configuration of the n-queens' placement, where 'Q' and '.' both indicate a queen and an empty space, respectively.
-
-
-
Example 1:
-
-
-Input: n = 4
-Output: [[".Q..","...Q","Q...","..Q."],["..Q.","Q...","...Q",".Q.."]]
-Explanation: There exist two distinct solutions to the 4-queens puzzle as shown above
-
The answer is guaranteed to fit within a 32-bit integer, ie. answer <= 2^31 - 1.
-
-
-### Related Topics
- [[Memoization](../../tag/memoization/README.md)]
- [[Math](../../tag/math/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Similar Questions
- 1. [Climbing Stairs](../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/nearest-exit-from-entrance-in-maze/README.md b/problems/nearest-exit-from-entrance-in-maze/README.md
deleted file mode 100644
index 3f05dc6b0..000000000
--- a/problems/nearest-exit-from-entrance-in-maze/README.md
+++ /dev/null
@@ -1,82 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../count-square-sum-triples "Count Square Sum Triples")
-
-[Next >](../sum-game "Sum Game")
-
-## [1926. Nearest Exit from Entrance in Maze (Medium)](https://leetcode.com/problems/nearest-exit-from-entrance-in-maze "迷宫中离入口最近的出口")
-
-
You are given an m x n matrix maze (0-indexed) with empty cells (represented as '.') and walls (represented as '+'). You are also given the entrance of the maze, where entrance = [entrancerow, entrancecol] denotes the row and column of the cell you are initially standing at.
-
-
In one step, you can move one cell up, down, left, or right. You cannot step into a cell with a wall, and you cannot step outside the maze. Your goal is to find the nearest exit from the entrance. An exit is defined as an empty cell that is at the border of the maze. The entrancedoes not count as an exit.
-
-
Return the number of steps in the shortest path from the entrance to the nearest exit, or -1 if no such path exists.
-
-
-
Example 1:
-
-
-Input: maze = [["+","+",".","+"],[".",".",".","+"],["+","+","+","."]], entrance = [1,2]
-Output: 1
-Explanation: There are 3 exits in this maze at [1,0], [0,2], and [2,3].
-Initially, you are at the entrance cell [1,2].
-- You can reach [1,0] by moving 2 steps left.
-- You can reach [0,2] by moving 1 step up.
-It is impossible to reach [2,3] from the entrance.
-Thus, the nearest exit is [0,2], which is 1 step away.
-
-
-
Example 2:
-
-
-Input: maze = [["+","+","+"],[".",".","."],["+","+","+"]], entrance = [1,0]
-Output: 2
-Explanation: There is 1 exit in this maze at [1,2].
-[1,0] does not count as an exit since it is the entrance cell.
-Initially, you are at the entrance cell [1,0].
-- You can reach [1,2] by moving 2 steps right.
-Thus, the nearest exit is [1,2], which is 2 steps away.
-
-
-
Example 3:
-
-
-Input: maze = [[".","+"]], entrance = [0,0]
-Output: -1
-Explanation: There are no exits in this maze.
-
-
-
-
Constraints:
-
-
-
maze.length == m
-
maze[i].length == n
-
1 <= m, n <= 100
-
maze[i][j] is either '.' or '+'.
-
entrance.length == 2
-
0 <= entrancerow < m
-
0 <= entrancecol < n
-
entrance will always be an empty cell.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
-
-### Hints
-
-Hint 1
-Which type of traversal lets you find the distance from a point?
-
-
-
-Hint 2
-Try using a Breadth First Search.
-
diff --git a/problems/nested-list-weight-sum-ii/README.md b/problems/nested-list-weight-sum-ii/README.md
deleted file mode 100644
index 3dd813ef7..000000000
--- a/problems/nested-list-weight-sum-ii/README.md
+++ /dev/null
@@ -1,45 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../max-sum-of-rectangle-no-larger-than-k "Max Sum of Rectangle No Larger Than K")
-
-[Next >](../water-and-jug-problem "Water and Jug Problem")
-
-## [364. Nested List Weight Sum II (Medium)](https://leetcode.com/problems/nested-list-weight-sum-ii "加权嵌套序列和 II")
-
-
Given a nested list of integers, return the sum of all integers in the list weighted by their depth.
-
-
Each element is either an integer, or a list -- whose elements may also be integers or other lists.
-
-
Different from the previous question where weight is increasing from root to leaf, now the weight is defined from bottom up. i.e., the leaf level integers have weight 1, and the root level integers have the largest weight.
-
-
Example 1:
-
-
-
-Input: [[1,1],2,[1,1]]
-Output: 8
-Explanation: Four 1's at depth 1, one 2 at depth 2.
-
-
-
-
Example 2:
-
-
-Input: [1,[4,[6]]]
-Output: 17
-Explanation: One 1 at depth 3, one 4 at depth 2, and one 6 at depth 1; 1*3 + 4*2 + 6*1 = 17.
-
-
-### Related Topics
- [[Stack](../../tag/stack/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
-
-### Similar Questions
- 1. [Nested List Weight Sum](../nested-list-weight-sum) (Medium)
- 1. [Array Nesting](../array-nesting) (Medium)
diff --git a/problems/nested-list-weight-sum-ii/nested_list_weight_sum_ii.go b/problems/nested-list-weight-sum-ii/nested_list_weight_sum_ii.go
deleted file mode 100644
index e06dafdd3..000000000
--- a/problems/nested-list-weight-sum-ii/nested_list_weight_sum_ii.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem364
diff --git a/problems/nested-list-weight-sum-ii/nested_list_weight_sum_ii_test.go b/problems/nested-list-weight-sum-ii/nested_list_weight_sum_ii_test.go
deleted file mode 100644
index e06dafdd3..000000000
--- a/problems/nested-list-weight-sum-ii/nested_list_weight_sum_ii_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem364
diff --git a/problems/nested-list-weight-sum/README.md b/problems/nested-list-weight-sum/README.md
deleted file mode 100644
index 68ee743ea..000000000
--- a/problems/nested-list-weight-sum/README.md
+++ /dev/null
@@ -1,41 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../counting-bits "Counting Bits")
-
-[Next >](../longest-substring-with-at-most-k-distinct-characters "Longest Substring with At Most K Distinct Characters")
-
-## [339. Nested List Weight Sum (Medium)](https://leetcode.com/problems/nested-list-weight-sum "嵌套列表权重和")
-
-
Given a nested list of integers, return the sum of all integers in the list weighted by their depth.
-
-
Each element is either an integer, or a list -- whose elements may also be integers or other lists.
-
-
-
Example 1:
-
-
-Input: [[1,1],2,[1,1]]
-Output: 10
-Explanation: Four 1's at depth 2, one 2 at depth 1.
-
-
-
Example 2:
-
-
-Input: [1,[4,[6]]]
-Output: 27
-Explanation: One 1 at depth 1, one 4 at depth 2, and one 6 at depth 3; 1 + 4*2 + 6*3 = 27.
You are given a network of n nodes, labeled from 1 to n. You are also given times, a list of travel times as directed edges times[i] = (ui, vi, wi), where ui is the source node, vi is the target node, and wi is the time it takes for a signal to travel from source to target.
-
-
We will send a signal from a given node k. Return the time it takes for all the n nodes to receive the signal. If it is impossible for all the n nodes to receive the signal, return -1.
-
-
-
Example 1:
-
-
-Input: times = [[2,1,1],[2,3,1],[3,4,1]], n = 4, k = 2
-Output: 2
-
-
-
Example 2:
-
-
-Input: times = [[1,2,1]], n = 2, k = 1
-Output: 1
-
-
-
Example 3:
-
-
-Input: times = [[1,2,1]], n = 2, k = 2
-Output: -1
-
-
-
-
Constraints:
-
-
-
1 <= k <= n <= 100
-
1 <= times.length <= 6000
-
times[i].length == 3
-
1 <= ui, vi <= n
-
ui != vi
-
0 <= wi <= 100
-
All the pairs (ui, vi) are unique. (i.e., no multiple edges.)
-
-
-### Related Topics
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Graph](../../tag/graph/README.md)]
- [[Shortest Path](../../tag/shortest-path/README.md)]
- [[Heap (Priority Queue)](../../tag/heap-priority-queue/README.md)]
-
-### Hints
-
-Hint 1
-We visit each node at some time, and if that time is better than the fastest time we've reached this node, we travel along outgoing edges in sorted order. Alternatively, we could use Dijkstra's algorithm.
-
diff --git a/problems/network-delay-time/network_delay_time.go b/problems/network-delay-time/network_delay_time.go
deleted file mode 100644
index cb1b0979f..000000000
--- a/problems/network-delay-time/network_delay_time.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem743
diff --git a/problems/network-delay-time/network_delay_time_test.go b/problems/network-delay-time/network_delay_time_test.go
deleted file mode 100644
index cb1b0979f..000000000
--- a/problems/network-delay-time/network_delay_time_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem743
diff --git a/problems/new-21-game/README.md b/problems/new-21-game/README.md
deleted file mode 100644
index 71e615e07..000000000
--- a/problems/new-21-game/README.md
+++ /dev/null
@@ -1,61 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../rectangle-overlap "Rectangle Overlap")
-
-[Next >](../push-dominoes "Push Dominoes")
-
-## [837. New 21 Game (Medium)](https://leetcode.com/problems/new-21-game "新 21 点")
-
-
Alice plays the following game, loosely based on the card game "21".
-
-
Alice starts with 0 points and draws numbers while she has less than k points. During each draw, she gains an integer number of points randomly from the range [1, maxPts], where maxPts is an integer. Each draw is independent and the outcomes have equal probabilities.
-
-
Alice stops drawing numbers when she gets kor more points.
-
-
Return the probability that Alice has n or fewer points.
-
-
Answers within 10-5 of the actual answer are considered accepted.
-
-
-
Example 1:
-
-
-Input: n = 10, k = 1, maxPts = 10
-Output: 1.00000
-Explanation: Alice gets a single card, then stops.
-
-
-
Example 2:
-
-
-Input: n = 6, k = 1, maxPts = 10
-Output: 0.60000
-Explanation: Alice gets a single card, then stops.
-In 6 out of 10 possibilities, she is at or below 6 points.
-
-
-
Example 3:
-
-
-Input: n = 21, k = 17, maxPts = 10
-Output: 0.73278
-
-+---------------+---------+
-| Column Name | Type |
-+---------------+---------+
-| user_id | int |
-| activity | enum |
-| activity_date | date |
-+---------------+---------+
-There is no primary key for this table, it may have duplicate rows.
-The activity column is an ENUM type of ('login', 'logout', 'jobs', 'groups', 'homepage').
-
-
-
-
-
Write an SQL query that reports for every date within at most 90 days from today, the number of users that logged in for the first time on that date. Assume today is 2019-06-30.
-
-
The query result format is in the following example:
-
-
-Traffic table:
-+---------+----------+---------------+
-| user_id | activity | activity_date |
-+---------+----------+---------------+
-| 1 | login | 2019-05-01 |
-| 1 | homepage | 2019-05-01 |
-| 1 | logout | 2019-05-01 |
-| 2 | login | 2019-06-21 |
-| 2 | logout | 2019-06-21 |
-| 3 | login | 2019-01-01 |
-| 3 | jobs | 2019-01-01 |
-| 3 | logout | 2019-01-01 |
-| 4 | login | 2019-06-21 |
-| 4 | groups | 2019-06-21 |
-| 4 | logout | 2019-06-21 |
-| 5 | login | 2019-03-01 |
-| 5 | logout | 2019-03-01 |
-| 5 | login | 2019-06-21 |
-| 5 | logout | 2019-06-21 |
-+---------+----------+---------------+
-
-Result table:
-+------------+-------------+
-| login_date | user_count |
-+------------+-------------+
-| 2019-05-01 | 1 |
-| 2019-06-21 | 2 |
-+------------+-------------+
-Note that we only care about dates with non zero user count.
-The user with id 5 first logged in on 2019-03-01 so he's not counted on 2019-06-21.
-
Given a time represented in the format "HH:MM", form the next closest time by reusing the current digits. There is no limit on how many times a digit can be reused.
-
-
You may assume the given input string is always valid. For example, "01:34", "12:09" are all valid. "1:34", "12:9" are all invalid.
-
-
Example 1:
-
-Input: "19:34"
-Output: "19:39"
-Explanation: The next closest time choosing from digits 1, 9, 3, 4, is 19:39, which occurs 5 minutes later. It is not 19:33, because this occurs 23 hours and 59 minutes later.
-
-
-
-
Example 2:
-
-Input: "23:59"
-Output: "22:22"
-Explanation: The next closest time choosing from digits 2, 3, 5, 9, is 22:22. It may be assumed that the returned time is next day's time since it is smaller than the input time numerically.
-
The next greater element of some element x in an array is the first greater element that is to the right of x in the same array.
-
-
You are given two distinct 0-indexed integer arrays nums1 and nums2, where nums1 is a subset of nums2.
-
-
For each 0 <= i < nums1.length, find the index j such that nums1[i] == nums2[j] and determine the next greater element of nums2[j] in nums2. If there is no next greater element, then the answer for this query is -1.
-
-
Return an array ans of length nums1.length such that ans[i] is the next greater element as described above.
-
-
-
Example 1:
-
-
-Input: nums1 = [4,1,2], nums2 = [1,3,4,2]
-Output: [-1,3,-1]
-Explanation: The next greater element for each value of nums1 is as follows:
-- 4 is underlined in nums2 = [1,3,4,2]. There is no next greater element, so the answer is -1.
-- 1 is underlined in nums2 = [1,3,4,2]. The next greater element is 3.
-- 2 is underlined in nums2 = [1,3,4,2]. There is no next greater element, so the answer is -1.
-
-
-
Example 2:
-
-
-Input: nums1 = [2,4], nums2 = [1,2,3,4]
-Output: [3,-1]
-Explanation: The next greater element for each value of nums1 is as follows:
-- 2 is underlined in nums2 = [1,2,3,4]. The next greater element is 3.
-- 4 is underlined in nums2 = [1,2,3,4]. There is no next greater element, so the answer is -1.
-
Given a circular integer array nums (i.e., the next element of nums[nums.length - 1] is nums[0]), return the next greater number for every element innums.
-
-
The next greater number of a number x is the first greater number to its traversing-order next in the array, which means you could search circularly to find its next greater number. If it doesn't exist, return -1 for this number.
-
-
-
Example 1:
-
-
-Input: nums = [1,2,1]
-Output: [2,-1,2]
-Explanation: The first 1's next greater number is 2;
-The number 2 can't find next greater number.
-The second 1's next greater number needs to search circularly, which is also 2.
-
-
-### Related Topics
- [[Stack](../../tag/stack/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Monotonic Stack](../../tag/monotonic-stack/README.md)]
-
-### Similar Questions
- 1. [Next Greater Element I](../next-greater-element-i) (Easy)
- 1. [Next Greater Element III](../next-greater-element-iii) (Medium)
diff --git a/problems/next-greater-element-ii/next_greater_element_ii.go b/problems/next-greater-element-ii/next_greater_element_ii.go
deleted file mode 100644
index 1057e1687..000000000
--- a/problems/next-greater-element-ii/next_greater_element_ii.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem503
diff --git a/problems/next-greater-element-ii/next_greater_element_ii_test.go b/problems/next-greater-element-ii/next_greater_element_ii_test.go
deleted file mode 100644
index 1057e1687..000000000
--- a/problems/next-greater-element-ii/next_greater_element_ii_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem503
diff --git a/problems/next-greater-element-iii/README.md b/problems/next-greater-element-iii/README.md
deleted file mode 100644
index a5dfc606b..000000000
--- a/problems/next-greater-element-iii/README.md
+++ /dev/null
@@ -1,40 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../split-concatenated-strings "Split Concatenated Strings")
-
-[Next >](../reverse-words-in-a-string-iii "Reverse Words in a String III")
-
-## [556. Next Greater Element III (Medium)](https://leetcode.com/problems/next-greater-element-iii "下一个更大元素 III")
-
-
Given a positive integer n, find the smallest integer which has exactly the same digits existing in the integernand is greater in value thann. If no such positive integer exists, return -1.
-
-
Note that the returned integer should fit in 32-bit integer, if there is a valid answer but it does not fit in 32-bit integer, return -1.
-
-
-
Example 1:
-
Input: n = 12
-Output: 21
-
Example 2:
-
Input: n = 21
-Output: -1
-
-
-
Constraints:
-
-
-
1 <= n <= 231 - 1
-
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
- [[Two Pointers](../../tag/two-pointers/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Similar Questions
- 1. [Next Greater Element I](../next-greater-element-i) (Easy)
- 1. [Next Greater Element II](../next-greater-element-ii) (Medium)
diff --git a/problems/next-greater-element-iii/next_greater_element_iii.go b/problems/next-greater-element-iii/next_greater_element_iii.go
deleted file mode 100644
index 4a7201280..000000000
--- a/problems/next-greater-element-iii/next_greater_element_iii.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem556
diff --git a/problems/next-greater-element-iii/next_greater_element_iii_test.go b/problems/next-greater-element-iii/next_greater_element_iii_test.go
deleted file mode 100644
index 4a7201280..000000000
--- a/problems/next-greater-element-iii/next_greater_element_iii_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem556
diff --git a/problems/next-greater-node-in-linked-list/README.md b/problems/next-greater-node-in-linked-list/README.md
deleted file mode 100644
index 89037df98..000000000
--- a/problems/next-greater-node-in-linked-list/README.md
+++ /dev/null
@@ -1,54 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../binary-prefix-divisible-by-5 "Binary Prefix Divisible By 5")
-
-[Next >](../number-of-enclaves "Number of Enclaves")
-
-## [1019. Next Greater Node In Linked List (Medium)](https://leetcode.com/problems/next-greater-node-in-linked-list "链表中的下一个更大节点")
-
-
You are given the head of a linked list with n nodes.
-
-
For each node in the list, find the value of the next greater node. That is, for each node, find the value of the first node that is next to it and has a strictly larger value than it.
-
-
Return an integer array answer where answer[i] is the value of the next greater node of the ith node (1-indexed). If the ith node does not have a next greater node, set answer[i] = 0.
-
-
-
Example 1:
-
-
-Input: head = [2,1,5]
-Output: [5,5,0]
-
-
-
Example 2:
-
-
-Input: head = [2,7,4,3,5]
-Output: [7,0,5,5,0]
-
-
-
-
Constraints:
-
-
-
The number of nodes in the list is n.
-
1 <= n <= 104
-
1 <= Node.val <= 109
-
-
-### Related Topics
- [[Stack](../../tag/stack/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Linked List](../../tag/linked-list/README.md)]
- [[Monotonic Stack](../../tag/monotonic-stack/README.md)]
-
-### Hints
-
-Hint 1
-We can use a stack that stores nodes in monotone decreasing order of value. When we see a node_j with a larger value, every node_i in the stack has next_larger(node_i) = node_j .
-
diff --git a/problems/next-greater-numerically-balanced-number/README.md b/problems/next-greater-numerically-balanced-number/README.md
deleted file mode 100644
index 338830ba3..000000000
--- a/problems/next-greater-numerically-balanced-number/README.md
+++ /dev/null
@@ -1,76 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../number-of-valid-words-in-a-sentence "Number of Valid Words in a Sentence")
-
-[Next >](../count-nodes-with-the-highest-score "Count Nodes With the Highest Score")
-
-## [2048. Next Greater Numerically Balanced Number (Medium)](https://leetcode.com/problems/next-greater-numerically-balanced-number "下一个更大的数值平衡数")
-
-
An integer x is numerically balanced if for every digit d in the number x, there are exactlyd occurrences of that digit in x.
-
-
Given an integer n, return the smallest numerically balanced number strictly greater than n.
-
-
-
Example 1:
-
-
-Input: n = 1
-Output: 22
-Explanation:
-22 is numerically balanced since:
-- The digit 2 occurs 2 times.
-It is also the smallest numerically balanced number strictly greater than 1.
-
-
-
Example 2:
-
-
-Input: n = 1000
-Output: 1333
-Explanation:
-1333 is numerically balanced since:
-- The digit 1 occurs 1 time.
-- The digit 3 occurs 3 times.
-It is also the smallest numerically balanced number strictly greater than 1000.
-Note that 1022 cannot be the answer because 0 appeared more than 0 times.
-
-
-
Example 3:
-
-
-Input: n = 3000
-Output: 3133
-Explanation:
-3133 is numerically balanced since:
-- The digit 1 occurs 1 time.
-- The digit 3 occurs 3 times.
-It is also the smallest numerically balanced number strictly greater than 3000.
-
-
-
-
Constraints:
-
-
-
0 <= n <= 106
-
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
- [[Backtracking](../../tag/backtracking/README.md)]
- [[Enumeration](../../tag/enumeration/README.md)]
-
-### Hints
-
-Hint 1
-How far away can the next greater numerically balanced number be from n?
-
-
-
-Hint 2
-With the given constraints, what is the largest numerically balanced number?
-
diff --git a/problems/next-palindrome-using-same-digits/README.md b/problems/next-palindrome-using-same-digits/README.md
deleted file mode 100644
index 5c062380d..000000000
--- a/problems/next-palindrome-using-same-digits/README.md
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../league-statistics "League Statistics")
-
-[Next >](../suspicious-bank-accounts "Suspicious Bank Accounts")
-
-## [1842. Next Palindrome Using Same Digits (Hard)](https://leetcode.com/problems/next-palindrome-using-same-digits "下个由相同数字构成的回文串")
-
-
-
-### Related Topics
- [[Two Pointers](../../tag/two-pointers/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Hints
-
-Hint 1
-Is it possible to swap one character in the first half of the palindrome to make the next one?
-
-
-
-Hint 2
-Are there different cases for when the length is odd and even?
-
diff --git a/problems/next-permutation/README.md b/problems/next-permutation/README.md
deleted file mode 100644
index b85f403e3..000000000
--- a/problems/next-permutation/README.md
+++ /dev/null
@@ -1,50 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../substring-with-concatenation-of-all-words "Substring with Concatenation of All Words")
-
-[Next >](../longest-valid-parentheses "Longest Valid Parentheses")
-
-## [31. Next Permutation (Medium)](https://leetcode.com/problems/next-permutation "下一个排列")
-
-
Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.
-
-
If such an arrangement is not possible, it must rearrange it as the lowest possible order (i.e., sorted in ascending order).
-
-
The replacement must be in place and use only constant extra memory.
You are playing the following Nim Game with your friend:
-
-
-
Initially, there is a heap of stones on the table.
-
You and your friend will alternate taking turns, and you go first.
-
On each turn, the person whose turn it is will remove 1 to 3 stones from the heap.
-
The one who removes the last stone is the winner.
-
-
-
Given n, the number of stones in the heap, return true if you can win the game assuming both you and your friend play optimally, otherwise return false.
-
-
-
Example 1:
-
-
-Input: n = 4
-Output: false
-Explanation: These are the possible outcomes:
-1. You remove 1 stone. Your friend removes 3 stones, including the last stone. Your friend wins.
-2. You remove 2 stones. Your friend removes 2 stones, including the last stone. Your friend wins.
-3. You remove 3 stones. Your friend removes the last stone. Your friend wins.
-In all outcomes, your friend wins.
-
-
-
Example 2:
-
-
-Input: n = 1
-Output: true
-
-
-
Example 3:
-
-
-Input: n = 2
-Output: true
-
-
-
-
Constraints:
-
-
-
1 <= n <= 231 - 1
-
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
- [[Brainteaser](../../tag/brainteaser/README.md)]
- [[Game Theory](../../tag/game-theory/README.md)]
-
-### Similar Questions
- 1. [Flip Game II](../flip-game-ii) (Medium)
-
-### Hints
-
-Hint 1
-If there are 5 stones in the heap, could you figure out a way to remove the stones such that you will always be the winner?
-
diff --git a/problems/nim-game/nim_game.go b/problems/nim-game/nim_game.go
deleted file mode 100644
index ce9563614..000000000
--- a/problems/nim-game/nim_game.go
+++ /dev/null
@@ -1,5 +0,0 @@
-package problem292
-
-func canWinNim(n int) bool {
- return n%4 != 0
-}
diff --git a/problems/nim-game/nim_game_test.go b/problems/nim-game/nim_game_test.go
deleted file mode 100644
index acd719a48..000000000
--- a/problems/nim-game/nim_game_test.go
+++ /dev/null
@@ -1,27 +0,0 @@
-package problem292
-
-import "testing"
-
-type testType struct {
- in int
- want bool
-}
-
-func TestCanWinNim(t *testing.T) {
- tests := [...]testType{
- {
- in: 4,
- want: false,
- },
- {
- in: 3,
- want: true,
- },
- }
- for _, tt := range tests {
- got := canWinNim(tt.in)
- if got != tt.want {
- t.Fatalf("in: %v, got: %v, want: %v", tt.in, got, tt.want)
- }
- }
-}
diff --git a/problems/non-decreasing-array/README.md b/problems/non-decreasing-array/README.md
deleted file mode 100644
index 1bf899059..000000000
--- a/problems/non-decreasing-array/README.md
+++ /dev/null
@@ -1,48 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../strange-printer "Strange Printer")
-
-[Next >](../path-sum-iv "Path Sum IV")
-
-## [665. Non-decreasing Array (Medium)](https://leetcode.com/problems/non-decreasing-array "非递减数列")
-
-
Given an array nums with n integers, your task is to check if it could become non-decreasing by modifying at most one element.
-
-
We define an array is non-decreasing if nums[i] <= nums[i + 1] holds for every i (0-based) such that (0 <= i <= n - 2).
-
-
-
Example 1:
-
-
-Input: nums = [4,2,3]
-Output: true
-Explanation: You could modify the first 4 to 1 to get a non-decreasing array.
-
-
-
Example 2:
-
-
-Input: nums = [4,2,1]
-Output: false
-Explanation: You can't get a non-decreasing array by modify at most one element.
-
Given an array of intervals intervals where intervals[i] = [starti, endi], return the minimum number of intervals you need to remove to make the rest of the intervals non-overlapping.
-
-
-
Example 1:
-
-
-Input: intervals = [[1,2],[2,3],[3,4],[1,3]]
-Output: 1
-Explanation: [1,3] can be removed and the rest of the intervals are non-overlapping.
-
-
-
Example 2:
-
-
-Input: intervals = [[1,2],[1,2],[1,2]]
-Output: 2
-Explanation: You need to remove two [1,2] to make the rest of the intervals non-overlapping.
-
-
-
Example 3:
-
-
-Input: intervals = [[1,2],[2,3]]
-Output: 0
-Explanation: You don't need to remove any of the intervals since they're already non-overlapping.
-
-+----------------+----------+
-| Column Name | Type |
-+----------------+----------+
-| id | int |
-| movie | varchar |
-| description | varchar |
-| rating | float |
-+----------------+----------+
-id is the primary key for this table.
-Each row contains information about the name of a movie, its genre, and its rating.
-rating is a 2 decimal places float in the range [0, 10]
-
-
-
-
-
Write an SQL query to report the movies with an odd-numbered ID and a description that is not "boring".
-
-
Return the result table ordered by ratingin descending order.
-
-
The query result format is in the following example.
-
-
-
Example 1:
-
-
-Input:
-Cinema table:
-+----+------------+-------------+--------+
-| id | movie | description | rating |
-+----+------------+-------------+--------+
-| 1 | War | great 3D | 8.9 |
-| 2 | Science | fiction | 8.5 |
-| 3 | irish | boring | 6.2 |
-| 4 | Ice song | Fantacy | 8.6 |
-| 5 | House card | Interesting | 9.1 |
-+----+------------+-------------+--------+
-Output:
-+----+------------+-------------+--------+
-| id | movie | description | rating |
-+----+------------+-------------+--------+
-| 5 | House card | Interesting | 9.1 |
-| 1 | War | great 3D | 8.9 |
-+----+------------+-------------+--------+
-Explanation:
-We have three movies with odd-numbered IDs: 1, 3, and 5. The movie with ID = 3 is boring so we do not include it in the answer.
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/not-boring-movies/mysql_schemas.sql b/problems/not-boring-movies/mysql_schemas.sql
deleted file mode 100644
index 51a9eae8a..000000000
--- a/problems/not-boring-movies/mysql_schemas.sql
+++ /dev/null
@@ -1,7 +0,0 @@
-Create table If Not Exists cinema (id int, movie varchar(255), description varchar(255), rating float(2, 1));
-Truncate table cinema;
-insert into cinema (id, movie, description, rating) values ('1', 'War', 'great 3D', '8.9');
-insert into cinema (id, movie, description, rating) values ('2', 'Science', 'fiction', '8.5');
-insert into cinema (id, movie, description, rating) values ('3', 'irish', 'boring', '6.2');
-insert into cinema (id, movie, description, rating) values ('4', 'Ice song', 'Fantacy', '8.6');
-insert into cinema (id, movie, description, rating) values ('5', 'House card', 'Interesting', '9.1');
diff --git a/problems/not-boring-movies/not_boring_movies.sql b/problems/not-boring-movies/not_boring_movies.sql
deleted file mode 100644
index 97f268428..000000000
--- a/problems/not-boring-movies/not_boring_movies.sql
+++ /dev/null
@@ -1,10 +0,0 @@
-# Write your MySQL query statement below
-
-SELECT *
-FROM
- cinema
-WHERE
- MOD(id, 2) = 1
- AND description != 'boring'
-ORDER BY
- rating DESC;
diff --git a/problems/npv-queries/README.md b/problems/npv-queries/README.md
deleted file mode 100644
index 70c027462..000000000
--- a/problems/npv-queries/README.md
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../build-array-where-you-can-find-the-maximum-exactly-k-comparisons "Build Array Where You Can Find The Maximum Exactly K Comparisons")
-
-[Next >](../maximum-score-after-splitting-a-string "Maximum Score After Splitting a String")
-
-## [1421. NPV Queries (Medium)](https://leetcode.com/problems/npv-queries "净现值查询")
-
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/npv-queries/mysql_schemas.sql b/problems/npv-queries/mysql_schemas.sql
deleted file mode 100644
index 0ad1de8aa..000000000
--- a/problems/npv-queries/mysql_schemas.sql
+++ /dev/null
@@ -1,19 +0,0 @@
-Create Table If Not Exists NPV (id int, year int, npv int);
-Create Table If Not Exists Queries (id int, year int);
-Truncate table NPV;
-insert into NPV (id, year, npv) values ('1', '2018', '100');
-insert into NPV (id, year, npv) values ('7', '2020', '30');
-insert into NPV (id, year, npv) values ('13', '2019', '40');
-insert into NPV (id, year, npv) values ('1', '2019', '113');
-insert into NPV (id, year, npv) values ('2', '2008', '121');
-insert into NPV (id, year, npv) values ('3', '2009', '21');
-insert into NPV (id, year, npv) values ('11', '2020', '99');
-insert into NPV (id, year, npv) values ('7', '2019', '0');
-Truncate table Queries;
-insert into Queries (id, year) values ('1', '2019');
-insert into Queries (id, year) values ('2', '2008');
-insert into Queries (id, year) values ('3', '2009');
-insert into Queries (id, year) values ('7', '2018');
-insert into Queries (id, year) values ('7', '2019');
-insert into Queries (id, year) values ('7', '2020');
-insert into Queries (id, year) values ('13', '2019');
diff --git a/problems/nth-digit/README.md b/problems/nth-digit/README.md
deleted file mode 100644
index b2130eefe..000000000
--- a/problems/nth-digit/README.md
+++ /dev/null
@@ -1,41 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../evaluate-division "Evaluate Division")
-
-[Next >](../binary-watch "Binary Watch")
-
-## [400. Nth Digit (Medium)](https://leetcode.com/problems/nth-digit "第 N 位数字")
-
-
Given an integer n, return the nth digit of the infinite integer sequence [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, ...].
-
-
-
Example 1:
-
-
-Input: n = 3
-Output: 3
-
-
-
Example 2:
-
-
-Input: n = 11
-Output: 0
-Explanation: The 11th digit of the sequence 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, ... is a 0, which is part of the number 10.
-
-+-------------+------+
-| Column Name | Type |
-+-------------+------+
-| id | int |
-| salary | int |
-+-------------+------+
-id is the primary key column for this table.
-Each row of this table contains information about the salary of an employee.
-
-
-
-
-
Write an SQL query to report the nth highest salary from the Employee table. If there is no nth highest salary, the query should report null.
-
-
The query result format is in the following example.
The complement of an integer is the integer you get when you flip all the 0's to 1's and all the 1's to 0's in its binary representation.
-
-
-
For example, The integer 5 is "101" in binary and its complement is "010" which is the integer 2.
-
-
-
Given an integer num, return its complement.
-
-
-
Example 1:
-
-
-Input: num = 5
-Output: 2
-Explanation: The binary representation of 5 is 101 (no leading zero bits), and its complement is 010. So you need to output 2.
-
-
-
Example 2:
-
-
-Input: num = 1
-Output: 0
-Explanation: The binary representation of 1 is 1 (no leading zero bits), and its complement is 0. So you need to output 0.
-
Write a function that takes an unsigned integer and returns the number of '1' bits it has (also known as the Hamming weight).
-
-
Note:
-
-
-
Note that in some languages, such as Java, there is no unsigned integer type. In this case, the input will be given as a signed integer type. It should not affect your implementation, as the integer's internal binary representation is the same, whether it is signed or unsigned.
-
In Java, the compiler represents the signed integers using 2's complement notation. Therefore, in Example 3, the input represents the signed integer. -3.
-
-
-
-
Example 1:
-
-
-Input: n = 00000000000000000000000000001011
-Output: 3
-Explanation: The input binary string 00000000000000000000000000001011 has a total of three '1' bits.
-
-
-
Example 2:
-
-
-Input: n = 00000000000000000000000010000000
-Output: 1
-Explanation: The input binary string 00000000000000000000000010000000 has a total of one '1' bit.
-
-
-
Example 3:
-
-
-Input: n = 11111111111111111111111111111101
-Output: 31
-Explanation: The input binary string 11111111111111111111111111111101 has a total of thirty one '1' bits.
-
-
-
-
Constraints:
-
-
-
The input must be a binary string of length 32.
-
-
-
-Follow up: If this function is called many times, how would you optimize it?
-
-### Related Topics
- [[Bit Manipulation](../../tag/bit-manipulation/README.md)]
-
-### Similar Questions
- 1. [Reverse Bits](../reverse-bits) (Easy)
- 1. [Power of Two](../power-of-two) (Easy)
- 1. [Counting Bits](../counting-bits) (Easy)
- 1. [Binary Watch](../binary-watch) (Easy)
- 1. [Hamming Distance](../hamming-distance) (Easy)
- 1. [Binary Number with Alternating Bits](../binary-number-with-alternating-bits) (Easy)
- 1. [Prime Number of Set Bits in Binary Representation](../prime-number-of-set-bits-in-binary-representation) (Easy)
diff --git a/problems/number-of-1-bits/number_of_1_bits.go b/problems/number-of-1-bits/number_of_1_bits.go
deleted file mode 100644
index bab7344b6..000000000
--- a/problems/number-of-1-bits/number_of_1_bits.go
+++ /dev/null
@@ -1,9 +0,0 @@
-package problem191
-
-func hammingWeight(num uint32) int {
- num = (num & 0x55555555) + (num>>1)&0x55555555
- num = (num & 0x33333333) + (num>>2)&0x33333333
- num = (num & 0x0F0F0F0F) + (num>>4)&0x0F0F0F0F
- num = (num * 0x01010101) >> 24
- return int(num)
-}
diff --git a/problems/number-of-1-bits/number_of_1_bits_test.go b/problems/number-of-1-bits/number_of_1_bits_test.go
deleted file mode 100644
index ead22f4c4..000000000
--- a/problems/number-of-1-bits/number_of_1_bits_test.go
+++ /dev/null
@@ -1,41 +0,0 @@
-package problem191
-
-import "testing"
-
-type testType struct {
- in uint32
- want int
-}
-
-func TestHammingWeight(t *testing.T) {
- tests := [...]testType{
- {
- in: 3,
- want: 2,
- },
- {
- in: 7,
- want: 3,
- },
- {
- in: 8,
- want: 1,
- },
- {
- in: 0x5555,
- want: 8,
- },
- }
- for _, tt := range tests {
- got := hammingWeight(tt.in)
- if got != tt.want {
- t.Fatalf("in: %v, got: %v, want: %v", tt.in, got, tt.want)
- }
- }
-}
-
-func BenchmarkHammingWeight(b *testing.B) {
- for i := 0; i < b.N; i++ {
- hammingWeight(0x55555555)
- }
-}
diff --git a/problems/number-of-accounts-that-did-not-stream/README.md b/problems/number-of-accounts-that-did-not-stream/README.md
deleted file mode 100644
index d386e55a8..000000000
--- a/problems/number-of-accounts-that-did-not-stream/README.md
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../the-score-of-students-solving-math-expression "The Score of Students Solving Math Expression")
-
-[Next >](../brightest-position-on-street "Brightest Position on Street")
-
-## [2020. Number of Accounts That Did Not Stream (Medium)](https://leetcode.com/problems/number-of-accounts-that-did-not-stream "")
-
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/number-of-accounts-that-did-not-stream/mysql_schemas.sql b/problems/number-of-accounts-that-did-not-stream/mysql_schemas.sql
deleted file mode 100644
index 242bcbb86..000000000
--- a/problems/number-of-accounts-that-did-not-stream/mysql_schemas.sql
+++ /dev/null
@@ -1,16 +0,0 @@
-Create table If Not Exists Subscriptions (account_id int, start_date date, end_date date);
-Create table If Not Exists Streams (session_id int, account_id int, stream_date date);
-Truncate table Subscriptions;
-insert into Subscriptions (account_id, start_date, end_date) values ('9', '2020-02-18', '2021-10-30');
-insert into Subscriptions (account_id, start_date, end_date) values ('3', '2021-09-21', '2021-11-13');
-insert into Subscriptions (account_id, start_date, end_date) values ('11', '2020-02-28', '2020-08-18');
-insert into Subscriptions (account_id, start_date, end_date) values ('13', '2021-04-20', '2021-09-22');
-insert into Subscriptions (account_id, start_date, end_date) values ('4', '2020-10-26', '2021-05-08');
-insert into Subscriptions (account_id, start_date, end_date) values ('5', '2020-09-11', '2021-01-17');
-Truncate table Streams;
-insert into Streams (session_id, account_id, stream_date) values ('14', '9', '2020-05-16');
-insert into Streams (session_id, account_id, stream_date) values ('16', '3', '2021-10-27');
-insert into Streams (session_id, account_id, stream_date) values ('18', '11', '2020-04-29');
-insert into Streams (session_id, account_id, stream_date) values ('17', '13', '2021-08-08');
-insert into Streams (session_id, account_id, stream_date) values ('19', '4', '2020-12-31');
-insert into Streams (session_id, account_id, stream_date) values ('13', '5', '2021-01-05');
diff --git a/problems/number-of-atoms/README.md b/problems/number-of-atoms/README.md
deleted file mode 100644
index 0019c59b2..000000000
--- a/problems/number-of-atoms/README.md
+++ /dev/null
@@ -1,96 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../split-linked-list-in-parts "Split Linked List in Parts")
-
-[Next >](../minimum-window-subsequence "Minimum Window Subsequence")
-
-## [726. Number of Atoms (Hard)](https://leetcode.com/problems/number-of-atoms "原子的数量")
-
-
Given a string formula representing a chemical formula, return the count of each atom.
-
-
The atomic element always starts with an uppercase character, then zero or more lowercase letters, representing the name.
-
-
One or more digits representing that element's count may follow if the count is greater than 1. If the count is 1, no digits will follow.
-
-
-
For example, "H2O" and "H2O2" are possible, but "H1O2" is impossible.
-
-
-
Two formulas are concatenated together to produce another formula.
-
-
-
For example, "H2O2He3Mg4" is also a formula.
-
-
-
A formula placed in parentheses, and a count (optionally added) is also a formula.
-
-
-
For example, "(H2O2)" and "(H2O2)3" are formulas.
-
-
-
Return the count of all elements as a string in the following form: the first name (in sorted order), followed by its count (if that count is more than 1), followed by the second name (in sorted order), followed by its count (if that count is more than 1), and so on.
-
-
-
Example 1:
-
-
-Input: formula = "H2O"
-Output: "H2O"
-Explanation: The count of elements are {'H': 2, 'O': 1}.
-
-
-
Example 2:
-
-
-Input: formula = "Mg(OH)2"
-Output: "H2MgO2"
-Explanation: The count of elements are {'H': 2, 'Mg': 1, 'O': 2}.
-
-
-
Example 3:
-
-
-Input: formula = "K4(ON(SO3)2)2"
-Output: "K4N2O14S4"
-Explanation: The count of elements are {'K': 4, 'N': 2, 'O': 14, 'S': 4}.
-
-
-
Example 4:
-
-
-Input: formula = "Be32"
-Output: "Be32"
-
-
-
-
Constraints:
-
-
-
1 <= formula.length <= 1000
-
formula consists of English letters, digits, '(', and ')'.
-
formula is always valid.
-
All the values in the output will fit in a 32-bit integer.
-
-
-### Related Topics
- [[Stack](../../tag/stack/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Similar Questions
- 1. [Decode String](../decode-string) (Medium)
- 1. [Encode String with Shortest Length](../encode-string-with-shortest-length) (Hard)
- 1. [Parse Lisp Expression](../parse-lisp-expression) (Hard)
-
-### Hints
-
-Hint 1
-To parse formula[i:], when we see a `'('`, we will parse recursively whatever is inside the brackets (up to the correct closing ending bracket) and add it to our count, multiplying by the following multiplicity if there is one.
-
-Otherwise, we should see an uppercase character: we will parse the rest of the letters to get the name, and add that (plus the multiplicity if there is one.)
-
diff --git a/problems/number-of-atoms/number_of_atoms.go b/problems/number-of-atoms/number_of_atoms.go
deleted file mode 100644
index 941046264..000000000
--- a/problems/number-of-atoms/number_of_atoms.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem726
diff --git a/problems/number-of-atoms/number_of_atoms_test.go b/problems/number-of-atoms/number_of_atoms_test.go
deleted file mode 100644
index 941046264..000000000
--- a/problems/number-of-atoms/number_of_atoms_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem726
diff --git a/problems/number-of-boomerangs/README.md b/problems/number-of-boomerangs/README.md
deleted file mode 100644
index 236720226..000000000
--- a/problems/number-of-boomerangs/README.md
+++ /dev/null
@@ -1,58 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../arithmetic-slices-ii-subsequence "Arithmetic Slices II - Subsequence")
-
-[Next >](../find-all-numbers-disappeared-in-an-array "Find All Numbers Disappeared in an Array")
-
-## [447. Number of Boomerangs (Medium)](https://leetcode.com/problems/number-of-boomerangs "回旋镖的数量")
-
-
You are given npoints in the plane that are all distinct, where points[i] = [xi, yi]. A boomerang is a tuple of points (i, j, k) such that the distance between i and j equals the distance between i and k(the order of the tuple matters).
-
-
Return the number of boomerangs.
-
-
-
Example 1:
-
-
-Input: points = [[0,0],[1,0],[2,0]]
-Output: 2
-Explanation: The two boomerangs are [[1,0],[0,0],[2,0]] and [[1,0],[2,0],[0,0]].
-
-
-
Example 2:
-
-
-Input: points = [[1,1],[2,2],[3,3]]
-Output: 2
-
-
-
Example 3:
-
-
-Input: points = [[1,1]]
-Output: 0
-
-
-
-
Constraints:
-
-
-
n == points.length
-
1 <= n <= 500
-
points[i].length == 2
-
-104 <= xi, yi <= 104
-
All the points are unique.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Math](../../tag/math/README.md)]
-
-### Similar Questions
- 1. [Line Reflection](../line-reflection) (Medium)
diff --git a/problems/number-of-boomerangs/number_of_boomerangs.go b/problems/number-of-boomerangs/number_of_boomerangs.go
deleted file mode 100644
index 7c071e644..000000000
--- a/problems/number-of-boomerangs/number_of_boomerangs.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem447
diff --git a/problems/number-of-boomerangs/number_of_boomerangs_test.go b/problems/number-of-boomerangs/number_of_boomerangs_test.go
deleted file mode 100644
index 7c071e644..000000000
--- a/problems/number-of-boomerangs/number_of_boomerangs_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem447
diff --git a/problems/number-of-burgers-with-no-waste-of-ingredients/README.md b/problems/number-of-burgers-with-no-waste-of-ingredients/README.md
deleted file mode 100644
index 2d56fac68..000000000
--- a/problems/number-of-burgers-with-no-waste-of-ingredients/README.md
+++ /dev/null
@@ -1,98 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../find-winner-on-a-tic-tac-toe-game "Find Winner on a Tic Tac Toe Game")
-
-[Next >](../count-square-submatrices-with-all-ones "Count Square Submatrices with All Ones")
-
-## [1276. Number of Burgers with No Waste of Ingredients (Medium)](https://leetcode.com/problems/number-of-burgers-with-no-waste-of-ingredients "不浪费原料的汉堡制作方案")
-
-
Given two integers tomatoSlices and cheeseSlices. The ingredients of different burgers are as follows:
-
-
-
Jumbo Burger: 4 tomato slices and 1 cheese slice.
-
Small Burger: 2 Tomato slices and 1 cheese slice.
-
-
-
Return [total_jumbo, total_small] so that the number of remaining tomatoSlices equal to 0 and the number of remaining cheeseSlices equal to 0. If it is not possible to make the remaining tomatoSlices and cheeseSlices equal to 0 return [].
-
-
-
Example 1:
-
-
-Input: tomatoSlices = 16, cheeseSlices = 7
-Output: [1,6]
-Explantion: To make one jumbo burger and 6 small burgers we need 4*1 + 2*6 = 16 tomato and 1 + 6 = 7 cheese. There will be no remaining ingredients.
-
-
-
Example 2:
-
-
-Input: tomatoSlices = 17, cheeseSlices = 4
-Output: []
-Explantion: There will be no way to use all ingredients to make small and jumbo burgers.
-
-
-
Example 3:
-
-
-Input: tomatoSlices = 4, cheeseSlices = 17
-Output: []
-Explantion: Making 1 jumbo burger there will be 16 cheese remaining and making 2 small burgers there will be 15 cheese remaining.
-
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
-
-### Hints
-
-Hint 1
-Can we have an answer if the number of tomatoes is odd ?
-
-
-
-Hint 2
-If we have answer will be there multiple answers or just one answer ?
-
-
-
-Hint 3
-Let us define number of jumbo burgers as X and number of small burgers as Y
-We have to find an x and y in this equation
-
-
-
-Hint 4
-1. 4X + 2Y = tomato
-
-
-
-Hint 5
-2. X + Y = cheese
-
diff --git a/problems/number-of-calls-between-two-persons/README.md b/problems/number-of-calls-between-two-persons/README.md
deleted file mode 100644
index 341c37f73..000000000
--- a/problems/number-of-calls-between-two-persons/README.md
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../number-of-distinct-substrings-in-a-string "Number of Distinct Substrings in a String")
-
-[Next >](../number-of-students-unable-to-eat-lunch "Number of Students Unable to Eat Lunch")
-
-## [1699. Number of Calls Between Two Persons (Medium)](https://leetcode.com/problems/number-of-calls-between-two-persons "两人之间的通话次数")
-
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/number-of-calls-between-two-persons/mysql_schemas.sql b/problems/number-of-calls-between-two-persons/mysql_schemas.sql
deleted file mode 100644
index d2578c68b..000000000
--- a/problems/number-of-calls-between-two-persons/mysql_schemas.sql
+++ /dev/null
@@ -1,9 +0,0 @@
-Create table If Not Exists Calls (from_id int, to_id int, duration int);
-Truncate table Calls;
-insert into Calls (from_id, to_id, duration) values ('1', '2', '59');
-insert into Calls (from_id, to_id, duration) values ('2', '1', '11');
-insert into Calls (from_id, to_id, duration) values ('1', '3', '20');
-insert into Calls (from_id, to_id, duration) values ('3', '4', '100');
-insert into Calls (from_id, to_id, duration) values ('3', '4', '200');
-insert into Calls (from_id, to_id, duration) values ('3', '4', '200');
-insert into Calls (from_id, to_id, duration) values ('4', '3', '499');
diff --git a/problems/number-of-closed-islands/README.md b/problems/number-of-closed-islands/README.md
deleted file mode 100644
index 1c2c4e1ee..000000000
--- a/problems/number-of-closed-islands/README.md
+++ /dev/null
@@ -1,75 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../reconstruct-a-2-row-binary-matrix "Reconstruct a 2-Row Binary Matrix")
-
-[Next >](../maximum-score-words-formed-by-letters "Maximum Score Words Formed by Letters")
-
-## [1254. Number of Closed Islands (Medium)](https://leetcode.com/problems/number-of-closed-islands "统计封闭岛屿的数目")
-
-
Given a 2D grid consists of 0s (land) and 1s (water). An island is a maximal 4-directionally connected group of 0s and a closed island is an island totally (all left, top, right, bottom) surrounded by 1s.
-
-
Return the number of closed islands.
-
-
-
Example 1:
-
-
-
-
-Input: grid = [[1,1,1,1,1,1,1,0],[1,0,0,0,0,1,1,0],[1,0,1,0,1,1,1,0],[1,0,0,0,0,1,0,1],[1,1,1,1,1,1,1,0]]
-Output: 2
-Explanation:
-Islands in gray are closed because they are completely surrounded by water (group of 1s).
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Union Find](../../tag/union-find/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
-
-### Hints
-
-Hint 1
-Exclude connected group of 0s on the corners because they are not closed island.
-
-
-
-Hint 2
-Return number of connected component of 0s on the grid.
-
diff --git a/problems/number-of-comments-per-post/README.md b/problems/number-of-comments-per-post/README.md
deleted file mode 100644
index b190512bd..000000000
--- a/problems/number-of-comments-per-post/README.md
+++ /dev/null
@@ -1,73 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../tiling-a-rectangle-with-the-fewest-squares "Tiling a Rectangle with the Fewest Squares")
-
-[Next >](../web-crawler-multithreaded "Web Crawler Multithreaded")
-
-## [1241. Number of Comments per Post (Easy)](https://leetcode.com/problems/number-of-comments-per-post "每个帖子的评论数")
-
-
Table: Submissions
-
-
+---------------+----------+
-| Column Name | Type |
-+---------------+----------+
-| sub_id | int |
-| parent_id | int |
-+---------------+----------+
-There is no primary key for this table, it may have duplicate rows.
-Each row can be a post or comment on the post.
-parent_id is null for posts.
-parent_id for comments is sub_id for another post in the table.
-
-
-
-
-
Write an SQL query to find number of comments per each post.
-
-
Result table should contain post_id and its corresponding number_of_comments, and must be sorted by post_id in ascending order.
-
-
Submissions may contain duplicate comments. You should count the number of unique comments per post.
-
-
Submissions may contain duplicate posts. You should treat them as one post.
-
-
The query result format is in the following example:
-
-
Submissions table:
-+---------+------------+
-| sub_id | parent_id |
-+---------+------------+
-| 1 | Null |
-| 2 | Null |
-| 1 | Null |
-| 12 | Null |
-| 3 | 1 |
-| 5 | 2 |
-| 3 | 1 |
-| 4 | 1 |
-| 9 | 1 |
-| 10 | 2 |
-| 6 | 7 |
-+---------+------------+
-
-Result table:
-+---------+--------------------+
-| post_id | number_of_comments |
-+---------+--------------------+
-| 1 | 3 |
-| 2 | 2 |
-| 12 | 0 |
-+---------+--------------------+
-
-The post with id 1 has three comments in the table with id 3, 4 and 9. The comment with id 3 is repeated in the table, we counted it only once.
-The post with id 2 has two comments in the table with id 5 and 10.
-The post with id 12 has no comments in the table.
-The comment with id 6 is a comment on a deleted post with id 7 so we ignored it.
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/number-of-comments-per-post/mysql_schemas.sql b/problems/number-of-comments-per-post/mysql_schemas.sql
deleted file mode 100644
index cf53a553f..000000000
--- a/problems/number-of-comments-per-post/mysql_schemas.sql
+++ /dev/null
@@ -1,13 +0,0 @@
-Create table If Not Exists Submissions (sub_id int, parent_id int);
-Truncate table Submissions;
-insert into Submissions (sub_id, parent_id) values ('1', 'None');
-insert into Submissions (sub_id, parent_id) values ('2', 'None');
-insert into Submissions (sub_id, parent_id) values ('1', 'None');
-insert into Submissions (sub_id, parent_id) values ('12', 'None');
-insert into Submissions (sub_id, parent_id) values ('3', '1');
-insert into Submissions (sub_id, parent_id) values ('5', '2');
-insert into Submissions (sub_id, parent_id) values ('3', '1');
-insert into Submissions (sub_id, parent_id) values ('4', '1');
-insert into Submissions (sub_id, parent_id) values ('9', '1');
-insert into Submissions (sub_id, parent_id) values ('10', '2');
-insert into Submissions (sub_id, parent_id) values ('6', '7');
diff --git a/problems/number-of-connected-components-in-an-undirected-graph/README.md b/problems/number-of-connected-components-in-an-undirected-graph/README.md
deleted file mode 100644
index c7a635238..000000000
--- a/problems/number-of-connected-components-in-an-undirected-graph/README.md
+++ /dev/null
@@ -1,52 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../coin-change "Coin Change")
-
-[Next >](../wiggle-sort-ii "Wiggle Sort II")
-
-## [323. Number of Connected Components in an Undirected Graph (Medium)](https://leetcode.com/problems/number-of-connected-components-in-an-undirected-graph "无向图中连通分量的数目")
-
-
Given n nodes labeled from 0 to n - 1 and a list of undirected edges (each edge is a pair of nodes), write a function to find the number of connected components in an undirected graph.
Note:
-You can assume that no duplicate edges will appear in edges. Since all edges are undirected, [0, 1] is the same as [1, 0] and thus will not appear together in edges.
Given a grid where each entry is only 0 or 1, find the number of corner rectangles.
-
-
A corner rectangle is 4 distinct 1s on the grid that form an axis-aligned rectangle. Note that only the corners need to have the value 1. Also, all four 1s used must be distinct.
-
-
-
-
Example 1:
-
-
-Input: grid =
-[[1, 0, 0, 1, 0],
- [0, 0, 1, 0, 1],
- [0, 0, 0, 1, 0],
- [1, 0, 1, 0, 1]]
-Output: 1
-Explanation: There is only one corner rectangle, with corners grid[1][2], grid[1][4], grid[3][2], grid[3][4].
-
-
-
-
-
Example 2:
-
-
-Input: grid =
-[[1, 1, 1],
- [1, 1, 1],
- [1, 1, 1]]
-Output: 9
-Explanation: There are four 2x2 rectangles, four 2x3 and 3x2 rectangles, and one 3x3 rectangle.
-
-
-
-
-
Example 3:
-
-
-Input: grid =
-[[1, 1, 1, 1]]
-Output: 0
-Explanation: Rectangles must have four distinct corners.
-
-
-
-
-
Note:
-
-
-
The number of rows and columns of grid will each be in the range [1, 200].
-
Each grid[i][j] will be either 0 or 1.
-
The number of 1s in the grid will be at most 6000.
-
-
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Math](../../tag/math/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
-
-### Hints
-
-Hint 1
-For each pair of 1s in the new row (say at `new_row[i]` and `new_row[j]`), we could create more rectangles where that pair forms the base. The number of new rectangles is the number of times some previous row had `row[i] = row[j] = 1`.
-
diff --git a/problems/number-of-corner-rectangles/number_of_corner_rectangles.go b/problems/number-of-corner-rectangles/number_of_corner_rectangles.go
deleted file mode 100644
index c6028923f..000000000
--- a/problems/number-of-corner-rectangles/number_of_corner_rectangles.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem750
diff --git a/problems/number-of-corner-rectangles/number_of_corner_rectangles_test.go b/problems/number-of-corner-rectangles/number_of_corner_rectangles_test.go
deleted file mode 100644
index c6028923f..000000000
--- a/problems/number-of-corner-rectangles/number_of_corner_rectangles_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem750
diff --git a/problems/number-of-days-between-two-dates/README.md b/problems/number-of-days-between-two-dates/README.md
deleted file mode 100644
index 6f1fd8d63..000000000
--- a/problems/number-of-days-between-two-dates/README.md
+++ /dev/null
@@ -1,56 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../count-all-valid-pickup-and-delivery-options "Count All Valid Pickup and Delivery Options")
-
-[Next >](../validate-binary-tree-nodes "Validate Binary Tree Nodes")
-
-## [1360. Number of Days Between Two Dates (Easy)](https://leetcode.com/problems/number-of-days-between-two-dates "日期之间隔几天")
-
-
Write a program to count the number of days between two dates.
-
-
The two dates are given as strings, their format is YYYY-MM-DD as shown in the examples.
The given dates are valid dates between the years 1971 and 2100.
-
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Hints
-
-Hint 1
-Create a function f(date) that counts the number of days from 1900-01-01 to date. How can we calculate the answer ?
-
-
-
-Hint 2
-The answer is just |f(date1) - f(date2)|.
-
-
-
-Hint 3
-How to construct f(date) ?
-
-
-
-Hint 4
-For each year from 1900 to year - 1 sum up 365 or 366 in case of leap years. Then sum up for each month the number of days, consider the case when the current year is leap, finally sum up the days.
-
diff --git a/problems/number-of-days-in-a-month/README.md b/problems/number-of-days-in-a-month/README.md
deleted file mode 100644
index 217dbebec..000000000
--- a/problems/number-of-days-in-a-month/README.md
+++ /dev/null
@@ -1,60 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../building-h2o "Building H2O")
-
-[Next >](../remove-vowels-from-a-string "Remove Vowels from a String")
-
-## [1118. Number of Days in a Month (Easy)](https://leetcode.com/problems/number-of-days-in-a-month "一月有多少天")
-
-
Given a year Y and a month M, return how many days there are in that month.
-
-
-
-
Example 1:
-
-
-Input: Y = 1992, M = 7
-Output: 31
-
-
-
Example 2:
-
-
-Input: Y = 2000, M = 2
-Output: 29
-
-
-
Example 3:
-
-
-Input: Y = 1900, M = 2
-Output: 28
-
-
-
-
-
Note:
-
-
-
1583 <= Y <= 2100
-
1 <= M <= 12
-
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
-
-### Hints
-
-Hint 1
-Does February have 28 days or 29 days?
-
-
-
-Hint 2
-Think of Leap years.
-
diff --git a/problems/number-of-dice-rolls-with-target-sum/README.md b/problems/number-of-dice-rolls-with-target-sum/README.md
deleted file mode 100644
index 2a075c709..000000000
--- a/problems/number-of-dice-rolls-with-target-sum/README.md
+++ /dev/null
@@ -1,64 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../day-of-the-year "Day of the Year")
-
-[Next >](../swap-for-longest-repeated-character-substring "Swap For Longest Repeated Character Substring")
-
-## [1155. Number of Dice Rolls With Target Sum (Medium)](https://leetcode.com/problems/number-of-dice-rolls-with-target-sum "掷骰子的N种方法")
-
-
You have n dice and each die has k faces numbered from 1 to k.
-
-
Given three integers n, k, and target, return the number of possible ways (out of the kn total ways) to roll the dice so the sum of the face-up numbers equals target. Since the answer may be too large, return it modulo109 + 7.
-
-
-
Example 1:
-
-
-Input: n = 1, k = 6, target = 3
-Output: 1
-Explanation: You throw one die with 6 faces.
-There is only one way to get a sum of 3.
-
-
-
Example 2:
-
-
-Input: n = 2, k = 6, target = 7
-Output: 6
-Explanation: You throw two dice, each with 6 faces.
-There are 6 ways to get a sum of 7: 1+6, 2+5, 3+4, 4+3, 5+2, 6+1.
-
-
-
Example 3:
-
-
-Input: n = 30, k = 30, target = 500
-Output: 222616187
-Explanation: The answer must be returned modulo 109 + 7.
-
-
-
-
Constraints:
-
-
-
1 <= n, k <= 30
-
1 <= target <= 1000
-
-
-### Related Topics
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Similar Questions
- 1. [Equal Sum Arrays With Minimum Number of Operations](../equal-sum-arrays-with-minimum-number-of-operations) (Medium)
- 1. [Find Missing Observations](../find-missing-observations) (Medium)
-
-### 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-different-integers-in-a-string/README.md b/problems/number-of-different-integers-in-a-string/README.md
deleted file mode 100644
index 0da225fa1..000000000
--- a/problems/number-of-different-integers-in-a-string/README.md
+++ /dev/null
@@ -1,68 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../implement-trie-ii-prefix-tree "Implement Trie II (Prefix Tree)")
-
-[Next >](../minimum-number-of-operations-to-reinitialize-a-permutation "Minimum Number of Operations to Reinitialize a Permutation")
-
-## [1805. Number of Different Integers in a String (Easy)](https://leetcode.com/problems/number-of-different-integers-in-a-string "字符串中不同整数的数目")
-
-
You are given a string word that consists of digits and lowercase English letters.
-
-
You will replace every non-digit character with a space. For example, "a123bc34d8ef34" will become " 123 34 8 34". Notice that you are left with some integers that are separated by at least one space: "123", "34", "8", and "34".
-
-
Return the number of different integers after performing the replacement operations on word.
-
-
Two integers are considered different if their decimal representations without any leading zeros are different.
-
-
-
Example 1:
-
-
-Input: word = "a123bc34d8ef34"
-Output: 3
-Explanation: The three different integers are "123", "34", and "8". Notice that "34" is only counted once.
-
-
-
Example 2:
-
-
-Input: word = "leet1234code234"
-Output: 2
-
-
-
Example 3:
-
-
-Input: word = "a1b01c001"
-Output: 1
-Explanation: The three integers "1", "01", and "001" all represent the same integer because
-the leading zeros are ignored when comparing their decimal values.
-
-
-
-
Constraints:
-
-
-
1 <= word.length <= 1000
-
word consists of digits and lowercase English letters.
-
-
-### Related Topics
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Hints
-
-Hint 1
-Try to split the string so that each integer is in a different string.
-
-
-
-Hint 2
-Try to remove each integer's leading zeroes and compare the strings to find how many of them are unique.
-
diff --git a/problems/number-of-different-subsequences-gcds/README.md b/problems/number-of-different-subsequences-gcds/README.md
deleted file mode 100644
index 3665c4ac0..000000000
--- a/problems/number-of-different-subsequences-gcds/README.md
+++ /dev/null
@@ -1,80 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-absolute-sum-difference "Minimum Absolute Sum Difference")
-
-[Next >](../maximum-number-of-accepted-invitations "Maximum Number of Accepted Invitations")
-
-## [1819. Number of Different Subsequences GCDs (Hard)](https://leetcode.com/problems/number-of-different-subsequences-gcds "序列中不同最大公约数的数目")
-
-
You are given an array nums that consists of positive integers.
-
-
The GCD of a sequence of numbers is defined as the greatest integer that divides all the numbers in the sequence evenly.
-
-
-
For example, the GCD of the sequence [4,6,16] is 2.
-
-
-
A subsequence of an array is a sequence that can be formed by removing some elements (possibly none) of the array.
-
-
-
For example, [2,5,10] is a subsequence of [1,2,1,2,4,1,5,10].
-
-
-
Return the number of different GCDs among all non-empty subsequences ofnums.
-
-
-
Example 1:
-
-
-Input: nums = [6,10,3]
-Output: 5
-Explanation: The figure shows all the non-empty subsequences and their GCDs.
-The different GCDs are 6, 10, 3, 2, and 1.
-
-
-
Example 2:
-
-
-Input: nums = [5,15,40,5,6]
-Output: 7
-
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 105
-
1 <= nums[i] <= 2 * 105
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Math](../../tag/math/README.md)]
- [[Counting](../../tag/counting/README.md)]
- [[Number Theory](../../tag/number-theory/README.md)]
-
-### Hints
-
-Hint 1
-Think of how to check if a number x is a gcd of a subsequence.
-
-
-
-Hint 2
-If there is such subsequence, then all of it will be divisible by x. Moreover, if you divide each number in the subsequence by x , then the gcd of the resulting numbers will be 1.
-
-
-
-Hint 3
-Adding a number to a subsequence cannot increase its gcd. So, if there is a valid subsequence for x , then the subsequence that contains all multiples of x is a valid one too.
-
-
-
-Hint 4
-Iterate on all possiblex from 1 to 10^5, and check if there is a valid subsequence for x.
-
diff --git a/problems/number-of-digit-one/README.md b/problems/number-of-digit-one/README.md
deleted file mode 100644
index efc194352..000000000
--- a/problems/number-of-digit-one/README.md
+++ /dev/null
@@ -1,51 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../implement-queue-using-stacks "Implement Queue using Stacks")
-
-[Next >](../palindrome-linked-list "Palindrome Linked List")
-
-## [233. Number of Digit One (Hard)](https://leetcode.com/problems/number-of-digit-one "数字 1 的个数")
-
-
Given an integer n, count the total number of digit 1 appearing in all non-negative integers less than or equal ton.
Given a non-empty 2D array grid of 0's and 1's, an island is a group of 1's (representing land) connected 4-directionally (horizontal or vertical.) You may assume all four edges of the grid are surrounded by water.
-
-
Count the number of distinct islands. An island is considered to be the same as another if they have the same shape, or have the same shape after rotation (90, 180, or 270 degrees only) or reflection (left/right direction or up/down direction).
-
-
Example 1:
-
-11000
-10000
-00001
-00011
-
-Given the above grid map, return 1.
-
-Notice that:
-
-11
-1
-
-and
-
- 1
-11
-
-are considered same island shapes. Because if we make a 180 degrees clockwise rotation on the first island, then two islands will have the same shapes.
-
-
-
Example 2:
-
-11100
-10001
-01001
-01110
-Given the above grid map, return 2.
-
-Here are the two distinct islands:
-
-111
-1
-
-and
-
-1
-1
-
-
-Notice that:
-
-111
-1
-
-and
-
-1
-111
-
-are considered same island shapes. Because if we flip the first array in the up/down direction, then they have the same shapes.
-
-
-
Note:
-The length of each dimension in the given grid does not exceed 50.
-
-
-### Related Topics
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Union Find](../../tag/union-find/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Hash Function](../../tag/hash-function/README.md)]
-
-### Similar Questions
- 1. [Number of Distinct Islands](../number-of-distinct-islands) (Medium)
diff --git a/problems/number-of-distinct-islands-ii/number_of_distinct_islands_ii.go b/problems/number-of-distinct-islands-ii/number_of_distinct_islands_ii.go
deleted file mode 100644
index 3aae5265d..000000000
--- a/problems/number-of-distinct-islands-ii/number_of_distinct_islands_ii.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem711
diff --git a/problems/number-of-distinct-islands-ii/number_of_distinct_islands_ii_test.go b/problems/number-of-distinct-islands-ii/number_of_distinct_islands_ii_test.go
deleted file mode 100644
index 3aae5265d..000000000
--- a/problems/number-of-distinct-islands-ii/number_of_distinct_islands_ii_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem711
diff --git a/problems/number-of-distinct-islands/README.md b/problems/number-of-distinct-islands/README.md
deleted file mode 100644
index 67b054bcc..000000000
--- a/problems/number-of-distinct-islands/README.md
+++ /dev/null
@@ -1,60 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../binary-number-with-alternating-bits "Binary Number with Alternating Bits")
-
-[Next >](../max-area-of-island "Max Area of Island")
-
-## [694. Number of Distinct Islands (Medium)](https://leetcode.com/problems/number-of-distinct-islands "不同岛屿的数量")
-
-
Given a non-empty 2D array grid of 0's and 1's, an island is a group of 1's (representing land) connected 4-directionally (horizontal or vertical.) You may assume all four edges of the grid are surrounded by water.
-
-
Count the number of distinct islands. An island is considered to be the same as another if and only if one island can be translated (and not rotated or reflected) to equal the other.
-
-
Example 1:
-
-11000
-11000
-00011
-00011
-
-Given the above grid map, return 1.
-
-
-
Example 2:
-
11011
-10000
-00001
-11011
-Given the above grid map, return 3.
-Notice that:
-
-11
-1
-
-and
-
- 1
-11
-
-are considered different island shapes, because we do not consider reflection / rotation.
-
-
-
Note:
-The length of each dimension in the given grid does not exceed 50.
-
-
-### Related Topics
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Union Find](../../tag/union-find/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Hash Function](../../tag/hash-function/README.md)]
-
-### Similar Questions
- 1. [Number of Islands](../number-of-islands) (Medium)
- 1. [Number of Distinct Islands II](../number-of-distinct-islands-ii) (Hard)
diff --git a/problems/number-of-distinct-islands/number_of_distinct_islands.go b/problems/number-of-distinct-islands/number_of_distinct_islands.go
deleted file mode 100644
index cf18ea1fe..000000000
--- a/problems/number-of-distinct-islands/number_of_distinct_islands.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem694
diff --git a/problems/number-of-distinct-islands/number_of_distinct_islands_test.go b/problems/number-of-distinct-islands/number_of_distinct_islands_test.go
deleted file mode 100644
index cf18ea1fe..000000000
--- a/problems/number-of-distinct-islands/number_of_distinct_islands_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem694
diff --git a/problems/number-of-distinct-substrings-in-a-string/README.md b/problems/number-of-distinct-substrings-in-a-string/README.md
deleted file mode 100644
index 97806c83a..000000000
--- a/problems/number-of-distinct-substrings-in-a-string/README.md
+++ /dev/null
@@ -1,42 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../checking-existence-of-edge-length-limited-paths "Checking Existence of Edge Length Limited Paths")
-
-[Next >](../number-of-calls-between-two-persons "Number of Calls Between Two Persons")
-
-## [1698. Number of Distinct Substrings in a String (Medium)](https://leetcode.com/problems/number-of-distinct-substrings-in-a-string "字符串的不同子字符串个数")
-
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
- [[Trie](../../tag/trie/README.md)]
- [[Rolling Hash](../../tag/rolling-hash/README.md)]
- [[Suffix Array](../../tag/suffix-array/README.md)]
- [[Hash Function](../../tag/hash-function/README.md)]
-
-### Hints
-
-Hint 1
-Calculate the prefix hashing array for s.
-
-
-
-Hint 2
-Use the prefix hashing array to calculate the hashing value of each substring.
-
-
-
-Hint 3
-Compare the hashing values to determine the unique substrings.
-
-
-
-Hint 4
-There could be collisions if you use hashing, what about double hashing.
-
diff --git a/problems/number-of-enclaves/README.md b/problems/number-of-enclaves/README.md
deleted file mode 100644
index 7a7d21404..000000000
--- a/problems/number-of-enclaves/README.md
+++ /dev/null
@@ -1,64 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../next-greater-node-in-linked-list "Next Greater Node In Linked List")
-
-[Next >](../remove-outermost-parentheses "Remove Outermost Parentheses")
-
-## [1020. Number of Enclaves (Medium)](https://leetcode.com/problems/number-of-enclaves "飞地的数量")
-
-
You are given an m x n binary matrix grid, where 0 represents a sea cell and 1 represents a land cell.
-
-
A move consists of walking from one land cell to another adjacent (4-directionally) land cell or walking off the boundary of the grid.
-
-
Return the number of land cells ingridfor which we cannot walk off the boundary of the grid in any number of moves.
-
-
-
Example 1:
-
-
-Input: grid = [[0,0,0,0],[1,0,1,0],[0,1,1,0],[0,0,0,0]]
-Output: 3
-Explanation: There are three 1s that are enclosed by 0s, and one 1 that is not enclosed because its on the boundary.
-
-
-
Example 2:
-
-
-Input: grid = [[0,1,1,0],[0,0,1,0],[0,0,1,0],[0,0,0,0]]
-Output: 0
-Explanation: All 1s are either on the boundary or can reach the boundary.
-
-
-
-
Constraints:
-
-
-
m == grid.length
-
n == grid[i].length
-
1 <= m, n <= 500
-
grid[i][j] is either 0 or 1.
-
-
-### Related Topics
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Union Find](../../tag/union-find/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
-
-### Hints
-
-Hint 1
-Can you model this problem as a graph problem? Create n * m + 1 nodes where n * m nodes represents each cell of the map and one extra node to represent the exterior of the map.
-
-
-
-Hint 2
-In the map add edges between neighbors on land cells. And add edges between the exterior and land nodes which are in the boundary.
-Return as answer the number of nodes that are not reachable from the exterior node.
-
diff --git a/problems/number-of-enclaves/number_of_enclaves.go b/problems/number-of-enclaves/number_of_enclaves.go
deleted file mode 100644
index 360588a7c..000000000
--- a/problems/number-of-enclaves/number_of_enclaves.go
+++ /dev/null
@@ -1,44 +0,0 @@
-package problem1020
-
-var dx = [4]int{-1, 1, 0, 0}
-var dy = [4]int{0, 0, -1, 1}
-
-func numEnclaves(A [][]int) int {
- m, n := len(A), len(A[0])
-
- var dfs func(int, int)
- dfs = func(x, y int) {
- if x < 0 || m <= x ||
- y < 0 || n <= y ||
- A[x][y] == 0 {
- return
- }
- A[x][y] = 0
- for i := 0; i < 4; i++ {
- dfs(x+dx[i], y+dy[i])
- }
- }
-
- line := func(i, di, j, dj int) {
- for i < m && j < n {
- dfs(i, j)
- i += di
- j += dj
- }
- }
-
- // search from the boundary
- line(0, 0, 0, 1) // top
- line(m-1, 0, 0, 1) // down
- line(0, 1, 0, 0) // left
- line(0, 1, n-1, 0) // right
-
- res := 0
- for i := 0; i < m; i++ {
- for j := 0; j < n; j++ {
- res += A[i][j]
- }
- }
-
- return res
-}
diff --git a/problems/number-of-equal-count-substrings/README.md b/problems/number-of-equal-count-substrings/README.md
deleted file mode 100644
index 1b65042c0..000000000
--- a/problems/number-of-equal-count-substrings/README.md
+++ /dev/null
@@ -1,40 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../account-balance "Account Balance")
-
-[Next >](../check-whether-two-strings-are-almost-equivalent "Check Whether Two Strings are Almost Equivalent")
-
-## [2067. Number of Equal Count Substrings (Medium)](https://leetcode.com/problems/number-of-equal-count-substrings "")
-
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
- [[Counting](../../tag/counting/README.md)]
- [[Prefix Sum](../../tag/prefix-sum/README.md)]
-
-### Hints
-
-Hint 1
-The brute force solution is to check every substring, which would TLE. How can we improve this solution?
-
-
-
-Hint 2
-In an equal count substring, the first character appears count times, the second character appears count times, and so on.
-
-
-
-Hint 3
-The length of an equal count substring is the number of unique characters multiplied by count.
-
-
-
-Hint 4
-The length of all equal count substrings are multiples of count.
-
diff --git a/problems/number-of-equivalent-domino-pairs/README.md b/problems/number-of-equivalent-domino-pairs/README.md
deleted file mode 100644
index 188b4d506..000000000
--- a/problems/number-of-equivalent-domino-pairs/README.md
+++ /dev/null
@@ -1,56 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../user-purchase-platform "User Purchase Platform")
-
-[Next >](../shortest-path-with-alternating-colors "Shortest Path with Alternating Colors")
-
-## [1128. Number of Equivalent Domino Pairs (Easy)](https://leetcode.com/problems/number-of-equivalent-domino-pairs "等价多米诺骨牌对的数量")
-
-
Given a list of dominoes, dominoes[i] = [a, b] is equivalent todominoes[j] = [c, d] if and only if either (a == c and b == d), or (a == d and b == c) - that is, one domino can be rotated to be equal to another domino.
-
-
Return the number of pairs (i, j) for which 0 <= i < j < dominoes.length, and dominoes[i] is equivalent todominoes[j].
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Counting](../../tag/counting/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/number-of-good-leaf-nodes-pairs/README.md b/problems/number-of-good-leaf-nodes-pairs/README.md
deleted file mode 100644
index d01430c7f..000000000
--- a/problems/number-of-good-leaf-nodes-pairs/README.md
+++ /dev/null
@@ -1,71 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-suffix-flips "Minimum Suffix Flips")
-
-[Next >](../string-compression-ii "String Compression II")
-
-## [1530. Number of Good Leaf Nodes Pairs (Medium)](https://leetcode.com/problems/number-of-good-leaf-nodes-pairs "好叶子节点对的数量")
-
-
You are given the root of a binary tree and an integer distance. A pair of two different leaf nodes of a binary tree is said to be good if the length of the shortest path between them is less than or equal to distance.
-
-
Return the number of good leaf node pairs in the tree.
-
-
-
Example 1:
-
-
-Input: root = [1,2,3,null,4], distance = 3
-Output: 1
-Explanation: The leaf nodes of the tree are 3 and 4 and the length of the shortest path between them is 3. This is the only good pair.
-
-
-
Example 2:
-
-
-Input: root = [1,2,3,4,5,6,7], distance = 3
-Output: 2
-Explanation: The good pairs are [4,5] and [6,7] with shortest path = 2. The pair [4,6] is not good because the length of ther shortest path between them is 4.
-
-
-
Example 3:
-
-
-Input: root = [7,1,4,6,null,5,3,null,null,null,null,null,2], distance = 3
-Output: 1
-Explanation: The only good pair is [2,5].
-
-
-
-
Constraints:
-
-
-
The number of nodes in the tree is in the range [1, 210].
-
1 <= Node.val <= 100
-
1 <= distance <= 10
-
-
-### Related Topics
- [[Tree](../../tag/tree/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Binary Tree](../../tag/binary-tree/README.md)]
-
-### Hints
-
-Hint 1
-Start DFS from each leaf node. stop the DFS when the number of steps done > distance.
-
-
-
-Hint 2
-If you reach another leaf node within distance steps, add 1 to the answer.
-
-
-
-Hint 3
-Note that all pairs will be counted twice so divide the answer by 2.
-
diff --git a/problems/number-of-good-pairs/README.md b/problems/number-of-good-pairs/README.md
deleted file mode 100644
index f7631e3ce..000000000
--- a/problems/number-of-good-pairs/README.md
+++ /dev/null
@@ -1,64 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../customer-order-frequency "Customer Order Frequency")
-
-[Next >](../number-of-substrings-with-only-1s "Number of Substrings With Only 1s")
-
-## [1512. Number of Good Pairs (Easy)](https://leetcode.com/problems/number-of-good-pairs "好数对的数目")
-
-
Given an array of integers nums, return the number of good pairs.
-
-
A pair (i, j) is called good if nums[i] == nums[j] and i < j.
-
-
-
Example 1:
-
-
-Input: nums = [1,2,3,1,1,3]
-Output: 4
-Explanation: There are 4 good pairs (0,3), (0,4), (3,4), (2,5) 0-indexed.
-
-
-
Example 2:
-
-
-Input: nums = [1,1,1,1]
-Output: 6
-Explanation: Each pair in the array are good.
-
-
-
Example 3:
-
-
-Input: nums = [1,2,3]
-Output: 0
-
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 100
-
1 <= nums[i] <= 100
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Math](../../tag/math/README.md)]
- [[Counting](../../tag/counting/README.md)]
-
-### Similar Questions
- 1. [Number of Pairs of Interchangeable Rectangles](../number-of-pairs-of-interchangeable-rectangles) (Medium)
- 1. [Substrings That Begin and End With the Same Letter](../substrings-that-begin-and-end-with-the-same-letter) (Medium)
-
-### Hints
-
-Hint 1
-Count how many times each number appears. If a number appears n times, then n * (n – 1) // 2 good pairs can be made with this number.
-
diff --git a/problems/number-of-good-ways-to-split-a-string/README.md b/problems/number-of-good-ways-to-split-a-string/README.md
deleted file mode 100644
index 39d75a7e4..000000000
--- a/problems/number-of-good-ways-to-split-a-string/README.md
+++ /dev/null
@@ -1,59 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../number-of-sub-arrays-with-odd-sum "Number of Sub-arrays With Odd Sum")
-
-[Next >](../minimum-number-of-increments-on-subarrays-to-form-a-target-array "Minimum Number of Increments on Subarrays to Form a Target Array")
-
-## [1525. Number of Good Ways to Split a String (Medium)](https://leetcode.com/problems/number-of-good-ways-to-split-a-string "字符串的好分割数目")
-
-
You are given a string s.
-
-
A split is called good if you can split s into two non-empty strings sleft and sright where their concatenation is equal to s (i.e., sleft + sright = s) and the number of distinct letters in sleft and sright is the same.
-
-
Return the number of good splits you can make in s.
-
-
-
Example 1:
-
-
-Input: s = "aacaba"
-Output: 2
-Explanation: There are 5 ways to split "aacaba" and 2 of them are good.
-("a", "acaba") Left string and right string contains 1 and 3 different letters respectively.
-("aa", "caba") Left string and right string contains 1 and 3 different letters respectively.
-("aac", "aba") Left string and right string contains 2 and 2 different letters respectively (good split).
-("aaca", "ba") Left string and right string contains 2 and 2 different letters respectively (good split).
-("aacab", "a") Left string and right string contains 3 and 1 different letters respectively.
-
-
-
Example 2:
-
-
-Input: s = "abcd"
-Output: 1
-Explanation: Split the string as follows ("ab", "cd").
-
-
-
-
Constraints:
-
-
-
1 <= s.length <= 105
-
s consists of only lowercase English letters.
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Bit Manipulation](../../tag/bit-manipulation/README.md)]
-
-### Hints
-
-Hint 1
-Use two HashMap to store the counts of distinct letters in the left and right substring divided by the current index.
-
diff --git a/problems/number-of-islands-ii/README.md b/problems/number-of-islands-ii/README.md
deleted file mode 100644
index d11faa469..000000000
--- a/problems/number-of-islands-ii/README.md
+++ /dev/null
@@ -1,74 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../range-sum-query-2d-immutable "Range Sum Query 2D - Immutable")
-
-[Next >](../additive-number "Additive Number")
-
-## [305. Number of Islands II (Hard)](https://leetcode.com/problems/number-of-islands-ii "岛屿数量 II")
-
-
A 2d grid map of m rows and n columns is initially filled with water. We may perform an addLand operation which turns the water at position (row, col) into a land. Given a list of positions to operate, count the number of islands after each addLand operation. An island is surrounded by water and is formed by connecting adjacent lands horizontally or vertically. You may assume all four edges of the grid are all surrounded by water.
-
-
Example:
-
-
-Input: m = 3, n = 3, positions = [[0,0], [0,1], [1,2], [2,1]]
-Output: [1,1,2,3]
-
-
-
Explanation:
-
-
Initially, the 2d grid grid is filled with water. (Assume 0 represents water and 1 represents land).
-
-
-0 0 0
-0 0 0
-0 0 0
-
-
-
Operation #1: addLand(0, 0) turns the water at grid[0][0] into a land.
-
-
-1 0 0
-0 0 0 Number of islands = 1
-0 0 0
-
-
-
Operation #2: addLand(0, 1) turns the water at grid[0][1] into a land.
-
-
-1 1 0
-0 0 0 Number of islands = 1
-0 0 0
-
-
-
Operation #3: addLand(1, 2) turns the water at grid[1][2] into a land.
-
-
-1 1 0
-0 0 1 Number of islands = 2
-0 0 0
-
-
-
Operation #4: addLand(2, 1) turns the water at grid[2][1] into a land.
-
-
-1 1 0
-0 0 1 Number of islands = 3
-0 1 0
-
-
-
Follow up:
-
-
Can you do it in time complexity O(k log mn), where k is the length of the positions?
-
-### Related Topics
- [[Union Find](../../tag/union-find/README.md)]
- [[Array](../../tag/array/README.md)]
-
-### Similar Questions
- 1. [Number of Islands](../number-of-islands) (Medium)
diff --git a/problems/number-of-islands-ii/number_of_islands_ii.go b/problems/number-of-islands-ii/number_of_islands_ii.go
deleted file mode 100644
index f9ddc34b9..000000000
--- a/problems/number-of-islands-ii/number_of_islands_ii.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem305
diff --git a/problems/number-of-islands-ii/number_of_islands_ii_test.go b/problems/number-of-islands-ii/number_of_islands_ii_test.go
deleted file mode 100644
index f9ddc34b9..000000000
--- a/problems/number-of-islands-ii/number_of_islands_ii_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem305
diff --git a/problems/number-of-islands/README.md b/problems/number-of-islands/README.md
deleted file mode 100644
index f0a9b1b79..000000000
--- a/problems/number-of-islands/README.md
+++ /dev/null
@@ -1,66 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../binary-tree-right-side-view "Binary Tree Right Side View")
-
-[Next >](../bitwise-and-of-numbers-range "Bitwise AND of Numbers Range")
-
-## [200. Number of Islands (Medium)](https://leetcode.com/problems/number-of-islands "岛屿数量")
-
-
Given an m x n 2D binary grid grid which represents a map of '1's (land) and '0's (water), return the number of islands.
-
-
An island is surrounded by water and is formed by connecting adjacent lands horizontally or vertically. You may assume all four edges of the grid are all surrounded by water.
-
-### Related Topics
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Union Find](../../tag/union-find/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
-
-### Similar Questions
- 1. [Surrounded Regions](../surrounded-regions) (Medium)
- 1. [Walls and Gates](../walls-and-gates) (Medium)
- 1. [Number of Islands II](../number-of-islands-ii) (Hard)
- 1. [Number of Connected Components in an Undirected Graph](../number-of-connected-components-in-an-undirected-graph) (Medium)
- 1. [Number of Distinct Islands](../number-of-distinct-islands) (Medium)
- 1. [Max Area of Island](../max-area-of-island) (Medium)
diff --git a/problems/number-of-islands/number_of_islands.go b/problems/number-of-islands/number_of_islands.go
deleted file mode 100644
index cd42e2c11..000000000
--- a/problems/number-of-islands/number_of_islands.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem200
diff --git a/problems/number-of-islands/number_of_islands_test.go b/problems/number-of-islands/number_of_islands_test.go
deleted file mode 100644
index cd42e2c11..000000000
--- a/problems/number-of-islands/number_of_islands_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem200
diff --git a/problems/number-of-laser-beams-in-a-bank/README.md b/problems/number-of-laser-beams-in-a-bank/README.md
deleted file mode 100644
index 831713168..000000000
--- a/problems/number-of-laser-beams-in-a-bank/README.md
+++ /dev/null
@@ -1,89 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../check-if-all-as-appears-before-all-bs "Check if All A's Appears Before All B's")
-
-[Next >](../destroying-asteroids "Destroying Asteroids")
-
-## [2125. Number of Laser Beams in a Bank (Medium)](https://leetcode.com/problems/number-of-laser-beams-in-a-bank "银行中的激光束数量")
-
-
Anti-theft security devices are activated inside a bank. You are given a 0-indexed binary string array bank representing the floor plan of the bank, which is an m x n 2D matrix. bank[i] represents the ith row, consisting of '0's and '1's. '0' means the cell is empty, while'1' means the cell has a security device.
-
-
There is one laser beam between any two security devices if both conditions are met:
-
-
-
The two devices are located on two different rows: r1 and r2, where r1 < r2.
-
For each row i where r1 < i < r2, there are no security devices in the ith row.
-
-
-
Laser beams are independent, i.e., one beam does not interfere nor join with another.
-
-
Return the total number of laser beams in the bank.
-
-
-
Example 1:
-
-
-Input: bank = ["011001","000000","010100","001000"]
-Output: 8
-Explanation: Between each of the following device pairs, there is one beam. In total, there are 8 beams:
- * bank[0][1] -- bank[2][1]
- * bank[0][1] -- bank[2][3]
- * bank[0][2] -- bank[2][1]
- * bank[0][2] -- bank[2][3]
- * bank[0][5] -- bank[2][1]
- * bank[0][5] -- bank[2][3]
- * bank[2][1] -- bank[3][2]
- * bank[2][3] -- bank[3][2]
-Note that there is no beam between any device on the 0th row with any on the 3rd row.
-This is because the 2nd row contains security devices, which breaks the second condition.
-
-
-
Example 2:
-
-
-Input: bank = ["000","111","000"]
-Output: 0
-Explanation: There does not exist two devices located on two different rows.
-
-
-
-
Constraints:
-
-
-
m == bank.length
-
n == bank[i].length
-
1 <= m, n <= 500
-
bank[i][j] is either '0' or '1'.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Math](../../tag/math/README.md)]
- [[String](../../tag/string/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
-
-### Hints
-
-Hint 1
-What is the commonality between security devices on the same row?
-
-
-
-Hint 2
-Each device on the same row has the same number of beams pointing towards the devices on the next row with devices.
-
-
-
-Hint 3
-If you were given an integer array where each element is the number of security devices on each row, can you solve it?
-
-
-
-Hint 4
-Convert the input to such an array, skip any row with no security device, then find the sum of the product between adjacent elements.
-
diff --git a/problems/number-of-lines-to-write-string/README.md b/problems/number-of-lines-to-write-string/README.md
deleted file mode 100644
index c21fe3637..000000000
--- a/problems/number-of-lines-to-write-string/README.md
+++ /dev/null
@@ -1,59 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../split-array-with-same-average "Split Array With Same Average")
-
-[Next >](../max-increase-to-keep-city-skyline "Max Increase to Keep City Skyline")
-
-## [806. Number of Lines To Write String (Easy)](https://leetcode.com/problems/number-of-lines-to-write-string "写字符串需要的行数")
-
-
You are given a string s of lowercase English letters and an array widths denoting how many pixels wide each lowercase English letter is. Specifically, widths[0] is the width of 'a', widths[1] is the width of 'b', and so on.
-
-
You are trying to write s across several lines, where each line is no longer than 100 pixels. Starting at the beginning of s, write as many letters on the first line such that the total width does not exceed 100 pixels. Then, from where you stopped in s, continue writing as many letters as you can on the second line. Continue this process until you have written all of s.
-
-
Return an array result of length 2 where:
-
-
-
result[0] is the total number of lines.
-
result[1] is the width of the last line in pixels.
-
-
-
-
Example 1:
-
-
-Input: widths = [10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10], s = "abcdefghijklmnopqrstuvwxyz"
-Output: [3,60]
-Explanation: You can write s as follows:
-abcdefghij // 100 pixels wide
-klmnopqrst // 100 pixels wide
-uvwxyz // 60 pixels wide
-There are a total of 3 lines, and the last line is 60 pixels wide.
-
-
Example 2:
-
-
-Input: widths = [4,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10], s = "bbbcccdddaaa"
-Output: [2,4]
-Explanation: You can write s as follows:
-bbbcccdddaa // 98 pixels wide
-a // 4 pixels wide
-There are a total of 2 lines, and the last line is 4 pixels wide.
Given an integer array nums, return the number of longest increasing subsequences.
-
-
Notice that the sequence has to be strictly increasing.
-
-
-
Example 1:
-
-
-Input: nums = [1,3,5,4,7]
-Output: 2
-Explanation: The two longest increasing subsequences are [1, 3, 4, 7] and [1, 3, 5, 7].
-
-
-
Example 2:
-
-
-Input: nums = [2,2,2,2,2]
-Output: 5
-Explanation: The length of longest continuous increasing subsequence is 1, and there are 5 subsequences' length is 1, so output 5.
-
-
Given a string s and an array of strings words, return the number ofwords[i]that is a subsequence ofs.
-
-
A subsequence of a string is a new string generated from the original string with some characters (can be none) deleted without changing the relative order of the remaining characters.
-
-
-
For example, "ace" is a subsequence of "abcde".
-
-
-
-
Example 1:
-
-
-Input: s = "abcde", words = ["a","bb","acd","ace"]
-Output: 3
-Explanation: There are three strings in words that are a subsequence of s: "a", "acd", "ace".
-
-
-
Example 2:
-
-
-Input: s = "dsahjpjauf", words = ["ahjpjau","ja","ahbwzgqnuk","tnmlanowax"]
-Output: 2
-
-
-
-
Constraints:
-
-
-
1 <= s.length <= 5 * 104
-
1 <= words.length <= 5000
-
1 <= words[i].length <= 50
-
s and words[i] consist of only lowercase English letters.
Your music player contains n different songs. You want to listen to goal songs (not necessarily different) during your trip. To avoid boredom, you will create a playlist so that:
-
-
-
Every song is played at least once.
-
A song can only be played again only if k other songs have been played.
-
-
-
Given n, goal, and k, return the number of possible playlists that you can create. Since the answer can be very large, return it modulo109 + 7.
-
-
Example 1:
-
-
-Input: n = 3, goal = 3, k = 1
-Output: 6
-Explanation: There are 6 possible playlists: [1, 2, 3], [1, 3, 2], [2, 1, 3], [2, 3, 1], [3, 1, 2], and [3, 2, 1].
-
-
-
Example 2:
-
-
-Input: n = 2, goal = 3, k = 0
-Output: 6
-Explanation: There are 6 possible playlists: [1, 1, 2], [1, 2, 1], [2, 1, 1], [2, 2, 1], [2, 1, 2], and [1, 2, 2].
-
-
-
Example 3:
-
-
-Input: n = 2, goal = 3, k = 1
-Output: 2
-Explanation: There are 2 possible playlists: [1, 2, 1] and [2, 1, 2].
-
-
-
-
Constraints:
-
-
-
0 <= k < n <= goal <= 100
-
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Combinatorics](../../tag/combinatorics/README.md)]
diff --git a/problems/number-of-music-playlists/number_of_music_playlists.go b/problems/number-of-music-playlists/number_of_music_playlists.go
deleted file mode 100644
index 091dcd6ce..000000000
--- a/problems/number-of-music-playlists/number_of_music_playlists.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem920
diff --git a/problems/number-of-music-playlists/number_of_music_playlists_test.go b/problems/number-of-music-playlists/number_of_music_playlists_test.go
deleted file mode 100644
index 091dcd6ce..000000000
--- a/problems/number-of-music-playlists/number_of_music_playlists_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem920
diff --git a/problems/number-of-nodes-in-the-sub-tree-with-the-same-label/README.md b/problems/number-of-nodes-in-the-sub-tree-with-the-same-label/README.md
deleted file mode 100644
index fbfb6a7ef..000000000
--- a/problems/number-of-nodes-in-the-sub-tree-with-the-same-label/README.md
+++ /dev/null
@@ -1,77 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../water-bottles "Water Bottles")
-
-[Next >](../maximum-number-of-non-overlapping-substrings "Maximum Number of Non-Overlapping Substrings")
-
-## [1519. Number of Nodes in the Sub-Tree With the Same Label (Medium)](https://leetcode.com/problems/number-of-nodes-in-the-sub-tree-with-the-same-label "子树中标签相同的节点数")
-
-
You are given a tree (i.e. a connected, undirected graph that has no cycles) consisting of n nodes numbered from 0 to n - 1 and exactly n - 1edges. The root of the tree is the node 0, and each node of the tree has a label which is a lower-case character given in the string labels (i.e. The node with the number i has the label labels[i]).
-
-
The edges array is given on the form edges[i] = [ai, bi], which means there is an edge between nodes ai and bi in the tree.
-
-
Return an array of size n where ans[i] is the number of nodes in the subtree of the ith node which have the same label as node i.
-
-
A subtree of a tree T is the tree consisting of a node in T and all of its descendant nodes.
-
-
-
Example 1:
-
-
-Input: n = 7, edges = [[0,1],[0,2],[1,4],[1,5],[2,3],[2,6]], labels = "abaedcd"
-Output: [2,1,1,1,1,1,1]
-Explanation: Node 0 has label 'a' and its sub-tree has node 2 with label 'a' as well, thus the answer is 2. Notice that any node is part of its sub-tree.
-Node 1 has a label 'b'. The sub-tree of node 1 contains nodes 1,4 and 5, as nodes 4 and 5 have different labels than node 1, the answer is just 1 (the node itself).
-
-
-
Example 2:
-
-
-Input: n = 4, edges = [[0,1],[1,2],[0,3]], labels = "bbbb"
-Output: [4,2,1,1]
-Explanation: The sub-tree of node 2 contains only node 2, so the answer is 1.
-The sub-tree of node 3 contains only node 3, so the answer is 1.
-The sub-tree of node 1 contains nodes 1 and 2, both have label 'b', thus the answer is 2.
-The sub-tree of node 0 contains nodes 0, 1, 2 and 3, all with label 'b', thus the answer is 4.
-
labels is consisting of only of lowercase English letters.
-
-
-### Related Topics
- [[Tree](../../tag/tree/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
-
-### Hints
-
-Hint 1
-Start traversing the tree and each node should return a vector to its parent node.
-
-
-
-Hint 2
-The vector should be of length 26 and have the count of all the labels in the sub-tree of this node.
-
diff --git a/problems/number-of-operations-to-make-network-connected/README.md b/problems/number-of-operations-to-make-network-connected/README.md
deleted file mode 100644
index 77fb4cf07..000000000
--- a/problems/number-of-operations-to-make-network-connected/README.md
+++ /dev/null
@@ -1,72 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-flips-to-make-a-or-b-equal-to-c "Minimum Flips to Make a OR b Equal to c")
-
-[Next >](../minimum-distance-to-type-a-word-using-two-fingers "Minimum Distance to Type a Word Using Two Fingers")
-
-## [1319. Number of Operations to Make Network Connected (Medium)](https://leetcode.com/problems/number-of-operations-to-make-network-connected "连通网络的操作次数")
-
-
There are n computers numbered from 0 to n - 1 connected by ethernet cables connections forming a network where connections[i] = [ai, bi] represents a connection between computers ai and bi. Any computer can reach any other computer directly or indirectly through the network.
-
-
You are given an initial computer network connections. You can extract certain cables between two directly connected computers, and place them between any pair of disconnected computers to make them directly connected.
-
-
Return the minimum number of times you need to do this in order to make all the computers connected. If it is not possible, return -1.
-
-
-
Example 1:
-
-
-Input: n = 4, connections = [[0,1],[0,2],[1,2]]
-Output: 1
-Explanation: Remove cable between computer 1 and 2 and place between computers 1 and 3.
-
-
-
Example 2:
-
-
-Input: n = 6, connections = [[0,1],[0,2],[0,3],[1,2],[1,3]]
-Output: 2
-
-
-
Example 3:
-
-
-Input: n = 6, connections = [[0,1],[0,2],[0,3],[1,2]]
-Output: -1
-Explanation: There are not enough cables.
-
No two computers are connected by more than one cable.
-
-
-### Related Topics
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Union Find](../../tag/union-find/README.md)]
- [[Graph](../../tag/graph/README.md)]
-
-### Hints
-
-Hint 1
-As long as there are at least (n - 1) connections, there is definitely a way to connect all computers.
-
-
-
-Hint 2
-Use DFS to determine the number of isolated computer clusters.
-
diff --git a/problems/number-of-orders-in-the-backlog/README.md b/problems/number-of-orders-in-the-backlog/README.md
deleted file mode 100644
index dcfcdfae9..000000000
--- a/problems/number-of-orders-in-the-backlog/README.md
+++ /dev/null
@@ -1,83 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-ascending-subarray-sum "Maximum Ascending Subarray Sum")
-
-[Next >](../maximum-value-at-a-given-index-in-a-bounded-array "Maximum Value at a Given Index in a Bounded Array")
-
-## [1801. Number of Orders in the Backlog (Medium)](https://leetcode.com/problems/number-of-orders-in-the-backlog "积压订单中的订单总数")
-
-
You are given a 2D integer array orders, where each orders[i] = [pricei, amounti, orderTypei] denotes that amountiorders have been placed of type orderTypei at the price pricei. The orderTypei is:
-
-
-
0 if it is a batch of buy orders, or
-
1 if it is a batch of sell orders.
-
-
-
Note that orders[i] represents a batch of amounti independent orders with the same price and order type. All orders represented by orders[i] will be placed before all orders represented by orders[i+1] for all valid i.
-
-
There is a backlog that consists of orders that have not been executed. The backlog is initially empty. When an order is placed, the following happens:
-
-
-
If the order is a buy order, you look at the sell order with the smallest price in the backlog. If that sell order's price is smaller than or equal to the current buy order's price, they will match and be executed, and that sell order will be removed from the backlog. Else, the buy order is added to the backlog.
-
Vice versa, if the order is a sell order, you look at the buy order with the largest price in the backlog. If that buy order's price is larger than or equal to the current sell order's price, they will match and be executed, and that buy order will be removed from the backlog. Else, the sell order is added to the backlog.
-
-
-
Return the total amount of orders in the backlog after placing all the orders from the input. Since this number can be large, return it modulo109 + 7.
-
-
-
Example 1:
-
-
-Input: orders = [[10,5,0],[15,2,1],[25,1,1],[30,4,0]]
-Output: 6
-Explanation: Here is what happens with the orders:
-- 5 orders of type buy with price 10 are placed. There are no sell orders, so the 5 orders are added to the backlog.
-- 2 orders of type sell with price 15 are placed. There are no buy orders with prices larger than or equal to 15, so the 2 orders are added to the backlog.
-- 1 order of type sell with price 25 is placed. There are no buy orders with prices larger than or equal to 25 in the backlog, so this order is added to the backlog.
-- 4 orders of type buy with price 30 are placed. The first 2 orders are matched with the 2 sell orders of the least price, which is 15 and these 2 sell orders are removed from the backlog. The 3rd order is matched with the sell order of the least price, which is 25 and this sell order is removed from the backlog. Then, there are no more sell orders in the backlog, so the 4th order is added to the backlog.
-Finally, the backlog has 5 buy orders with price 10, and 1 buy order with price 30. So the total number of orders in the backlog is 6.
-
-
-
Example 2:
-
-
-Input: orders = [[7,1000000000,1],[15,3,0],[5,999999995,0],[5,1,1]]
-Output: 999999984
-Explanation: Here is what happens with the orders:
-- 109 orders of type sell with price 7 are placed. There are no buy orders, so the 109 orders are added to the backlog.
-- 3 orders of type buy with price 15 are placed. They are matched with the 3 sell orders with the least price which is 7, and those 3 sell orders are removed from the backlog.
-- 999999995 orders of type buy with price 5 are placed. The least price of a sell order is 7, so the 999999995 orders are added to the backlog.
-- 1 order of type sell with price 5 is placed. It is matched with the buy order of the highest price, which is 5, and that buy order is removed from the backlog.
-Finally, the backlog has (1000000000-3) sell orders with price 7, and (999999995-1) buy orders with price 5. So the total number of orders = 1999999991, which is equal to 999999984 % (109 + 7).
-
-
-
-
Constraints:
-
-
-
1 <= orders.length <= 105
-
orders[i].length == 3
-
1 <= pricei, amounti <= 109
-
orderTypei is either 0 or 1.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Simulation](../../tag/simulation/README.md)]
- [[Heap (Priority Queue)](../../tag/heap-priority-queue/README.md)]
-
-### Hints
-
-Hint 1
-Store the backlog buy and sell orders in two heaps, the buy orders in a max heap by price and the sell orders in a min heap by price.
-
-
-
-Hint 2
-Store the orders in batches and update the fields according to new incoming orders. Each batch should only take 1 "slot" in the heap.
-
diff --git a/problems/number-of-pairs-of-interchangeable-rectangles/README.md b/problems/number-of-pairs-of-interchangeable-rectangles/README.md
deleted file mode 100644
index c03ce8bca..000000000
--- a/problems/number-of-pairs-of-interchangeable-rectangles/README.md
+++ /dev/null
@@ -1,69 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../reverse-prefix-of-word "Reverse Prefix of Word")
-
-[Next >](../maximum-product-of-the-length-of-two-palindromic-subsequences "Maximum Product of the Length of Two Palindromic Subsequences")
-
-## [2001. Number of Pairs of Interchangeable Rectangles (Medium)](https://leetcode.com/problems/number-of-pairs-of-interchangeable-rectangles "可互换矩形的组数")
-
-
You are given n rectangles represented by a 0-indexed 2D integer array rectangles, where rectangles[i] = [widthi, heighti] denotes the width and height of the ith rectangle.
-
-
Two rectangles i and j (i < j) are considered interchangeable if they have the same width-to-height ratio. More formally, two rectangles are interchangeable if widthi/heighti == widthj/heightj (using decimal division, not integer division).
-
-
Return the number of pairs of interchangeable rectangles in rectangles.
-
-
-
Example 1:
-
-
-Input: rectangles = [[4,8],[3,6],[10,20],[15,30]]
-Output: 6
-Explanation: The following are the interchangeable pairs of rectangles by index (0-indexed):
-- Rectangle 0 with rectangle 1: 4/8 == 3/6.
-- Rectangle 0 with rectangle 2: 4/8 == 10/20.
-- Rectangle 0 with rectangle 3: 4/8 == 15/30.
-- Rectangle 1 with rectangle 2: 3/6 == 10/20.
-- Rectangle 1 with rectangle 3: 3/6 == 15/30.
-- Rectangle 2 with rectangle 3: 10/20 == 15/30.
-
-
-
Example 2:
-
-
-Input: rectangles = [[4,5],[7,8]]
-Output: 0
-Explanation: There are no interchangeable pairs of rectangles.
-
-
-
-
Constraints:
-
-
-
n == rectangles.length
-
1 <= n <= 105
-
rectangles[i].length == 2
-
1 <= widthi, heighti <= 105
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Math](../../tag/math/README.md)]
- [[Counting](../../tag/counting/README.md)]
- [[Number Theory](../../tag/number-theory/README.md)]
-
-### Hints
-
-Hint 1
-Store the rectangle height and width ratio in a hashmap.
-
-
-
-Hint 2
-Traverse the ratios, and for each ratio, use the frequency of the ratio to add to the total pair count.
-
diff --git a/problems/number-of-pairs-of-strings-with-concatenation-equal-to-target/README.md b/problems/number-of-pairs-of-strings-with-concatenation-equal-to-target/README.md
deleted file mode 100644
index 07acd4a01..000000000
--- a/problems/number-of-pairs-of-strings-with-concatenation-equal-to-target/README.md
+++ /dev/null
@@ -1,77 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../convert-1d-array-into-2d-array "Convert 1D Array Into 2D Array")
-
-[Next >](../maximize-the-confusion-of-an-exam "Maximize the Confusion of an Exam")
-
-## [2023. Number of Pairs of Strings With Concatenation Equal to Target (Medium)](https://leetcode.com/problems/number-of-pairs-of-strings-with-concatenation-equal-to-target "连接后等于目标字符串的字符串对")
-
-
Given an array of digit strings nums and a digit string target, return the number of pairs of indices (i, j) (where i != j) such that the concatenation of nums[i] + nums[j] equals target.
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Hints
-
-Hint 1
-Try to concatenate every two different strings from the list.
-
-
-
-Hint 2
-Count the number of pairs with concatenation equals to target.
-
diff --git a/problems/number-of-paths-with-max-score/README.md b/problems/number-of-paths-with-max-score/README.md
deleted file mode 100644
index 773e71630..000000000
--- a/problems/number-of-paths-with-max-score/README.md
+++ /dev/null
@@ -1,54 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../sum-of-mutated-array-closest-to-target "Sum of Mutated Array Closest to Target")
-
-[Next >](../deepest-leaves-sum "Deepest Leaves Sum")
-
-## [1301. Number of Paths with Max Score (Hard)](https://leetcode.com/problems/number-of-paths-with-max-score "最大得分的路径数目")
-
-
You are given a square board of characters. You can move on the board starting at the bottom right square marked with the character 'S'.
-
-
You need to reach the top left square marked with the character 'E'. The rest of the squares are labeled either with a numeric character 1, 2, ..., 9 or with an obstacle 'X'. In one move you can go up, left or up-left (diagonally) only if there is no obstacle there.
-
-
Return a list of two integers: the first integer is the maximum sum of numeric characters you can collect, and the second is the number of such paths that you can take to get that maximum sum, taken modulo 10^9 + 7.
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
-
-### Hints
-
-Hint 1
-Use dynamic programming to find the path with the max score.
-
-
-
-Hint 2
-Use another dynamic programming array to count the number of paths with max score.
-
diff --git a/problems/number-of-provinces/README.md b/problems/number-of-provinces/README.md
deleted file mode 100644
index e55fc5326..000000000
--- a/problems/number-of-provinces/README.md
+++ /dev/null
@@ -1,60 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../remove-boxes "Remove Boxes")
-
-[Next >](../split-array-with-equal-sum "Split Array with Equal Sum")
-
-## [547. Number of Provinces (Medium)](https://leetcode.com/problems/number-of-provinces "省份数量")
-
-
There are n cities. Some of them are connected, while some are not. If city a is connected directly with city b, and city b is connected directly with city c, then city a is connected indirectly with city c.
-
-
A province is a group of directly or indirectly connected cities and no other cities outside of the group.
-
-
You are given an n x n matrix isConnected where isConnected[i][j] = 1 if the ith city and the jth city are directly connected, and isConnected[i][j] = 0 otherwise.
-
-### Related Topics
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Union Find](../../tag/union-find/README.md)]
- [[Graph](../../tag/graph/README.md)]
-
-### Similar Questions
- 1. [Number of Connected Components in an Undirected Graph](../number-of-connected-components-in-an-undirected-graph) (Medium)
- 1. [Robot Return to Origin](../robot-return-to-origin) (Easy)
- 1. [Sentence Similarity](../sentence-similarity) (Easy)
- 1. [Sentence Similarity II](../sentence-similarity-ii) (Medium)
- 1. [The Earliest Moment When Everyone Become Friends](../the-earliest-moment-when-everyone-become-friends) (Medium)
diff --git a/problems/number-of-recent-calls/README.md b/problems/number-of-recent-calls/README.md
deleted file mode 100644
index d961559a0..000000000
--- a/problems/number-of-recent-calls/README.md
+++ /dev/null
@@ -1,55 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../beautiful-array "Beautiful Array")
-
-[Next >](../shortest-bridge "Shortest Bridge")
-
-## [933. Number of Recent Calls (Easy)](https://leetcode.com/problems/number-of-recent-calls "最近的请求次数")
-
-
You have a RecentCounter class which counts the number of recent requests within a certain time frame.
-
-
Implement the RecentCounter class:
-
-
-
RecentCounter() Initializes the counter with zero recent requests.
-
int ping(int t) Adds a new request at time t, where t represents some time in milliseconds, and returns the number of requests that has happened in the past 3000 milliseconds (including the new request). Specifically, return the number of requests that have happened in the inclusive range [t - 3000, t].
-
-
-
It is guaranteed that every call to ping uses a strictly larger value of t than the previous call.
-
-
-
Example 1:
-
-
-Input
-["RecentCounter", "ping", "ping", "ping", "ping"]
-[[], [1], [100], [3001], [3002]]
-Output
-[null, 1, 2, 3, 3]
-
-Explanation
-RecentCounter recentCounter = new RecentCounter();
-recentCounter.ping(1); // requests = [1], range is [-2999,1], return 1
-recentCounter.ping(100); // requests = [1, 100], range is [-2900,100], return 2
-recentCounter.ping(3001); // requests = [1, 100, 3001], range is [1,3001], return 3
-recentCounter.ping(3002); // requests = [1, 100, 3001, 3002], range is [2,3002], return 3
-
-
-
-
Constraints:
-
-
-
1 <= t <= 109
-
Each test case will call ping with strictly increasing values of t.
-
At most 104 calls will be made to ping.
-
-
-### Related Topics
- [[Design](../../tag/design/README.md)]
- [[Queue](../../tag/queue/README.md)]
- [[Data Stream](../../tag/data-stream/README.md)]
diff --git a/problems/number-of-recent-calls/number_of_recent_calls.go b/problems/number-of-recent-calls/number_of_recent_calls.go
deleted file mode 100644
index 5202162ce..000000000
--- a/problems/number-of-recent-calls/number_of_recent_calls.go
+++ /dev/null
@@ -1,25 +0,0 @@
-package problem933
-
-import "container/list"
-
-type RecentCounter struct {
- queue *list.List
-}
-
-func Constructor() RecentCounter {
- return RecentCounter{list.New()}
-}
-
-func (this *RecentCounter) Ping(t int) int {
- this.queue.PushBack(t)
- for this.queue.Front().Value.(int) < t-3000 {
- this.queue.Remove(this.queue.Front())
- }
- return this.queue.Len()
-}
-
-/**
- * Your RecentCounter object will be instantiated and called as such:
- * obj := Constructor();
- * param_1 := obj.Ping(t);
- */
diff --git a/problems/number-of-recent-calls/number_of_recent_calls_test.go b/problems/number-of-recent-calls/number_of_recent_calls_test.go
deleted file mode 100644
index 8cee8bc23..000000000
--- a/problems/number-of-recent-calls/number_of_recent_calls_test.go
+++ /dev/null
@@ -1,29 +0,0 @@
-package problem933
-
-import (
- "reflect"
- "testing"
-)
-
-type testType struct {
- in []int
- want []int
-}
-
-func TestConstructor(t *testing.T) {
- tests := [...]testType{
- {
- in: []int{1, 100, 3001, 3002},
- want: []int{1, 2, 3, 3},
- },
- }
- for _, tt := range tests {
- obj, got := Constructor(), make([]int, 0)
- for _, t := range tt.in {
- got = append(got, obj.Ping(t))
- }
- if !reflect.DeepEqual(got, tt.want) {
- t.Fatalf("in: %v, got: %v, want: %v", tt.in, got, tt.want)
- }
- }
-}
diff --git a/problems/number-of-rectangles-that-can-form-the-largest-square/README.md b/problems/number-of-rectangles-that-can-form-the-largest-square/README.md
deleted file mode 100644
index 4e1dbdfa1..000000000
--- a/problems/number-of-rectangles-that-can-form-the-largest-square/README.md
+++ /dev/null
@@ -1,66 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../checking-existence-of-edge-length-limited-paths-ii "Checking Existence of Edge Length Limited Paths II")
-
-[Next >](../tuple-with-same-product "Tuple with Same Product")
-
-## [1725. Number Of Rectangles That Can Form The Largest Square (Easy)](https://leetcode.com/problems/number-of-rectangles-that-can-form-the-largest-square "可以形成最大正方形的矩形数目")
-
-
You are given an array rectangles where rectangles[i] = [li, wi] represents the ith rectangle of length li and width wi.
-
-
You can cut the ith rectangle to form a square with a side length of k if both k <= li and k <= wi. For example, if you have a rectangle [4,6], you can cut it to get a square with a side length of at most 4.
-
-
Let maxLen be the side length of the largest square you can obtain from any of the given rectangles.
-
-
Return the number of rectangles that can make a square with a side length of maxLen.
-
-
-
Example 1:
-
-
-Input: rectangles = [[5,8],[3,9],[5,12],[16,5]]
-Output: 3
-Explanation: The largest squares you can get from each rectangle are of lengths [5,3,5,5].
-The largest possible square is of length 5, and you can get it out of 3 rectangles.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
-
-### Hints
-
-Hint 1
-What is the length of the largest square the can be cut out of some rectangle? It'll be equal to min(rectangle.length, rectangle.width). Replace each rectangle with this value.
-
-
-
-Hint 2
-Calculate maxSize by iterating over the given rectangles and maximizing the answer with their values denoted in the first hint.
-
-
-
-Hint 3
-Then iterate again on the rectangles and calculate the number whose values = maxSize.
-
diff --git a/problems/number-of-restricted-paths-from-first-to-last-node/README.md b/problems/number-of-restricted-paths-from-first-to-last-node/README.md
deleted file mode 100644
index 991d1a7a2..000000000
--- a/problems/number-of-restricted-paths-from-first-to-last-node/README.md
+++ /dev/null
@@ -1,77 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-elements-to-add-to-form-a-given-sum "Minimum Elements to Add to Form a Given Sum")
-
-[Next >](../make-the-xor-of-all-segments-equal-to-zero "Make the XOR of All Segments Equal to Zero")
-
-## [1786. Number of Restricted Paths From First to Last Node (Medium)](https://leetcode.com/problems/number-of-restricted-paths-from-first-to-last-node "从第一个节点出发到最后一个节点的受限路径数")
-
-
There is an undirected weighted connected graph. You are given a positive integer n which denotes that the graph has n nodes labeled from 1 to n, and an array edges where each edges[i] = [ui, vi, weighti] denotes that there is an edge between nodes ui and vi with weight equal to weighti.
-
-
A path from node start to node end is a sequence of nodes [z0, z1,z2, ..., zk] such that z0 = start and zk = end and there is an edge between zi and zi+1 where 0 <= i <= k-1.
-
-
The distance of a path is the sum of the weights on the edges of the path. Let distanceToLastNode(x) denote the shortest distance of a path between node n and node x. A restricted path is a path that also satisfies that distanceToLastNode(zi) > distanceToLastNode(zi+1) where 0 <= i <= k-1.
-
-
Return the number of restricted paths from node1to noden. Since that number may be too large, return it modulo109 + 7.
-
-
-
Example 1:
-
-
-Input: n = 5, edges = [[1,2,3],[1,3,3],[2,3,1],[1,4,2],[5,2,2],[3,5,1],[5,4,10]]
-Output: 3
-Explanation: Each circle contains the node number in black and its distanceToLastNode value in blue. The three restricted paths are:
-1) 1 --> 2 --> 5
-2) 1 --> 2 --> 3 --> 5
-3) 1 --> 3 --> 5
-
-
-
Example 2:
-
-
-Input: n = 7, edges = [[1,3,1],[4,1,2],[7,3,4],[2,5,3],[5,6,1],[6,7,2],[7,5,3],[2,6,4]]
-Output: 1
-Explanation: Each circle contains the node number in black and its distanceToLastNode value in blue. The only restricted path is 1 --> 3 --> 7.
-
-
-
-
Constraints:
-
-
-
1 <= n <= 2 * 104
-
n - 1 <= edges.length <= 4 * 104
-
edges[i].length == 3
-
1 <= ui, vi <= n
-
ui != vi
-
1 <= weighti <= 105
-
There is at most one edge between any two nodes.
-
There is at least one path between any two nodes.
-
-
-### Related Topics
- [[Graph](../../tag/graph/README.md)]
- [[Topological Sort](../../tag/topological-sort/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Shortest Path](../../tag/shortest-path/README.md)]
- [[Heap (Priority Queue)](../../tag/heap-priority-queue/README.md)]
-
-### Hints
-
-Hint 1
-Run a Dijkstra from node numbered n to compute distance from the last node.
-
-
-
-Hint 2
-Consider all edges [u, v] one by one and direct them such that distance of u to n > distance of v to n. If both u and v are at the same distance from n, discard this edge.
-
-
-
-Hint 3
-Now this problem reduces to computing the number of paths from 1 to n in a DAG, a standard DP problem.
-
diff --git a/problems/number-of-segments-in-a-string/README.md b/problems/number-of-segments-in-a-string/README.md
deleted file mode 100644
index ccd1d349a..000000000
--- a/problems/number-of-segments-in-a-string/README.md
+++ /dev/null
@@ -1,44 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-genetic-mutation "Minimum Genetic Mutation")
-
-[Next >](../non-overlapping-intervals "Non-overlapping Intervals")
-
-## [434. Number of Segments in a String (Easy)](https://leetcode.com/problems/number-of-segments-in-a-string "字符串中的单词数")
-
-
Given a string s, return the number of segments in the string.
-
-
A segment is defined to be a contiguous sequence of non-space characters.
-
-
-
Example 1:
-
-
-Input: s = "Hello, my name is John"
-Output: 5
-Explanation: The five segments are ["Hello,", "my", "name", "is", "John"]
-
-
-
Example 2:
-
-
-Input: s = "Hello"
-Output: 1
-
-
-
-
Constraints:
-
-
-
0 <= s.length <= 300
-
s consists of lowercase and uppercase English letters, digits, or one of the following characters "!@#$%^&*()_+-=',.:".
Given n points on a 1-D plane, where the ith point (from 0 to n-1) is at x = i, find the number of ways we can draw exactlyknon-overlapping line segments such that each segment covers two or more points. The endpoints of each segment must have integral coordinates. The k line segments do not have to cover all n points, and they are allowed to share endpoints.
-
-
Return the number of ways we can draw k non-overlapping line segments. Since this number can be huge, return it modulo109 + 7.
-
-
-
Example 1:
-
-
-Input: n = 4, k = 2
-Output: 5
-Explanation: The two line segments are shown in red and blue.
-The image above shows the 5 different ways {(0,2),(2,3)}, {(0,1),(1,3)}, {(0,1),(2,3)}, {(1,2),(2,3)}, {(0,1),(1,2)}.
-
-
-
Example 2:
-
-
-Input: n = 3, k = 1
-Output: 3
-Explanation: The 3 ways are {(0,1)}, {(0,2)}, {(1,2)}.
-
-
-
Example 3:
-
-
-Input: n = 30, k = 7
-Output: 796297179
-Explanation: The total number of possible ways to draw 7 line segments is 3796297200. Taking this number modulo 109 + 7 gives us 796297179.
-
-
-
-
Constraints:
-
-
-
2 <= n <= 1000
-
1 <= k <= n-1
-
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Hints
-
-Hint 1
-Try to use dynamic programming where the current index and remaining number of line segments to form can describe any intermediate state.
-
-
-
-Hint 2
-To make the computation of each state in constant time, we could add another flag to the state that indicates whether or not we are in the middle of placing a line (placed start point but no endpoint).
-
diff --git a/problems/number-of-ships-in-a-rectangle/README.md b/problems/number-of-ships-in-a-rectangle/README.md
deleted file mode 100644
index 754422647..000000000
--- a/problems/number-of-ships-in-a-rectangle/README.md
+++ /dev/null
@@ -1,64 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../delete-tree-nodes "Delete Tree Nodes")
-
-[Next >](../find-winner-on-a-tic-tac-toe-game "Find Winner on a Tic Tac Toe Game")
-
-## [1274. Number of Ships in a Rectangle (Hard)](https://leetcode.com/problems/number-of-ships-in-a-rectangle "矩形内船只的数目")
-
-
(This problem is an interactive problem.)
-
-
On the sea represented by a cartesian plane, each ship is located at an integer point, and each integer point may contain at most 1 ship.
-
-
You have a function Sea.hasShips(topRight, bottomLeft) which takes two points as arguments and returns true if and only if there is at least one ship in the rectangle represented by the two points, including on the boundary.
-
-
Given two points, which are the top right and bottom left corners of a rectangle, return the number of ships present in that rectangle. It is guaranteed that there are at most 10 ships in that rectangle.
-
-
Submissions making more than 400 calls to hasShips will be judged Wrong Answer. Also, any solutions that attempt to circumvent the judge will result in disqualification.
-
-
-
Example :
-
-
-
-
-Input:
-ships = [[1,1],[2,2],[3,3],[5,5]], topRight = [4,4], bottomLeft = [0,0]
-Output: 3
-Explanation: From [0,0] to [4,4] we can count 3 ships within the range.
-
-
-
-
Constraints:
-
-
-
On the input ships is only given to initialize the map internally. You must solve this problem "blindfolded". In other words, you must find the answer using the given hasShips API, without knowing the ships position.
-
0 <= bottomLeft[0] <= topRight[0] <= 1000
-
0 <= bottomLeft[1] <= topRight[1] <= 1000
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Divide and Conquer](../../tag/divide-and-conquer/README.md)]
- [[Interactive](../../tag/interactive/README.md)]
-
-### Hints
-
-Hint 1
-Use divide and conquer technique.
-
-
-
-Hint 2
-Divide the query rectangle into 4 rectangles.
-
-
-
-Hint 3
-Use recursion to continue with the rectangles that has ships only.
-
diff --git a/problems/number-of-smooth-descent-periods-of-a-stock/README.md b/problems/number-of-smooth-descent-periods-of-a-stock/README.md
deleted file mode 100644
index 8a05be526..000000000
--- a/problems/number-of-smooth-descent-periods-of-a-stock/README.md
+++ /dev/null
@@ -1,75 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../adding-spaces-to-a-string "Adding Spaces to a String")
-
-[Next >](../minimum-operations-to-make-the-array-k-increasing "Minimum Operations to Make the Array K-Increasing")
-
-## [2110. Number of Smooth Descent Periods of a Stock (Medium)](https://leetcode.com/problems/number-of-smooth-descent-periods-of-a-stock "股票平滑下跌阶段的数目")
-
-
You are given an integer array prices representing the daily price history of a stock, where prices[i] is the stock price on the ith day.
-
-
A smooth descent period of a stock consists of one or more contiguous days such that the price on each day is lower than the price on the preceding day by exactly1. The first day of the period is exempted from this rule.
-
-
Return the number of smooth descent periods.
-
-
-
Example 1:
-
-
-Input: prices = [3,2,1,4]
-Output: 7
-Explanation: There are 7 smooth descent periods:
-[3], [2], [1], [4], [3,2], [2,1], and [3,2,1]
-Note that a period with one day is a smooth descent period by the definition.
-
-
-
Example 2:
-
-
-Input: prices = [8,6,7,7]
-Output: 4
-Explanation: There are 4 smooth descent periods: [8], [6], [7], and [7]
-Note that [8,6] is not a smooth descent period as 8 - 6 ≠ 1.
-
-
-
Example 3:
-
-
-Input: prices = [1]
-Output: 1
-Explanation: There is 1 smooth descent period: [1]
-
-
-
-
Constraints:
-
-
-
1 <= prices.length <= 105
-
1 <= prices[i] <= 105
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Math](../../tag/math/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Hints
-
-Hint 1
-Any array is a series of adjacent longest possible smooth descent periods. For example, [5,3,2,1,7,6] is [5] + [3,2,1] + [7,6].
-
-
-
-Hint 2
-Think of a 2-pointer approach to traverse the array and find each longest possible period.
-
-
-
-Hint 3
-Suppose you found the longest possible period with a length of k. How many periods are within that period? How can you count them quickly? Think of the formula to calculate the sum of 1, 2, 3, ..., k.
-
diff --git a/problems/number-of-spaces-cleaning-robot-cleaned/README.md b/problems/number-of-spaces-cleaning-robot-cleaned/README.md
deleted file mode 100644
index c40efb276..000000000
--- a/problems/number-of-spaces-cleaning-robot-cleaned/README.md
+++ /dev/null
@@ -1,35 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../check-if-an-original-string-exists-given-two-encoded-strings "Check if an Original String Exists Given Two Encoded Strings")
-
-[Next >](../count-vowel-substrings-of-a-string "Count Vowel Substrings of a String")
-
-## [2061. Number of Spaces Cleaning Robot Cleaned (Medium)](https://leetcode.com/problems/number-of-spaces-cleaning-robot-cleaned "扫地机器人清扫过的空间个数")
-
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
- [[Simulation](../../tag/simulation/README.md)]
-
-### Hints
-
-Hint 1
-Simulate how the robot moves and keep track of how many spaces it has cleaned so far.
-
-
-
-Hint 2
-When can we stop the simulation?
-
-
-
-Hint 3
-When the robot reaches a space that it has already cleaned and is facing the same direction as before, we can stop the simulation.
-
diff --git a/problems/number-of-squareful-arrays/README.md b/problems/number-of-squareful-arrays/README.md
deleted file mode 100644
index bfd6778ee..000000000
--- a/problems/number-of-squareful-arrays/README.md
+++ /dev/null
@@ -1,53 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-number-of-k-consecutive-bit-flips "Minimum Number of K Consecutive Bit Flips")
-
-[Next >](../find-the-town-judge "Find the Town Judge")
-
-## [996. Number of Squareful Arrays (Hard)](https://leetcode.com/problems/number-of-squareful-arrays "正方形数组的数目")
-
-
An array is squareful if the sum of every pair of adjacent elements is a perfect square.
-
-
Given an integer array nums, return the number of permutations of nums that are squareful.
-
-
Two permutations perm1 and perm2 are different if there is some index i such that perm1[i] != perm2[i].
-
-
-
Example 1:
-
-
-Input: nums = [1,17,8]
-Output: 2
-Explanation: [1,8,17] and [17,8,1] are the valid permutations.
-
-
-
Example 2:
-
-
-Input: nums = [2,2,2]
-Output: 1
-
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 12
-
0 <= nums[i] <= 109
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Math](../../tag/math/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Backtracking](../../tag/backtracking/README.md)]
- [[Bit Manipulation](../../tag/bit-manipulation/README.md)]
- [[Bitmask](../../tag/bitmask/README.md)]
-
-### Similar Questions
- 1. [Permutations II](../permutations-ii) (Medium)
diff --git a/problems/number-of-squareful-arrays/number_of_squareful_arrays.go b/problems/number-of-squareful-arrays/number_of_squareful_arrays.go
deleted file mode 100644
index 687ab0359..000000000
--- a/problems/number-of-squareful-arrays/number_of_squareful_arrays.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem996
diff --git a/problems/number-of-steps-to-reduce-a-number-in-binary-representation-to-one/README.md b/problems/number-of-steps-to-reduce-a-number-in-binary-representation-to-one/README.md
deleted file mode 100644
index a94b24aca..000000000
--- a/problems/number-of-steps-to-reduce-a-number-in-binary-representation-to-one/README.md
+++ /dev/null
@@ -1,83 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-subsequence-in-non-increasing-order "Minimum Subsequence in Non-Increasing Order")
-
-[Next >](../longest-happy-string "Longest Happy String")
-
-## [1404. Number of Steps to Reduce a Number in Binary Representation to One (Medium)](https://leetcode.com/problems/number-of-steps-to-reduce-a-number-in-binary-representation-to-one "将二进制表示减到 1 的步骤数")
-
-
Given the binary representation of an integer as a string s, return the number of steps to reduce it to 1 under the following rules:
-
-
-
-
If the current number is even, you have to divide it by 2.
-
-
-
If the current number is odd, you have to add 1 to it.
-
-
-
-
It is guaranteed that you can always reach one for all test cases.
-
-
-
Example 1:
-
-
-Input: s = "1101"
-Output: 6
-Explanation: "1101" corressponds to number 13 in their decimal representation.
-Step 1) 13 is odd, add 1 and obtain 14.
-Step 2) 14 is even, divide by 2 and obtain 7.
-Step 3) 7 is odd, add 1 and obtain 8.
-Step 4) 8 is even, divide by 2 and obtain 4.
-Step 5) 4 is even, divide by 2 and obtain 2.
-Step 6) 2 is even, divide by 2 and obtain 1.
-
-
-
Example 2:
-
-
-Input: s = "10"
-Output: 1
-Explanation: "10" corressponds to number 2 in their decimal representation.
-Step 1) 2 is even, divide by 2 and obtain 1.
-
-
-
Example 3:
-
-
-Input: s = "1"
-Output: 0
-
-
-
-
Constraints:
-
-
-
1 <= s.length <= 500
-
s consists of characters '0' or '1'
-
s[0] == '1'
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
- [[Bit Manipulation](../../tag/bit-manipulation/README.md)]
-
-### Similar Questions
- 1. [Minimum Moves to Reach Target Score](../minimum-moves-to-reach-target-score) (Medium)
-
-### Hints
-
-Hint 1
-Read the string from right to left, if the string ends in '0' then the number is even otherwise it is odd.
-
-
-
-Hint 2
-Simulate the steps described in the binary string.
-
diff --git a/problems/number-of-steps-to-reduce-a-number-to-zero/README.md b/problems/number-of-steps-to-reduce-a-number-to-zero/README.md
deleted file mode 100644
index 6a5b12197..000000000
--- a/problems/number-of-steps-to-reduce-a-number-to-zero/README.md
+++ /dev/null
@@ -1,71 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../movie-rating "Movie Rating")
-
-[Next >](../number-of-sub-arrays-of-size-k-and-average-greater-than-or-equal-to-threshold "Number of Sub-arrays of Size K and Average Greater than or Equal to Threshold")
-
-## [1342. Number of Steps to Reduce a Number to Zero (Easy)](https://leetcode.com/problems/number-of-steps-to-reduce-a-number-to-zero "将数字变成 0 的操作次数")
-
-
Given an integer num, return the number of steps to reduce it to zero.
-
-
In one step, if the current number is even, you have to divide it by 2, otherwise, you have to subtract 1 from it.
-
-
-
Example 1:
-
-
-Input: num = 14
-Output: 6
-Explanation:
-Step 1) 14 is even; divide by 2 and obtain 7.
-Step 2) 7 is odd; subtract 1 and obtain 6.
-Step 3) 6 is even; divide by 2 and obtain 3.
-Step 4) 3 is odd; subtract 1 and obtain 2.
-Step 5) 2 is even; divide by 2 and obtain 1.
-Step 6) 1 is odd; subtract 1 and obtain 0.
-
-
-
Example 2:
-
-
-Input: num = 8
-Output: 4
-Explanation:
-Step 1) 8 is even; divide by 2 and obtain 4.
-Step 2) 4 is even; divide by 2 and obtain 2.
-Step 3) 2 is even; divide by 2 and obtain 1.
-Step 4) 1 is odd; subtract 1 and obtain 0.
-
-
-
Example 3:
-
-
-Input: num = 123
-Output: 12
-
-
-
-
Constraints:
-
-
-
0 <= num <= 106
-
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
- [[Bit Manipulation](../../tag/bit-manipulation/README.md)]
-
-### Similar Questions
- 1. [Minimum Moves to Reach Target Score](../minimum-moves-to-reach-target-score) (Medium)
- 1. [Count Operations to Obtain Zero](../count-operations-to-obtain-zero) (Easy)
-
-### Hints
-
-Hint 1
-Simulate the process to get the final answer.
-
diff --git a/problems/number-of-strings-that-appear-as-substrings-in-word/README.md b/problems/number-of-strings-that-appear-as-substrings-in-word/README.md
deleted file mode 100644
index f5aec31f7..000000000
--- a/problems/number-of-strings-that-appear-as-substrings-in-word/README.md
+++ /dev/null
@@ -1,74 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../binary-searchable-numbers-in-an-unsorted-array "Binary Searchable Numbers in an Unsorted Array")
-
-[Next >](../array-with-elements-not-equal-to-average-of-neighbors "Array With Elements Not Equal to Average of Neighbors")
-
-## [1967. Number of Strings That Appear as Substrings in Word (Easy)](https://leetcode.com/problems/number-of-strings-that-appear-as-substrings-in-word "作为子字符串出现在单词中的字符串数目")
-
-
Given an array of strings patterns and a string word, return the number of strings in patterns that exist as a substring in word.
-
-
A substring is a contiguous sequence of characters within a string.
-
-
-
Example 1:
-
-
-Input: patterns = ["a","abc","bc","d"], word = "abc"
-Output: 3
-Explanation:
-- "a" appears as a substring in "abc".
-- "abc" appears as a substring in "abc".
-- "bc" appears as a substring in "abc".
-- "d" does not appear as a substring in "abc".
-3 of the strings in patterns appear as a substring in word.
-
-
-
Example 2:
-
-
-Input: patterns = ["a","b","c"], word = "aaaaabbbbb"
-Output: 2
-Explanation:
-- "a" appears as a substring in "aaaaabbbbb".
-- "b" appears as a substring in "aaaaabbbbb".
-- "c" does not appear as a substring in "aaaaabbbbb".
-2 of the strings in patterns appear as a substring in word.
-
-
-
Example 3:
-
-
-Input: patterns = ["a","a","a"], word = "ab"
-Output: 3
-Explanation: Each of the patterns appears as a substring in word "ab".
-
-
-
-
Constraints:
-
-
-
1 <= patterns.length <= 100
-
1 <= patterns[i].length <= 100
-
1 <= word.length <= 100
-
patterns[i] and word consist of lowercase English letters.
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
-
-### Hints
-
-Hint 1
-Deal with each of the patterns individually.
-
-
-
-Hint 2
-Use the built-in function in the language you are using to find if the pattern exists as a substring in word.
-
diff --git a/problems/number-of-students-doing-homework-at-a-given-time/README.md b/problems/number-of-students-doing-homework-at-a-given-time/README.md
deleted file mode 100644
index 0378b7668..000000000
--- a/problems/number-of-students-doing-homework-at-a-given-time/README.md
+++ /dev/null
@@ -1,62 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../form-largest-integer-with-digits-that-add-up-to-target "Form Largest Integer With Digits That Add up to Target")
-
-[Next >](../rearrange-words-in-a-sentence "Rearrange Words in a Sentence")
-
-## [1450. Number of Students Doing Homework at a Given Time (Easy)](https://leetcode.com/problems/number-of-students-doing-homework-at-a-given-time "在既定时间做作业的学生人数")
-
-
Given two integer arrays startTime and endTime and given an integer queryTime.
-
-
The ith student started doing their homework at the time startTime[i] and finished it at time endTime[i].
-
-
Return the number of students doing their homework at time queryTime. More formally, return the number of students where queryTime lays in the interval [startTime[i], endTime[i]] inclusive.
-
-
-
Example 1:
-
-
-Input: startTime = [1,2,3], endTime = [3,2,7], queryTime = 4
-Output: 1
-Explanation: We have 3 students where:
-The first student started doing homework at time 1 and finished at time 3 and wasn't doing anything at time 4.
-The second student started doing homework at time 2 and finished at time 2 and also wasn't doing anything at time 4.
-The third student started doing homework at time 3 and finished at time 7 and was the only student doing homework at time 4.
-
-
-
Example 2:
-
-
-Input: startTime = [4], endTime = [4], queryTime = 4
-Output: 1
-Explanation: The only student was doing their homework at the queryTime.
-
-
-
-
Constraints:
-
-
-
startTime.length == endTime.length
-
1 <= startTime.length <= 100
-
1 <= startTime[i] <= endTime[i] <= 1000
-
1 <= queryTime <= 1000
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
-
-### Hints
-
-Hint 1
-Imagine that startTime[i] and endTime[i] form an interval (i.e. [startTime[i], endTime[i]]).
-
-
-
-Hint 2
-The answer is how many times the queryTime laid in those mentioned intervals.
-
diff --git a/problems/number-of-students-unable-to-eat-lunch/README.md b/problems/number-of-students-unable-to-eat-lunch/README.md
deleted file mode 100644
index 010fc4510..000000000
--- a/problems/number-of-students-unable-to-eat-lunch/README.md
+++ /dev/null
@@ -1,80 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../number-of-calls-between-two-persons "Number of Calls Between Two Persons")
-
-[Next >](../average-waiting-time "Average Waiting Time")
-
-## [1700. Number of Students Unable to Eat Lunch (Easy)](https://leetcode.com/problems/number-of-students-unable-to-eat-lunch "无法吃午餐的学生数量")
-
-
The school cafeteria offers circular and square sandwiches at lunch break, referred to by numbers 0 and 1 respectively. All students stand in a queue. Each student either prefers square or circular sandwiches.
-
-
The number of sandwiches in the cafeteria is equal to the number of students. The sandwiches are placed in a stack. At each step:
-
-
-
If the student at the front of the queue prefers the sandwich on the top of the stack, they will take it and leave the queue.
-
Otherwise, they will leave it and go to the queue's end.
-
-
-
This continues until none of the queue students want to take the top sandwich and are thus unable to eat.
-
-
You are given two integer arrays students and sandwiches where sandwiches[i] is the type of the ith sandwich in the stack (i = 0 is the top of the stack) and students[j] is the preference of the jth student in the initial queue (j = 0 is the front of the queue). Return the number of students that are unable to eat.
-
-
-
Example 1:
-
-
-Input: students = [1,1,0,0], sandwiches = [0,1,0,1]
-Output: 0
-Explanation:
-- Front student leaves the top sandwich and returns to the end of the line making students = [1,0,0,1].
-- Front student leaves the top sandwich and returns to the end of the line making students = [0,0,1,1].
-- Front student takes the top sandwich and leaves the line making students = [0,1,1] and sandwiches = [1,0,1].
-- Front student leaves the top sandwich and returns to the end of the line making students = [1,1,0].
-- Front student takes the top sandwich and leaves the line making students = [1,0] and sandwiches = [0,1].
-- Front student leaves the top sandwich and returns to the end of the line making students = [0,1].
-- Front student takes the top sandwich and leaves the line making students = [1] and sandwiches = [1].
-- Front student takes the top sandwich and leaves the line making students = [] and sandwiches = [].
-Hence all students are able to eat.
-
-
-
Example 2:
-
-
-Input: students = [1,1,1,0,0,1], sandwiches = [1,0,0,0,1,1]
-Output: 3
-
-
-
-
Constraints:
-
-
-
1 <= students.length, sandwiches.length <= 100
-
students.length == sandwiches.length
-
sandwiches[i] is 0 or 1.
-
students[i] is 0 or 1.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Stack](../../tag/stack/README.md)]
- [[Queue](../../tag/queue/README.md)]
- [[Simulation](../../tag/simulation/README.md)]
-
-### Similar Questions
- 1. [Time Needed to Buy Tickets](../time-needed-to-buy-tickets) (Easy)
-
-### Hints
-
-Hint 1
-Simulate the given in the statement
-
-
-
-Hint 2
-Calculate those who will eat instead of those who will not.
-
diff --git a/problems/number-of-sub-arrays-of-size-k-and-average-greater-than-or-equal-to-threshold/README.md b/problems/number-of-sub-arrays-of-size-k-and-average-greater-than-or-equal-to-threshold/README.md
deleted file mode 100644
index ea0d4c7dd..000000000
--- a/problems/number-of-sub-arrays-of-size-k-and-average-greater-than-or-equal-to-threshold/README.md
+++ /dev/null
@@ -1,56 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../number-of-steps-to-reduce-a-number-to-zero "Number of Steps to Reduce a Number to Zero")
-
-[Next >](../angle-between-hands-of-a-clock "Angle Between Hands of a Clock")
-
-## [1343. Number of Sub-arrays of Size K and Average Greater than or Equal to Threshold (Medium)](https://leetcode.com/problems/number-of-sub-arrays-of-size-k-and-average-greater-than-or-equal-to-threshold "大小为 K 且平均值大于等于阈值的子数组数目")
-
-
Given an array of integers arr and two integers k and threshold, return the number of sub-arrays of size k and average greater than or equal to threshold.
-
-
-
Example 1:
-
-
-Input: arr = [2,2,2,2,5,5,5,8], k = 3, threshold = 4
-Output: 3
-Explanation: Sub-arrays [2,5,5],[5,5,5] and [5,5,8] have averages 4, 5 and 6 respectively. All other sub-arrays of size 3 have averages less than 4 (the threshold).
-
-
-
Example 2:
-
-
-Input: arr = [11,13,17,23,29,31,7,5,2,3], k = 3, threshold = 5
-Output: 6
-Explanation: The first 6 sub-arrays of size 3 have averages greater than 5. Note that averages are not integers.
-
-
-
-
Constraints:
-
-
-
1 <= arr.length <= 105
-
1 <= arr[i] <= 104
-
1 <= k <= arr.length
-
0 <= threshold <= 104
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Sliding Window](../../tag/sliding-window/README.md)]
-
-### Hints
-
-Hint 1
-Start with a window of size K and test its average against the threshold.
-
-
-
-Hint 2
-Keep moving the window by one element maintaining its size k until you cover the whole array. count number of windows that satisfy that its average is greater than the threshold.
-
diff --git a/problems/number-of-sub-arrays-with-odd-sum/README.md b/problems/number-of-sub-arrays-with-odd-sum/README.md
deleted file mode 100644
index 98a5c903c..000000000
--- a/problems/number-of-sub-arrays-with-odd-sum/README.md
+++ /dev/null
@@ -1,72 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../count-odd-numbers-in-an-interval-range "Count Odd Numbers in an Interval Range")
-
-[Next >](../number-of-good-ways-to-split-a-string "Number of Good Ways to Split a String")
-
-## [1524. Number of Sub-arrays With Odd Sum (Medium)](https://leetcode.com/problems/number-of-sub-arrays-with-odd-sum "和为奇数的子数组数目")
-
-
Given an array of integers arr, return the number of subarrays with an odd sum.
-
-
Since the answer can be very large, return it modulo 109 + 7.
-
-
-
Example 1:
-
-
-Input: arr = [1,3,5]
-Output: 4
-Explanation: All subarrays are [[1],[1,3],[1,3,5],[3],[3,5],[5]]
-All sub-arrays sum are [1,4,9,3,8,5].
-Odd sums are [1,9,3,5] so the answer is 4.
-
-
-
Example 2:
-
-
-Input: arr = [2,4,6]
-Output: 0
-Explanation: All subarrays are [[2],[2,4],[2,4,6],[4],[4,6],[6]]
-All sub-arrays sum are [2,6,12,4,10,6].
-All sub-arrays have even sum and the answer is 0.
-
-
-
Example 3:
-
-
-Input: arr = [1,2,3,4,5,6,7]
-Output: 16
-
-
-
-
Constraints:
-
-
-
1 <= arr.length <= 105
-
1 <= arr[i] <= 100
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Math](../../tag/math/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Prefix Sum](../../tag/prefix-sum/README.md)]
-
-### Similar Questions
- 1. [Subsequence of Size K With the Largest Even Sum](../subsequence-of-size-k-with-the-largest-even-sum) (Medium)
-
-### Hints
-
-Hint 1
-Can we use the accumulative sum to keep track of all the odd-sum sub-arrays ?
-
-
-
-Hint 2
-if the current accu sum is odd, we care only about previous even accu sums and vice versa.
-
diff --git a/problems/number-of-subarrays-with-bounded-maximum/README.md b/problems/number-of-subarrays-with-bounded-maximum/README.md
deleted file mode 100644
index 80823a666..000000000
--- a/problems/number-of-subarrays-with-bounded-maximum/README.md
+++ /dev/null
@@ -1,45 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../valid-tic-tac-toe-state "Valid Tic-Tac-Toe State")
-
-[Next >](../rotate-string "Rotate String")
-
-## [795. Number of Subarrays with Bounded Maximum (Medium)](https://leetcode.com/problems/number-of-subarrays-with-bounded-maximum "区间子数组个数")
-
-
Given an integer array nums and two integers left and right, return the number of contiguous non-empty subarrays such that the value of the maximum array element in that subarray is in the range [left, right].
-
-
The test cases are generated so that the answer will fit in a 32-bit integer.
-
-
-
Example 1:
-
-
-Input: nums = [2,1,4,3], left = 2, right = 3
-Output: 3
-Explanation: There are three subarrays that meet the requirements: [2], [2, 1], [3].
-
-
-
Example 2:
-
-
-Input: nums = [2,9,2,5,6], left = 2, right = 8
-Output: 7
-
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 105
-
0 <= nums[i] <= 109
-
0 <= left <= right <= 109
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Two Pointers](../../tag/two-pointers/README.md)]
diff --git a/problems/number-of-subarrays-with-bounded-maximum/number_of_subarrays_with_bounded_maximum.go b/problems/number-of-subarrays-with-bounded-maximum/number_of_subarrays_with_bounded_maximum.go
deleted file mode 100644
index 6ac73f4d9..000000000
--- a/problems/number-of-subarrays-with-bounded-maximum/number_of_subarrays_with_bounded_maximum.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem795
diff --git a/problems/number-of-subarrays-with-bounded-maximum/number_of_subarrays_with_bounded_maximum_test.go b/problems/number-of-subarrays-with-bounded-maximum/number_of_subarrays_with_bounded_maximum_test.go
deleted file mode 100644
index 6ac73f4d9..000000000
--- a/problems/number-of-subarrays-with-bounded-maximum/number_of_subarrays_with_bounded_maximum_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem795
diff --git a/problems/number-of-submatrices-that-sum-to-target/README.md b/problems/number-of-submatrices-that-sum-to-target/README.md
deleted file mode 100644
index b9b2aebe9..000000000
--- a/problems/number-of-submatrices-that-sum-to-target/README.md
+++ /dev/null
@@ -1,65 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../adding-two-negabinary-numbers "Adding Two Negabinary Numbers")
-
-[Next >](../project-employees-i "Project Employees I")
-
-## [1074. Number of Submatrices That Sum to Target (Hard)](https://leetcode.com/problems/number-of-submatrices-that-sum-to-target "元素和为目标值的子矩阵数量")
-
-
Given a matrix and a target, return the number of non-empty submatrices that sum to target.
-
-
A submatrix x1, y1, x2, y2 is the set of all cells matrix[x][y] with x1 <= x <= x2 and y1 <= y <= y2.
-
-
Two submatrices (x1, y1, x2, y2) and (x1', y1', x2', y2') are different if they have some coordinate that is different: for example, if x1 != x1'.
-
-
-
Example 1:
-
-
-Input: matrix = [[0,1,0],[1,1,1],[0,1,0]], target = 0
-Output: 4
-Explanation: The four 1x1 submatrices that only contain 0.
-
-
-
Example 2:
-
-
-Input: matrix = [[1,-1],[-1,1]], target = 0
-Output: 5
-Explanation: The two 1x2 submatrices, plus the two 2x1 submatrices, plus the 2x2 submatrix.
-
-
-
Example 3:
-
-
-Input: matrix = [[904]], target = 0
-Output: 0
-
-
-
-
Constraints:
-
-
-
1 <= matrix.length <= 100
-
1 <= matrix[0].length <= 100
-
-1000 <= matrix[i] <= 1000
-
-10^8 <= target <= 10^8
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
- [[Prefix Sum](../../tag/prefix-sum/README.md)]
-
-### Hints
-
-Hint 1
-Using a 2D prefix sum, we can query the sum of any submatrix in O(1) time.
-Now for each (r1, r2), we can find the largest sum of a submatrix that uses every row in [r1, r2] in linear time using a sliding window.
-
diff --git a/problems/number-of-submatrices-that-sum-to-target/number_of_submatrices_that_sum_to_target.go b/problems/number-of-submatrices-that-sum-to-target/number_of_submatrices_that_sum_to_target.go
deleted file mode 100644
index 052ca2755..000000000
--- a/problems/number-of-submatrices-that-sum-to-target/number_of_submatrices_that_sum_to_target.go
+++ /dev/null
@@ -1,28 +0,0 @@
-package problem1074
-
-func numSubmatrixSumTarget(M [][]int, target int) int {
- m, n := len(M), len(M[0])
-
- S := [301][301]int{}
- for i := 1; i <= m; i++ {
- for j := 1; j <= n; j++ {
- S[i][j] = S[i][j-1] + M[i-1][j-1]
- }
- }
-
- res := 0
-
- for y1 := 0; y1 < n; y1++ {
- for y2 := y1 + 1; y2 <= n; y2++ {
- count := make(map[int]int, m)
- sum := 0
- for x := 0; x <= m; x++ {
- sum += S[x][y2] - S[x][y1]
- res += count[sum-target]
- count[sum]++
- }
- }
- }
-
- return res
-}
diff --git a/problems/number-of-subsequences-that-satisfy-the-given-sum-condition/README.md b/problems/number-of-subsequences-that-satisfy-the-given-sum-condition/README.md
deleted file mode 100644
index e05fcbde2..000000000
--- a/problems/number-of-subsequences-that-satisfy-the-given-sum-condition/README.md
+++ /dev/null
@@ -1,78 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../check-if-array-pairs-are-divisible-by-k "Check If Array Pairs Are Divisible by k")
-
-[Next >](../max-value-of-equation "Max Value of Equation")
-
-## [1498. Number of Subsequences That Satisfy the Given Sum Condition (Medium)](https://leetcode.com/problems/number-of-subsequences-that-satisfy-the-given-sum-condition "满足条件的子序列数目")
-
-
You are given an array of integers nums and an integer target.
-
-
Return the number of non-empty subsequences of nums such that the sum of the minimum and maximum element on it is less or equal to target. Since the answer may be too large, return it modulo109 + 7.
-
-
-
Example 1:
-
-
-Input: nums = [3,5,6,7], target = 9
-Output: 4
-Explanation: There are 4 subsequences that satisfy the condition.
-[3] -> Min value + max value <= target (3 + 3 <= 9)
-[3,5] -> (3 + 5 <= 9)
-[3,5,6] -> (3 + 6 <= 9)
-[3,6] -> (3 + 6 <= 9)
-
-
-
Example 2:
-
-
-Input: nums = [3,3,6,8], target = 10
-Output: 6
-Explanation: There are 6 subsequences that satisfy the condition. (nums can have repeated numbers).
-[3] , [3] , [3,3], [3,6] , [3,6] , [3,3,6]
-
-
-
Example 3:
-
-
-Input: nums = [2,3,3,4,6,7], target = 12
-Output: 61
-Explanation: There are 63 non-empty subsequences, two of them do not satisfy the condition ([6,7], [7]).
-Number of valid subsequences (63 - 2 = 61).
-
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 105
-
1 <= nums[i] <= 106
-
1 <= target <= 106
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Two Pointers](../../tag/two-pointers/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Hints
-
-Hint 1
-Sort the array nums.
-
-
-
-Hint 2
-Use two pointers approach: Given an index i (choose it as the minimum in a subsequence) find the maximum j where j ≥ i and nums[i] +nums[j] ≤ target.
-
-
-
-Hint 3
-Count the number of subsequences.
-
diff --git a/problems/number-of-substrings-containing-all-three-characters/README.md b/problems/number-of-substrings-containing-all-three-characters/README.md
deleted file mode 100644
index 06af64589..000000000
--- a/problems/number-of-substrings-containing-all-three-characters/README.md
+++ /dev/null
@@ -1,64 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../apply-discount-every-n-orders "Apply Discount Every n Orders")
-
-[Next >](../count-all-valid-pickup-and-delivery-options "Count All Valid Pickup and Delivery Options")
-
-## [1358. Number of Substrings Containing All Three Characters (Medium)](https://leetcode.com/problems/number-of-substrings-containing-all-three-characters "包含所有三种字符的子字符串数目")
-
-
Given a string s consisting only of characters a, b and c.
-
-
Return the number of substrings containing at least one occurrence of all these characters a, b and c.
-
-
-
Example 1:
-
-
-Input: s = "abcabc"
-Output: 10
-Explanation: The substrings containing at least one occurrence of the characters a, b and c are "abc", "abca", "abcab", "abcabc", "bca", "bcab", "bcabc", "cab", "cabc" and "abc" (again).
-
-
-
Example 2:
-
-
-Input: s = "aaacb"
-Output: 3
-Explanation: The substrings containing at least one occurrence of the characters a, b and c are "aaacb", "aacb" and "acb".
-
-
-
Example 3:
-
-
-Input: s = "abc"
-Output: 1
-
-
-
-
Constraints:
-
-
-
3 <= s.length <= 5 x 10^4
-
s only consists of a, b or c characters.
-
-
-### Related Topics
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
- [[Sliding Window](../../tag/sliding-window/README.md)]
-
-### Hints
-
-Hint 1
-For each position we simply need to find the first occurrence of a/b/c on or after this position.
-
-
-
-Hint 2
-So we can pre-compute three link-list of indices of each a, b, and c.
-
diff --git a/problems/number-of-substrings-with-only-1s/README.md b/problems/number-of-substrings-with-only-1s/README.md
deleted file mode 100644
index 3e0062cdb..000000000
--- a/problems/number-of-substrings-with-only-1s/README.md
+++ /dev/null
@@ -1,63 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../number-of-good-pairs "Number of Good Pairs")
-
-[Next >](../path-with-maximum-probability "Path with Maximum Probability")
-
-## [1513. Number of Substrings With Only 1s (Medium)](https://leetcode.com/problems/number-of-substrings-with-only-1s "仅含 1 的子串数")
-
-
Given a binary string s, return the number of substrings with all characters1's. Since the answer may be too large, return it modulo 109 + 7.
-
-
-
Example 1:
-
-
-Input: s = "0110111"
-Output: 9
-Explanation: There are 9 substring in total with only 1's characters.
-"1" -> 5 times.
-"11" -> 3 times.
-"111" -> 1 time.
-
-
Example 2:
-
-
-Input: s = "101"
-Output: 2
-Explanation: Substring "1" is shown 2 times in s.
-
-
-
Example 3:
-
-
-Input: s = "111111"
-Output: 21
-Explanation: Each substring contains only 1's characters.
-
-
-
-
Constraints:
-
-
-
1 <= s.length <= 105
-
s[i] is either '0' or '1'.
-
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Similar Questions
- 1. [Count Number of Homogenous Substrings](../count-number-of-homogenous-substrings) (Medium)
- 1. [Count Vowel Substrings of a String](../count-vowel-substrings-of-a-string) (Easy)
-
-### Hints
-
-Hint 1
-Count number of 1s in each consecutive-1 group. For a group with n consecutive 1s, the total contribution of it to the final answer is (n + 1) * n // 2.
-
diff --git a/problems/number-of-transactions-per-visit/README.md b/problems/number-of-transactions-per-visit/README.md
deleted file mode 100644
index e08f68f39..000000000
--- a/problems/number-of-transactions-per-visit/README.md
+++ /dev/null
@@ -1,97 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-difficulty-of-a-job-schedule "Minimum Difficulty of a Job Schedule")
-
-[Next >](../the-k-weakest-rows-in-a-matrix "The K Weakest Rows in a Matrix")
-
-## [1336. Number of Transactions per Visit (Hard)](https://leetcode.com/problems/number-of-transactions-per-visit "每次访问的交易次数")
-
-
Table: Visits
-
-+---------------+---------+
-| Column Name | Type |
-+---------------+---------+
-| user_id | int |
-| visit_date | date |
-+---------------+---------+
-(user_id, visit_date) is the primary key for this table.
-Each row of this table indicates that user_id has visited the bank in visit_date.
-
-
-
Table: Transactions
-
-+------------------+---------+
-| Column Name | Type |
-+------------------+---------+
-| user_id | int |
-| transaction_date | date |
-| amount | int |
-+------------------+---------+
-There is no primary key for this table, it may contain duplicates.
-Each row of this table indicates that user_id has done a transaction of amount in transaction_date.
-It is guaranteed that the user has visited the bank in the transaction_date.(i.e The Visits table contains (user_id, transaction_date) in one row)
-
-
-Write an SQL query to find how many users visited the bank and didn't do any transactions, how many visited the bank and did one transaction and so on.
-
-The result table will contain two columns transactions_count which is the number of transactions done in one visit and visits_count which is the corresponding number of users who did transactions_count in one visit to the bank. transactions_count should take all values from 0 to max(transactions_count) done by one or more users.
-
-Order the result table by transactions_count.
-
-The query result format is in the following example:
-
-
-Visits table:
-+---------+------------+
-| user_id | visit_date |
-+---------+------------+
-| 1 | 2020-01-01 |
-| 2 | 2020-01-02 |
-| 12 | 2020-01-01 |
-| 19 | 2020-01-03 |
-| 1 | 2020-01-02 |
-| 2 | 2020-01-03 |
-| 1 | 2020-01-04 |
-| 7 | 2020-01-11 |
-| 9 | 2020-01-25 |
-| 8 | 2020-01-28 |
-+---------+------------+
-Transactions table:
-+---------+------------------+--------+
-| user_id | transaction_date | amount |
-+---------+------------------+--------+
-| 1 | 2020-01-02 | 120 |
-| 2 | 2020-01-03 | 22 |
-| 7 | 2020-01-11 | 232 |
-| 1 | 2020-01-04 | 7 |
-| 9 | 2020-01-25 | 33 |
-| 9 | 2020-01-25 | 66 |
-| 8 | 2020-01-28 | 1 |
-| 9 | 2020-01-25 | 99 |
-+---------+------------------+--------+
-Result table:
-+--------------------+--------------+
-| transactions_count | visits_count |
-+--------------------+--------------+
-| 0 | 4 |
-| 1 | 5 |
-| 2 | 0 |
-| 3 | 1 |
-+--------------------+--------------+
-Users 1, 2, 12 and 19 visited the bank in 2020-01-01, 2020-01-02, 2020-01-01 and 2020-01-03 respectively, and didn't do any transactions.
-So we have visits_count = 4 for transactions_count = 0.
-Users 2, 7 and 8 visited the bank in 2020-01-03, 2020-01-11 and 2020-01-28 respectively, and did one transaction.
-User 1 Also visited the bank in 2020-01-02 and 2020-01-04 and did one transaction each day.
-So we have total visits_count = 5 for transactions_count = 1.
-For transactions_count = 2 we don't have any users who visited the bank and did two transactions.
-For transactions_count = 3 we have user 9 who visited the bank in 2020-01-25 and did three transactions.
-Note that we stopped at transactions_count = 3 as this is the maximum number of transactions done by one user in one visit to the bank.
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/number-of-transactions-per-visit/mysql_schemas.sql b/problems/number-of-transactions-per-visit/mysql_schemas.sql
deleted file mode 100644
index 0c16a9c57..000000000
--- a/problems/number-of-transactions-per-visit/mysql_schemas.sql
+++ /dev/null
@@ -1,22 +0,0 @@
-Create table If Not Exists Visits (user_id int, visit_date date);
-Create table If Not Exists Transactions (user_id int, transaction_date date, amount int);
-Truncate table Visits;
-insert into Visits (user_id, visit_date) values ('1', '2020-01-01');
-insert into Visits (user_id, visit_date) values ('2', '2020-01-02');
-insert into Visits (user_id, visit_date) values ('12', '2020-01-01');
-insert into Visits (user_id, visit_date) values ('19', '2020-01-03');
-insert into Visits (user_id, visit_date) values ('1', '2020-01-02');
-insert into Visits (user_id, visit_date) values ('2', '2020-01-03');
-insert into Visits (user_id, visit_date) values ('1', '2020-01-04');
-insert into Visits (user_id, visit_date) values ('7', '2020-01-11');
-insert into Visits (user_id, visit_date) values ('9', '2020-01-25');
-insert into Visits (user_id, visit_date) values ('8', '2020-01-28');
-Truncate table Transactions;
-insert into Transactions (user_id, transaction_date, amount) values ('1', '2020-01-02', '120');
-insert into Transactions (user_id, transaction_date, amount) values ('2', '2020-01-03', '22');
-insert into Transactions (user_id, transaction_date, amount) values ('7', '2020-01-11', '232');
-insert into Transactions (user_id, transaction_date, amount) values ('1', '2020-01-04', '7');
-insert into Transactions (user_id, transaction_date, amount) values ('9', '2020-01-25', '33');
-insert into Transactions (user_id, transaction_date, amount) values ('9', '2020-01-25', '66');
-insert into Transactions (user_id, transaction_date, amount) values ('8', '2020-01-28', '1');
-insert into Transactions (user_id, transaction_date, amount) values ('9', '2020-01-25', '99');
diff --git a/problems/number-of-trusted-contacts-of-a-customer/README.md b/problems/number-of-trusted-contacts-of-a-customer/README.md
deleted file mode 100644
index fc43743ce..000000000
--- a/problems/number-of-trusted-contacts-of-a-customer/README.md
+++ /dev/null
@@ -1,114 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../largest-multiple-of-three "Largest Multiple of Three")
-
-[Next >](../how-many-numbers-are-smaller-than-the-current-number "How Many Numbers Are Smaller Than the Current Number")
-
-## [1364. Number of Trusted Contacts of a Customer (Medium)](https://leetcode.com/problems/number-of-trusted-contacts-of-a-customer "顾客的可信联系人数量")
-
-
Table: Customers
-
-+---------------+---------+
-| Column Name | Type |
-+---------------+---------+
-| customer_id | int |
-| customer_name | varchar |
-| email | varchar |
-+---------------+---------+
-customer_id is the primary key for this table.
-Each row of this table contains the name and the email of a customer of an online shop.
-
-
-
Table: Contacts
-
-+---------------+---------+
-| Column Name | Type |
-+---------------+---------+
-| user_id | id |
-| contact_name | varchar |
-| contact_email | varchar |
-+---------------+---------+
-(user_id, contact_email) is the primary key for this table.
-Each row of this table contains the name and email of one contact of customer with user_id.
-This table contains information about people each customer trust. The contact may or may not exist in the Customers table.
-
-
-
Table: Invoices
-
-+--------------+---------+
-| Column Name | Type |
-+--------------+---------+
-| invoice_id | int |
-| price | int |
-| user_id | int |
-+--------------+---------+
-invoice_id is the primary key for this table.
-Each row of this table indicates that user_id has an invoice with invoice_id and a price.
-
-
-Write an SQL query to find the following for each invoice_id:
-
-- customer_name: The name of the customer the invoice is related to.
-- price: The price of the invoice.
-- contacts_cnt: The number of contacts related to the customer.
-- trusted_contacts_cnt: The number of contacts related to the customer and at the same time they are customers to the shop. (i.e His/Her email exists in the Customers table.)
-
-Order the result table by invoice_id.
-
-The query result format is in the following example:
-
-Customers table:
-+-------------+---------------+--------------------+
-| customer_id | customer_name | email |
-+-------------+---------------+--------------------+
-| 1 | Alice | alice@leetcode.com |
-| 2 | Bob | bob@leetcode.com |
-| 13 | John | john@leetcode.com |
-| 6 | Alex | alex@leetcode.com |
-+-------------+---------------+--------------------+
-Contacts table:
-+-------------+--------------+--------------------+
-| user_id | contact_name | contact_email |
-+-------------+--------------+--------------------+
-| 1 | Bob | bob@leetcode.com |
-| 1 | John | john@leetcode.com |
-| 1 | Jal | jal@leetcode.com |
-| 2 | Omar | omar@leetcode.com |
-| 2 | Meir | meir@leetcode.com |
-| 6 | Alice | alice@leetcode.com |
-+-------------+--------------+--------------------+
-Invoices table:
-+------------+-------+---------+
-| invoice_id | price | user_id |
-+------------+-------+---------+
-| 77 | 100 | 1 |
-| 88 | 200 | 1 |
-| 99 | 300 | 2 |
-| 66 | 400 | 2 |
-| 55 | 500 | 13 |
-| 44 | 60 | 6 |
-+------------+-------+---------+
-Result table:
-+------------+---------------+-------+--------------+----------------------+
-| invoice_id | customer_name | price | contacts_cnt | trusted_contacts_cnt |
-+------------+---------------+-------+--------------+----------------------+
-| 44 | Alex | 60 | 1 | 1 |
-| 55 | John | 500 | 0 | 0 |
-| 66 | Bob | 400 | 2 | 0 |
-| 77 | Alice | 100 | 3 | 2 |
-| 88 | Alice | 200 | 3 | 2 |
-| 99 | Bob | 300 | 2 | 0 |
-+------------+---------------+-------+--------------+----------------------+
-Alice has three contacts, two of them are trusted contacts (Bob and John).
-Bob has two contacts, none of them is a trusted contact.
-Alex has one contact and it is a trusted contact (Alice).
-John doesn't have any contacts.
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/number-of-trusted-contacts-of-a-customer/mysql_schemas.sql b/problems/number-of-trusted-contacts-of-a-customer/mysql_schemas.sql
deleted file mode 100644
index 608197d7b..000000000
--- a/problems/number-of-trusted-contacts-of-a-customer/mysql_schemas.sql
+++ /dev/null
@@ -1,22 +0,0 @@
-Create table If Not Exists Customers (customer_id int, customer_name varchar(20), email varchar(30));
-Create table If Not Exists Contacts (user_id int, contact_name varchar(20), contact_email varchar(30));
-Create table If Not Exists Invoices (invoice_id int, price int, user_id int);
-Truncate table Customers;
-insert into Customers (customer_id, customer_name, email) values ('1', 'Alice', 'alice@leetcode.com');
-insert into Customers (customer_id, customer_name, email) values ('2', 'Bob', 'bob@leetcode.com');
-insert into Customers (customer_id, customer_name, email) values ('13', 'John', 'john@leetcode.com');
-insert into Customers (customer_id, customer_name, email) values ('6', 'Alex', 'alex@leetcode.com');
-Truncate table Contacts;
-insert into Contacts (user_id, contact_name, contact_email) values ('1', 'Bob', 'bob@leetcode.com');
-insert into Contacts (user_id, contact_name, contact_email) values ('1', 'John', 'john@leetcode.com');
-insert into Contacts (user_id, contact_name, contact_email) values ('1', 'Jal', 'jal@leetcode.com');
-insert into Contacts (user_id, contact_name, contact_email) values ('2', 'Omar', 'omar@leetcode.com');
-insert into Contacts (user_id, contact_name, contact_email) values ('2', 'Meir', 'meir@leetcode.com');
-insert into Contacts (user_id, contact_name, contact_email) values ('6', 'Alice', 'alice@leetcode.com');
-Truncate table Invoices;
-insert into Invoices (invoice_id, price, user_id) values ('77', '100', '1');
-insert into Invoices (invoice_id, price, user_id) values ('88', '200', '1');
-insert into Invoices (invoice_id, price, user_id) values ('99', '300', '2');
-insert into Invoices (invoice_id, price, user_id) values ('66', '400', '2');
-insert into Invoices (invoice_id, price, user_id) values ('55', '500', '13');
-insert into Invoices (invoice_id, price, user_id) values ('44', '60', '6');
diff --git a/problems/number-of-unique-flavors-after-sharing-k-candies/README.md b/problems/number-of-unique-flavors-after-sharing-k-candies/README.md
deleted file mode 100644
index e77956fbe..000000000
--- a/problems/number-of-unique-flavors-after-sharing-k-candies/README.md
+++ /dev/null
@@ -1,35 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-fruits-harvested-after-at-most-k-steps "Maximum Fruits Harvested After at Most K Steps")
-
-[Next >](../find-first-palindromic-string-in-the-array "Find First Palindromic String in the Array")
-
-## [2107. Number of Unique Flavors After Sharing K Candies (Medium)](https://leetcode.com/problems/number-of-unique-flavors-after-sharing-k-candies "")
-
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Sliding Window](../../tag/sliding-window/README.md)]
-
-### Hints
-
-Hint 1
-For every group of k consecutive candies, count the number of unique flavors not inside that group. Return the largest number of unique flavors.
-
-
-
-Hint 2
-When calculating an adjacent group of k consecutive candies, can you use some of your previous calculations?
-
-
-
-Hint 3
-Use a sliding window where the window is the group of k consecutive candies you are sharing. Use a hash map to store the number of candies of each type you can keep.
-
diff --git a/problems/number-of-unique-good-subsequences/README.md b/problems/number-of-unique-good-subsequences/README.md
deleted file mode 100644
index 7a678c170..000000000
--- a/problems/number-of-unique-good-subsequences/README.md
+++ /dev/null
@@ -1,74 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-number-of-work-sessions-to-finish-the-tasks "Minimum Number of Work Sessions to Finish the Tasks")
-
-[Next >](../find-cutoff-score-for-each-school "Find Cutoff Score for Each School")
-
-## [1987. Number of Unique Good Subsequences (Hard)](https://leetcode.com/problems/number-of-unique-good-subsequences "不同的好子序列数目")
-
-
You are given a binary string binary. A subsequence of binary is considered good if it is not empty and has no leading zeros (with the exception of "0").
-
-
Find the number of unique good subsequences of binary.
-
-
-
For example, if binary = "001", then all the good subsequences are ["0", "0", "1"], so the unique good subsequences are "0" and "1". Note that subsequences "00", "01", and "001" are not good because they have leading zeros.
-
-
-
Return the number of unique good subsequences of binary. Since the answer may be very large, return it modulo109 + 7.
-
-
A subsequence is a sequence that can be derived from another sequence by deleting some or no elements without changing the order of the remaining elements.
-
-
-
Example 1:
-
-
-Input: binary = "001"
-Output: 2
-Explanation: The good subsequences of binary are ["0", "0", "1"].
-The unique good subsequences are "0" and "1".
-
-
-
Example 2:
-
-
-Input: binary = "11"
-Output: 2
-Explanation: The good subsequences of binary are ["1", "1", "11"].
-The unique good subsequences are "1" and "11".
-
-
Example 3:
-
-
-Input: binary = "101"
-Output: 5
-Explanation: The good subsequences of binary are ["1", "0", "1", "10", "11", "101"].
-The unique good subsequences are "0", "1", "10", "11", and "101".
-
-
-
-
Constraints:
-
-
-
1 <= binary.length <= 105
-
binary consists of only '0's and '1's.
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Hints
-
-Hint 1
-The number of unique good subsequences is equal to the number of unique decimal values there are for all possible subsequences.
-
-
-
-Hint 2
-Find the answer at each index based on the previous indexes' answers.
-
diff --git a/problems/number-of-valid-move-combinations-on-chessboard/README.md b/problems/number-of-valid-move-combinations-on-chessboard/README.md
deleted file mode 100644
index 89549528a..000000000
--- a/problems/number-of-valid-move-combinations-on-chessboard/README.md
+++ /dev/null
@@ -1,89 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../plates-between-candles "Plates Between Candles")
-
-[Next >](../smallest-index-with-equal-value "Smallest Index With Equal Value")
-
-## [2056. Number of Valid Move Combinations On Chessboard (Hard)](https://leetcode.com/problems/number-of-valid-move-combinations-on-chessboard "棋盘上有效移动组合的数目")
-
-
There is an 8 x 8 chessboard containing n pieces (rooks, queens, or bishops). You are given a string array pieces of length n, where pieces[i] describes the type (rook, queen, or bishop) of the ith piece. In addition, you are given a 2D integer array positions also of length n, where positions[i] = [ri, ci] indicates that the ith piece is currently at the 1-based coordinate (ri, ci) on the chessboard.
-
-
When making a move for a piece, you choose a destination square that the piece will travel toward and stop on.
-
-
-
A rook can only travel horizontally or vertically from (r, c) to the direction of (r+1, c), (r-1, c), (r, c+1), or (r, c-1).
-
A queen can only travel horizontally, vertically, or diagonally from (r, c) to the direction of (r+1, c), (r-1, c), (r, c+1), (r, c-1), (r+1, c+1), (r+1, c-1), (r-1, c+1), (r-1, c-1).
-
A bishop can only travel diagonally from (r, c) to the direction of (r+1, c+1), (r+1, c-1), (r-1, c+1), (r-1, c-1).
-
-
-
You must make a move for every piece on the board simultaneously. A move combination consists of all the moves performed on all the given pieces. Every second, each piece will instantaneously travel one square towards their destination if they are not already at it. All pieces start traveling at the 0th second. A move combination is invalid if, at a given time, two or more pieces occupy the same square.
-
-
Return the number of valid move combinations.
-
-
Notes:
-
-
-
No two pieces will start in the same square.
-
You may choose the square a piece is already on as its destination.
-
If two pieces are directly adjacent to each other, it is valid for them to move past each other and swap positions in one second.
-
-
-
-
Example 1:
-
-
-Input: pieces = ["rook"], positions = [[1,1]]
-Output: 15
-Explanation: The image above shows the possible squares the piece can move to.
-
-
-
Example 2:
-
-
-Input: pieces = ["queen"], positions = [[1,1]]
-Output: 22
-Explanation: The image above shows the possible squares the piece can move to.
-
-
-
Example 3:
-
-
-Input: pieces = ["bishop"], positions = [[4,3]]
-Output: 12
-Explanation: The image above shows the possible squares the piece can move to.
-
-
-
-
Constraints:
-
-
-
n == pieces.length
-
n == positions.length
-
1 <= n <= 4
-
pieces only contains the strings "rook", "queen", and "bishop".
-
There will be at most one queen on the chessboard.
-
1 <= xi, yi <= 8
-
Each positions[i] is distinct.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[String](../../tag/string/README.md)]
- [[Backtracking](../../tag/backtracking/README.md)]
- [[Simulation](../../tag/simulation/README.md)]
-
-### Hints
-
-Hint 1
-N is small, we can generate all possible move combinations.
-
-
-
-Hint 2
-For each possible move combination, determine which ones are valid.
-
diff --git a/problems/number-of-valid-subarrays/README.md b/problems/number-of-valid-subarrays/README.md
deleted file mode 100644
index 0a0bdd5a5..000000000
--- a/problems/number-of-valid-subarrays/README.md
+++ /dev/null
@@ -1,67 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../longest-repeating-substring "Longest Repeating Substring")
-
-[Next >](../fixed-point "Fixed Point")
-
-## [1063. Number of Valid Subarrays (Hard)](https://leetcode.com/problems/number-of-valid-subarrays "有效子数组的数目")
-
-
Given an array A of integers, return the number of non-empty continuous subarrays that satisfy the following condition:
-
-
The leftmost element of the subarray is not larger than other elements in the subarray.
-
-
-
-
Example 1:
-
-
-Input: [1,4,2,5,3]
-Output: 11
-Explanation: There are 11 valid subarrays: [1],[4],[2],[5],[3],[1,4],[2,5],[1,4,2],[2,5,3],[1,4,2,5],[1,4,2,5,3].
-
-Input: [2,2,2]
-Output: 6
-Explanation: There are 6 valid subarrays: [2],[2],[2],[2,2],[2,2],[2,2,2].
-
-
-
-
-
Note:
-
-
-
1 <= A.length <= 50000
-
0 <= A[i] <= 100000
-
-
-### Related Topics
- [[Stack](../../tag/stack/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Monotonic Stack](../../tag/monotonic-stack/README.md)]
-
-### Hints
-
-Hint 1
-Given a data structure that answers queries of the type to find the minimum in a range of an array (Range minimum query (RMQ) sparse table) in O(1) time. How can you solve this problem?
-
-
-
-Hint 2
-For each starting index do a binary search with an RMQ to find the ending possible position.
-
diff --git a/problems/number-of-valid-words-for-each-puzzle/README.md b/problems/number-of-valid-words-for-each-puzzle/README.md
deleted file mode 100644
index 32cfedc50..000000000
--- a/problems/number-of-valid-words-for-each-puzzle/README.md
+++ /dev/null
@@ -1,80 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../can-make-palindrome-from-substring "Can Make Palindrome from Substring")
-
-[Next >](../reformat-department-table "Reformat Department Table")
-
-## [1178. Number of Valid Words for Each Puzzle (Hard)](https://leetcode.com/problems/number-of-valid-words-for-each-puzzle "猜字谜")
-
-With respect to a given puzzle string, a word is valid if both the following conditions are satisfied:
-
-
word contains the first letter of puzzle.
-
For each letter in word, that letter is in puzzle.
-
-
For example, if the puzzle is "abcdefg", then valid words are "faced", "cabbage", and "baggage", while
-
invalid words are "beefed" (does not include 'a') and "based" (includes 's' which is not in the puzzle).
-
-
-
-Return an array answer, where answer[i] is the number of words in the given word list words that is valid with respect to the puzzle puzzles[i].
-
-
Example 1:
-
-
-Input: words = ["aaaa","asas","able","ability","actt","actor","access"], puzzles = ["aboveyz","abrodyz","abslute","absoryz","actresz","gaswxyz"]
-Output: [1,1,3,2,4,0]
-Explanation:
-1 valid word for "aboveyz" : "aaaa"
-1 valid word for "abrodyz" : "aaaa"
-3 valid words for "abslute" : "aaaa", "asas", "able"
-2 valid words for "absoryz" : "aaaa", "asas"
-4 valid words for "actresz" : "aaaa", "asas", "actt", "access"
-There are no valid words for "gaswxyz" cause none of the words in the list contains letter 'g'.
-
-
-
Example 2:
-
-
-Input: words = ["apple","pleas","please"], puzzles = ["aelwxyz","aelpxyz","aelpsxy","saelpxy","xaelpsy"]
-Output: [0,1,3,2,0]
-
-
-
-
Constraints:
-
-
-
1 <= words.length <= 105
-
4 <= words[i].length <= 50
-
1 <= puzzles.length <= 104
-
puzzles[i].length == 7
-
words[i] and puzzles[i] consist of lowercase English letters.
-
Each puzzles[i] does not contain repeated characters.
-
-
-### Related Topics
- [[Bit Manipulation](../../tag/bit-manipulation/README.md)]
- [[Trie](../../tag/trie/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Hints
-
-Hint 1
-Exploit the fact that the length of the puzzle is only 7.
-
-
-
-Hint 2
-Use bit-masks to represent the word and puzzle strings.
-
-
-
-Hint 3
-For each puzzle, count the number of words whose bit-mask is a sub-mask of the puzzle's bit-mask.
-
diff --git a/problems/number-of-valid-words-in-a-sentence/README.md b/problems/number-of-valid-words-in-a-sentence/README.md
deleted file mode 100644
index 6687e6bd5..000000000
--- a/problems/number-of-valid-words-in-a-sentence/README.md
+++ /dev/null
@@ -1,77 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../sort-linked-list-already-sorted-using-absolute-values "Sort Linked List Already Sorted Using Absolute Values")
-
-[Next >](../next-greater-numerically-balanced-number "Next Greater Numerically Balanced Number")
-
-## [2047. Number of Valid Words in a Sentence (Easy)](https://leetcode.com/problems/number-of-valid-words-in-a-sentence "句子中的有效单词数")
-
-
A sentence consists of lowercase letters ('a' to 'z'), digits ('0' to '9'), hyphens ('-'), punctuation marks ('!', '.', and ','), and spaces (' ') only. Each sentence can be broken down into one or more tokens separated by one or more spaces ' '.
-
-
A token is a valid word if all three of the following are true:
-
-
-
It only contains lowercase letters, hyphens, and/or punctuation (no digits).
-
There is at most one hyphen '-'. If present, it must be surrounded by lowercase characters ("a-b" is valid, but "-ab" and "ab-" are not valid).
-
There is at most one punctuation mark. If present, it must be at the end of the token ("ab,", "cd!", and "." are valid, but "a!b" and "c.," are not valid).
-
-
-
Examples of valid words include "a-b.", "afad", "ba-c", "a!", and "!".
-
-
Given a string sentence, return the number of valid words in sentence.
-
-
-
Example 1:
-
-
-Input: sentence = "catanddog"
-Output: 3
-Explanation: The valid words in the sentence are "cat", "and", and "dog".
-
-
-
Example 2:
-
-
-Input: sentence = "!this 1-s b8d!"
-Output: 0
-Explanation: There are no valid words in the sentence.
-"!this" is invalid because it starts with a punctuation mark.
-"1-s" and "b8d" are invalid because they contain digits.
-
-
-
Example 3:
-
-
-Input: sentence = "aliceandbobareplaying stone-game10"
-Output: 5
-Explanation: The valid words in the sentence are "alice", "and", "bob", "are", and "playing".
-"stone-game10" is invalid because it contains digits.
-
-
-
-
Constraints:
-
-
-
1 <= sentence.length <= 1000
-
sentence only contains lowercase English letters, digits, ' ', '-', '!', '.', and ','.
-
There will be at least 1 token.
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
-
-### Hints
-
-Hint 1
-Iterate through the string to split it by spaces.
-
-
-
-Hint 2
-Count the number of characters of each type (letters, numbers, hyphens, and punctuations).
-
diff --git a/problems/number-of-visible-people-in-a-queue/README.md b/problems/number-of-visible-people-in-a-queue/README.md
deleted file mode 100644
index 0cf9c4819..000000000
--- a/problems/number-of-visible-people-in-a-queue/README.md
+++ /dev/null
@@ -1,83 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../describe-the-painting "Describe the Painting")
-
-[Next >](../sum-of-digits-of-string-after-convert "Sum of Digits of String After Convert")
-
-## [1944. Number of Visible People in a Queue (Hard)](https://leetcode.com/problems/number-of-visible-people-in-a-queue "队列中可以看到的人数")
-
-
There are n people standing in a queue, and they numbered from 0 to n - 1 in left to right order. You are given an array heights of distinct integers where heights[i] represents the height of the ith person.
-
-
A person can see another person to their right in the queue if everybody in between is shorter than both of them. More formally, the ith person can see the jth person if i < j and min(heights[i], heights[j]) > max(heights[i+1], heights[i+2], ..., heights[j-1]).
-
-
Return an array answer of length n where answer[i] is the number of people the ith person can see to their right in the queue.
-
-
-
Example 1:
-
-
-
-
-Input: heights = [10,6,8,5,11,9]
-Output: [3,1,2,1,1,0]
-Explanation:
-Person 0 can see person 1, 2, and 4.
-Person 1 can see person 2.
-Person 2 can see person 3 and 4.
-Person 3 can see person 4.
-Person 4 can see person 5.
-Person 5 can see no one since nobody is to the right of them.
-
-
-### Related Topics
- [[Stack](../../tag/stack/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Monotonic Stack](../../tag/monotonic-stack/README.md)]
-
-### Hints
-
-Hint 1
-How to solve this problem in quadratic complexity ?
-
-
-
-Hint 2
-For every subarray start at index i, keep finding new maximum values until a value larger than arr[i] is found.
-
-
-
-Hint 3
-Since the limits are high, you need a linear solution.
-
-
-
-Hint 4
-Use a stack to keep the values of the array sorted as you iterate the array from the end to the start.
-
-
-
-Hint 5
-Keep popping from the stack the elements in sorted order until a value larger than arr[i] is found, these are the ones that person i can see.
-
diff --git a/problems/number-of-ways-of-cutting-a-pizza/README.md b/problems/number-of-ways-of-cutting-a-pizza/README.md
deleted file mode 100644
index 67d6c62c9..000000000
--- a/problems/number-of-ways-of-cutting-a-pizza/README.md
+++ /dev/null
@@ -1,81 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-time-to-collect-all-apples-in-a-tree "Minimum Time to Collect All Apples in a Tree")
-
-[Next >](../apples-oranges "Apples & Oranges")
-
-## [1444. Number of Ways of Cutting a Pizza (Hard)](https://leetcode.com/problems/number-of-ways-of-cutting-a-pizza "切披萨的方案数")
-
-
Given a rectangular pizza represented as a rows x cols matrix containing the following characters: 'A' (an apple) and '.' (empty cell) and given the integer k. You have to cut the pizza into k pieces using k-1 cuts.
-
-
For each cut you choose the direction: vertical or horizontal, then you choose a cut position at the cell boundary and cut the pizza into two pieces. If you cut the pizza vertically, give the left part of the pizza to a person. If you cut the pizza horizontally, give the upper part of the pizza to a person. Give the last piece of pizza to the last person.
-
-
Return the number of ways of cutting the pizza such that each piece contains at least one apple. Since the answer can be a huge number, return this modulo 10^9 + 7.
-
-
-
Example 1:
-
-
-
-
-Input: pizza = ["A..","AAA","..."], k = 3
-Output: 3
-Explanation: The figure above shows the three ways to cut the pizza. Note that pieces must contain at least one apple.
-
-
-
Example 2:
-
-
-Input: pizza = ["A..","AA.","..."], k = 3
-Output: 1
-
-
-
Example 3:
-
-
-Input: pizza = ["A..","A..","..."], k = 1
-Output: 1
-
-
-
-
Constraints:
-
-
-
1 <= rows, cols <= 50
-
rows == pizza.length
-
cols == pizza[i].length
-
1 <= k <= 10
-
pizza consists of characters 'A' and '.' only.
-
-
-### Related Topics
- [[Memoization](../../tag/memoization/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
-
-### Hints
-
-Hint 1
-Note that after each cut the remaining piece of pizza always has the lower right coordinate at (rows-1,cols-1).
-
-
-
-Hint 2
-Use dynamic programming approach with states (row1, col1, c) which computes the number of ways of cutting the pizza using "c" cuts where the current piece of pizza has upper left coordinate at (row1,col1) and lower right coordinate at (rows-1,cols-1).
-
-
-
-Hint 3
-For the transitions try all vertical and horizontal cuts such that the piece of pizza you have to give a person must contain at least one apple. The base case is when c=k-1.
-
-
-
-Hint 4
-Additionally use a 2D dynamic programming to respond in O(1) if a piece of pizza contains at least one apple.
-
diff --git a/problems/number-of-ways-to-arrive-at-destination/README.md b/problems/number-of-ways-to-arrive-at-destination/README.md
deleted file mode 100644
index 84295ec95..000000000
--- a/problems/number-of-ways-to-arrive-at-destination/README.md
+++ /dev/null
@@ -1,71 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-matrix-sum "Maximum Matrix Sum")
-
-[Next >](../number-of-ways-to-separate-numbers "Number of Ways to Separate Numbers")
-
-## [1976. Number of Ways to Arrive at Destination (Medium)](https://leetcode.com/problems/number-of-ways-to-arrive-at-destination "到达目的地的方案数")
-
-
You are in a city that consists of n intersections numbered from 0 to n - 1 with bi-directional roads between some intersections. The inputs are generated such that you can reach any intersection from any other intersection and that there is at most one road between any two intersections.
-
-
You are given an integer n and a 2D integer array roads where roads[i] = [ui, vi, timei] means that there is a road between intersections ui and vi that takes timei minutes to travel. You want to know in how many ways you can travel from intersection 0 to intersection n - 1 in the shortest amount of time.
-
-
Return the number of ways you can arrive at your destination in the shortest amount of time. Since the answer may be large, return it modulo109 + 7.
-
-
-
Example 1:
-
-
-Input: n = 7, roads = [[0,6,7],[0,1,2],[1,2,3],[1,3,3],[6,3,3],[3,5,1],[6,5,1],[2,5,1],[0,4,5],[4,6,2]]
-Output: 4
-Explanation: The shortest amount of time it takes to go from intersection 0 to intersection 6 is 7 minutes.
-The four ways to get there in 7 minutes are:
-- 0 ➝ 6
-- 0 ➝ 4 ➝ 6
-- 0 ➝ 1 ➝ 2 ➝ 5 ➝ 6
-- 0 ➝ 1 ➝ 3 ➝ 5 ➝ 6
-
-
-
Example 2:
-
-
-Input: n = 2, roads = [[1,0,10]]
-Output: 1
-Explanation: There is only one way to go from intersection 0 to intersection 1, and it takes 10 minutes.
-
-
-
-
Constraints:
-
-
-
1 <= n <= 200
-
n - 1 <= roads.length <= n * (n - 1) / 2
-
roads[i].length == 3
-
0 <= ui, vi <= n - 1
-
1 <= timei <= 109
-
ui != vi
-
There is at most one road connecting any two intersections.
-
You can reach any intersection from any other intersection.
-
-
-### Related Topics
- [[Graph](../../tag/graph/README.md)]
- [[Topological Sort](../../tag/topological-sort/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Shortest Path](../../tag/shortest-path/README.md)]
-
-### Hints
-
-Hint 1
-First use any shortest path algorithm to get edges where dist[u] + weight = dist[v], here dist[x] is the shortest distance between node 0 and x
-
-
-
-Hint 2
-Using those edges only the graph turns into a dag now we just need to know the number of ways to get from node 0 to node n - 1 on a dag using dp
-
diff --git a/problems/number-of-ways-to-divide-a-long-corridor/README.md b/problems/number-of-ways-to-divide-a-long-corridor/README.md
deleted file mode 100644
index 020172312..000000000
--- a/problems/number-of-ways-to-divide-a-long-corridor/README.md
+++ /dev/null
@@ -1,83 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../k-highest-ranked-items-within-a-price-range "K Highest Ranked Items Within a Price Range")
-
-[Next >](../count-elements-with-strictly-smaller-and-greater-elements "Count Elements With Strictly Smaller and Greater Elements ")
-
-## [2147. Number of Ways to Divide a Long Corridor (Hard)](https://leetcode.com/problems/number-of-ways-to-divide-a-long-corridor "分隔长廊的方案数")
-
-
Along a long library corridor, there is a line of seats and decorative plants. You are given a 0-indexed string corridor of length n consisting of letters 'S' and 'P' where each 'S' represents a seat and each 'P' represents a plant.
-
-
One room divider has already been installed to the left of index 0, and another to the right of index n - 1. Additional room dividers can be installed. For each position between indices i - 1 and i (1 <= i <= n - 1), at most one divider can be installed.
-
-
Divide the corridor into non-overlapping sections, where each section has exactly two seats with any number of plants. There may be multiple ways to perform the division. Two ways are different if there is a position with a room divider installed in the first way but not in the second way.
-
-
Return the number of ways to divide the corridor. Since the answer may be very large, return it modulo109 + 7. If there is no way, return 0.
-
-
-
Example 1:
-
-
-Input: corridor = "SSPPSPS"
-Output: 3
-Explanation: There are 3 different ways to divide the corridor.
-The black bars in the above image indicate the two room dividers already installed.
-Note that in each of the ways, each section has exactly two seats.
-
-
-
Example 2:
-
-
-Input: corridor = "PPSPSP"
-Output: 1
-Explanation: There is only 1 way to divide the corridor, by not installing any additional dividers.
-Installing any would create some section that does not have exactly two seats.
-
-
-
Example 3:
-
-
-Input: corridor = "S"
-Output: 0
-Explanation: There is no way to divide the corridor because there will always be a section that does not have exactly two seats.
-
-
-
-
Constraints:
-
-
-
n == corridor.length
-
1 <= n <= 105
-
corridor[i] is either 'S' or 'P'.
-
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
- [[String](../../tag/string/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Hints
-
-Hint 1
-Divide the corridor into segments. Each segment has two seats, starts precisely with one seat, and ends precisely with the other seat.
-
-
-
-Hint 2
-How many dividers can you install between two adjacent segments? You must install precisely one. Otherwise, you would have created a section with not exactly two seats.
-
-
-
-Hint 3
-If there are k plants between two adjacent segments, there are k + 1 positions (ways) you could install the divider you must install.
-
-
-
-Hint 4
-The problem now becomes: Find the product of all possible positions between every two adjacent segments.
-
diff --git a/problems/number-of-ways-to-form-a-target-string-given-a-dictionary/README.md b/problems/number-of-ways-to-form-a-target-string-given-a-dictionary/README.md
deleted file mode 100644
index 8ef01bd16..000000000
--- a/problems/number-of-ways-to-form-a-target-string-given-a-dictionary/README.md
+++ /dev/null
@@ -1,81 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../count-substrings-that-differ-by-one-character "Count Substrings That Differ by One Character")
-
-[Next >](../check-array-formation-through-concatenation "Check Array Formation Through Concatenation")
-
-## [1639. Number of Ways to Form a Target String Given a Dictionary (Hard)](https://leetcode.com/problems/number-of-ways-to-form-a-target-string-given-a-dictionary "通过给定词典构造目标字符串的方案数")
-
-
You are given a list of strings of the same lengthwords and a string target.
-
-
Your task is to form target using the given words under the following rules:
-
-
-
target should be formed from left to right.
-
To form the ith character (0-indexed) of target, you can choose the kth character of the jth string in words if target[i] = words[j][k].
-
Once you use the kth character of the jth string of words, you can no longer use the xth character of any string in words where x <= k. In other words, all characters to the left of or at index k become unusuable for every string.
-
Repeat the process until you form the string target.
-
-
-
Notice that you can use multiple characters from the same string in words provided the conditions above are met.
-
-
Return the number of ways to form target from words. Since the answer may be too large, return it modulo109 + 7.
-
-
-
Example 1:
-
-
-Input: words = ["acca","bbbb","caca"], target = "aba"
-Output: 6
-Explanation: There are 6 ways to form target.
-"aba" -> index 0 ("acca"), index 1 ("bbbb"), index 3 ("caca")
-"aba" -> index 0 ("acca"), index 2 ("bbbb"), index 3 ("caca")
-"aba" -> index 0 ("acca"), index 1 ("bbbb"), index 3 ("acca")
-"aba" -> index 0 ("acca"), index 2 ("bbbb"), index 3 ("acca")
-"aba" -> index 1 ("caca"), index 2 ("bbbb"), index 3 ("acca")
-"aba" -> index 1 ("caca"), index 2 ("bbbb"), index 3 ("caca")
-
-
-
Example 2:
-
-
-Input: words = ["abba","baab"], target = "bab"
-Output: 4
-Explanation: There are 4 ways to form target.
-"bab" -> index 0 ("baab"), index 1 ("baab"), index 2 ("abba")
-"bab" -> index 0 ("baab"), index 1 ("baab"), index 3 ("baab")
-"bab" -> index 0 ("baab"), index 2 ("baab"), index 3 ("baab")
-"bab" -> index 1 ("abba"), index 2 ("baab"), index 3 ("baab")
-
-
-
-
Constraints:
-
-
-
1 <= words.length <= 1000
-
1 <= words[i].length <= 1000
-
All strings in words have the same length.
-
1 <= target.length <= 1000
-
words[i] and target contain only lowercase English letters.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[String](../../tag/string/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Hints
-
-Hint 1
-For each index i, store the frequency of each character in the ith row.
-
-
-
-Hint 2
-Use dynamic programing to calculate the number of ways to get the target string using the frequency array,
-
diff --git a/problems/number-of-ways-to-paint-n-3-grid/README.md b/problems/number-of-ways-to-paint-n-3-grid/README.md
deleted file mode 100644
index aea32d531..000000000
--- a/problems/number-of-ways-to-paint-n-3-grid/README.md
+++ /dev/null
@@ -1,57 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../html-entity-parser "HTML Entity Parser")
-
-[Next >](../find-the-quiet-students-in-all-exams "Find the Quiet Students in All Exams")
-
-## [1411. Number of Ways to Paint N × 3 Grid (Hard)](https://leetcode.com/problems/number-of-ways-to-paint-n-3-grid "给 N x 3 网格图涂色的方案数")
-
-
You have a grid of size n x 3 and you want to paint each cell of the grid with exactly one of the three colors: Red, Yellow, or Green while making sure that no two adjacent cells have the same color (i.e., no two cells that share vertical or horizontal sides have the same color).
-
-
Given n the number of rows of the grid, return the number of ways you can paint this grid. As the answer may grow large, the answer must be computed modulo 109 + 7.
-
-
-
Example 1:
-
-
-Input: n = 1
-Output: 12
-Explanation: There are 12 possible way to paint the grid as shown.
-
-
-
Example 2:
-
-
-Input: n = 5000
-Output: 30228214
-
-
-
-
Constraints:
-
-
-
n == grid.length
-
1 <= n <= 5000
-
-
-### Related Topics
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Similar Questions
- 1. [Painting a Grid With Three Different Colors](../painting-a-grid-with-three-different-colors) (Hard)
-
-### Hints
-
-Hint 1
-We will use Dynamic programming approach. we will try all possible configuration.
-
-
-
-Hint 2
-Let dp[idx][prev1col][prev2col][prev3col] be the number of ways to color the rows of the grid from idx to n-1 keeping in mind that the previous row (idx - 1) has colors prev1col, prev2col and prev3col. Build the dp array to get the answer.
-
diff --git a/problems/number-of-ways-to-rearrange-sticks-with-k-sticks-visible/README.md b/problems/number-of-ways-to-rearrange-sticks-with-k-sticks-visible/README.md
deleted file mode 100644
index d107b5fdd..000000000
--- a/problems/number-of-ways-to-rearrange-sticks-with-k-sticks-visible/README.md
+++ /dev/null
@@ -1,71 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../finding-pairs-with-a-certain-sum "Finding Pairs With a Certain Sum")
-
-[Next >](../orders-with-maximum-quantity-above-average "Orders With Maximum Quantity Above Average")
-
-## [1866. Number of Ways to Rearrange Sticks With K Sticks Visible (Hard)](https://leetcode.com/problems/number-of-ways-to-rearrange-sticks-with-k-sticks-visible "恰有 K 根木棍可以看到的排列数目")
-
-
There are n uniquely-sized sticks whose lengths are integers from 1 to n. You want to arrange the sticks such that exactlyk sticks are visible from the left. A stick is visible from the left if there are no longer sticks to the left of it.
-
-
-
For example, if the sticks are arranged [1,3,2,5,4], then the sticks with lengths 1, 3, and 5 are visible from the left.
-
-
-
Given n and k, return the number of such arrangements. Since the answer may be large, return it modulo109 + 7.
-
-
-
Example 1:
-
-
-Input: n = 3, k = 2
-Output: 3
-Explanation: [1,3,2], [2,3,1], and [2,1,3] are the only arrangements such that exactly 2 sticks are visible.
-The visible sticks are underlined.
-
-
-
Example 2:
-
-
-Input: n = 5, k = 5
-Output: 1
-Explanation: [1,2,3,4,5] is the only arrangement such that all 5 sticks are visible.
-The visible sticks are underlined.
-
-
-
Example 3:
-
-
-Input: n = 20, k = 11
-Output: 647427950
-Explanation: There are 647427950 (mod 109 + 7) ways to rearrange the sticks such that exactly 11 sticks are visible.
-
-
-
-
Constraints:
-
-
-
1 <= n <= 1000
-
1 <= k <= n
-
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Combinatorics](../../tag/combinatorics/README.md)]
-
-### Hints
-
-Hint 1
-Is there a way to build the solution from a base case?
-
-
-
-Hint 2
-How many ways are there if we fix the position of one stick?
-
diff --git a/problems/number-of-ways-to-reconstruct-a-tree/README.md b/problems/number-of-ways-to-reconstruct-a-tree/README.md
deleted file mode 100644
index 11533af4f..000000000
--- a/problems/number-of-ways-to-reconstruct-a-tree/README.md
+++ /dev/null
@@ -1,100 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../construct-the-lexicographically-largest-valid-sequence "Construct the Lexicographically Largest Valid Sequence")
-
-[Next >](../decode-xored-array "Decode XORed Array")
-
-## [1719. Number Of Ways To Reconstruct A Tree (Hard)](https://leetcode.com/problems/number-of-ways-to-reconstruct-a-tree "重构一棵树的方案数")
-
-
You are given an array pairs, where pairs[i] = [xi, yi], and:
-
-
-
There are no duplicates.
-
xi < yi
-
-
-
Let ways be the number of rooted trees that satisfy the following conditions:
-
-
-
The tree consists of nodes whose values appeared in pairs.
-
A pair [xi, yi] exists in pairsif and only ifxi is an ancestor of yi or yi is an ancestor of xi.
-
Note: the tree does not have to be a binary tree.
-
-
-
Two ways are considered to be different if there is at least one node that has different parents in both ways.
-
-
Return:
-
-
-
0 if ways == 0
-
1 if ways == 1
-
2 if ways > 1
-
-
-
A rooted tree is a tree that has a single root node, and all edges are oriented to be outgoing from the root.
-
-
An ancestor of a node is any node on the path from the root to that node (excluding the node itself). The root has no ancestors.
-
-
-
Example 1:
-
-
-Input: pairs = [[1,2],[2,3]]
-Output: 1
-Explanation: There is exactly one valid rooted tree, which is shown in the above figure.
-
-
-
Example 2:
-
-
-Input: pairs = [[1,2],[2,3],[1,3]]
-Output: 2
-Explanation: There are multiple valid rooted trees. Three of them are shown in the above figures.
-
-
-
Example 3:
-
-
-Input: pairs = [[1,2],[2,3],[2,4],[1,5]]
-Output: 0
-Explanation: There are no valid rooted trees.
-
-
-
Constraints:
-
-
-
1 <= pairs.length <= 105
-
1 <= xi < yi <= 500
-
The elements in pairs are unique.
-
-
-### Related Topics
- [[Tree](../../tag/tree/README.md)]
- [[Graph](../../tag/graph/README.md)]
- [[Topological Sort](../../tag/topological-sort/README.md)]
-
-### Hints
-
-Hint 1
-Think inductively. The first step is to get the root. Obviously, the root should be in pairs with all the nodes. If there isn't exactly one such node, then there are 0 ways.
-
-
-
-Hint 2
-The number of pairs involving a node must be less than or equal to that number of its parent.
-
-
-
-Hint 3
-Actually, if it's equal, then there is not exactly 1 way, because they can be swapped.
-
-
-
-Hint 4
-Recursively, given a set of nodes, get the node with the most pairs, then this must be a root and have no parents in the current set of nodes.
-
diff --git a/problems/number-of-ways-to-reorder-array-to-get-same-bst/README.md b/problems/number-of-ways-to-reorder-array-to-get-same-bst/README.md
deleted file mode 100644
index 698d1d0ed..000000000
--- a/problems/number-of-ways-to-reorder-array-to-get-same-bst/README.md
+++ /dev/null
@@ -1,84 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-number-of-days-to-disconnect-island "Minimum Number of Days to Disconnect Island")
-
-[Next >](../dot-product-of-two-sparse-vectors "Dot Product of Two Sparse Vectors")
-
-## [1569. Number of Ways to Reorder Array to Get Same BST (Hard)](https://leetcode.com/problems/number-of-ways-to-reorder-array-to-get-same-bst "将子数组重新排序得到同一个二叉查找树的方案数")
-
-
Given an array nums that represents a permutation of integers from 1 to n. We are going to construct a binary search tree (BST) by inserting the elements of nums in order into an initially empty BST. Find the number of different ways to reorder nums so that the constructed BST is identical to that formed from the original array nums.
-
-
-
For example, given nums = [2,1,3], we will have 2 as the root, 1 as a left child, and 3 as a right child. The array [2,3,1] also yields the same BST but [3,2,1] yields a different BST.
-
-
-
Return the number of ways to reordernumssuch that the BST formed is identical to the original BST formed fromnums.
-
-
Since the answer may be very large, return it modulo 109 + 7.
-
-
-
Example 1:
-
-
-Input: nums = [2,1,3]
-Output: 1
-Explanation: We can reorder nums to be [2,3,1] which will yield the same BST. There are no other ways to reorder nums which will yield the same BST.
-
-
-
Example 2:
-
-
-Input: nums = [3,4,5,1,2]
-Output: 5
-Explanation: The following 5 arrays will yield the same BST:
-[3,1,2,4,5]
-[3,1,4,2,5]
-[3,1,4,5,2]
-[3,4,1,2,5]
-[3,4,1,5,2]
-
-
-
Example 3:
-
-
-Input: nums = [1,2,3]
-Output: 0
-Explanation: There are no other orderings of nums that will yield the same BST.
-
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 1000
-
1 <= nums[i] <= nums.length
-
All integers in nums are distinct.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Math](../../tag/math/README.md)]
- [[Divide and Conquer](../../tag/divide-and-conquer/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Tree](../../tag/tree/README.md)]
- [[Union Find](../../tag/union-find/README.md)]
- [[Binary Search Tree](../../tag/binary-search-tree/README.md)]
- [[Memoization](../../tag/memoization/README.md)]
- [[Combinatorics](../../tag/combinatorics/README.md)]
- [[Binary Tree](../../tag/binary-tree/README.md)]
-
-### Hints
-
-Hint 1
-Use a divide and conquer strategy.
-
-
-
-Hint 2
-The first number will always be the root. Consider the numbers smaller and larger than the root separately. When merging the results together, how many ways can you order x elements in x+y positions?
-
diff --git a/problems/number-of-ways-to-separate-numbers/README.md b/problems/number-of-ways-to-separate-numbers/README.md
deleted file mode 100644
index 1d359dd07..000000000
--- a/problems/number-of-ways-to-separate-numbers/README.md
+++ /dev/null
@@ -1,67 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../number-of-ways-to-arrive-at-destination "Number of Ways to Arrive at Destination")
-
-[Next >](../employees-whose-manager-left-the-company "Employees Whose Manager Left the Company")
-
-## [1977. Number of Ways to Separate Numbers (Hard)](https://leetcode.com/problems/number-of-ways-to-separate-numbers "划分数字的方案数")
-
-
You wrote down many positive integers in a string called num. However, you realized that you forgot to add commas to seperate the different numbers. You remember that the list of integers was non-decreasing and that no integer had leading zeros.
-
-
Return the number of possible lists of integers that you could have written down to get the string num. Since the answer may be large, return it modulo109 + 7.
-
-
-
Example 1:
-
-
-Input: num = "327"
-Output: 2
-Explanation: You could have written down the numbers:
-3, 27
-327
-
-
-
Example 2:
-
-
-Input: num = "094"
-Output: 0
-Explanation: No numbers can have leading zeros and all numbers must be positive.
-
-
-
Example 3:
-
-
-Input: num = "0"
-Output: 0
-Explanation: No numbers can have leading zeros and all numbers must be positive.
-
-
-
-
Constraints:
-
-
-
1 <= num.length <= 3500
-
num consists of digits '0' through '9'.
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Suffix Array](../../tag/suffix-array/README.md)]
-
-### Hints
-
-Hint 1
-If we know the current number has d digits, how many digits can the previous number have?
-
-
-
-Hint 2
-Is there a quick way of calculating the number of possibilities for the previous number if we know that it must have less than or equal to d digits? Try to do some pre-processing.
-
diff --git a/problems/number-of-ways-to-split-a-string/README.md b/problems/number-of-ways-to-split-a-string/README.md
deleted file mode 100644
index 9874c1112..000000000
--- a/problems/number-of-ways-to-split-a-string/README.md
+++ /dev/null
@@ -1,78 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../matrix-diagonal-sum "Matrix Diagonal Sum")
-
-[Next >](../shortest-subarray-to-be-removed-to-make-array-sorted "Shortest Subarray to be Removed to Make Array Sorted")
-
-## [1573. Number of Ways to Split a String (Medium)](https://leetcode.com/problems/number-of-ways-to-split-a-string "分割字符串的方案数")
-
-
Given a binary string s, you can split s into 3 non-empty strings s1, s2, and s3 where s1 + s2 + s3 = s.
-
-
Return the number of ways s can be split such that the number of ones is the same in s1, s2, and s3. Since the answer may be too large, return it modulo109 + 7.
-
-
-
Example 1:
-
-
-Input: s = "10101"
-Output: 4
-Explanation: There are four ways to split s in 3 parts where each part contain the same number of letters '1'.
-"1|010|1"
-"1|01|01"
-"10|10|1"
-"10|1|01"
-
-
-
Example 2:
-
-
-Input: s = "1001"
-Output: 0
-
-
-
Example 3:
-
-
-Input: s = "0000"
-Output: 3
-Explanation: There are three ways to split s in 3 parts.
-"0|0|00"
-"0|00|0"
-"00|0|0"
-
-
-
-
Constraints:
-
-
-
3 <= s.length <= 105
-
s[i] is either '0' or '1'.
-
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Similar Questions
- 1. [Split Array with Equal Sum](../split-array-with-equal-sum) (Hard)
-
-### Hints
-
-Hint 1
-There is no way if the sum (number of '1's) is not divisible by the number of splits. So sum%3 should be 0.
-
-
-
-Hint 2
-Preffix s1 , and suffix s3 should have sum/3 characters '1'.
-
-
-
-Hint 3
-Follow up: Can you generalize the problem with numbers between [-10^9, 10^9] such the sum between subarrays s1, s2, s3 are the same?
-
diff --git a/problems/number-of-ways-to-stay-in-the-same-place-after-some-steps/README.md b/problems/number-of-ways-to-stay-in-the-same-place-after-some-steps/README.md
deleted file mode 100644
index 5dfd4cae6..000000000
--- a/problems/number-of-ways-to-stay-in-the-same-place-after-some-steps/README.md
+++ /dev/null
@@ -1,68 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../search-suggestions-system "Search Suggestions System")
-
-[Next >](../all-people-report-to-the-given-manager "All People Report to the Given Manager")
-
-## [1269. Number of Ways to Stay in the Same Place After Some Steps (Hard)](https://leetcode.com/problems/number-of-ways-to-stay-in-the-same-place-after-some-steps "停在原地的方案数")
-
-
You have a pointer at index 0 in an array of size arrLen. At each step, you can move 1 position to the left, 1 position to the right in the array, or stay in the same place (The pointer should not be placed outside the array at any time).
-
-
Given two integers steps and arrLen, return the number of ways such that your pointer still at index 0 after exactlysteps steps. Since the answer may be too large, return it modulo109 + 7.
-
-
-
Example 1:
-
-
-Input: steps = 3, arrLen = 2
-Output: 4
-Explanation: There are 4 differents ways to stay at index 0 after 3 steps.
-Right, Left, Stay
-Stay, Right, Left
-Right, Stay, Left
-Stay, Stay, Stay
-
-
-
Example 2:
-
-
-Input: steps = 2, arrLen = 4
-Output: 2
-Explanation: There are 2 differents ways to stay at index 0 after 2 steps
-Right, Left
-Stay, Stay
-
-
-
Example 3:
-
-
-Input: steps = 4, arrLen = 2
-Output: 8
-
-
-
-
Constraints:
-
-
-
1 <= steps <= 500
-
1 <= arrLen <= 106
-
-
-### Related Topics
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Hints
-
-Hint 1
-Try with Dynamic programming, dp(pos,steps): number of ways to back pos = 0 using exactly "steps" moves.
-
-
-
-Hint 2
-Notice that the computational complexity does not depend of "arrlen".
-
diff --git a/problems/number-of-ways-to-wear-different-hats-to-each-other/README.md b/problems/number-of-ways-to-wear-different-hats-to-each-other/README.md
deleted file mode 100644
index a5b016402..000000000
--- a/problems/number-of-ways-to-wear-different-hats-to-each-other/README.md
+++ /dev/null
@@ -1,79 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../check-if-a-string-can-break-another-string "Check If a String Can Break Another String")
-
-[Next >](../create-a-session-bar-chart "Create a Session Bar Chart")
-
-## [1434. Number of Ways to Wear Different Hats to Each Other (Hard)](https://leetcode.com/problems/number-of-ways-to-wear-different-hats-to-each-other "每个人戴不同帽子的方案数")
-
-
There are n people and 40 types of hats labeled from 1 to 40.
-
-
Given a 2D integer array hats, where hats[i] is a list of all hats preferred by the ith person.
-
-
Return the number of ways that the n people wear different hats to each other.
-
-
Since the answer may be too large, return it modulo 109 + 7.
-
-
-
Example 1:
-
-
-Input: hats = [[3,4],[4,5],[5]]
-Output: 1
-Explanation: There is only one way to choose hats given the conditions.
-First person choose hat 3, Second person choose hat 4 and last one hat 5.
-
-
-
Example 2:
-
-
-Input: hats = [[3,5,1],[3,5]]
-Output: 4
-Explanation: There are 4 ways to choose hats:
-(3,5), (5,3), (1,3) and (1,5)
-
-
-
Example 3:
-
-
-Input: hats = [[1,2,3,4],[1,2,3,4],[1,2,3,4],[1,2,3,4]]
-Output: 24
-Explanation: Each person can choose hats labeled from 1 to 4.
-Number of Permutations of (1,2,3,4) = 24.
-
-
-
-
Constraints:
-
-
-
n == hats.length
-
1 <= n <= 10
-
1 <= hats[i].length <= 40
-
1 <= hats[i][j] <= 40
-
hats[i] contains a list of unique integers.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Bit Manipulation](../../tag/bit-manipulation/README.md)]
- [[Bitmask](../../tag/bitmask/README.md)]
-
-### Similar Questions
- 1. [The Number of Good Subsets](../the-number-of-good-subsets) (Hard)
-
-### Hints
-
-Hint 1
-Dynamic programming + bitmask.
-
-
-
-Hint 2
-dp(peopleMask, idHat) number of ways to wear different hats given a bitmask (people visited) and used hats from 1 to idHat-1.
-
diff --git a/problems/number-of-ways-where-square-of-number-is-equal-to-product-of-two-numbers/README.md b/problems/number-of-ways-where-square-of-number-is-equal-to-product-of-two-numbers/README.md
deleted file mode 100644
index 9a7b126db..000000000
--- a/problems/number-of-ways-where-square-of-number-is-equal-to-product-of-two-numbers/README.md
+++ /dev/null
@@ -1,68 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../replace-all-s-to-avoid-consecutive-repeating-characters "Replace All ?'s to Avoid Consecutive Repeating Characters")
-
-[Next >](../minimum-time-to-make-rope-colorful "Minimum Time to Make Rope Colorful")
-
-## [1577. Number of Ways Where Square of Number Is Equal to Product of Two Numbers (Medium)](https://leetcode.com/problems/number-of-ways-where-square-of-number-is-equal-to-product-of-two-numbers "数的平方等于两数乘积的方法数")
-
-
Given two arrays of integers nums1 and nums2, return the number of triplets formed (type 1 and type 2) under the following rules:
-
-
-
Type 1: Triplet (i, j, k) if nums1[i]2 == nums2[j] * nums2[k] where 0 <= i < nums1.length and 0 <= j < k < nums2.length.
-
Type 2: Triplet (i, j, k) if nums2[i]2 == nums1[j] * nums1[k] where 0 <= i < nums2.length and 0 <= j < k < nums1.length.
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Math](../../tag/math/README.md)]
- [[Two Pointers](../../tag/two-pointers/README.md)]
-
-### Hints
-
-Hint 1
-Precalculate the frequencies of all nums1[i]^2 and nums2[i]^2
-
diff --git a/problems/number-of-wonderful-substrings/README.md b/problems/number-of-wonderful-substrings/README.md
deleted file mode 100644
index 0c236f651..000000000
--- a/problems/number-of-wonderful-substrings/README.md
+++ /dev/null
@@ -1,87 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../cyclically-rotating-a-grid "Cyclically Rotating a Grid")
-
-[Next >](../count-ways-to-build-rooms-in-an-ant-colony "Count Ways to Build Rooms in an Ant Colony")
-
-## [1915. Number of Wonderful Substrings (Medium)](https://leetcode.com/problems/number-of-wonderful-substrings "最美子字符串的数目")
-
-
A wonderful string is a string where at most one letter appears an odd number of times.
-
-
-
For example, "ccjjc" and "abab" are wonderful, but "ab" is not.
-
-
-
Given a string word that consists of the first ten lowercase English letters ('a' through 'j'), return the number of wonderful non-empty substrings in word. If the same substring appears multiple times in word, then count each occurrence separately.
-
-
A substring is a contiguous sequence of characters in a string.
-
-
-
Example 1:
-
-
-Input: word = "aba"
-Output: 4
-Explanation: The four wonderful substrings are underlined below:
-- "aba" -> "a"
-- "aba" -> "b"
-- "aba" -> "a"
-- "aba" -> "aba"
-
-
-
Example 2:
-
-
-Input: word = "aabb"
-Output: 9
-Explanation: The nine wonderful substrings are underlined below:
-- "aabb" -> "a"
-- "aabb" -> "aa"
-- "aabb" -> "aab"
-- "aabb" -> "aabb"
-- "aabb" -> "a"
-- "aabb" -> "abb"
-- "aabb" -> "b"
-- "aabb" -> "bb"
-- "aabb" -> "b"
-
-
-
Example 3:
-
-
-Input: word = "he"
-Output: 2
-Explanation: The two wonderful substrings are underlined below:
-- "he" -> "h"
-- "he" -> "e"
-
-
-
-
Constraints:
-
-
-
1 <= word.length <= 105
-
word consists of lowercase English letters from 'a' to 'j'.
-
-
-### Related Topics
- [[Bit Manipulation](../../tag/bit-manipulation/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
- [[Prefix Sum](../../tag/prefix-sum/README.md)]
-
-### Hints
-
-Hint 1
-For each prefix of the string, check which characters are of even frequency and which are not and represent it by a bitmask.
-
-
-
-Hint 2
-Find the other prefixes whose masks differs from the current prefix mask by at most one bit.
-
diff --git a/problems/numbers-at-most-n-given-digit-set/README.md b/problems/numbers-at-most-n-given-digit-set/README.md
deleted file mode 100644
index fd2f7a8ae..000000000
--- a/problems/numbers-at-most-n-given-digit-set/README.md
+++ /dev/null
@@ -1,64 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../online-stock-span "Online Stock Span")
-
-[Next >](../valid-permutations-for-di-sequence "Valid Permutations for DI Sequence")
-
-## [902. Numbers At Most N Given Digit Set (Hard)](https://leetcode.com/problems/numbers-at-most-n-given-digit-set "最大为 N 的数字组合")
-
-
Given an array of digits which is sorted in non-decreasing order. You can write numbers using each digits[i] as many times as we want. For example, if digits = ['1','3','5'], we may write numbers such as '13', '551', and '1351315'.
-
-
Return the number of positive integers that can be generated that are less than or equal to a given integer n.
-
-
-
Example 1:
-
-
-Input: digits = ["1","3","5","7"], n = 100
-Output: 20
-Explanation:
-The 20 numbers that can be written are:
-1, 3, 5, 7, 11, 13, 15, 17, 31, 33, 35, 37, 51, 53, 55, 57, 71, 73, 75, 77.
-
-
-
Example 2:
-
-
-Input: digits = ["1","4","9"], n = 1000000000
-Output: 29523
-Explanation:
-We can write 3 one digit numbers, 9 two digit numbers, 27 three digit numbers,
-81 four digit numbers, 243 five digit numbers, 729 six digit numbers,
-2187 seven digit numbers, 6561 eight digit numbers, and 19683 nine digit numbers.
-In total, this is 29523 integers that can be written using the digits array.
-
-
-
Example 3:
-
-
-Input: digits = ["7"], n = 8
-Output: 1
-
-
-
-
Constraints:
-
-
-
1 <= digits.length <= 9
-
digits[i].length == 1
-
digits[i] is a digit from '1' to '9'.
-
All the values in digits are unique.
-
digits is sorted in non-decreasing order.
-
1 <= n <= 109
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Math](../../tag/math/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
diff --git a/problems/numbers-at-most-n-given-digit-set/numbers_at_most_n_given_digit_set.go b/problems/numbers-at-most-n-given-digit-set/numbers_at_most_n_given_digit_set.go
deleted file mode 100644
index 6a5b71a6d..000000000
--- a/problems/numbers-at-most-n-given-digit-set/numbers_at_most_n_given_digit_set.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem902
diff --git a/problems/numbers-at-most-n-given-digit-set/numbers_at_most_n_given_digit_set_test.go b/problems/numbers-at-most-n-given-digit-set/numbers_at_most_n_given_digit_set_test.go
deleted file mode 100644
index 6a5b71a6d..000000000
--- a/problems/numbers-at-most-n-given-digit-set/numbers_at_most_n_given_digit_set_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem902
diff --git a/problems/numbers-with-repeated-digits/README.md b/problems/numbers-with-repeated-digits/README.md
deleted file mode 100644
index 4d2f0738f..000000000
--- a/problems/numbers-with-repeated-digits/README.md
+++ /dev/null
@@ -1,60 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../capacity-to-ship-packages-within-d-days "Capacity To Ship Packages Within D Days")
-
-[Next >](../partition-array-into-three-parts-with-equal-sum "Partition Array Into Three Parts With Equal Sum")
-
-## [1012. Numbers With Repeated Digits (Hard)](https://leetcode.com/problems/numbers-with-repeated-digits "至少有 1 位重复的数字")
-
-
Given an integer n, return the number of positive integers in the range [1, n] that have at least one repeated digit.
-
-
-
Example 1:
-
-
-Input: n = 20
-Output: 1
-Explanation: The only positive number (<= 20) with at least 1 repeated digit is 11.
-
-
-
Example 2:
-
-
-Input: n = 100
-Output: 10
-Explanation: The positive numbers (<= 100) with atleast 1 repeated digit are 11, 22, 33, 44, 55, 66, 77, 88, 99, and 100.
-
-
-
Example 3:
-
-
-Input: n = 1000
-Output: 262
-
-
-
-
Constraints:
-
-
-
1 <= n <= 109
-
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Hints
-
-Hint 1
-How many numbers with no duplicate digits? How many numbers with K digits and no duplicates?
-
-
-
-Hint 2
-How many numbers with same length as N? How many numbers with same prefix as N?
-
diff --git a/problems/numbers-with-repeated-digits/numbers_with_repeated_digits.go b/problems/numbers-with-repeated-digits/numbers_with_repeated_digits.go
deleted file mode 100644
index 6097cd5c3..000000000
--- a/problems/numbers-with-repeated-digits/numbers_with_repeated_digits.go
+++ /dev/null
@@ -1,72 +0,0 @@
-package problem1012
-
-func numDupDigitsAtMostN(N int) int {
- digits := convert(N + 1) // +1 为为了把判别条件从 <= 简化成 <
- bits := len(digits)
-
- noRepeat := 0
- // 统计宽度短于 N 的不含重复数字的数的个数
- for b := 1; b < bits; b++ {
- noRepeat += 9 * count(9, b-1)
- }
-
- // 统计和 N 具有相同高位的且不含重复数字的数的个数
- hasSeen := make(map[int]bool, 10)
- for b := 0; b < bits; b++ {
- d := 0
- if b == 0 {
- d = 1 // 最高位上的数字不能为 0
- }
- for ; d < digits[b]; d++ {
- // 如果 hasSeen[d]=true
- // 说明在更高位上已经出现过 d 了
- // 无论低位上再出现什么,都不是 noRepeat 了
- if !hasSeen[d] {
- noRepeat += count(9-b, bits-b-1)
- }
- }
- if hasSeen[digits[b]] {
- // digits[:b+1] 中出现了重复的数字
- // 不可能再有 noRepeat 了
- break
- }
- hasSeen[digits[b]] = true
- }
- return N - noRepeat
-}
-
-func convert(N int) []int {
- res := make([]int, 0, 10)
- for N > 0 {
- res = append(res, N%10)
- N /= 10
- }
- swap(res)
- return res
-}
-
-func swap(A []int) {
- i, j := 0, len(A)-1
- for i < j {
- A[i], A[j] = A[j], A[i]
- i++
- j--
- }
-}
-
-// 统计了 m 个数字组成宽度为 n 的数值时,
-// 不含重复数字的数值的个数。
-// 注意,
-// 真正使用 count 的时候,是为了统计 n+1 位宽度的数值
-// 在 n+1 位的最高位上不放置 0
-// 就可以保证剩下的 n 位的宽度确实是 n
-// 所以,count 在使用时,还需要乘上 n+1 位上可供选择的数字的个数
-// 例如, 9*count(9, i-1) 的实际含义才是,所有宽度为 i 且不包含重复数字的数值个数
-// 例如, count(8,i) 的实际含义是,以 X 开头所有宽度为 i+1 且不包含重复数字的数的个数
-// X 可以是任意一个数字
-func count(m, n int) int {
- if n == 0 {
- return 1
- }
- return count(m, n-1) * (m - n + 1)
-}
diff --git a/problems/numbers-with-same-consecutive-differences/README.md b/problems/numbers-with-same-consecutive-differences/README.md
deleted file mode 100644
index b13d65569..000000000
--- a/problems/numbers-with-same-consecutive-differences/README.md
+++ /dev/null
@@ -1,60 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../vowel-spellchecker "Vowel Spellchecker")
-
-[Next >](../binary-tree-cameras "Binary Tree Cameras")
-
-## [967. Numbers With Same Consecutive Differences (Medium)](https://leetcode.com/problems/numbers-with-same-consecutive-differences "连续差相同的数字")
-
-
Return all non-negative integers of length n such that the absolute difference between every two consecutive digits is k.
-
-
Note that every number in the answer must not have leading zeros. For example, 01 has one leading zero and is invalid.
-
-
You may return the answer in any order.
-
-
-
Example 1:
-
-
-Input: n = 3, k = 7
-Output: [181,292,707,818,929]
-Explanation: Note that 070 is not a valid number, because it has leading zeroes.
-
-
-
Example 2:
-
-
-Input: n = 2, k = 1
-Output: [10,12,21,23,32,34,43,45,54,56,65,67,76,78,87,89,98]
-
-
-
Example 3:
-
-
-Input: n = 2, k = 0
-Output: [11,22,33,44,55,66,77,88,99]
-
-
-
Example 4:
-
-
-Input: n = 2, k = 2
-Output: [13,20,24,31,35,42,46,53,57,64,68,75,79,86,97]
-
Given two strings first and second, consider occurrences in some text of the form "first second third", where second comes immediately after first, and third comes immediately after second.
-
-
Return an array of all the wordsthirdfor each occurrence of"first second third".
-
-
-
Example 1:
-
Input: text = "alice is a good girl she is a good student", first = "a", second = "good"
-Output: ["girl","student"]
-
Example 2:
-
Input: text = "we will we will rock you", first = "we", second = "will"
-Output: ["we","rock"]
-
-
-
Constraints:
-
-
-
1 <= text.length <= 1000
-
text consists of lowercase English letters and spaces.
-
All the words in text a separated by a single space.
-
1 <= first.length, second.length <= 10
-
first and second consist of lowercase English letters.
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
-
-### Hints
-
-Hint 1
-Split the string into words, then look at adjacent triples of words.
-
diff --git a/problems/occurrences-after-bigram/occurrences_after_bigram.go b/problems/occurrences-after-bigram/occurrences_after_bigram.go
deleted file mode 100644
index 8267aff9e..000000000
--- a/problems/occurrences-after-bigram/occurrences_after_bigram.go
+++ /dev/null
@@ -1,16 +0,0 @@
-package problem1078
-
-import "strings"
-
-func findOcurrences(text string, first string, second string) []string {
- words := strings.Split(text, " ")
- n := len(words)
- res := make([]string, 0, n)
- for i := 0; i+2 < n; i++ {
- if words[i] == first &&
- words[i+1] == second {
- res = append(res, words[i+2])
- }
- }
- return res
-}
diff --git a/problems/odd-even-jump/README.md b/problems/odd-even-jump/README.md
deleted file mode 100644
index 43a345e2d..000000000
--- a/problems/odd-even-jump/README.md
+++ /dev/null
@@ -1,84 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../subarray-sums-divisible-by-k "Subarray Sums Divisible by K")
-
-[Next >](../largest-perimeter-triangle "Largest Perimeter Triangle")
-
-## [975. Odd Even Jump (Hard)](https://leetcode.com/problems/odd-even-jump "奇偶跳")
-
-
You are given an integer array arr. From some starting index, you can make a series of jumps. The (1st, 3rd, 5th, ...) jumps in the series are called odd-numbered jumps, and the (2nd, 4th, 6th, ...) jumps in the series are called even-numbered jumps. Note that the jumps are numbered, not the indices.
-
-
You may jump forward from index i to index j (with i < j) in the following way:
-
-
-
During odd-numbered jumps (i.e., jumps 1, 3, 5, ...), you jump to the index j such that arr[i] <= arr[j] and arr[j] is the smallest possible value. If there are multiple such indices j, you can only jump to the smallest such index j.
-
During even-numbered jumps (i.e., jumps 2, 4, 6, ...), you jump to the index j such that arr[i] >= arr[j] and arr[j] is the largest possible value. If there are multiple such indices j, you can only jump to the smallest such index j.
-
It may be the case that for some index i, there are no legal jumps.
-
-
-
A starting index is good if, starting from that index, you can reach the end of the array (index arr.length - 1) by jumping some number of times (possibly 0 or more than once).
-
-
Return the number of good starting indices.
-
-
-
Example 1:
-
-
-Input: arr = [10,13,12,14,15]
-Output: 2
-Explanation:
-From starting index i = 0, we can make our 1st jump to i = 2 (since arr[2] is the smallest among arr[1], arr[2], arr[3], arr[4] that is greater or equal to arr[0]), then we cannot jump any more.
-From starting index i = 1 and i = 2, we can make our 1st jump to i = 3, then we cannot jump any more.
-From starting index i = 3, we can make our 1st jump to i = 4, so we have reached the end.
-From starting index i = 4, we have reached the end already.
-In total, there are 2 different starting indices i = 3 and i = 4, where we can reach the end with some number of
-jumps.
-
-
-
Example 2:
-
-
-Input: arr = [2,3,1,1,4]
-Output: 3
-Explanation:
-From starting index i = 0, we make jumps to i = 1, i = 2, i = 3:
-During our 1st jump (odd-numbered), we first jump to i = 1 because arr[1] is the smallest value in [arr[1], arr[2], arr[3], arr[4]] that is greater than or equal to arr[0].
-During our 2nd jump (even-numbered), we jump from i = 1 to i = 2 because arr[2] is the largest value in [arr[2], arr[3], arr[4]] that is less than or equal to arr[1]. arr[3] is also the largest value, but 2 is a smaller index, so we can only jump to i = 2 and not i = 3
-During our 3rd jump (odd-numbered), we jump from i = 2 to i = 3 because arr[3] is the smallest value in [arr[3], arr[4]] that is greater than or equal to arr[2].
-We can't jump from i = 3 to i = 4, so the starting index i = 0 is not good.
-In a similar manner, we can deduce that:
-From starting index i = 1, we jump to i = 4, so we reach the end.
-From starting index i = 2, we jump to i = 3, and then we can't jump anymore.
-From starting index i = 3, we jump to i = 4, so we reach the end.
-From starting index i = 4, we are already at the end.
-In total, there are 3 different starting indices i = 1, i = 3, and i = 4, where we can reach the end with some
-number of jumps.
-
-
-
Example 3:
-
-
-Input: arr = [5,1,3,4,2]
-Output: 3
-Explanation: We can reach the end from starting indices 1, 2, and 4.
-
-
-
-
Constraints:
-
-
-
1 <= arr.length <= 2 * 104
-
0 <= arr[i] < 105
-
-
-### Related Topics
- [[Stack](../../tag/stack/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Ordered Set](../../tag/ordered-set/README.md)]
- [[Monotonic Stack](../../tag/monotonic-stack/README.md)]
diff --git a/problems/odd-even-jump/odd_even_jump.go b/problems/odd-even-jump/odd_even_jump.go
deleted file mode 100644
index 9f9b112b2..000000000
--- a/problems/odd-even-jump/odd_even_jump.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem975
diff --git a/problems/odd-even-linked-list/README.md b/problems/odd-even-linked-list/README.md
deleted file mode 100644
index febedeac1..000000000
--- a/problems/odd-even-linked-list/README.md
+++ /dev/null
@@ -1,50 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../count-of-range-sum "Count of Range Sum")
-
-[Next >](../longest-increasing-path-in-a-matrix "Longest Increasing Path in a Matrix")
-
-## [328. Odd Even Linked List (Medium)](https://leetcode.com/problems/odd-even-linked-list "奇偶链表")
-
-
Given the head of a singly linked list, group all the nodes with odd indices together followed by the nodes with even indices, and return the reordered list.
-
-
The first node is considered odd, and the second node is even, and so on.
-
-
Note that the relative order inside both the even and odd groups should remain as it was in the input.
-
-
You must solve the problem in O(1) extra space complexity and O(n) time complexity.
-
-
-
Example 1:
-
-
-Input: head = [1,2,3,4,5]
-Output: [1,3,5,2,4]
-
-
-
Example 2:
-
-
-Input: head = [2,1,3,5,6,4,7]
-Output: [2,3,6,7,1,5,4]
-
You are given an array of binary strings strs and two integers m and n.
-
-
Return the size of the largest subset of strs such that there are at mostm0's and n1's in the subset.
-
-
A set x is a subset of a set y if all elements of x are also elements of y.
-
-
-
Example 1:
-
-
-Input: strs = ["10","0001","111001","1","0"], m = 5, n = 3
-Output: 4
-Explanation: The largest subset with at most 5 0's and 3 1's is {"10", "0001", "1", "0"}, so the answer is 4.
-Other valid but smaller subsets include {"0001", "1"} and {"10", "1", "0"}.
-{"111001"} is an invalid subset because it contains 4 1's, greater than the maximum of 3.
-
-
-
Example 2:
-
-
-Input: strs = ["10","0","1"], m = 1, n = 1
-Output: 2
-Explanation: The largest subset is {"0", "1"}, so the answer is 2.
-
You are given two integer arrays persons and times. In an election, the ith vote was cast for persons[i] at time times[i].
-
-
For each query at a time t, find the person that was leading the election at time t. Votes cast at time t will count towards our query. In the case of a tie, the most recent vote (among tied candidates) wins.
-
-
Implement the TopVotedCandidate class:
-
-
-
TopVotedCandidate(int[] persons, int[] times) Initializes the object with the persons and times arrays.
-
int q(int t) Returns the number of the person that was leading the election at time t according to the mentioned rules.
-
-
-
-
Example 1:
-
-
-Input
-["TopVotedCandidate", "q", "q", "q", "q", "q", "q"]
-[[[0, 1, 1, 0, 0, 1, 0], [0, 5, 10, 15, 20, 25, 30]], [3], [12], [25], [15], [24], [8]]
-Output
-[null, 0, 1, 1, 0, 0, 1]
-
-Explanation
-TopVotedCandidate topVotedCandidate = new TopVotedCandidate([0, 1, 1, 0, 0, 1, 0], [0, 5, 10, 15, 20, 25, 30]);
-topVotedCandidate.q(3); // return 0, At time 3, the votes are [0], and 0 is leading.
-topVotedCandidate.q(12); // return 1, At time 12, the votes are [0,1,1], and 1 is leading.
-topVotedCandidate.q(25); // return 1, At time 25, the votes are [0,1,1,0,0,1], and 1 is leading (as ties go to the most recent vote.)
-topVotedCandidate.q(15); // return 0
-topVotedCandidate.q(24); // return 0
-topVotedCandidate.q(8); // return 1
-
-
Design a data structure that efficiently finds the majority element of a given subarray.
-
-
The majority element of a subarray is an element that occurs threshold times or more in the subarray.
-
-
Implementing the MajorityChecker class:
-
-
-
MajorityChecker(int[] arr) Initializes the instance of the class with the given array arr.
-
int query(int left, int right, int threshold) returns the element in the subarray arr[left...right] that occurs at least threshold times, or -1 if no such element exists.
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
- [[Design](../../tag/design/README.md)]
- [[Binary Indexed Tree](../../tag/binary-indexed-tree/README.md)]
- [[Segment Tree](../../tag/segment-tree/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/online-stock-span/README.md b/problems/online-stock-span/README.md
deleted file mode 100644
index 169db46d1..000000000
--- a/problems/online-stock-span/README.md
+++ /dev/null
@@ -1,62 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../rle-iterator "RLE Iterator")
-
-[Next >](../numbers-at-most-n-given-digit-set "Numbers At Most N Given Digit Set")
-
-## [901. Online Stock Span (Medium)](https://leetcode.com/problems/online-stock-span "股票价格跨度")
-
-
Design an algorithm that collects daily price quotes for some stock and returns the span of that stock's price for the current day.
-
-
The span of the stock's price today is defined as the maximum number of consecutive days (starting from today and going backward) for which the stock price was less than or equal to today's price.
-
-
-
For example, if the price of a stock over the next 7 days were [100,80,60,70,60,75,85], then the stock spans would be [1,1,1,2,1,4,6].
-
-
-
Implement the StockSpanner class:
-
-
-
StockSpanner() Initializes the object of the class.
-
int next(int price) Returns the span of the stock's price given that today's price is price.
-
-
-
-
Example 1:
-
-
-Input
-["StockSpanner", "next", "next", "next", "next", "next", "next", "next"]
-[[], [100], [80], [60], [70], [60], [75], [85]]
-Output
-[null, 1, 1, 1, 2, 1, 4, 6]
-
-Explanation
-StockSpanner stockSpanner = new StockSpanner();
-stockSpanner.next(100); // return 1
-stockSpanner.next(80); // return 1
-stockSpanner.next(60); // return 1
-stockSpanner.next(70); // return 2
-stockSpanner.next(60); // return 1
-stockSpanner.next(75); // return 4, because the last 4 prices (including today's price of 75) were less than or equal to today's price.
-stockSpanner.next(85); // return 6
-
You have a lock in front of you with 4 circular wheels. Each wheel has 10 slots: '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'. The wheels can rotate freely and wrap around: for example we can turn '9' to be '0', or '0' to be '9'. Each move consists of turning one wheel one slot.
-
-
The lock initially starts at '0000', a string representing the state of the 4 wheels.
-
-
You are given a list of deadends dead ends, meaning if the lock displays any of these codes, the wheels of the lock will stop turning and you will be unable to open it.
-
-
Given a target representing the value of the wheels that will unlock the lock, return the minimum total number of turns required to open the lock, or -1 if it is impossible.
-
-
-
Example 1:
-
-
-Input: deadends = ["0201","0101","0102","1212","2002"], target = "0202"
-Output: 6
-Explanation:
-A sequence of valid moves would be "0000" -> "1000" -> "1100" -> "1200" -> "1201" -> "1202" -> "0202".
-Note that a sequence like "0000" -> "0001" -> "0002" -> "0102" -> "0202" would be invalid,
-because the wheels of the lock become stuck after the display becomes the dead end "0102".
-
-
-
Example 2:
-
-
-Input: deadends = ["8888"], target = "0009"
-Output: 1
-Explanation:
-We can turn the last wheel in reverse to move from "0000" -> "0009".
-
-
-
Example 3:
-
-
-Input: deadends = ["8887","8889","8878","8898","8788","8988","7888","9888"], target = "8888"
-Output: -1
-Explanation:
-We can't reach the target without getting stuck.
-
-
-### Related Topics
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Hints
-
-Hint 1
-We can think of this problem as a shortest path problem on a graph: there are `10000` nodes (strings `'0000'` to `'9999'`), and there is an edge between two nodes if they differ in one digit, that digit differs by 1 (wrapping around, so `'0'` and `'9'` differ by 1), and if *both* nodes are not in `deadends`.
-
diff --git a/problems/open-the-lock/open_the_lock.go b/problems/open-the-lock/open_the_lock.go
deleted file mode 100644
index 2b5cf3464..000000000
--- a/problems/open-the-lock/open_the_lock.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem752
diff --git a/problems/open-the-lock/open_the_lock_test.go b/problems/open-the-lock/open_the_lock_test.go
deleted file mode 100644
index 2b5cf3464..000000000
--- a/problems/open-the-lock/open_the_lock_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem752
diff --git a/problems/operations-on-tree/README.md b/problems/operations-on-tree/README.md
deleted file mode 100644
index e249614a9..000000000
--- a/problems/operations-on-tree/README.md
+++ /dev/null
@@ -1,92 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../find-all-groups-of-farmland "Find All Groups of Farmland")
-
-[Next >](../the-number-of-good-subsets "The Number of Good Subsets")
-
-## [1993. Operations on Tree (Medium)](https://leetcode.com/problems/operations-on-tree "树上的操作")
-
-
You are given a tree with n nodes numbered from 0 to n - 1 in the form of a parent array parent where parent[i] is the parent of the ith node. The root of the tree is node 0, so parent[0] = -1 since it has no parent. You want to design a data structure that allows users to lock, unlock, and upgrade nodes in the tree.
-
-
The data structure should support the following functions:
-
-
-
Lock:Locks the given node for the given user and prevents other users from locking the same node. You may only lock a node using this function if the node is unlocked.
-
Unlock: Unlocks the given node for the given user. You may only unlock a node using this function if it is currently locked by the same user.
-
Upgrade: Locks the given node for the given user and unlocks all of its descendants regardless of who locked it. You may only upgrade a node if all 3 conditions are true:
-
-
The node is unlocked,
-
It has at least one locked descendant (by any user), and
-
It does not have any locked ancestors.
-
-
-
-
-
Implement the LockingTree class:
-
-
-
LockingTree(int[] parent) initializes the data structure with the parent array.
-
lock(int num, int user) returns true if it is possible for the user with id user to lock the node num, or false otherwise. If it is possible, the node num will become locked by the user with id user.
-
unlock(int num, int user) returns true if it is possible for the user with id user to unlock the node num, or false otherwise. If it is possible, the node num will become unlocked.
-
upgrade(int num, int user) returns true if it is possible for the user with id user to upgrade the node num, or false otherwise. If it is possible, the node num will be upgraded.
-
-
-
-
Example 1:
-
-
-Input
-["LockingTree", "lock", "unlock", "unlock", "lock", "upgrade", "lock"]
-[[[-1, 0, 0, 1, 1, 2, 2]], [2, 2], [2, 3], [2, 2], [4, 5], [0, 1], [0, 1]]
-Output
-[null, true, false, true, true, true, false]
-
-Explanation
-LockingTree lockingTree = new LockingTree([-1, 0, 0, 1, 1, 2, 2]);
-lockingTree.lock(2, 2); // return true because node 2 is unlocked.
- // Node 2 will now be locked by user 2.
-lockingTree.unlock(2, 3); // return false because user 3 cannot unlock a node locked by user 2.
-lockingTree.unlock(2, 2); // return true because node 2 was previously locked by user 2.
- // Node 2 will now be unlocked.
-lockingTree.lock(4, 5); // return true because node 4 is unlocked.
- // Node 4 will now be locked by user 5.
-lockingTree.upgrade(0, 1); // return true because node 0 is unlocked and has at least one locked descendant (node 4).
- // Node 0 will now be locked by user 1 and node 4 will now be unlocked.
-lockingTree.lock(0, 1); // return false because node 0 is already locked.
-
-
-
-
Constraints:
-
-
-
n == parent.length
-
2 <= n <= 2000
-
0 <= parent[i] <= n - 1 for i != 0
-
parent[0] == -1
-
0 <= num <= n - 1
-
1 <= user <= 104
-
parent represents a valid tree.
-
At most 2000 calls in total will be made to lock, unlock, and upgrade.
-
-
-### Related Topics
- [[Tree](../../tag/tree/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Design](../../tag/design/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
-
-### Hints
-
-Hint 1
-How can we use the small constraints to help us solve the problem?
-
-
-
-Hint 2
-How can we traverse the ancestors and descendants of a node?
-
diff --git a/problems/optimal-account-balancing/README.md b/problems/optimal-account-balancing/README.md
deleted file mode 100644
index 0a74001fe..000000000
--- a/problems/optimal-account-balancing/README.md
+++ /dev/null
@@ -1,61 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../can-i-win "Can I Win")
-
-[Next >](../count-the-repetitions "Count The Repetitions")
-
-## [465. Optimal Account Balancing (Hard)](https://leetcode.com/problems/optimal-account-balancing "最优账单平衡")
-
-
A group of friends went on holiday and sometimes lent each other money. For example, Alice paid for Bill's lunch for $10. Then later Chris gave Alice $5 for a taxi ride. We can model each transaction as a tuple (x, y, z) which means person x gave person y $z. Assuming Alice, Bill, and Chris are person 0, 1, and 2 respectively (0, 1, 2 are the person's ID), the transactions can be represented as [[0, 1, 10], [2, 0, 5]].
-
-
Given a list of transactions between a group of people, return the minimum number of transactions required to settle the debt.
-
-
Note:
-
-
A transaction will be given as a tuple (x, y, z). Note that x ≠ y and z > 0.
-
Person's IDs may not be linear, e.g. we could have the persons 0, 1, 2 or we could also have the persons 0, 2, 6.
-
-
-
-
Example 1:
-
-Input:
-[[0,1,10], [2,0,5]]
-
-Output:
-2
-
-Explanation:
-Person #0 gave person #1 $10.
-Person #2 gave person #0 $5.
-
-Two transactions are needed. One way to settle the debt is person #1 pays person #0 and #2 $5 each.
-
-
-
-
Example 2:
-
-Input:
-[[0,1,10], [1,0,1], [1,2,5], [2,0,5]]
-
-Output:
-1
-
-Explanation:
-Person #0 gave person #1 $10.
-Person #1 gave person #0 $1.
-Person #1 gave person #2 $5.
-Person #2 gave person #0 $5.
-
-Therefore, person #1 only need to give person #0 $4, and all debt is settled.
-
You are given an integer array nums. The adjacent integers in nums will perform the float division.
-
-
-
For example, for nums = [2,3,4], we will evaluate the expression "2/3/4".
-
-
-
However, you can add any number of parenthesis at any position to change the priority of operations. You want to add these parentheses such the value of the expression after the evaluation is maximum.
-
-
Return the corresponding expression that has the maximum value in string format.
-
-
Note: your expression should not contain redundant parenthesis.
-
-
-
Example 1:
-
-
-Input: nums = [1000,100,10,2]
-Output: "1000/(100/10/2)"
-Explanation:
-1000/(100/10/2) = 1000/((100/10)/2) = 200
-However, the bold parenthesis in "1000/((100/10)/2)" are redundant, since they don't influence the operation priority. So you should return "1000/(100/10/2)".
-Other cases:
-1000/(100/10)/2 = 50
-1000/(100/(10/2)) = 50
-1000/100/10/2 = 0.5
-1000/100/(10/2) = 2
-
-
-
Example 2:
-
-
-Input: nums = [2,3,4]
-Output: "2/(3/4)"
-
-
-
Example 3:
-
-
-Input: nums = [2]
-Output: "2"
-
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 10
-
2 <= nums[i] <= 1000
-
There is only one optimal division for the given iput.
There are n houses in a village. We want to supply water for all the houses by building wells and laying pipes.
-
-
For each house i, we can either build a well inside it directly with cost wells[i], or pipe in water from another well to it. The costs to lay pipes between houses are given by the array pipes, where each pipes[i] = [house1, house2, cost] represents the cost to connect house1 and house2 together using a pipe. Connections are bidirectional.
-
-
Find the minimum total cost to supply water to all houses.
-
-
-
Example 1:
-
-
-
-
-Input: n = 3, wells = [1,2,2], pipes = [[1,2,1],[2,3,1]]
-Output: 3
-Explanation:
-The image shows the costs of connecting houses using pipes.
-The best strategy is to build a well in the first house with cost 1 and connect the other houses to it with cost 2 so the total cost is 3.
-
-
-
-
Constraints:
-
-
-
1 <= n <= 10000
-
wells.length == n
-
0 <= wells[i] <= 10^5
-
1 <= pipes.length <= 10000
-
1 <= pipes[i][0], pipes[i][1] <= n
-
0 <= pipes[i][2] <= 10^5
-
pipes[i][0] != pipes[i][1]
-
-
-### Related Topics
- [[Union Find](../../tag/union-find/README.md)]
- [[Graph](../../tag/graph/README.md)]
- [[Minimum Spanning Tree](../../tag/minimum-spanning-tree/README.md)]
-
-### Hints
-
-Hint 1
-What if we model this problem as a graph problem?
-
-
-
-Hint 2
-A house is a node and a pipe is a weighted edge.
-
-
-
-Hint 3
-How to represent building wells in the graph model?
-
-
-
-Hint 4
-Add a virtual node, connect it to houses with edges weighted by the costs to build wells in these houses.
-
-
-
-Hint 5
-The problem is now reduced to a Minimum Spanning Tree problem.
-
diff --git a/problems/order-two-columns-independently/README.md b/problems/order-two-columns-independently/README.md
deleted file mode 100644
index 24bed0989..000000000
--- a/problems/order-two-columns-independently/README.md
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../amount-of-new-area-painted-each-day "Amount of New Area Painted Each Day")
-
-[Next >](../minimum-sum-of-four-digit-number-after-splitting-digits "Minimum Sum of Four Digit Number After Splitting Digits")
-
-## [2159. Order Two Columns Independently (Medium)](https://leetcode.com/problems/order-two-columns-independently "")
-
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/order-two-columns-independently/mysql_schemas.sql b/problems/order-two-columns-independently/mysql_schemas.sql
deleted file mode 100644
index 444d9231f..000000000
--- a/problems/order-two-columns-independently/mysql_schemas.sql
+++ /dev/null
@@ -1,6 +0,0 @@
-Create table If Not Exists Data (first_col int, second_col int);
-Truncate table Data;
-insert into Data (first_col, second_col) values ('4', '2');
-insert into Data (first_col, second_col) values ('2', '3');
-insert into Data (first_col, second_col) values ('3', '1');
-insert into Data (first_col, second_col) values ('1', '4');
diff --git a/problems/orderly-queue/README.md b/problems/orderly-queue/README.md
deleted file mode 100644
index 057a44d4e..000000000
--- a/problems/orderly-queue/README.md
+++ /dev/null
@@ -1,50 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../bitwise-ors-of-subarrays "Bitwise ORs of Subarrays")
-
-[Next >](../rle-iterator "RLE Iterator")
-
-## [899. Orderly Queue (Hard)](https://leetcode.com/problems/orderly-queue "有序队列")
-
-
You are given a string s and an integer k. You can choose one of the first k letters of s and append it at the end of the string..
-
-
Return the lexicographically smallest string you could have after applying the mentioned step any number of moves.
-
-
-
Example 1:
-
-
-Input: s = "cba", k = 1
-Output: "acb"
-Explanation:
-In the first move, we move the 1st character 'c' to the end, obtaining the string "bac".
-In the second move, we move the 1st character 'b' to the end, obtaining the final result "acb".
-
-
-
Example 2:
-
-
-Input: s = "baaca", k = 3
-Output: "aaabc"
-Explanation:
-In the first move, we move the 1st character 'b' to the end, obtaining the string "aacab".
-In the second move, we move the 3rd character 'c' to the end, obtaining the final result "aaabc".
-
-
-
-
Constraints:
-
-
-
1 <= k <= s.length <= 1000
-
s consist of lowercase English letters.
-
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
- [[String](../../tag/string/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
diff --git a/problems/orderly-queue/orderly_queue.go b/problems/orderly-queue/orderly_queue.go
deleted file mode 100644
index ba20e1e20..000000000
--- a/problems/orderly-queue/orderly_queue.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem899
diff --git a/problems/orderly-queue/orderly_queue_test.go b/problems/orderly-queue/orderly_queue_test.go
deleted file mode 100644
index ba20e1e20..000000000
--- a/problems/orderly-queue/orderly_queue_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem899
diff --git a/problems/orders-with-maximum-quantity-above-average/README.md b/problems/orders-with-maximum-quantity-above-average/README.md
deleted file mode 100644
index 4743751d8..000000000
--- a/problems/orders-with-maximum-quantity-above-average/README.md
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../number-of-ways-to-rearrange-sticks-with-k-sticks-visible "Number of Ways to Rearrange Sticks With K Sticks Visible")
-
-[Next >](../product-of-two-run-length-encoded-arrays "Product of Two Run-Length Encoded Arrays")
-
-## [1867. Orders With Maximum Quantity Above Average (Medium)](https://leetcode.com/problems/orders-with-maximum-quantity-above-average "最大数量高于平均水平的订单")
-
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/orders-with-maximum-quantity-above-average/mysql_schemas.sql b/problems/orders-with-maximum-quantity-above-average/mysql_schemas.sql
deleted file mode 100644
index 1e84558f9..000000000
--- a/problems/orders-with-maximum-quantity-above-average/mysql_schemas.sql
+++ /dev/null
@@ -1,16 +0,0 @@
-Create table If Not Exists OrdersDetails (order_id int, product_id int, quantity int);
-Truncate table OrdersDetails;
-insert into OrdersDetails (order_id, product_id, quantity) values ('1', '1', '12');
-insert into OrdersDetails (order_id, product_id, quantity) values ('1', '2', '10');
-insert into OrdersDetails (order_id, product_id, quantity) values ('1', '3', '15');
-insert into OrdersDetails (order_id, product_id, quantity) values ('2', '1', '8');
-insert into OrdersDetails (order_id, product_id, quantity) values ('2', '4', '4');
-insert into OrdersDetails (order_id, product_id, quantity) values ('2', '5', '6');
-insert into OrdersDetails (order_id, product_id, quantity) values ('3', '3', '5');
-insert into OrdersDetails (order_id, product_id, quantity) values ('3', '4', '18');
-insert into OrdersDetails (order_id, product_id, quantity) values ('4', '5', '2');
-insert into OrdersDetails (order_id, product_id, quantity) values ('4', '6', '8');
-insert into OrdersDetails (order_id, product_id, quantity) values ('5', '7', '9');
-insert into OrdersDetails (order_id, product_id, quantity) values ('5', '8', '9');
-insert into OrdersDetails (order_id, product_id, quantity) values ('3', '9', '20');
-insert into OrdersDetails (order_id, product_id, quantity) values ('2', '9', '4');
diff --git a/problems/out-of-boundary-paths/README.md b/problems/out-of-boundary-paths/README.md
deleted file mode 100644
index d870983f9..000000000
--- a/problems/out-of-boundary-paths/README.md
+++ /dev/null
@@ -1,65 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../distribute-candies "Distribute Candies")
-
-[Next >](../employee-bonus "Employee Bonus")
-
-## [576. Out of Boundary Paths (Medium)](https://leetcode.com/problems/out-of-boundary-paths "出界的路径数")
-
-
There is an m x n grid with a ball. The ball is initially at the position [startRow, startColumn]. You are allowed to move the ball to one of the four adjacent cells in the grid (possibly out of the grid crossing the grid boundary). You can apply at mostmaxMove moves to the ball.
-
-
Given the five integers m, n, maxMove, startRow, startColumn, return the number of paths to move the ball out of the grid boundary. Since the answer can be very large, return it modulo109 + 7.
-
-
-
Example 1:
-
-
-Input: m = 2, n = 2, maxMove = 2, startRow = 0, startColumn = 0
-Output: 6
-
-
-
Example 2:
-
-
-Input: m = 1, n = 3, maxMove = 3, startRow = 0, startColumn = 1
-Output: 12
-
-
-
-
Constraints:
-
-
-
1 <= m, n <= 50
-
0 <= maxMove <= 50
-
0 <= startRow < m
-
0 <= startColumn < n
-
-
-### Related Topics
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Similar Questions
- 1. [Knight Probability in Chessboard](../knight-probability-in-chessboard) (Medium)
-
-### Hints
-
-Hint 1
-Is traversing every path feasible? There are many possible paths for a small matrix. Try to optimize it.
-
-
-
-Hint 2
-Can we use some space to store the number of paths and update them after every move?
-
-
-
-Hint 3
-One obvious thing: the ball will go out of the boundary only by crossing it. Also, there is only one possible way the ball can go out of the boundary from the boundary cell except for corner cells. From the corner cell, the ball can go out in two different ways.
-
-Can you use this thing to solve the problem?
-
diff --git a/problems/out-of-boundary-paths/out_of_boundary_paths.go b/problems/out-of-boundary-paths/out_of_boundary_paths.go
deleted file mode 100644
index 3a312b812..000000000
--- a/problems/out-of-boundary-paths/out_of_boundary_paths.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem576
diff --git a/problems/out-of-boundary-paths/out_of_boundary_paths_test.go b/problems/out-of-boundary-paths/out_of_boundary_paths_test.go
deleted file mode 100644
index 3a312b812..000000000
--- a/problems/out-of-boundary-paths/out_of_boundary_paths_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem576
diff --git a/problems/output-contest-matches/README.md b/problems/output-contest-matches/README.md
deleted file mode 100644
index d2ed16eb9..000000000
--- a/problems/output-contest-matches/README.md
+++ /dev/null
@@ -1,61 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../diameter-of-binary-tree "Diameter of Binary Tree")
-
-[Next >](../boundary-of-binary-tree "Boundary of Binary Tree")
-
-## [544. Output Contest Matches (Medium)](https://leetcode.com/problems/output-contest-matches "输出比赛匹配对")
-
-
-During the NBA playoffs, we always arrange the rather strong team to play with the rather weak team, like make the rank 1 team play with the rank nth team, which is a good strategy to make the contest more interesting. Now, you're given n teams, you need to output their final contest matches in the form of a string.
-
-
-
The n teams are given in the form of positive integers from 1 to n, which represents their initial rank. (Rank 1 is the strongest team and Rank n is the weakest team.) We'll use parentheses('(', ')') and commas(',') to represent the contest team pairing - parentheses('(' , ')') for pairing and commas(',') for partition. During the pairing process in each round, you always need to follow the strategy of making the rather strong one pair with the rather weak one.
-
-
Example 1:
-
Input: 2
-Output: (1,2)
-Explanation:
-Initially, we have the team 1 and the team 2, placed like: 1,2.
-Then we pair the team (1,2) together with '(', ')' and ',', which is the final answer.
-
-
-
-
Example 2:
-
Input: 4
-Output: ((1,4),(2,3))
-Explanation:
-In the first round, we pair the team 1 and 4, the team 2 and 3 together, as we need to make the strong team and weak team together.
-And we got (1,4),(2,3).
-In the second round, the winners of (1,4) and (2,3) need to play again to generate the final winner, so you need to add the paratheses outside them.
-And we got the final answer ((1,4),(2,3)).
-
-
-
-
Example 3:
-
Input: 8
-Output: (((1,8),(4,5)),((2,7),(3,6)))
-Explanation:
-First round: (1,8),(2,7),(3,6),(4,5)
-Second round: ((1,8),(4,5)),((2,7),(3,6))
-Third round: (((1,8),(4,5)),((2,7),(3,6)))
-Since the third round will generate the final winner, you need to output the answer (((1,8),(4,5)),((2,7),(3,6))).
-
-
-
-
Note:
-
-
The n is in range [2, 212].
-
We ensure that the input n can be converted into the form 2k, where k is a positive integer.
There is an m x n rectangular island that borders both the Pacific Ocean and Atlantic Ocean. The Pacific Ocean touches the island's left and top edges, and the Atlantic Ocean touches the island's right and bottom edges.
-
-
The island is partitioned into a grid of square cells. You are given an m x n integer matrix heights where heights[r][c] represents the height above sea level of the cell at coordinate (r, c).
-
-
The island receives a lot of rain, and the rain water can flow to neighboring cells directly north, south, east, and west if the neighboring cell's height is less than or equal to the current cell's height. Water can flow from any cell adjacent to an ocean into the ocean.
-
-
Return a 2D list of grid coordinates result where result[i] = [ri, ci] denotes that rain water can flow from cell (ri, ci) to both the Pacific and Atlantic oceans.
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
diff --git a/problems/pacific-atlantic-water-flow/pacific_atlantic_water_flow.go b/problems/pacific-atlantic-water-flow/pacific_atlantic_water_flow.go
deleted file mode 100644
index ca9868411..000000000
--- a/problems/pacific-atlantic-water-flow/pacific_atlantic_water_flow.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem417
diff --git a/problems/pacific-atlantic-water-flow/pacific_atlantic_water_flow_test.go b/problems/pacific-atlantic-water-flow/pacific_atlantic_water_flow_test.go
deleted file mode 100644
index ca9868411..000000000
--- a/problems/pacific-atlantic-water-flow/pacific_atlantic_water_flow_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem417
diff --git a/problems/page-recommendations-ii/README.md b/problems/page-recommendations-ii/README.md
deleted file mode 100644
index 3e21532ec..000000000
--- a/problems/page-recommendations-ii/README.md
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../cutting-ribbons "Cutting Ribbons")
-
-[Next >](../check-if-all-the-integers-in-a-range-are-covered "Check if All the Integers in a Range Are Covered")
-
-## [1892. Page Recommendations II (Hard)](https://leetcode.com/problems/page-recommendations-ii "页面推荐Ⅱ")
-
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/page-recommendations-ii/mysql_schemas.sql b/problems/page-recommendations-ii/mysql_schemas.sql
deleted file mode 100644
index d7b0e4af6..000000000
--- a/problems/page-recommendations-ii/mysql_schemas.sql
+++ /dev/null
@@ -1,20 +0,0 @@
-Create table If Not Exists Friendship (user1_id int, user2_id int);
-Create table If Not Exists Likes (user_id int, page_id int);
-Truncate table Friendship;
-insert into Friendship (user1_id, user2_id) values ('1', '2');
-insert into Friendship (user1_id, user2_id) values ('1', '3');
-insert into Friendship (user1_id, user2_id) values ('1', '4');
-insert into Friendship (user1_id, user2_id) values ('2', '3');
-insert into Friendship (user1_id, user2_id) values ('2', '4');
-insert into Friendship (user1_id, user2_id) values ('2', '5');
-insert into Friendship (user1_id, user2_id) values ('6', '1');
-Truncate table Likes;
-insert into Likes (user_id, page_id) values ('1', '88');
-insert into Likes (user_id, page_id) values ('2', '23');
-insert into Likes (user_id, page_id) values ('3', '24');
-insert into Likes (user_id, page_id) values ('4', '56');
-insert into Likes (user_id, page_id) values ('5', '11');
-insert into Likes (user_id, page_id) values ('6', '33');
-insert into Likes (user_id, page_id) values ('2', '77');
-insert into Likes (user_id, page_id) values ('3', '77');
-insert into Likes (user_id, page_id) values ('6', '88');
diff --git a/problems/page-recommendations/README.md b/problems/page-recommendations/README.md
deleted file mode 100644
index 3faa1073c..000000000
--- a/problems/page-recommendations/README.md
+++ /dev/null
@@ -1,93 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-moves-to-move-a-box-to-their-target-location "Minimum Moves to Move a Box to Their Target Location")
-
-[Next >](../print-immutable-linked-list-in-reverse "Print Immutable Linked List in Reverse")
-
-## [1264. Page Recommendations (Medium)](https://leetcode.com/problems/page-recommendations "页面推荐")
-
-
Table: Friendship
-
-+---------------+---------+
-| Column Name | Type |
-+---------------+---------+
-| user1_id | int |
-| user2_id | int |
-+---------------+---------+
-(user1_id, user2_id) is the primary key for this table.
-Each row of this table indicates that there is a friendship relation between user1_id and user2_id.
-
-
-
Table: Likes
-
-+-------------+---------+
-| Column Name | Type |
-+-------------+---------+
-| user_id | int |
-| page_id | int |
-+-------------+---------+
-(user_id, page_id) is the primary key for this table.
-Each row of this table indicates that user_id likes page_id.
-
-
-Write an SQL query to recommend pages to the user with user_id = 1 using the pages that your friends liked. It should not recommend pages you already liked.
-
-Return result table in any order without duplicates.
-
-The query result format is in the following example:
-
-Friendship table:
-+----------+----------+
-| user1_id | user2_id |
-+----------+----------+
-| 1 | 2 |
-| 1 | 3 |
-| 1 | 4 |
-| 2 | 3 |
-| 2 | 4 |
-| 2 | 5 |
-| 6 | 1 |
-+----------+----------+
-
-Likes table:
-+---------+---------+
-| user_id | page_id |
-+---------+---------+
-| 1 | 88 |
-| 2 | 23 |
-| 3 | 24 |
-| 4 | 56 |
-| 5 | 11 |
-| 6 | 33 |
-| 2 | 77 |
-| 3 | 77 |
-| 6 | 88 |
-+---------+---------+
-
-Result table:
-+------------------+
-| recommended_page |
-+------------------+
-| 23 |
-| 24 |
-| 56 |
-| 33 |
-| 77 |
-+------------------+
-User one is friend with users 2, 3, 4 and 6.
-Suggested pages are 23 from user 2, 24 from user 3, 56 from user 3 and 33 from user 6.
-Page 77 is suggested from both user 2 and user 3.
-Page 88 is not suggested because user 1 already likes it.
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
-
-### Similar Questions
- 1. [Page Recommendations II](../page-recommendations-ii) (Hard)
- 1. [Strong Friendship](../strong-friendship) (Medium)
diff --git a/problems/page-recommendations/mysql_schemas.sql b/problems/page-recommendations/mysql_schemas.sql
deleted file mode 100644
index d7b0e4af6..000000000
--- a/problems/page-recommendations/mysql_schemas.sql
+++ /dev/null
@@ -1,20 +0,0 @@
-Create table If Not Exists Friendship (user1_id int, user2_id int);
-Create table If Not Exists Likes (user_id int, page_id int);
-Truncate table Friendship;
-insert into Friendship (user1_id, user2_id) values ('1', '2');
-insert into Friendship (user1_id, user2_id) values ('1', '3');
-insert into Friendship (user1_id, user2_id) values ('1', '4');
-insert into Friendship (user1_id, user2_id) values ('2', '3');
-insert into Friendship (user1_id, user2_id) values ('2', '4');
-insert into Friendship (user1_id, user2_id) values ('2', '5');
-insert into Friendship (user1_id, user2_id) values ('6', '1');
-Truncate table Likes;
-insert into Likes (user_id, page_id) values ('1', '88');
-insert into Likes (user_id, page_id) values ('2', '23');
-insert into Likes (user_id, page_id) values ('3', '24');
-insert into Likes (user_id, page_id) values ('4', '56');
-insert into Likes (user_id, page_id) values ('5', '11');
-insert into Likes (user_id, page_id) values ('6', '33');
-insert into Likes (user_id, page_id) values ('2', '77');
-insert into Likes (user_id, page_id) values ('3', '77');
-insert into Likes (user_id, page_id) values ('6', '88');
diff --git a/problems/paint-fence/README.md b/problems/paint-fence/README.md
deleted file mode 100644
index 508201a5d..000000000
--- a/problems/paint-fence/README.md
+++ /dev/null
@@ -1,47 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../h-index-ii "H-Index II")
-
-[Next >](../find-the-celebrity "Find the Celebrity")
-
-## [276. Paint Fence (Medium)](https://leetcode.com/problems/paint-fence "栅栏涂色")
-
-
There is a fence with n posts, each post can be painted with one of the k colors.
-
-
You have to paint all the posts such that no more than two adjacent fence posts have the same color.
-
-
Return the total number of ways you can paint the fence.
-
-
Note:
-n and k are non-negative integers.
-
-
Example:
-
-
-Input: n = 3, k = 2
-Output: 6
-Explanation: Take c1 as color 1, c2 as color 2. All possible ways are:
-
- post1 post2 post3
- ----- ----- ----- -----
- 1 c1 c1 c2
- 2 c1 c2 c1
- 3 c1 c2 c2
- 4 c2 c1 c1
- 5 c2 c1 c2
- 6 c2 c2 c1
-
There are a row of n houses, each house can be painted with one of the k colors. The cost of painting each house with a certain color is different. You have to paint all the houses such that no two adjacent houses have the same color.
-
-
The cost of painting each house with a certain color is represented by a n x k cost matrix. For example, costs[0][0] is the cost of painting house 0 with color 0; costs[1][2] is the cost of painting house 1 with color 2, and so on... Find the minimum cost to paint all houses.
-
-
Note:
-All costs are positive integers.
-
-
Example:
-
-
-Input: [[1,5,3],[2,9,4]]
-Output: 5
-Explanation: Paint house 0 into color 0, paint house 1 into color 2. Minimum cost: 1 + 4 = 5;
- Or paint house 0 into color 2, paint house 1 into color 0. Minimum cost: 3 + 2 = 5.
-
There is a row of m houses in a small city, each house must be painted with one of the n colors (labeled from 1 to n), some houses that have been painted last summer should not be painted again.
-
-
A neighborhood is a maximal group of continuous houses that are painted with the same color.
Given an array houses, an m x n matrix cost and an integer target where:
-
-
-
houses[i]: is the color of the house i, and 0 if the house is not painted yet.
-
cost[i][j]: is the cost of paint the house i with the color j + 1.
-
-
-
Return the minimum cost of painting all the remaining houses in such a way that there are exactlytargetneighborhoods. If it is not possible, return -1.
-
-
-
Example 1:
-
-
-Input: houses = [0,0,0,0,0], cost = [[1,10],[10,1],[10,1],[1,10],[5,1]], m = 5, n = 2, target = 3
-Output: 9
-Explanation: Paint houses of this way [1,2,2,1,1]
-This array contains target = 3 neighborhoods, [{1}, {2,2}, {1,1}].
-Cost of paint all houses (1 + 1 + 1 + 1 + 5) = 9.
-
-
-
Example 2:
-
-
-Input: houses = [0,2,1,2,0], cost = [[1,10],[10,1],[10,1],[1,10],[5,1]], m = 5, n = 2, target = 3
-Output: 11
-Explanation: Some houses are already painted, Paint the houses of this way [2,2,1,2,2]
-This array contains target = 3 neighborhoods, [{2,2}, {1}, {2,2}].
-Cost of paint the first and last house (10 + 1) = 11.
-
-
-
Example 3:
-
-
-Input: houses = [3,1,2,3], cost = [[1,1,1],[1,1,1],[1,1,1],[1,1,1]], m = 4, n = 3, target = 3
-Output: -1
-Explanation: Houses are already painted with a total of 4 neighborhoods [{3},{1},{2},{3}] different of target = 3.
-
-
-
-
Constraints:
-
-
-
m == houses.length == cost.length
-
n == cost[i].length
-
1 <= m <= 100
-
1 <= n <= 20
-
1 <= target <= m
-
0 <= houses[i] <= n
-
1 <= cost[i][j] <= 104
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Hints
-
-Hint 1
-Use Dynamic programming.
-
-
-
-Hint 2
-Define dp[i][j][k] as the minimum cost where we have k neighborhoods in the first i houses and the i-th house is painted with the color j.
-
diff --git a/problems/paint-house/README.md b/problems/paint-house/README.md
deleted file mode 100644
index 4c8b8ad64..000000000
--- a/problems/paint-house/README.md
+++ /dev/null
@@ -1,38 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../verify-preorder-sequence-in-binary-search-tree "Verify Preorder Sequence in Binary Search Tree")
-
-[Next >](../binary-tree-paths "Binary Tree Paths")
-
-## [256. Paint House (Medium)](https://leetcode.com/problems/paint-house "粉刷房子")
-
-
There are a row of n houses, each house can be painted with one of the three colors: red, blue or green. The cost of painting each house with a certain color is different. You have to paint all the houses such that no two adjacent houses have the same color.
-
-
The cost of painting each house with a certain color is represented by a n x 3 cost matrix. For example, costs[0][0] is the cost of painting house 0 with color red; costs[1][2] is the cost of painting house 1 with color green, and so on... Find the minimum cost to paint all houses.
-
-
Note:
-All costs are positive integers.
-
-
Example:
-
-
-Input: [[17,2,17],[16,16,5],[14,3,19]]
-Output: 10
-Explanation: Paint house 0 into blue, paint house 1 into green, paint house 2 into blue.
- Minimum cost: 2 + 5 + 3 = 10.
-
You are given two integers m and n. Consider an m x n grid where each cell is initially white. You can paint each cell red, green, or blue. All cells must be painted.
-
-
Return the number of ways to color the grid with no two adjacent cells having the same color. Since the answer can be very large, return it modulo109 + 7.
-
-
-
Example 1:
-
-
-Input: m = 1, n = 1
-Output: 3
-Explanation: The three possible colorings are shown in the image above.
-
-
-
Example 2:
-
-
-Input: m = 1, n = 2
-Output: 6
-Explanation: The six possible colorings are shown in the image above.
-
-
-
Example 3:
-
-
-Input: m = 5, n = 5
-Output: 580986
-
-
-
-
Constraints:
-
-
-
1 <= m <= 5
-
1 <= n <= 1000
-
-
-### Related Topics
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Hints
-
-Hint 1
-Represent each colored column by a bitmask based on each cell color.
-
-
-
-Hint 2
-Use bitmasks DP with state (currentCell, prevColumn).
-
diff --git a/problems/pairs-of-songs-with-total-durations-divisible-by-60/README.md b/problems/pairs-of-songs-with-total-durations-divisible-by-60/README.md
deleted file mode 100644
index f2a3f7713..000000000
--- a/problems/pairs-of-songs-with-total-durations-divisible-by-60/README.md
+++ /dev/null
@@ -1,60 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../complement-of-base-10-integer "Complement of Base 10 Integer")
-
-[Next >](../capacity-to-ship-packages-within-d-days "Capacity To Ship Packages Within D Days")
-
-## [1010. Pairs of Songs With Total Durations Divisible by 60 (Medium)](https://leetcode.com/problems/pairs-of-songs-with-total-durations-divisible-by-60 "总持续时间可被 60 整除的歌曲")
-
-
You are given a list of songs where the ith song has a duration of time[i] seconds.
-
-
Return the number of pairs of songs for which their total duration in seconds is divisible by60. Formally, we want the number of indices i, j such that i < j with (time[i] + time[j]) % 60 == 0.
-
-
-
Example 1:
-
-
-Input: time = [30,20,150,100,40]
-Output: 3
-Explanation: Three pairs have a total duration divisible by 60:
-(time[0] = 30, time[2] = 150): total duration 180
-(time[1] = 20, time[3] = 100): total duration 120
-(time[1] = 20, time[4] = 40): total duration 60
-
-
-
Example 2:
-
-
-Input: time = [60,60,60]
-Output: 3
-Explanation: All three pairs have a total duration of 120, which is divisible by 60.
-
-
-
-
Constraints:
-
-
-
1 <= time.length <= 6 * 104
-
1 <= time[i] <= 500
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Counting](../../tag/counting/README.md)]
-
-### Hints
-
-Hint 1
-We only need to consider each song length modulo 60.
-
-
-
-Hint 2
-We can count the number of songs with (length % 60) equal to r, and store that in an array of size 60.
-
diff --git a/problems/pairs-of-songs-with-total-durations-divisible-by-60/pairs_of_songs_with_total_durations_divisible_by_60.go b/problems/pairs-of-songs-with-total-durations-divisible-by-60/pairs_of_songs_with_total_durations_divisible_by_60.go
deleted file mode 100644
index a221e4fc0..000000000
--- a/problems/pairs-of-songs-with-total-durations-divisible-by-60/pairs_of_songs_with_total_durations_divisible_by_60.go
+++ /dev/null
@@ -1,10 +0,0 @@
-package problem1010
-
-func numPairsDivisibleBy60(time []int) int {
- ans, m := 0, [60]int{}
- for _, t := range time {
- ans += m[(60-t%60)%60]
- m[t%60]++
- }
- return ans
-}
diff --git a/problems/pairs-of-songs-with-total-durations-divisible-by-60/pairs_of_songs_with_total_durations_divisible_by_60_test.go b/problems/pairs-of-songs-with-total-durations-divisible-by-60/pairs_of_songs_with_total_durations_divisible_by_60_test.go
deleted file mode 100644
index 15c675a6d..000000000
--- a/problems/pairs-of-songs-with-total-durations-divisible-by-60/pairs_of_songs_with_total_durations_divisible_by_60_test.go
+++ /dev/null
@@ -1,27 +0,0 @@
-package problem1010
-
-import "testing"
-
-type testType struct {
- in []int
- want int
-}
-
-func TestNumPairsDivisibleBy60(t *testing.T) {
- tests := [...]testType{
- {
- in: []int{30, 20, 150, 100, 40},
- want: 3,
- },
- {
- in: []int{60, 60, 60},
- want: 3,
- },
- }
- for _, tt := range tests {
- got := numPairsDivisibleBy60(tt.in)
- if got != tt.want {
- t.Fatalf("in: %v, got: %v, want: %v", tt.in, got, tt.want)
- }
- }
-}
diff --git a/problems/palindrome-linked-list/README.md b/problems/palindrome-linked-list/README.md
deleted file mode 100644
index 95753900b..000000000
--- a/problems/palindrome-linked-list/README.md
+++ /dev/null
@@ -1,51 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../number-of-digit-one "Number of Digit One")
-
-[Next >](../lowest-common-ancestor-of-a-binary-search-tree "Lowest Common Ancestor of a Binary Search Tree")
-
-## [234. Palindrome Linked List (Easy)](https://leetcode.com/problems/palindrome-linked-list "回文链表")
-
-
Given the head of a singly linked list, return true if it is a palindrome.
-
-
-
Example 1:
-
-
-Input: head = [1,2,2,1]
-Output: true
-
-
-
Example 2:
-
-
-Input: head = [1,2]
-Output: false
-
-
-
-
Constraints:
-
-
-
The number of nodes in the list is in the range [1, 105].
Given an integer x, return true if x is palindrome integer.
-
-
An integer is a palindrome when it reads the same backward as forward. For example, 121 is palindrome while 123 is not.
-
-
-
Example 1:
-
-
-Input: x = 121
-Output: true
-
-
-
Example 2:
-
-
-Input: x = -121
-Output: false
-Explanation: From left to right, it reads -121. From right to left, it becomes 121-. Therefore it is not a palindrome.
-
-
-
Example 3:
-
-
-Input: x = 10
-Output: false
-Explanation: Reads 01 from right to left. Therefore it is not a palindrome.
-
-
-
Example 4:
-
-
-Input: x = -101
-Output: false
-
-
-
-
Constraints:
-
-
-
-231 <= x <= 231 - 1
-
-
-
-Follow up: Could you solve it without converting the integer to a string?
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
-
-### Similar Questions
- 1. [Palindrome Linked List](../palindrome-linked-list) (Easy)
-
-### Hints
-
-Hint 1
-Beware of overflow when you reverse the integer.
-
diff --git a/problems/palindrome-number/palindrome_number.go b/problems/palindrome-number/palindrome_number.go
deleted file mode 100644
index cd5492197..000000000
--- a/problems/palindrome-number/palindrome_number.go
+++ /dev/null
@@ -1,15 +0,0 @@
-package problem9
-
-func isPalindrome(x int) bool {
- if x < 0 {
- return false
- }
- rx, t := 0, 0
- n := x
- for x != 0 {
- t = rx*10 + x%10
- rx = t
- x /= 10
- }
- return rx == n
-}
diff --git a/problems/palindrome-number/palindrome_number_test.go b/problems/palindrome-number/palindrome_number_test.go
deleted file mode 100644
index 67de9186b..000000000
--- a/problems/palindrome-number/palindrome_number_test.go
+++ /dev/null
@@ -1,27 +0,0 @@
-package problem9
-
-import (
- "math"
- "testing"
-)
-
-func TestIsPalindrome(t *testing.T) {
- tests := map[int]bool{
- 0: true,
- 121: true,
- 12321: true,
- 123321: true,
- -121: false,
- 10: false,
- 100: false,
- 12345: false,
- math.MaxInt32: false,
- }
-
- for in, want := range tests {
- got := isPalindrome(in)
- if got != want {
- t.Fatalf("in: %v, got: %v, want: %v", in, got, want)
- }
- }
-}
diff --git a/problems/palindrome-pairs/README.md b/problems/palindrome-pairs/README.md
deleted file mode 100644
index 05b89368f..000000000
--- a/problems/palindrome-pairs/README.md
+++ /dev/null
@@ -1,58 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../self-crossing "Self Crossing")
-
-[Next >](../house-robber-iii "House Robber III")
-
-## [336. Palindrome Pairs (Hard)](https://leetcode.com/problems/palindrome-pairs "回文对")
-
-
Given a list of unique words, return all the pairs of the distinct indices (i, j) in the given list, so that the concatenation of the two words words[i] + words[j] is a palindrome.
-
-
-
Example 1:
-
-
-Input: words = ["abcd","dcba","lls","s","sssll"]
-Output: [[0,1],[1,0],[3,2],[2,4]]
-Explanation: The palindromes are ["dcbaabcd","abcddcba","slls","llssssll"]
-
-
-
Example 2:
-
-
-Input: words = ["bat","tab","cat"]
-Output: [[0,1],[1,0]]
-Explanation: The palindromes are ["battab","tabbat"]
-
You are given a string s containing lowercase letters and an integer k. You need to :
-
-
-
First, change some characters of s to other lowercase English letters.
-
Then divide s into k non-empty disjoint substrings such that each substring is a palindrome.
-
-
-
Return the minimal number of characters that you need to change to divide the string.
-
-
-
Example 1:
-
-
-Input: s = "abc", k = 2
-Output: 1
-Explanation: You can split the string into "ab" and "c", and change 1 character in "ab" to make it palindrome.
-
-
-
Example 2:
-
-
-Input: s = "aabbc", k = 3
-Output: 0
-Explanation: You can split the string into "aa", "bb" and "c", all of them are palindrome.
-
-
Example 3:
-
-
-Input: s = "leetcode", k = 8
-Output: 0
-
-
-
-
Constraints:
-
-
-
1 <= k <= s.length <= 100.
-
s only contains lowercase English letters.
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Similar Questions
- 1. [Palindrome Partitioning IV](../palindrome-partitioning-iv) (Hard)
-
-### Hints
-
-Hint 1
-For each substring calculate the minimum number of steps to make it palindrome and store it in a table.
-
-
-
-Hint 2
-Create a dp(pos, cnt) which means the minimum number of characters changed for the suffix of s starting on pos splitting the suffix on cnt chunks.
-
diff --git a/problems/palindrome-partitioning-iv/README.md b/problems/palindrome-partitioning-iv/README.md
deleted file mode 100644
index 360b484e8..000000000
--- a/problems/palindrome-partitioning-iv/README.md
+++ /dev/null
@@ -1,56 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../can-you-eat-your-favorite-candy-on-your-favorite-day "Can You Eat Your Favorite Candy on Your Favorite Day?")
-
-[Next >](../maximum-subarray-sum-after-one-operation "Maximum Subarray Sum After One Operation")
-
-## [1745. Palindrome Partitioning IV (Hard)](https://leetcode.com/problems/palindrome-partitioning-iv "回文串分割 IV")
-
-
Given a string s, return trueif it is possible to split the stringsinto three non-empty palindromic substrings. Otherwise, return false.
-
-
A string is said to be palindrome if it the same string when reversed.
-
-
-
Example 1:
-
-
-Input: s = "abcbdd"
-Output: true
-Explanation: "abcbdd" = "a" + "bcb" + "dd", and all three substrings are palindromes.
-
-
-
Example 2:
-
-
-Input: s = "bcbddxy"
-Output: false
-Explanation: s cannot be split into 3 palindromes.
-
-
-
-
Constraints:
-
-
-
3 <= s.length <= 2000
-
s consists only of lowercase English letters.
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Hints
-
-Hint 1
-Preprocess checking palindromes in O(1)
-
-
-
-Hint 2
-Note that one string is a prefix and another one is a suffix you can try brute forcing the rest
-
diff --git a/problems/palindrome-partitioning/README.md b/problems/palindrome-partitioning/README.md
deleted file mode 100644
index 22a3c6719..000000000
--- a/problems/palindrome-partitioning/README.md
+++ /dev/null
@@ -1,40 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../surrounded-regions "Surrounded Regions")
-
-[Next >](../palindrome-partitioning-ii "Palindrome Partitioning II")
-
-## [131. Palindrome Partitioning (Medium)](https://leetcode.com/problems/palindrome-partitioning "分割回文串")
-
-
Given a string s, partition s such that every substring of the partition is a palindrome. Return all possible palindrome partitioning of s.
-
-
A palindrome string is a string that reads the same backward as forward.
-
-
-
Example 1:
-
Input: s = "aab"
-Output: [["a","a","b"],["aa","b"]]
-
Given a string s, return all the palindromic permutations (without duplicates) of it. Return an empty list if no palindromic permutation could be form.
-
-
Example 1:
-
-
Input:"aabb"
-Output:["abba", "baab"]
-
-
Example 2:
-
-
Input:"abc"
-Output:[]
-
-### Related Topics
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
- [[Backtracking](../../tag/backtracking/README.md)]
-
-### Similar Questions
- 1. [Next Permutation](../next-permutation) (Medium)
- 1. [Permutations II](../permutations-ii) (Medium)
- 1. [Palindrome Permutation](../palindrome-permutation) (Easy)
-
-### Hints
-
-Hint 1
-If a palindromic permutation exists, we just need to generate the first half of the string.
-
-
-
-Hint 2
-To generate all distinct permutations of a (half of) string, use a similar approach from: Permutations II or Next Permutation.
-
diff --git a/problems/palindrome-permutation-ii/palindrome_permutation_ii.go b/problems/palindrome-permutation-ii/palindrome_permutation_ii.go
deleted file mode 100644
index 1f171637f..000000000
--- a/problems/palindrome-permutation-ii/palindrome_permutation_ii.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem267
diff --git a/problems/palindrome-permutation-ii/palindrome_permutation_ii_test.go b/problems/palindrome-permutation-ii/palindrome_permutation_ii_test.go
deleted file mode 100644
index 1f171637f..000000000
--- a/problems/palindrome-permutation-ii/palindrome_permutation_ii_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem267
diff --git a/problems/palindrome-permutation/README.md b/problems/palindrome-permutation/README.md
deleted file mode 100644
index 26442c494..000000000
--- a/problems/palindrome-permutation/README.md
+++ /dev/null
@@ -1,56 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../paint-house-ii "Paint House II")
-
-[Next >](../palindrome-permutation-ii "Palindrome Permutation II")
-
-## [266. Palindrome Permutation (Easy)](https://leetcode.com/problems/palindrome-permutation "回文排列")
-
-
Given a string, determine if a permutation of the string could form a palindrome.
-
-
Example 1:
-
-
Input:"code"
-Output: false
-
-
Example 2:
-
-
Input:"aab"
-Output: true
-
-
Example 3:
-
-
Input:"carerac"
-Output: true
-
-### Related Topics
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
- [[Bit Manipulation](../../tag/bit-manipulation/README.md)]
-
-### Similar Questions
- 1. [Longest Palindromic Substring](../longest-palindromic-substring) (Medium)
- 1. [Valid Anagram](../valid-anagram) (Easy)
- 1. [Palindrome Permutation II](../palindrome-permutation-ii) (Medium)
- 1. [Longest Palindrome](../longest-palindrome) (Easy)
-
-### Hints
-
-Hint 1
-Consider the palindromes of odd vs even length. What difference do you notice?
-
-
-
-Hint 2
-Count the frequency of each character.
-
-
-
-Hint 3
-If each character occurs even number of times, then it must be a palindrome. How about character which occurs odd number of times?
-
diff --git a/problems/palindrome-permutation/palindrome_permutation.go b/problems/palindrome-permutation/palindrome_permutation.go
deleted file mode 100644
index 05c029670..000000000
--- a/problems/palindrome-permutation/palindrome_permutation.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem266
diff --git a/problems/palindrome-permutation/palindrome_permutation_test.go b/problems/palindrome-permutation/palindrome_permutation_test.go
deleted file mode 100644
index 05c029670..000000000
--- a/problems/palindrome-permutation/palindrome_permutation_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem266
diff --git a/problems/palindrome-removal/README.md b/problems/palindrome-removal/README.md
deleted file mode 100644
index f7b82a429..000000000
--- a/problems/palindrome-removal/README.md
+++ /dev/null
@@ -1,60 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../tree-diameter "Tree Diameter")
-
-[Next >](../minimum-swaps-to-make-strings-equal "Minimum Swaps to Make Strings Equal")
-
-## [1246. Palindrome Removal (Hard)](https://leetcode.com/problems/palindrome-removal "删除回文子数组")
-
-
Given an integer array arr, in one move you can select a palindromic subarray arr[i], arr[i+1], ..., arr[j] where i <= j, and remove that subarray from the given array. Note that after removing a subarray, the elements on the left and on the right of that subarray move to fill the gap left by the removal.
-
-
Return the minimum number of moves needed to remove all numbers from the array.
-
-
-
Example 1:
-
-
-Input: arr = [1,2]
-Output: 2
-
-
-
Example 2:
-
-
-Input: arr = [1,3,4,1,5]
-Output: 3
-Explanation: Remove [4] then remove [1,3,1] then remove [5].
-
-
-
-
Constraints:
-
-
-
1 <= arr.length <= 100
-
1 <= arr[i] <= 20
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Hints
-
-Hint 1
-Use dynamic programming.
-
-
-
-Hint 2
-Let dp[i][j] be the solution for the sub-array from index i to index j.
-
-
-
-Hint 3
-Notice that if we have S[i] == S[j] one transition could be just dp(i + 1, j + 1) because in the last turn we would have a palindrome and we can extend this palindrome from both sides, the other transitions are not too difficult to deduce.
-
diff --git a/problems/palindromic-substrings/README.md b/problems/palindromic-substrings/README.md
deleted file mode 100644
index 878a0a02e..000000000
--- a/problems/palindromic-substrings/README.md
+++ /dev/null
@@ -1,69 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-length-of-pair-chain "Maximum Length of Pair Chain")
-
-[Next >](../replace-words "Replace Words")
-
-## [647. Palindromic Substrings (Medium)](https://leetcode.com/problems/palindromic-substrings "回文子串")
-
-
Given a string s, return the number of palindromic substrings in it.
-
-
A string is a palindrome when it reads the same backward as forward.
-
-
A substring is a contiguous sequence of characters within the string.
-
-
-
Example 1:
-
-
-Input: s = "abc"
-Output: 3
-Explanation: Three palindromic strings: "a", "b", "c".
-
-
-
Example 2:
-
-
-Input: s = "aaa"
-Output: 6
-Explanation: Six palindromic strings: "a", "a", "a", "aa", "aa", "aaa".
-
-
-
-
Constraints:
-
-
-
1 <= s.length <= 1000
-
s consists of lowercase English letters.
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Similar Questions
- 1. [Longest Palindromic Substring](../longest-palindromic-substring) (Medium)
- 1. [Longest Palindromic Subsequence](../longest-palindromic-subsequence) (Medium)
- 1. [Palindromic Substrings](../palindromic-substrings) (Medium)
-
-### Hints
-
-Hint 1
-How can we reuse a previously computed palindrome to compute a larger palindrome?
-
-
-
-Hint 2
-If “aba” is a palindrome, is “xabax” and palindrome? Similarly is “xabay” a palindrome?
-
-
-
-Hint 3
-Complexity based hint:
-If we use brute-force and check whether for every start and end position a substring is a palindrome we have O(n^2) start - end pairs and O(n) palindromic checks. Can we reduce the time for palindromic checks to O(1) by reusing some previous computation?
-
diff --git a/problems/palindromic-substrings/palindromic_substrings.go b/problems/palindromic-substrings/palindromic_substrings.go
deleted file mode 100644
index 79ac502a8..000000000
--- a/problems/palindromic-substrings/palindromic_substrings.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem647
diff --git a/problems/palindromic-substrings/palindromic_substrings_test.go b/problems/palindromic-substrings/palindromic_substrings_test.go
deleted file mode 100644
index 79ac502a8..000000000
--- a/problems/palindromic-substrings/palindromic_substrings_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem647
diff --git a/problems/pancake-sorting/README.md b/problems/pancake-sorting/README.md
deleted file mode 100644
index 7db0dd175..000000000
--- a/problems/pancake-sorting/README.md
+++ /dev/null
@@ -1,64 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../binary-tree-cameras "Binary Tree Cameras")
-
-[Next >](../powerful-integers "Powerful Integers")
-
-## [969. Pancake Sorting (Medium)](https://leetcode.com/problems/pancake-sorting "煎饼排序")
-
-
Given an array of integers arr, sort the array by performing a series of pancake flips.
-
-
In one pancake flip we do the following steps:
-
-
-
Choose an integer k where 1 <= k <= arr.length.
-
Reverse the sub-array arr[0...k-1] (0-indexed).
-
-
-
For example, if arr = [3,2,1,4] and we performed a pancake flip choosing k = 3, we reverse the sub-array [3,2,1], so arr = [1,2,3,4] after the pancake flip at k = 3.
-
-
Return an array of the k-values corresponding to a sequence of pancake flips that sort arr. Any valid answer that sorts the array within 10 * arr.length flips will be judged as correct.
-Input: arr = [1,2,3]
-Output: []
-Explanation: The input is already sorted, so there is no need to flip anything.
-Note that other answers, such as [3, 3], would also be accepted.
-
-
-
-
Constraints:
-
-
-
1 <= arr.length <= 100
-
1 <= arr[i] <= arr.length
-
All integers in arr are unique (i.e. arr is a permutation of the integers from 1 to arr.length).
-
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Two Pointers](../../tag/two-pointers/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
diff --git a/problems/pancake-sorting/pancake_sorting.go b/problems/pancake-sorting/pancake_sorting.go
deleted file mode 100644
index a7846f90f..000000000
--- a/problems/pancake-sorting/pancake_sorting.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem969
diff --git a/problems/parallel-courses-ii/README.md b/problems/parallel-courses-ii/README.md
deleted file mode 100644
index f3ace5883..000000000
--- a/problems/parallel-courses-ii/README.md
+++ /dev/null
@@ -1,84 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../longest-subarray-of-1s-after-deleting-one-element "Longest Subarray of 1's After Deleting One Element")
-
-[Next >](../friendly-movies-streamed-last-month "Friendly Movies Streamed Last Month")
-
-## [1494. Parallel Courses II (Hard)](https://leetcode.com/problems/parallel-courses-ii "并行课程 II")
-
-
You are given an integer n, which indicates that there are n courses labeled from 1 to n. You are also given an array relations where relations[i] = [prevCoursei, nextCoursei], representing a prerequisite relationship between course prevCoursei and course nextCoursei: course prevCoursei has to be taken before course nextCoursei. Also, you are given the integer k.
-
-
In one semester, you can take at mostk courses as long as you have taken all the prerequisites in the previous semester for the courses you are taking.
-
-
Return the minimum number of semesters needed to take all courses. The testcases will be generated such that it is possible to take every course.
-
-
-
Example 1:
-
-
-
-
-Input: n = 4, dependencies = [[2,1],[3,1],[1,4]], k = 2
-Output: 3
-Explanation: The figure above represents the given graph.
-In the first semester, you can take courses 2 and 3.
-In the second semester, you can take course 1.
-In the third semester, you can take course 4.
-
-
-
Example 2:
-
-
-
-
-Input: n = 5, dependencies = [[2,1],[3,1],[4,1],[1,5]], k = 2
-Output: 4
-Explanation: The figure above represents the given graph.
-In the first semester, you can take courses 2 and 3 only since you cannot take more than two per semester.
-In the second semester, you can take course 4.
-In the third semester, you can take course 1.
-In the fourth semester, you can take course 5.
-
-
-
Example 3:
-
-
-Input: n = 11, dependencies = [], k = 2
-Output: 6
-
-
-
-
Constraints:
-
-
-
1 <= n <= 15
-
1 <= k <= n
-
0 <= relations.length <= n * (n-1) / 2
-
relations[i].length == 2
-
1 <= prevCoursei, nextCoursei <= n
-
prevCoursei != nextCoursei
-
All the pairs [prevCoursei, nextCoursei] are unique.
-
The given graph is a directed acyclic graph.
-
-
-### Related Topics
- [[Bit Manipulation](../../tag/bit-manipulation/README.md)]
- [[Graph](../../tag/graph/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Bitmask](../../tag/bitmask/README.md)]
-
-### Hints
-
-Hint 1
-Use backtracking with states (bitmask, degrees) where bitmask represents the set of courses, if the ith bit is 1 then the ith course was taken, otherwise, you can take the ith course. Degrees represent the degree for each course (nodes in the graph).
-
-
-
-Hint 2
-Note that you can only take nodes (courses) with degree = 0 and it is optimal at every step in the backtracking take the maximum number of courses limited by k.
-
diff --git a/problems/parallel-courses-iii/README.md b/problems/parallel-courses-iii/README.md
deleted file mode 100644
index ca6fddca5..000000000
--- a/problems/parallel-courses-iii/README.md
+++ /dev/null
@@ -1,88 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../count-nodes-with-the-highest-score "Count Nodes With the Highest Score")
-
-[Next >](../the-category-of-each-member-in-the-store "The Category of Each Member in the Store")
-
-## [2050. Parallel Courses III (Hard)](https://leetcode.com/problems/parallel-courses-iii "并行课程 III")
-
-
You are given an integer n, which indicates that there are n courses labeled from 1 to n. You are also given a 2D integer array relations where relations[j] = [prevCoursej, nextCoursej] denotes that course prevCoursej has to be completed before course nextCoursej (prerequisite relationship). Furthermore, you are given a 0-indexed integer array time where time[i] denotes how many months it takes to complete the (i+1)th course.
-
-
You must find the minimum number of months needed to complete all the courses following these rules:
-
-
-
You may start taking a course at any time if the prerequisites are met.
-
Any number of courses can be taken at the same time.
-
-
-
Return the minimum number of months needed to complete all the courses.
-
-
Note: The test cases are generated such that it is possible to complete every course (i.e., the graph is a directed acyclic graph).
-
-
-
Example 1:
-
-
-
-Input: n = 3, relations = [[1,3],[2,3]], time = [3,2,5]
-Output: 8
-Explanation: The figure above represents the given graph and the time required to complete each course.
-We start course 1 and course 2 simultaneously at month 0.
-Course 1 takes 3 months and course 2 takes 2 months to complete respectively.
-Thus, the earliest time we can start course 3 is at month 3, and the total time required is 3 + 5 = 8 months.
-
-
-
Example 2:
-
-
-
-Input: n = 5, relations = [[1,5],[2,5],[3,5],[3,4],[4,5]], time = [1,2,3,4,5]
-Output: 12
-Explanation: The figure above represents the given graph and the time required to complete each course.
-You can start courses 1, 2, and 3 at month 0.
-You can complete them after 1, 2, and 3 months respectively.
-Course 4 can be taken only after course 3 is completed, i.e., after 3 months. It is completed after 3 + 4 = 7 months.
-Course 5 can be taken only after courses 1, 2, 3, and 4 have been completed, i.e., after max(1,2,3,7) = 7 months.
-Thus, the minimum time needed to complete all the courses is 7 + 5 = 12 months.
-
All the pairs [prevCoursej, nextCoursej] are unique.
-
time.length == n
-
1 <= time[i] <= 104
-
The given graph is a directed acyclic graph.
-
-
-### Related Topics
- [[Graph](../../tag/graph/README.md)]
- [[Topological Sort](../../tag/topological-sort/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Hints
-
-Hint 1
-What is the earliest time a course can be taken?
-
-
-
-Hint 2
-How would you solve the problem if all courses take equal time?
-
-
-
-Hint 3
-How would you generalize this approach?
-
diff --git a/problems/parallel-courses/README.md b/problems/parallel-courses/README.md
deleted file mode 100644
index ce0d249ab..000000000
--- a/problems/parallel-courses/README.md
+++ /dev/null
@@ -1,75 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../connecting-cities-with-minimum-cost "Connecting Cities With Minimum Cost")
-
-[Next >](../n-th-tribonacci-number "N-th Tribonacci Number")
-
-## [1136. Parallel Courses (Medium)](https://leetcode.com/problems/parallel-courses "平行课程")
-
-
There are N courses, labelled from 1 to N.
-
-
We are given relations[i] = [X, Y], representing a prerequisite relationship between course X and course Y: course X has to be studied before course Y.
-
-
In one semester you can study any number of courses as long as you have studied all the prerequisites for the course you are studying.
-
-
Return the minimum number of semesters needed to study all courses. If there is no way to study all the courses, return -1.
-
-
-
-
Example 1:
-
-
-
-
-Input: N = 3, relations = [[1,3],[2,3]]
-Output: 2
-Explanation:
-In the first semester, courses 1 and 2 are studied. In the second semester, course 3 is studied.
-
-
-
Example 2:
-
-
-
-
-Input: N = 3, relations = [[1,2],[2,3],[3,1]]
-Output: -1
-Explanation:
-No course can be studied because they depend on each other.
-
-
-
-
-
Note:
-
-
-
1 <= N <= 5000
-
1 <= relations.length <= 5000
-
relations[i][0] != relations[i][1]
-
There are no repeated relations in the input.
-
-
-### Related Topics
- [[Graph](../../tag/graph/README.md)]
- [[Topological Sort](../../tag/topological-sort/README.md)]
-
-### Hints
-
-Hint 1
-Try to think of it as a graph problem. It will be impossible to study all the courses if the graph had a cycle.
-
-
-
-Hint 2
-The graph is a directed acyclic graph (DAG). The answer is the longes path in this DAG.
-
-
-
-Hint 3
-You can use DP to find the longest path in the DAG.
-
diff --git a/problems/parse-lisp-expression/README.md b/problems/parse-lisp-expression/README.md
deleted file mode 100644
index e75e66ef0..000000000
--- a/problems/parse-lisp-expression/README.md
+++ /dev/null
@@ -1,107 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../asteroid-collision "Asteroid Collision")
-
-[Next >](../sentence-similarity-ii "Sentence Similarity II")
-
-## [736. Parse Lisp Expression (Hard)](https://leetcode.com/problems/parse-lisp-expression "Lisp 语法解析")
-
-
You are given a string expression representing a Lisp-like expression to return the integer value of.
-
-
The syntax for these expressions is given as follows.
-
-
-
An expression is either an integer, let expression, add expression, mult expression, or an assigned variable. Expressions always evaluate to a single integer.
-
(An integer could be positive or negative.)
-
A let expression takes the form "(let v1 e1 v2 e2 ... vn en expr)", where let is always the string "let", then there are one or more pairs of alternating variables and expressions, meaning that the first variable v1 is assigned the value of the expression e1, the second variable v2 is assigned the value of the expression e2, and so on sequentially; and then the value of this let expression is the value of the expression expr.
-
An add expression takes the form "(add e1 e2)" where add is always the string "add", there are always two expressions e1, e2 and the result is the addition of the evaluation of e1 and the evaluation of e2.
-
A mult expression takes the form "(mult e1 e2)" where mult is always the string "mult", there are always two expressions e1, e2 and the result is the multiplication of the evaluation of e1 and the evaluation of e2.
-
For this question, we will use a smaller subset of variable names. A variable starts with a lowercase letter, then zero or more lowercase letters or digits. Additionally, for your convenience, the names "add", "let", and "mult" are protected and will never be used as variable names.
-
Finally, there is the concept of scope. When an expression of a variable name is evaluated, within the context of that evaluation, the innermost scope (in terms of parentheses) is checked first for the value of that variable, and then outer scopes are checked sequentially. It is guaranteed that every expression is legal. Please see the examples for more details on the scope.
-
-
-
-
Example 1:
-
-
-Input: expression = "(let x 2 (mult x (let x 3 y 4 (add x y))))"
-Output: 14
-Explanation: In the expression (add x y), when checking for the value of the variable x,
-we check from the innermost scope to the outermost in the context of the variable we are trying to evaluate.
-Since x = 3 is found first, the value of x is 3.
-
-
-
Example 2:
-
-
-Input: expression = "(let x 3 x 2 x)"
-Output: 2
-Explanation: Assignment in let statements is processed sequentially.
-
-
-
Example 3:
-
-
-Input: expression = "(let x 1 y 2 x (add x y) (add x y))"
-Output: 5
-Explanation: The first (add x y) evaluates as 3, and is assigned to x.
-The second (add x y) evaluates as 3+2 = 5.
-
-
-
Example 4:
-
-
-Input: expression = "(let x 2 (add (let x 3 (let x 4 x)) x))"
-Output: 6
-Explanation: Even though (let x 4 x) has a deeper scope, it is outside the context
-of the final x in the add-expression. That final x will equal 2.
-
-
-
Example 5:
-
-
-Input: expression = "(let a1 3 b2 (add a1 1) b2)"
-Output: 4
-Explanation: Variable names can contain digits after the first character.
-
-
-
-
Constraints:
-
-
-
1 <= expression.length <= 2000
-
There are no leading or trailing spaces in exprssion.
-
All tokens are separated by a single space in expressoin.
-
The answer and all intermediate calculations of that answer are guaranteed to fit in a 32-bit integer.
-
The expression is guaranteed to be legal and evaluate to an integer.
-
-
-### Related Topics
- [[Stack](../../tag/stack/README.md)]
- [[Recursion](../../tag/recursion/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Similar Questions
- 1. [Ternary Expression Parser](../ternary-expression-parser) (Medium)
- 1. [Number of Atoms](../number-of-atoms) (Hard)
- 1. [Basic Calculator IV](../basic-calculator-iv) (Hard)
-
-### Hints
-
-Hint 1
-* If the expression starts with a digit or '-', it's an integer: return it.
-
-* If the expression starts with a letter, it's a variable. Recall it by checking the current scope in reverse order.
-
-* Otherwise, group the tokens (variables or expressions) within this expression by counting the "balance" `bal` of the occurrences of `'('` minus the number of occurrences of `')'`. When the balance is zero, we have ended a token. For example, `(add 1 (add 2 3))` should have tokens `'1'` and `'(add 2 3)'`.
-
-* For add and mult expressions, evaluate each token and return the addition or multiplication of them.
-
-* For let expressions, evaluate each expression sequentially and assign it to the variable in the current scope, then return the evaluation of the final expression.
-
diff --git a/problems/parse-lisp-expression/parse_lisp_expression.go b/problems/parse-lisp-expression/parse_lisp_expression.go
deleted file mode 100644
index 7acc7ad61..000000000
--- a/problems/parse-lisp-expression/parse_lisp_expression.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem736
diff --git a/problems/parse-lisp-expression/parse_lisp_expression_test.go b/problems/parse-lisp-expression/parse_lisp_expression_test.go
deleted file mode 100644
index 7acc7ad61..000000000
--- a/problems/parse-lisp-expression/parse_lisp_expression_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem736
diff --git a/problems/parsing-a-boolean-expression/README.md b/problems/parsing-a-boolean-expression/README.md
deleted file mode 100644
index 9ab927c3f..000000000
--- a/problems/parsing-a-boolean-expression/README.md
+++ /dev/null
@@ -1,73 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../filling-bookcase-shelves "Filling Bookcase Shelves")
-
-[Next >](../new-users-daily-count "New Users Daily Count")
-
-## [1106. Parsing A Boolean Expression (Hard)](https://leetcode.com/problems/parsing-a-boolean-expression "解析布尔表达式")
-
-
Return the result of evaluating a given boolean expression, represented as a string.
-
-
An expression can either be:
-
-
-
"t", evaluating to True;
-
"f", evaluating to False;
-
"!(expr)", evaluating to the logical NOT of the inner expression expr;
-
"&(expr1,expr2,...)", evaluating to the logical AND of 2 or more inner expressions expr1, expr2, ...;
-
"|(expr1,expr2,...)", evaluating to the logical OR of 2 or more inner expressions expr1, expr2, ...
expression[i] consists of characters in {'(', ')', '&', '|', '!', 't', 'f', ','}.
-
expression is a valid expression representing a boolean, as given in the description.
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
- [[Stack](../../tag/stack/README.md)]
- [[Recursion](../../tag/recursion/README.md)]
-
-### Hints
-
-Hint 1
-Write a function "parse" which calls helper functions "parse_or", "parse_and", "parse_not".
-
diff --git a/problems/parsing-a-boolean-expression/parsing_a_boolean_expression.go b/problems/parsing-a-boolean-expression/parsing_a_boolean_expression.go
deleted file mode 100644
index d03249a3f..000000000
--- a/problems/parsing-a-boolean-expression/parsing_a_boolean_expression.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem1106
diff --git a/problems/partition-array-according-to-given-pivot/README.md b/problems/partition-array-according-to-given-pivot/README.md
deleted file mode 100644
index c058a818e..000000000
--- a/problems/partition-array-according-to-given-pivot/README.md
+++ /dev/null
@@ -1,74 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-sum-of-four-digit-number-after-splitting-digits "Minimum Sum of Four Digit Number After Splitting Digits")
-
-[Next >](../minimum-cost-to-set-cooking-time "Minimum Cost to Set Cooking Time")
-
-## [2161. Partition Array According to Given Pivot (Medium)](https://leetcode.com/problems/partition-array-according-to-given-pivot "根据给定数字划分数组")
-
-
You are given a 0-indexed integer array nums and an integer pivot. Rearrange nums such that the following conditions are satisfied:
-
-
-
Every element less than pivot appears before every element greater than pivot.
-
Every element equal to pivot appears in between the elements less than and greater than pivot.
-
The relative order of the elements less than pivot and the elements greater than pivot is maintained.
-
-
More formally, consider every pi, pj where pi is the new position of the ith element and pj is the new position of the jth element. For elements less than pivot, if i < j and nums[i] < pivot and nums[j] < pivot, then pi < pj. Similarly for elements greater than pivot, if i < j and nums[i] > pivot and nums[j] > pivot, then pi < pj.
-
-
-
-
-
Return nums after the rearrangement.
-
-
-
Example 1:
-
-
-Input: nums = [9,12,5,10,14,3,10], pivot = 10
-Output: [9,5,3,10,10,12,14]
-Explanation:
-The elements 9, 5, and 3 are less than the pivot so they are on the left side of the array.
-The elements 12 and 14 are greater than the pivot so they are on the right side of the array.
-The relative ordering of the elements less than and greater than pivot is also maintained. [9, 5, 3] and [12, 14] are the respective orderings.
-
-
-
Example 2:
-
-
-Input: nums = [-3,4,3,2], pivot = 2
-Output: [-3,2,4,3]
-Explanation:
-The element -3 is less than the pivot so it is on the left side of the array.
-The elements 4 and 3 are greater than the pivot so they are on the right side of the array.
-The relative ordering of the elements less than and greater than pivot is also maintained. [-3] and [4, 3] are the respective orderings.
-
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 105
-
-106 <= nums[i] <= 106
-
pivot equals to an element of nums.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Two Pointers](../../tag/two-pointers/README.md)]
- [[Simulation](../../tag/simulation/README.md)]
-
-### Hints
-
-Hint 1
-Could you put the elements smaller than the pivot and greater than the pivot in a separate list as in the sequence that they occur?
-
-
-
-Hint 2
-With the separate lists generated, could you then generate the result?
-
diff --git a/problems/partition-array-for-maximum-sum/README.md b/problems/partition-array-for-maximum-sum/README.md
deleted file mode 100644
index 0822d49cc..000000000
--- a/problems/partition-array-for-maximum-sum/README.md
+++ /dev/null
@@ -1,63 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../flower-planting-with-no-adjacent "Flower Planting With No Adjacent")
-
-[Next >](../longest-duplicate-substring "Longest Duplicate Substring")
-
-## [1043. Partition Array for Maximum Sum (Medium)](https://leetcode.com/problems/partition-array-for-maximum-sum "分隔数组以得到最大和")
-
-
Given an integer array arr, partition the array into (contiguous) subarrays of length at mostk. After partitioning, each subarray has their values changed to become the maximum value of that subarray.
-
-
Return the largest sum of the given array after partitioning. Test cases are generated so that the answer fits in a 32-bit integer.
-Input: arr = [1,4,1,5,7,3,6,1,9,9,3], k = 4
-Output: 83
-
-
-
Example 3:
-
-
-Input: arr = [1], k = 1
-Output: 1
-
-
-
-
Constraints:
-
-
-
1 <= arr.length <= 500
-
0 <= arr[i] <= 109
-
1 <= k <= arr.length
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Hints
-
-Hint 1
-Think dynamic programming: dp[i] will be the answer for array A[0], ..., A[i-1].
-
-
-
-Hint 2
-For j = 1 .. k that keeps everything in bounds, dp[i] is the maximum of dp[i-j] + max(A[i-1], ..., A[i-j]) * j .
-
diff --git a/problems/partition-array-for-maximum-sum/partition_array_for_maximum_sum.go b/problems/partition-array-for-maximum-sum/partition_array_for_maximum_sum.go
deleted file mode 100644
index ccff295e8..000000000
--- a/problems/partition-array-for-maximum-sum/partition_array_for_maximum_sum.go
+++ /dev/null
@@ -1,23 +0,0 @@
-package problem1043
-
-func maxSumAfterPartitioning(A []int, K int) int {
- n := len(A)
- dp := make([]int, n+1)
- // A's length grows up from 1 to n
- for l := 1; l <= n; l++ {
- m := 0 // max value of last k items in A[:l]
- for k := 1; k <= K && 0 <= l-k; k++ {
- m = max(m, A[l-k])
- sum := dp[l-k] + m*k
- dp[l] = max(dp[l], sum)
- }
- }
- return dp[n]
-}
-
-func max(a, b int) int {
- if a > b {
- return a
- }
- return b
-}
diff --git a/problems/partition-array-into-disjoint-intervals/README.md b/problems/partition-array-into-disjoint-intervals/README.md
deleted file mode 100644
index 5a1693ed6..000000000
--- a/problems/partition-array-into-disjoint-intervals/README.md
+++ /dev/null
@@ -1,56 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../x-of-a-kind-in-a-deck-of-cards "X of a Kind in a Deck of Cards")
-
-[Next >](../word-subsets "Word Subsets")
-
-## [915. Partition Array into Disjoint Intervals (Medium)](https://leetcode.com/problems/partition-array-into-disjoint-intervals "分割数组")
-
-
Given an integer array nums, partition it into two (contiguous) subarrays left and right so that:
-
-
-
Every element in left is less than or equal to every element in right.
-
left and right are non-empty.
-
left has the smallest possible size.
-
-
-
Return the length of left after such a partitioning.
-
-
Test cases are generated such that partitioning exists.
-
-
-
Example 1:
-
-
-Input: nums = [5,0,3,8,6]
-Output: 3
-Explanation: left = [5,0,3], right = [8,6]
-
-
-
Example 2:
-
-
-Input: nums = [1,1,1,0,6,12]
-Output: 4
-Explanation: left = [1,1,1,0], right = [6,12]
-
-
-
-
Constraints:
-
-
-
2 <= nums.length <= 105
-
0 <= nums[i] <= 106
-
There is at least one valid answer for the given input.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
-
-### Similar Questions
- 1. [Sum of Beauty in the Array](../sum-of-beauty-in-the-array) (Medium)
diff --git a/problems/partition-array-into-disjoint-intervals/partition_array_into_disjoint_intervals.go b/problems/partition-array-into-disjoint-intervals/partition_array_into_disjoint_intervals.go
deleted file mode 100644
index 57c0c2bef..000000000
--- a/problems/partition-array-into-disjoint-intervals/partition_array_into_disjoint_intervals.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem915
diff --git a/problems/partition-array-into-disjoint-intervals/partition_array_into_disjoint_intervals_test.go b/problems/partition-array-into-disjoint-intervals/partition_array_into_disjoint_intervals_test.go
deleted file mode 100644
index 57c0c2bef..000000000
--- a/problems/partition-array-into-disjoint-intervals/partition_array_into_disjoint_intervals_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem915
diff --git a/problems/partition-array-into-three-parts-with-equal-sum/README.md b/problems/partition-array-into-three-parts-with-equal-sum/README.md
deleted file mode 100644
index 2acd962bb..000000000
--- a/problems/partition-array-into-three-parts-with-equal-sum/README.md
+++ /dev/null
@@ -1,59 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../numbers-with-repeated-digits "Numbers With Repeated Digits")
-
-[Next >](../best-sightseeing-pair "Best Sightseeing Pair")
-
-## [1013. Partition Array Into Three Parts With Equal Sum (Easy)](https://leetcode.com/problems/partition-array-into-three-parts-with-equal-sum "将数组分成和相等的三个部分")
-
-
Given an array of integers arr, return true if we can partition the array into three non-empty parts with equal sums.
-
-
Formally, we can partition the array if we can find indexes i + 1 < j with (arr[0] + arr[1] + ... + arr[i] == arr[i + 1] + arr[i + 2] + ... + arr[j - 1] == arr[j] + arr[j + 1] + ... + arr[arr.length - 1])
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[Array](../../tag/array/README.md)]
-
-### Hints
-
-Hint 1
-If we have three parts with the same sum, what is the sum of each?
-If you can find the first part, can you find the second part?
-
diff --git a/problems/partition-array-into-three-parts-with-equal-sum/partition_array_into_three_parts_with_equal_sum.go b/problems/partition-array-into-three-parts-with-equal-sum/partition_array_into_three_parts_with_equal_sum.go
deleted file mode 100644
index 7e7b08762..000000000
--- a/problems/partition-array-into-three-parts-with-equal-sum/partition_array_into_three_parts_with_equal_sum.go
+++ /dev/null
@@ -1,19 +0,0 @@
-package problem1013
-
-func canThreePartsEqualSum(A []int) bool {
- avg, sum := 0, 0
- for _, v := range A {
- sum += v
- }
- if sum%3 != 0 {
- return false
- }
- avg, sum, count := sum/3, 0, 0
- for _, v := range A {
- sum += v
- if sum == avg {
- count, sum = count+1, 0
- }
- }
- return count == 3
-}
diff --git a/problems/partition-array-into-three-parts-with-equal-sum/partition_array_into_three_parts_with_equal_sum_test.go b/problems/partition-array-into-three-parts-with-equal-sum/partition_array_into_three_parts_with_equal_sum_test.go
deleted file mode 100644
index ff9546982..000000000
--- a/problems/partition-array-into-three-parts-with-equal-sum/partition_array_into_three_parts_with_equal_sum_test.go
+++ /dev/null
@@ -1,39 +0,0 @@
-package problem1013
-
-import "testing"
-
-type testType struct {
- in []int
- want bool
-}
-
-func TestCanThreePartsEqualSum(t *testing.T) {
- tests := [...]testType{
- {
- in: []int{0, 2, 1, -6, 6, -7, 9, 1, 2, 0, 1},
- want: true,
- },
- {
- in: []int{0, 2, 1, -6, 6, 7, 9, -1, 2, 0, 1},
- want: false,
- },
- {
- in: []int{3, 3, 6, 5, -2, 2, 5, 1, -9, 4},
- want: true,
- },
- {
- in: []int{-3, 3, 3, -3},
- want: false,
- },
- {
- in: []int{1, 7, 2, 6, 3, 5, 8},
- want: false,
- },
- }
- for _, tt := range tests {
- got := canThreePartsEqualSum(tt.in)
- if got != tt.want {
- t.Fatalf("in: %v, got: %v, want: %v", tt.in, got, tt.want)
- }
- }
-}
diff --git a/problems/partition-array-into-two-arrays-to-minimize-sum-difference/README.md b/problems/partition-array-into-two-arrays-to-minimize-sum-difference/README.md
deleted file mode 100644
index 2869b4b0e..000000000
--- a/problems/partition-array-into-two-arrays-to-minimize-sum-difference/README.md
+++ /dev/null
@@ -1,83 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../stock-price-fluctuation "Stock Price Fluctuation ")
-
-[Next >](../maximum-alternating-subarray-sum "Maximum Alternating Subarray Sum")
-
-## [2035. Partition Array Into Two Arrays to Minimize Sum Difference (Hard)](https://leetcode.com/problems/partition-array-into-two-arrays-to-minimize-sum-difference "将数组分成两个数组并最小化数组和的差")
-
-
You are given an integer array nums of 2 * n integers. You need to partition nums into two arrays of length n to minimize the absolute difference of the sums of the arrays. To partition nums, put each element of nums into one of the two arrays.
-
-
Return the minimum possible absolute difference.
-
-
-
Example 1:
-
-
-Input: nums = [3,9,7,3]
-Output: 2
-Explanation: One optimal partition is: [3,9] and [7,3].
-The absolute difference between the sums of the arrays is abs((3 + 9) - (7 + 3)) = 2.
-
-
-
Example 2:
-
-
-Input: nums = [-36,36]
-Output: 72
-Explanation: One optimal partition is: [-36] and [36].
-The absolute difference between the sums of the arrays is abs((-36) - (36)) = 72.
-
-
-
Example 3:
-
-
-Input: nums = [2,-1,0,4,-2,-9]
-Output: 0
-Explanation: One optimal partition is: [2,4,-9] and [-1,0,-2].
-The absolute difference between the sums of the arrays is abs((2 + 4 + -9) - (-1 + 0 + -2)) = 0.
-
-
-
-
Constraints:
-
-
-
1 <= n <= 15
-
nums.length == 2 * n
-
-107 <= nums[i] <= 107
-
-
-### Related Topics
- [[Bit Manipulation](../../tag/bit-manipulation/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Two Pointers](../../tag/two-pointers/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Bitmask](../../tag/bitmask/README.md)]
- [[Ordered Set](../../tag/ordered-set/README.md)]
-
-### Hints
-
-Hint 1
-The target sum for the two partitions is sum(nums) / 2.
-
-
-
-Hint 2
-Could you reduce the time complexity if you arbitrarily divide nums into two halves (two arrays)? Meet-in-the-Middle?
-
-
-
-Hint 3
-For both halves, pre-calculate a 2D array where the kth index will store all possible sum values if only k elements from this half are added.
-
-
-
-Hint 4
-For each sum of k elements in the first half, find the best sum of n-k elements in the second half such that the two sums add up to a value closest to the target sum from hint 1. These two subsets will form one array of the partition.
-
diff --git a/problems/partition-equal-subset-sum/README.md b/problems/partition-equal-subset-sum/README.md
deleted file mode 100644
index 691f51958..000000000
--- a/problems/partition-equal-subset-sum/README.md
+++ /dev/null
@@ -1,46 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../add-strings "Add Strings")
-
-[Next >](../pacific-atlantic-water-flow "Pacific Atlantic Water Flow")
-
-## [416. Partition Equal Subset Sum (Medium)](https://leetcode.com/problems/partition-equal-subset-sum "分割等和子集")
-
-
Given a non-empty array nums containing only positive integers, find if the array can be partitioned into two subsets such that the sum of elements in both subsets is equal.
-
-
-
Example 1:
-
-
-Input: nums = [1,5,11,5]
-Output: true
-Explanation: The array can be partitioned as [1, 5, 5] and [11].
-
-
-
Example 2:
-
-
-Input: nums = [1,2,3,5]
-Output: false
-Explanation: The array cannot be partitioned into equal sum subsets.
-
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 200
-
1 <= nums[i] <= 100
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Similar Questions
- 1. [Partition to K Equal Sum Subsets](../partition-to-k-equal-sum-subsets) (Medium)
diff --git a/problems/partition-equal-subset-sum/partition_equal_subset_sum.go b/problems/partition-equal-subset-sum/partition_equal_subset_sum.go
deleted file mode 100644
index 0ed830b00..000000000
--- a/problems/partition-equal-subset-sum/partition_equal_subset_sum.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem416
diff --git a/problems/partition-equal-subset-sum/partition_equal_subset_sum_test.go b/problems/partition-equal-subset-sum/partition_equal_subset_sum_test.go
deleted file mode 100644
index 0ed830b00..000000000
--- a/problems/partition-equal-subset-sum/partition_equal_subset_sum_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem416
diff --git a/problems/partition-labels/README.md b/problems/partition-labels/README.md
deleted file mode 100644
index 760ae0cf3..000000000
--- a/problems/partition-labels/README.md
+++ /dev/null
@@ -1,58 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../prime-number-of-set-bits-in-binary-representation "Prime Number of Set Bits in Binary Representation")
-
-[Next >](../largest-plus-sign "Largest Plus Sign")
-
-## [763. Partition Labels (Medium)](https://leetcode.com/problems/partition-labels "划分字母区间")
-
-
You are given a string s. We want to partition the string into as many parts as possible so that each letter appears in at most one part.
-
-
Return a list of integers representing the size of these parts.
-
-
-
Example 1:
-
-
-Input: s = "ababcbacadefegdehijhklij"
-Output: [9,7,8]
-Explanation:
-The partition is "ababcbaca", "defegde", "hijhklij".
-This is a partition so that each letter appears in at most one part.
-A partition like "ababcbacadefegde", "hijhklij" is incorrect, because it splits s into less parts.
-
-
-
Example 2:
-
-
-Input: s = "eccbbbbdec"
-Output: [10]
-
-
-
-
Constraints:
-
-
-
1 <= s.length <= 500
-
s consists of lowercase English letters.
-
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Two Pointers](../../tag/two-pointers/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Similar Questions
- 1. [Merge Intervals](../merge-intervals) (Medium)
-
-### Hints
-
-Hint 1
-Try to greedily choose the smallest partition that includes the first letter. If you have something like "abaccbdeffed", then you might need to add b. You can use an map like "last['b'] = 5" to help you expand the width of your partition.
-
diff --git a/problems/partition-labels/partition_labels.go b/problems/partition-labels/partition_labels.go
deleted file mode 100644
index 09f8f05ae..000000000
--- a/problems/partition-labels/partition_labels.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem763
diff --git a/problems/partition-labels/partition_labels_test.go b/problems/partition-labels/partition_labels_test.go
deleted file mode 100644
index 09f8f05ae..000000000
--- a/problems/partition-labels/partition_labels_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem763
diff --git a/problems/partition-list/README.md b/problems/partition-list/README.md
deleted file mode 100644
index e212ee33c..000000000
--- a/problems/partition-list/README.md
+++ /dev/null
@@ -1,44 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximal-rectangle "Maximal Rectangle")
-
-[Next >](../scramble-string "Scramble String")
-
-## [86. Partition List (Medium)](https://leetcode.com/problems/partition-list "分隔链表")
-
-
Given the head of a linked list and a value x, partition it such that all nodes less thanx come before nodes greater than or equal to x.
-
-
You should preserve the original relative order of the nodes in each of the two partitions.
-
-
-
Example 1:
-
-
-Input: head = [1,4,3,2,5,2], x = 3
-Output: [1,2,2,4,3,5]
-
-
-
Example 2:
-
-
-Input: head = [2,1], x = 2
-Output: [1,2]
-
-
-
-
Constraints:
-
-
-
The number of nodes in the list is in the range [0, 200].
Given an integer array nums and an integer k, return true if it is possible to divide this array into k non-empty subsets whose sums are all equal.
-
-
-
Example 1:
-
-
-Input: nums = [4,3,2,3,5,2,1], k = 4
-Output: true
-Explanation: It's possible to divide it into 4 subsets (5), (1, 4), (2,3), (2,3) with equal sums.
-
-
-
Example 2:
-
-
-Input: nums = [1,2,3,4], k = 3
-Output: false
-
-
-
-
Constraints:
-
-
-
1 <= k <= nums.length <= 16
-
1 <= nums[i] <= 104
-
The frequency of each element is in the range [1, 4].
-
-
-### Related Topics
- [[Bit Manipulation](../../tag/bit-manipulation/README.md)]
- [[Memoization](../../tag/memoization/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Backtracking](../../tag/backtracking/README.md)]
- [[Bitmask](../../tag/bitmask/README.md)]
-
-### Similar Questions
- 1. [Partition Equal Subset Sum](../partition-equal-subset-sum) (Medium)
-
-### Hints
-
-Hint 1
-We can figure out what target each subset must sum to. Then, let's recursively search, where at each call to our function, we choose which of k subsets the next value will join.
-
diff --git a/problems/partition-to-k-equal-sum-subsets/partition_to_k_equal_sum_subsets.go b/problems/partition-to-k-equal-sum-subsets/partition_to_k_equal_sum_subsets.go
deleted file mode 100644
index 8508b90d5..000000000
--- a/problems/partition-to-k-equal-sum-subsets/partition_to_k_equal_sum_subsets.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem698
diff --git a/problems/partition-to-k-equal-sum-subsets/partition_to_k_equal_sum_subsets_test.go b/problems/partition-to-k-equal-sum-subsets/partition_to_k_equal_sum_subsets_test.go
deleted file mode 100644
index 8508b90d5..000000000
--- a/problems/partition-to-k-equal-sum-subsets/partition_to_k_equal_sum_subsets_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem698
diff --git a/problems/partitioning-into-minimum-number-of-deci-binary-numbers/README.md b/problems/partitioning-into-minimum-number-of-deci-binary-numbers/README.md
deleted file mode 100644
index 3b62f1968..000000000
--- a/problems/partitioning-into-minimum-number-of-deci-binary-numbers/README.md
+++ /dev/null
@@ -1,68 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../count-of-matches-in-tournament "Count of Matches in Tournament")
-
-[Next >](../stone-game-vii "Stone Game VII")
-
-## [1689. Partitioning Into Minimum Number Of Deci-Binary Numbers (Medium)](https://leetcode.com/problems/partitioning-into-minimum-number-of-deci-binary-numbers "十-二进制数的最少数目")
-
-
A decimal number is called deci-binary if each of its digits is either 0 or 1 without any leading zeros. For example, 101 and 1100 are deci-binary, while 112 and 3001 are not.
-
-
Given a string n that represents a positive decimal integer, return the minimum number of positive deci-binary numbers needed so that they sum up to n.
n does not contain any leading zeros and represents a positive integer.
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
- [[Greedy](../../tag/greedy/README.md)]
-
-### Hints
-
-Hint 1
-Think about if the input was only one digit. Then you need to add up as many ones as the value of this digit.
-
-
-
-Hint 2
-If the input has multiple digits, then you can solve for each digit independently, and merge the answers to form numbers that add up to that input.
-
-
-
-Hint 3
-Thus the answer is equal to the max digit.
-
diff --git a/problems/pascals-triangle-ii/README.md b/problems/pascals-triangle-ii/README.md
deleted file mode 100644
index 8817e0ce5..000000000
--- a/problems/pascals-triangle-ii/README.md
+++ /dev/null
@@ -1,44 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../pascals-triangle "Pascal's Triangle")
-
-[Next >](../triangle "Triangle")
-
-## [119. Pascal's Triangle II (Easy)](https://leetcode.com/problems/pascals-triangle-ii "杨辉三角 II")
-
-
Given an integer rowIndex, return the rowIndexth (0-indexed) row of the Pascal's triangle.
-
-
In Pascal's triangle, each number is the sum of the two numbers directly above it as shown:
-
-
-
Example 1:
-
Input: rowIndex = 3
-Output: [1,3,3,1]
-
Example 2:
-
Input: rowIndex = 0
-Output: [1]
-
Example 3:
-
Input: rowIndex = 1
-Output: [1,1]
-
-
-
Constraints:
-
-
-
0 <= rowIndex <= 33
-
-
-
-
Follow up: Could you optimize your algorithm to use only O(rowIndex) extra space?
Given a sorted integer array nums and an integer n, add/patch elements to the array such that any number in the range [1, n] inclusive can be formed by the sum of some elements in the array.
-
-
Return the minimum number of patches required.
-
-
-
Example 1:
-
-
-Input: nums = [1,3], n = 6
-Output: 1
-Explanation:
-Combinations of nums are [1], [3], [1,3], which form possible sums of: 1, 3, 4.
-Now if we add/patch 2 to nums, the combinations are: [1], [2], [3], [1,3], [2,3], [1,2,3].
-Possible sums are 1, 2, 3, 4, 5, 6, which now covers the range [1, 6].
-So we only need 1 patch.
-
-
-
Example 2:
-
-
-Input: nums = [1,5,10], n = 20
-Output: 2
-Explanation: The two patches can be [2, 4].
-
Given a string path, where path[i] = 'N', 'S', 'E' or 'W', each representing moving one unit north, south, east, or west, respectively. You start at the origin (0, 0) on a 2D plane and walk on the path specified by path.
-
-
Return trueif the path crosses itself at any point, that is, if at any time you are on a location you have previously visited. Return false otherwise.
-
-
-
Example 1:
-
-
-Input: path = "NES"
-Output: false
-Explanation: Notice that the path doesn't cross any point more than once.
-
-
-
Example 2:
-
-
-Input: path = "NESWW"
-Output: true
-Explanation: Notice that the path visits the origin twice.
-
-
-
Constraints:
-
-
-
1 <= path.length <= 104
-
path[i] is either 'N', 'S', 'E', or 'W'.
-
-
-### Related Topics
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Hints
-
-Hint 1
-Simulate the process while keeping track of visited points.
-
-
-
-Hint 2
-Use a set to store previously visited points.
-
diff --git a/problems/path-in-zigzag-labelled-binary-tree/README.md b/problems/path-in-zigzag-labelled-binary-tree/README.md
deleted file mode 100644
index 32eb5c01b..000000000
--- a/problems/path-in-zigzag-labelled-binary-tree/README.md
+++ /dev/null
@@ -1,53 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../distribute-candies-to-people "Distribute Candies to People")
-
-[Next >](../filling-bookcase-shelves "Filling Bookcase Shelves")
-
-## [1104. Path In Zigzag Labelled Binary Tree (Medium)](https://leetcode.com/problems/path-in-zigzag-labelled-binary-tree "二叉树寻路")
-
-
In an infinite binary tree where every node has two children, the nodes are labelled in row order.
-
-
In the odd numbered rows (ie., the first, third, fifth,...), the labelling is left to right, while in the even numbered rows (second, fourth, sixth,...), the labelling is right to left.
-
-
-
-
Given the label of a node in this tree, return the labels in the path from the root of the tree to the node with that label.
-
-
-
Example 1:
-
-
-Input: label = 14
-Output: [1,3,4,14]
-
-
-
Example 2:
-
-
-Input: label = 26
-Output: [1,2,6,10,26]
-
-
-
-
Constraints:
-
-
-
1 <= label <= 10^6
-
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
- [[Tree](../../tag/tree/README.md)]
- [[Binary Tree](../../tag/binary-tree/README.md)]
-
-### Hints
-
-Hint 1
-Based on the label of the current node, find what the label must be for the parent of that node.
-
diff --git a/problems/path-in-zigzag-labelled-binary-tree/path_in_zigzag_labelled_binary_tree.go b/problems/path-in-zigzag-labelled-binary-tree/path_in_zigzag_labelled_binary_tree.go
deleted file mode 100644
index eff4b25ad..000000000
--- a/problems/path-in-zigzag-labelled-binary-tree/path_in_zigzag_labelled_binary_tree.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem1104
diff --git a/problems/path-sum-ii/README.md b/problems/path-sum-ii/README.md
deleted file mode 100644
index 50e88d874..000000000
--- a/problems/path-sum-ii/README.md
+++ /dev/null
@@ -1,62 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../path-sum "Path Sum")
-
-[Next >](../flatten-binary-tree-to-linked-list "Flatten Binary Tree to Linked List")
-
-## [113. Path Sum II (Medium)](https://leetcode.com/problems/path-sum-ii "路径总和 II")
-
-
Given the root of a binary tree and an integer targetSum, return all root-to-leaf paths where the sum of the node values in the path equals targetSum. Each path should be returned as a list of the node values, not node references.
-
-
A root-to-leaf path is a path starting from the root and ending at any leaf node. A leaf is a node with no children.
-
-
-
Example 1:
-
-
-Input: root = [5,4,8,11,null,13,4,7,2,null,null,5,1], targetSum = 22
-Output: [[5,4,11,2],[5,8,4,5]]
-Explanation: There are two paths whose sum equals targetSum:
-5 + 4 + 11 + 2 = 22
-5 + 8 + 4 + 5 = 22
-
The number of nodes in the tree is in the range [0, 1000].
-
-109 <= Node.val <= 109
-
-1000 <= targetSum <= 1000
-
-
-### Related Topics
- [[Tree](../../tag/tree/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Binary Tree](../../tag/binary-tree/README.md)]
-
-### Similar Questions
- 1. [Path Sum](../path-sum) (Easy)
- 1. [Path Sum II](../path-sum-ii) (Medium)
- 1. [Path Sum IV](../path-sum-iv) (Medium)
- 1. [Longest Univalue Path](../longest-univalue-path) (Medium)
diff --git a/problems/path-sum-iii/path_sum_iii.go b/problems/path-sum-iii/path_sum_iii.go
deleted file mode 100644
index c096c6c56..000000000
--- a/problems/path-sum-iii/path_sum_iii.go
+++ /dev/null
@@ -1,33 +0,0 @@
-package problem437
-
-import "github.com/awesee/leetcode/internal/kit"
-
-// TreeNode - Definition for a binary tree node.
-type TreeNode = kit.TreeNode
-
-/**
- * Definition for a binary tree node.
- * type TreeNode struct {
- * Val int
- * Left *TreeNode
- * Right *TreeNode
- * }
- */
-func pathSum(root *TreeNode, sum int) int {
- if root == nil {
- return 0
- }
- return findPath(root, sum) + pathSum(root.Left, sum) + pathSum(root.Right, sum)
-}
-
-func findPath(root *TreeNode, sum int) int {
- r := 0
- if root == nil {
- return 0
- } else if root.Val == sum {
- r++
- }
- r += findPath(root.Left, sum-root.Val)
- r += findPath(root.Right, sum-root.Val)
- return r
-}
diff --git a/problems/path-sum-iii/path_sum_iii_test.go b/problems/path-sum-iii/path_sum_iii_test.go
deleted file mode 100644
index 63bfddee1..000000000
--- a/problems/path-sum-iii/path_sum_iii_test.go
+++ /dev/null
@@ -1,30 +0,0 @@
-package problem437
-
-import (
- "testing"
-
- "github.com/awesee/leetcode/internal/kit"
-)
-
-type testType struct {
- in []int
- sum int
- want int
-}
-
-func TestPathSum(t *testing.T) {
- tests := [...]testType{
- {
- in: []int{10, 5, -3, 3, 2, kit.NULL, 11, 3, -2, kit.NULL, 1},
- sum: 8,
- want: 3,
- },
- }
- for _, tt := range tests {
- root := kit.SliceInt2TreeNode(tt.in)
- got := pathSum(root, tt.sum)
- if got != tt.want {
- t.Fatalf("in: %v, got: %v, want: %v", tt.in, got, tt.want)
- }
- }
-}
diff --git a/problems/path-sum-iv/README.md b/problems/path-sum-iv/README.md
deleted file mode 100644
index d0052c494..000000000
--- a/problems/path-sum-iv/README.md
+++ /dev/null
@@ -1,68 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../non-decreasing-array "Non-decreasing Array")
-
-[Next >](../beautiful-arrangement-ii "Beautiful Arrangement II")
-
-## [666. Path Sum IV (Medium)](https://leetcode.com/problems/path-sum-iv "路径总和 IV")
-
-
If the depth of a tree is smaller than 5, then this tree can be represented by a list of three-digits integers.
-
-
For each integer in this list:
-
-
-
The hundreds digit represents the depth D of this node, 1 <= D <= 4.
-
The tens digit represents the position P of this node in the level it belongs to, 1 <= P <= 8. The position is the same as that in a full binary tree.
-
The units digit represents the value V of this node, 0 <= V <= 9.
-
-
-
-
-
Given a list of ascending three-digits integers representing a binary tree with the depth smaller than 5, you need to return the sum of all paths from the root towards the leaves.
-
-
Example 1:
-
-
Input: [113, 215, 221]
-Output: 12
-Explanation:
-The tree that the list represents is:
- 3
- / \
- 5 1
-
-The path sum is (3 + 5) + (3 + 1) = 12.
-
-
-
-
-
Example 2:
-
-
Input: [113, 221]
-Output: 4
-Explanation:
-The tree that the list represents is:
- 3
- \
- 1
-
-The path sum is (3 + 1) = 4.
-
Given the root of a binary tree and an integer targetSum, return true if the tree has a root-to-leaf path such that adding up all the values along the path equals targetSum.
-
-
A leaf is a node with no children.
-
-
-
Example 1:
-
-
-Input: root = [5,4,8,11,null,13,4,7,2,null,null,null,1], targetSum = 22
-Output: true
-Explanation: The root-to-leaf path with the target sum is shown.
-
-
-
Example 2:
-
-
-Input: root = [1,2,3], targetSum = 5
-Output: false
-Explanation: There two root-to-leaf paths in the tree:
-(1 --> 2): The sum is 3.
-(1 --> 3): The sum is 4.
-There is no root-to-leaf path with sum = 5.
-
-
-
Example 3:
-
-
-Input: root = [], targetSum = 0
-Output: false
-Explanation: Since the tree is empty, there are no root-to-leaf paths.
-
-
-
-
Constraints:
-
-
-
The number of nodes in the tree is in the range [0, 5000].
-
-1000 <= Node.val <= 1000
-
-1000 <= targetSum <= 1000
-
-
-### Related Topics
- [[Tree](../../tag/tree/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Binary Tree](../../tag/binary-tree/README.md)]
-
-### Similar Questions
- 1. [Path Sum II](../path-sum-ii) (Medium)
- 1. [Binary Tree Maximum Path Sum](../binary-tree-maximum-path-sum) (Hard)
- 1. [Sum Root to Leaf Numbers](../sum-root-to-leaf-numbers) (Medium)
- 1. [Path Sum III](../path-sum-iii) (Medium)
- 1. [Path Sum IV](../path-sum-iv) (Medium)
diff --git a/problems/path-sum/path_sum.go b/problems/path-sum/path_sum.go
deleted file mode 100644
index a8e044bda..000000000
--- a/problems/path-sum/path_sum.go
+++ /dev/null
@@ -1,24 +0,0 @@
-package problem112
-
-import "github.com/awesee/leetcode/internal/kit"
-
-// TreeNode - Definition for a binary tree node.
-type TreeNode = kit.TreeNode
-
-/**
- * Definition for a binary tree node.
- * type TreeNode struct {
- * Val int
- * Left *TreeNode
- * Right *TreeNode
- * }
- */
-func hasPathSum(root *TreeNode, sum int) bool {
- if root == nil {
- return false
- }
- if root.Left == nil && root.Right == nil {
- return root.Val == sum
- }
- return hasPathSum(root.Left, sum-root.Val) || hasPathSum(root.Right, sum-root.Val)
-}
diff --git a/problems/path-sum/path_sum_test.go b/problems/path-sum/path_sum_test.go
deleted file mode 100644
index 93325f6fd..000000000
--- a/problems/path-sum/path_sum_test.go
+++ /dev/null
@@ -1,34 +0,0 @@
-package problem112
-
-import (
- "testing"
-
- "github.com/awesee/leetcode/internal/kit"
-)
-
-type testType struct {
- in []int
- sum int
- want bool
-}
-
-func TestHasPathSum(t *testing.T) {
- tests := [...]testType{
- {
- in: []int{5, 4, 8, 11, kit.NULL, 13, 4, 7, 2, kit.NULL, kit.NULL, kit.NULL, 1},
- sum: 22,
- want: true,
- },
- {
- in: []int{5, 8, 4, 4, 13, kit.NULL, 11, 7, 2},
- sum: 22,
- want: false,
- },
- }
- for _, tt := range tests {
- got := hasPathSum(kit.SliceInt2TreeNode(tt.in), tt.sum)
- if got != tt.want {
- t.Fatalf("in: %v, got: %v, want: %v", tt.in, got, tt.want)
- }
- }
-}
diff --git a/problems/path-with-maximum-gold/README.md b/problems/path-with-maximum-gold/README.md
deleted file mode 100644
index 7b86e75cc..000000000
--- a/problems/path-with-maximum-gold/README.md
+++ /dev/null
@@ -1,73 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../longest-arithmetic-subsequence-of-given-difference "Longest Arithmetic Subsequence of Given Difference")
-
-[Next >](../count-vowels-permutation "Count Vowels Permutation")
-
-## [1219. Path with Maximum Gold (Medium)](https://leetcode.com/problems/path-with-maximum-gold "黄金矿工")
-
-
In a gold mine grid of size m x n, each cell in this mine has an integer representing the amount of gold in that cell, 0 if it is empty.
-
-
Return the maximum amount of gold you can collect under the conditions:
-
-
-
Every time you are located in a cell you will collect all the gold in that cell.
-
From your position, you can walk one step to the left, right, up, or down.
-
You can't visit the same cell more than once.
-
Never visit a cell with 0 gold.
-
You can start and stop collecting gold from any position in the grid that has some gold.
-
-
-
-
Example 1:
-
-
-Input: grid = [[0,6,0],[5,8,7],[0,9,0]]
-Output: 24
-Explanation:
-[[0,6,0],
- [5,8,7],
- [0,9,0]]
-Path to get the maximum gold, 9 -> 8 -> 7.
-
-
-
Example 2:
-
-
-Input: grid = [[1,0,7],[2,0,6],[3,4,5],[0,3,0],[9,0,20]]
-Output: 28
-Explanation:
-[[1,0,7],
- [2,0,6],
- [3,4,5],
- [0,3,0],
- [9,0,20]]
-Path to get the maximum gold, 1 -> 2 -> 3 -> 4 -> 5 -> 6 -> 7.
-
-
-
-
Constraints:
-
-
-
m == grid.length
-
n == grid[i].length
-
1 <= m, n <= 15
-
0 <= grid[i][j] <= 100
-
There are at most 25 cells containing gold.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Backtracking](../../tag/backtracking/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
-
-### Hints
-
-Hint 1
-Use recursion to try all such paths and find the one with the maximum value.
-
diff --git a/problems/path-with-maximum-minimum-value/README.md b/problems/path-with-maximum-minimum-value/README.md
deleted file mode 100644
index 023f25b3f..000000000
--- a/problems/path-with-maximum-minimum-value/README.md
+++ /dev/null
@@ -1,90 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../the-earliest-moment-when-everyone-become-friends "The Earliest Moment When Everyone Become Friends")
-
-[Next >](../distribute-candies-to-people "Distribute Candies to People")
-
-## [1102. Path With Maximum Minimum Value (Medium)](https://leetcode.com/problems/path-with-maximum-minimum-value "得分最高的路径")
-
-
Given a matrix of integers A with R rows and C columns, find the maximum score of a path starting at [0,0] and ending at [R-1,C-1].
-
-
The score of a path is the minimum value in that path. For example, the value of the path 8 → 4 → 5 → 9 is 4.
-
-
A path moves some number of times from one visited cell to any neighbouring unvisited cell in one of the 4 cardinal directions (north, east, west, south).
-
-
-
-
Example 1:
-
-
-
-
-Input: [[5,4,5],[1,2,6],[7,4,6]]
-Output: 4
-Explanation:
-The path with the maximum score is highlighted in yellow.
-
-
-
-### Related Topics
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Union Find](../../tag/union-find/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
- [[Heap (Priority Queue)](../../tag/heap-priority-queue/README.md)]
-
-### Hints
-
-Hint 1
-What if we sort each cell of the matrix by the value?
-
-
-
-Hint 2
-Don't include small values in your path if you can only include large values.
-
-
-
-Hint 3
-Let's keep adding a possible cell to use in the path incrementally with decreasing values.
-
-
-
-Hint 4
-If the start and end cells are connected then we don't need to add more cells.
-
-
-
-Hint 5
-Use union-find data structure to check connectivity and return as answer the value of the given cell that makes start and end cells connected.
-
diff --git a/problems/path-with-maximum-probability/README.md b/problems/path-with-maximum-probability/README.md
deleted file mode 100644
index 8a74476a7..000000000
--- a/problems/path-with-maximum-probability/README.md
+++ /dev/null
@@ -1,86 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../number-of-substrings-with-only-1s "Number of Substrings With Only 1s")
-
-[Next >](../best-position-for-a-service-centre "Best Position for a Service Centre")
-
-## [1514. Path with Maximum Probability (Medium)](https://leetcode.com/problems/path-with-maximum-probability "概率最大的路径")
-
-
You are given an undirected weighted graph of n nodes (0-indexed), represented by an edge list where edges[i] = [a, b] is an undirected edge connecting the nodes a and b with a probability of success of traversing that edge succProb[i].
-
-
Given two nodes start and end, find the path with the maximum probability of success to go from start to end and return its success probability.
-
-
If there is no path from start to end, return 0. Your answer will be accepted if it differs from the correct answer by at most 1e-5.
-
-
-
Example 1:
-
-
-
-
-Input: n = 3, edges = [[0,1],[1,2],[0,2]], succProb = [0.5,0.5,0.2], start = 0, end = 2
-Output: 0.25000
-Explanation: There are two paths from start to end, one having a probability of success = 0.2 and the other has 0.5 * 0.5 = 0.25.
-
-
-
Example 2:
-
-
-
-
-Input: n = 3, edges = [[0,1],[1,2],[0,2]], succProb = [0.5,0.5,0.3], start = 0, end = 2
-Output: 0.30000
-
-
-
Example 3:
-
-
-
-
-Input: n = 3, edges = [[0,1]], succProb = [0.5], start = 0, end = 2
-Output: 0.00000
-Explanation: There is no path between 0 and 2.
-
-
-
-
Constraints:
-
-
-
2 <= n <= 10^4
-
0 <= start, end < n
-
start != end
-
0 <= a, b < n
-
a != b
-
0 <= succProb.length == edges.length <= 2*10^4
-
0 <= succProb[i] <= 1
-
There is at most one edge between every two nodes.
-
-
-### Related Topics
- [[Graph](../../tag/graph/README.md)]
- [[Heap (Priority Queue)](../../tag/heap-priority-queue/README.md)]
- [[Shortest Path](../../tag/shortest-path/README.md)]
-
-### Similar Questions
- 1. [Number of Ways to Arrive at Destination](../number-of-ways-to-arrive-at-destination) (Medium)
-
-### Hints
-
-Hint 1
-Multiplying probabilities will result in precision errors.
-
-
-
-Hint 2
-Take log probabilities to sum up numbers instead of multiplying them.
-
-
-
-Hint 3
-Use Dijkstra's algorithm to find the minimum path between the two nodes after negating all costs.
-
diff --git a/problems/path-with-minimum-effort/README.md b/problems/path-with-minimum-effort/README.md
deleted file mode 100644
index 9cee131df..000000000
--- a/problems/path-with-minimum-effort/README.md
+++ /dev/null
@@ -1,83 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../arithmetic-subarrays "Arithmetic Subarrays")
-
-[Next >](../rank-transform-of-a-matrix "Rank Transform of a Matrix")
-
-## [1631. Path With Minimum Effort (Medium)](https://leetcode.com/problems/path-with-minimum-effort "最小体力消耗路径")
-
-
You are a hiker preparing for an upcoming hike. You are given heights, a 2D array of size rows x columns, where heights[row][col] represents the height of cell (row, col). You are situated in the top-left cell, (0, 0), and you hope to travel to the bottom-right cell, (rows-1, columns-1) (i.e., 0-indexed). You can move up, down, left, or right, and you wish to find a route that requires the minimum effort.
-
-
A route's effort is the maximum absolute differencein heights between two consecutive cells of the route.
-
-
Return the minimum effort required to travel from the top-left cell to the bottom-right cell.
-
-
-
Example 1:
-
-
-
-
-Input: heights = [[1,2,2],[3,8,2],[5,3,5]]
-Output: 2
-Explanation: The route of [1,3,5,3,5] has a maximum absolute difference of 2 in consecutive cells.
-This is better than the route of [1,2,2,2,5], where the maximum absolute difference is 3.
-
-
-
Example 2:
-
-
-
-
-Input: heights = [[1,2,3],[3,8,4],[5,3,5]]
-Output: 1
-Explanation: The route of [1,2,3,4,5] has a maximum absolute difference of 1 in consecutive cells, which is better than route [1,3,5,3,5].
-
-
-
Example 3:
-
-
-Input: heights = [[1,2,1,1,1],[1,2,1,2,1],[1,2,1,2,1],[1,2,1,2,1],[1,1,1,2,1]]
-Output: 0
-Explanation: This route does not require any effort.
-
-
-
-
Constraints:
-
-
-
rows == heights.length
-
columns == heights[i].length
-
1 <= rows, columns <= 100
-
1 <= heights[i][j] <= 106
-
-
-### Related Topics
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Union Find](../../tag/union-find/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
- [[Heap (Priority Queue)](../../tag/heap-priority-queue/README.md)]
-
-### Hints
-
-Hint 1
-Consider the grid as a graph, where adjacent cells have an edge with cost of the difference between the cells.
-
-
-
-Hint 2
-If you are given threshold k, check if it is possible to go from (0, 0) to (n-1, m-1) using only edges of ≤ k cost.
-
-
-
-Hint 3
-Binary search the k value.
-
diff --git a/problems/paths-in-maze-that-lead-to-same-room/README.md b/problems/paths-in-maze-that-lead-to-same-room/README.md
deleted file mode 100644
index 40ea18453..000000000
--- a/problems/paths-in-maze-that-lead-to-same-room/README.md
+++ /dev/null
@@ -1,28 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../process-restricted-friend-requests "Process Restricted Friend Requests")
-
-[Next >](../two-furthest-houses-with-different-colors "Two Furthest Houses With Different Colors")
-
-## [2077. Paths in Maze That Lead to Same Room (Medium)](https://leetcode.com/problems/paths-in-maze-that-lead-to-same-room "")
-
-
-
-### Related Topics
- [[Graph](../../tag/graph/README.md)]
-
-### Hints
-
-Hint 1
-If the path starts at room i, what properties must the other two rooms in the cycle have?
-
-
-
-Hint 2
-The other two rooms must be connected to room i, and must be connected to each other.
-
diff --git a/problems/patients-with-a-condition/README.md b/problems/patients-with-a-condition/README.md
deleted file mode 100644
index 27a1f5cd3..000000000
--- a/problems/patients-with-a-condition/README.md
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-number-of-increments-on-subarrays-to-form-a-target-array "Minimum Number of Increments on Subarrays to Form a Target Array")
-
-[Next >](../shuffle-string "Shuffle String")
-
-## [1527. Patients With a Condition (Easy)](https://leetcode.com/problems/patients-with-a-condition "患某种疾病的患者")
-
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/patients-with-a-condition/mysql_schemas.sql b/problems/patients-with-a-condition/mysql_schemas.sql
deleted file mode 100644
index 0faba4460..000000000
--- a/problems/patients-with-a-condition/mysql_schemas.sql
+++ /dev/null
@@ -1,7 +0,0 @@
-Create table If Not Exists Patients (patient_id int, patient_name varchar(30), conditions varchar(100));
-Truncate table Patients;
-insert into Patients (patient_id, patient_name, conditions) values ('1', 'Daniel', 'YFEV COUGH');
-insert into Patients (patient_id, patient_name, conditions) values ('2', 'Alice', '');
-insert into Patients (patient_id, patient_name, conditions) values ('3', 'Bob', 'DIAB100 MYOP');
-insert into Patients (patient_id, patient_name, conditions) values ('4', 'George', 'ACNE DIAB100');
-insert into Patients (patient_id, patient_name, conditions) values ('5', 'Alain', 'DIAB201');
diff --git a/problems/peak-index-in-a-mountain-array/README.md b/problems/peak-index-in-a-mountain-array/README.md
deleted file mode 100644
index 05758a2dc..000000000
--- a/problems/peak-index-in-a-mountain-array/README.md
+++ /dev/null
@@ -1,62 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../loud-and-rich "Loud and Rich")
-
-[Next >](../car-fleet "Car Fleet")
-
-## [852. Peak Index in a Mountain Array (Easy)](https://leetcode.com/problems/peak-index-in-a-mountain-array "山脉数组的峰顶索引")
-
-
Let's call an array arr a mountain if the following properties hold:
-
-
-
arr.length >= 3
-
There exists some i with 0 < i < arr.length - 1 such that:
-
-
arr[0] < arr[1] < ... arr[i-1] < arr[i]
-
arr[i] > arr[i+1] > ... > arr[arr.length - 1]
-
-
-
-
-
Given an integer array arr that is guaranteed to be a mountain, return any i such that arr[0] < arr[1] < ... arr[i - 1] < arr[i] > arr[i + 1] > ... > arr[arr.length - 1].
-Follow up: Finding the O(n) is straightforward, could you find an O(log(n)) solution?
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
-
-### Similar Questions
- 1. [Find Peak Element](../find-peak-element) (Medium)
diff --git a/problems/peak-index-in-a-mountain-array/peak_index_in_a_mountain_array.go b/problems/peak-index-in-a-mountain-array/peak_index_in_a_mountain_array.go
deleted file mode 100644
index 02a8b917a..000000000
--- a/problems/peak-index-in-a-mountain-array/peak_index_in_a_mountain_array.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem852
diff --git a/problems/peak-index-in-a-mountain-array/peak_index_in_a_mountain_array_test.go b/problems/peak-index-in-a-mountain-array/peak_index_in_a_mountain_array_test.go
deleted file mode 100644
index 02a8b917a..000000000
--- a/problems/peak-index-in-a-mountain-array/peak_index_in_a_mountain_array_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem852
diff --git a/problems/peeking-iterator/README.md b/problems/peeking-iterator/README.md
deleted file mode 100644
index c922a69d3..000000000
--- a/problems/peeking-iterator/README.md
+++ /dev/null
@@ -1,88 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../move-zeroes "Move Zeroes")
-
-[Next >](../inorder-successor-in-bst "Inorder Successor in BST")
-
-## [284. Peeking Iterator (Medium)](https://leetcode.com/problems/peeking-iterator "窥探迭代器")
-
-
Design an iterator that supports the peek operation on an existing iterator in addition to the hasNext and the next operations.
-
-
Implement the PeekingIterator class:
-
-
-
PeekingIterator(Iterator<int> nums) Initializes the object with the given integer iterator iterator.
-
int next() Returns the next element in the array and moves the pointer to the next element.
-
boolean hasNext() Returns true if there are still elements in the array.
-
int peek() Returns the next element in the array without moving the pointer.
-
-
-
Note: Each language may have a different implementation of the constructor and Iterator, but they all support the int next() and boolean hasNext() functions.
-
-
-
Example 1:
-
-
-Input
-["PeekingIterator", "next", "peek", "next", "next", "hasNext"]
-[[[1, 2, 3]], [], [], [], [], []]
-Output
-[null, 1, 2, 2, 3, false]
-
-Explanation
-PeekingIterator peekingIterator = new PeekingIterator([1, 2, 3]); // [1,2,3]
-peekingIterator.next(); // return 1, the pointer moves to the next element [1,2,3].
-peekingIterator.peek(); // return 2, the pointer does not move [1,2,3].
-peekingIterator.next(); // return 2, the pointer moves to the next element [1,2,3]
-peekingIterator.next(); // return 3, the pointer moves to the next element [1,2,3]
-peekingIterator.hasNext(); // return False
-
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 1000
-
1 <= nums[i] <= 1000
-
All the calls to next and peek are valid.
-
At most 1000 calls will be made to next, hasNext, and peek.
-
-
-
-Follow up: How would you extend your design to be generic and work with all types, not just integer?
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Design](../../tag/design/README.md)]
- [[Iterator](../../tag/iterator/README.md)]
-
-### Similar Questions
- 1. [Binary Search Tree Iterator](../binary-search-tree-iterator) (Medium)
- 1. [Flatten 2D Vector](../flatten-2d-vector) (Medium)
- 1. [Zigzag Iterator](../zigzag-iterator) (Medium)
-
-### Hints
-
-Hint 1
-Think of "looking ahead". You want to cache the next element.
-
-
-
-Hint 2
-Is one variable sufficient? Why or why not?
-
-
-
-Hint 3
-Test your design with call order of peek() before next() vs next() before peek().
-
-
-
-Hint 4
-For a clean implementation, check out Google's guava library source code.
-
diff --git a/problems/peeking-iterator/peeking_iterator.go b/problems/peeking-iterator/peeking_iterator.go
deleted file mode 100644
index 801bd886d..000000000
--- a/problems/peeking-iterator/peeking_iterator.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem284
diff --git a/problems/peeking-iterator/peeking_iterator.py b/problems/peeking-iterator/peeking_iterator.py
deleted file mode 100755
index 1cbe1b002..000000000
--- a/problems/peeking-iterator/peeking_iterator.py
+++ /dev/null
@@ -1,55 +0,0 @@
-#!/usr/bin/env python
-
-# Below is the interface for Iterator, which is already defined for you.
-#
-# class Iterator:
-# def __init__(self, nums):
-# """
-# Initializes an iterator object to the beginning of a list.
-# :type nums: List[int]
-# """
-#
-# def hasNext(self):
-# """
-# Returns true if the iteration has more elements.
-# :rtype: bool
-# """
-#
-# def next(self):
-# """
-# Returns the next element in the iteration.
-# :rtype: int
-# """
-
-class PeekingIterator:
- def __init__(self, iterator):
- """
- Initialize your data structure here.
- :type iterator: Iterator
- """
-
-
- def peek(self):
- """
- Returns the next element in the iteration without advancing the iterator.
- :rtype: int
- """
-
-
- def next(self):
- """
- :rtype: int
- """
-
-
- def hasNext(self):
- """
- :rtype: bool
- """
-
-
-# Your PeekingIterator object will be instantiated and called as such:
-# iter = PeekingIterator(Iterator(nums))
-# while iter.hasNext():
-# val = iter.peek() # Get the next element but not advance the iterator.
-# iter.next() # Should return the same value as [val].
\ No newline at end of file
diff --git a/problems/peeking-iterator/peeking_iterator_test.go b/problems/peeking-iterator/peeking_iterator_test.go
deleted file mode 100644
index 801bd886d..000000000
--- a/problems/peeking-iterator/peeking_iterator_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem284
diff --git a/problems/people-whose-list-of-favorite-companies-is-not-a-subset-of-another-list/README.md b/problems/people-whose-list-of-favorite-companies-is-not-a-subset-of-another-list/README.md
deleted file mode 100644
index 7c32ea78e..000000000
--- a/problems/people-whose-list-of-favorite-companies-is-not-a-subset-of-another-list/README.md
+++ /dev/null
@@ -1,71 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../rearrange-words-in-a-sentence "Rearrange Words in a Sentence")
-
-[Next >](../maximum-number-of-darts-inside-of-a-circular-dartboard "Maximum Number of Darts Inside of a Circular Dartboard")
-
-## [1452. People Whose List of Favorite Companies Is Not a Subset of Another List (Medium)](https://leetcode.com/problems/people-whose-list-of-favorite-companies-is-not-a-subset-of-another-list "收藏清单")
-
-
Given the array favoriteCompanies where favoriteCompanies[i] is the list of favorites companies for the ith person (indexed from 0).
-
-
Return the indices of people whose list of favorite companies is not a subset of any other list of favorites companies. You must return the indices in increasing order.
-
-
-
Example 1:
-
-
-Input: favoriteCompanies = [["leetcode","google","facebook"],["google","microsoft"],["google","facebook"],["google"],["amazon"]]
-Output: [0,1,4]
-Explanation:
-Person with index=2 has favoriteCompanies[2]=["google","facebook"] which is a subset of favoriteCompanies[0]=["leetcode","google","facebook"] corresponding to the person with index 0.
-Person with index=3 has favoriteCompanies[3]=["google"] which is a subset of favoriteCompanies[0]=["leetcode","google","facebook"] and favoriteCompanies[1]=["google","microsoft"].
-Other lists of favorite companies are not a subset of another list, therefore, the answer is [0,1,4].
-
-
-
Example 2:
-
-
-Input: favoriteCompanies = [["leetcode","google","facebook"],["leetcode","amazon"],["facebook","google"]]
-Output: [0,1]
-Explanation: In this case favoriteCompanies[2]=["facebook","google"] is a subset of favoriteCompanies[0]=["leetcode","google","facebook"], therefore, the answer is [0,1].
-
All lists of favorite companies are distinct, that is, If we sort alphabetically each list then favoriteCompanies[i] != favoriteCompanies[j].
-
All strings consist of lowercase English letters only.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Hints
-
-Hint 1
-Use hashing to convert company names in numbers and then for each list check if this is a subset of any other list.
-
-
-
-Hint 2
-In order to check if a list is a subset of another list, use two pointers technique to get a linear solution for this task. The total complexity will be O(n^2 * m) where n is the number of lists and m is the maximum number of elements in a list.
-
diff --git a/problems/percentage-of-users-attended-a-contest/README.md b/problems/percentage-of-users-attended-a-contest/README.md
deleted file mode 100644
index 7773dffab..000000000
--- a/problems/percentage-of-users-attended-a-contest/README.md
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../rank-transform-of-a-matrix "Rank Transform of a Matrix")
-
-[Next >](../add-two-polynomials-represented-as-linked-lists "Add Two Polynomials Represented as Linked Lists")
-
-## [1633. Percentage of Users Attended a Contest (Easy)](https://leetcode.com/problems/percentage-of-users-attended-a-contest "各赛事的用户注册率")
-
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/percentage-of-users-attended-a-contest/mysql_schemas.sql b/problems/percentage-of-users-attended-a-contest/mysql_schemas.sql
deleted file mode 100644
index 722f57248..000000000
--- a/problems/percentage-of-users-attended-a-contest/mysql_schemas.sql
+++ /dev/null
@@ -1,19 +0,0 @@
-Create table If Not Exists Users (user_id int, user_name varchar(20));
-Create table If Not Exists Register (contest_id int, user_id int);
-Truncate table Users;
-insert into Users (user_id, user_name) values ('6', 'Alice');
-insert into Users (user_id, user_name) values ('2', 'Bob');
-insert into Users (user_id, user_name) values ('7', 'Alex');
-Truncate table Register;
-insert into Register (contest_id, user_id) values ('215', '6');
-insert into Register (contest_id, user_id) values ('209', '2');
-insert into Register (contest_id, user_id) values ('208', '2');
-insert into Register (contest_id, user_id) values ('210', '6');
-insert into Register (contest_id, user_id) values ('208', '6');
-insert into Register (contest_id, user_id) values ('209', '7');
-insert into Register (contest_id, user_id) values ('209', '6');
-insert into Register (contest_id, user_id) values ('215', '7');
-insert into Register (contest_id, user_id) values ('208', '7');
-insert into Register (contest_id, user_id) values ('210', '2');
-insert into Register (contest_id, user_id) values ('207', '2');
-insert into Register (contest_id, user_id) values ('210', '7');
diff --git a/problems/perfect-number/README.md b/problems/perfect-number/README.md
deleted file mode 100644
index 49cdc968c..000000000
--- a/problems/perfect-number/README.md
+++ /dev/null
@@ -1,67 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../relative-ranks "Relative Ranks")
-
-[Next >](../most-frequent-subtree-sum "Most Frequent Subtree Sum")
-
-## [507. Perfect Number (Easy)](https://leetcode.com/problems/perfect-number "完美数")
-
-
A perfect number is a positive integer that is equal to the sum of its positive divisors, excluding the number itself. A divisor of an integer x is an integer that can divide x evenly.
-
-
Given an integer n, return true if n is a perfect number, otherwise return false.
-
-
-
Example 1:
-
-
-Input: num = 28
-Output: true
-Explanation: 28 = 1 + 2 + 4 + 7 + 14
-1, 2, 4, 7, and 14 are all divisors of 28.
-
Given an array rectangles where rectangles[i] = [xi, yi, ai, bi] represents an axis-aligned rectangle. The bottom-left point of the rectangle is (xi, yi) and the top-right point of it is (ai, bi).
-
-
Return trueif all the rectangles together form an exact cover of a rectangular region.
-
-
-
Example 1:
-
-
-Input: rectangles = [[1,1,3,3],[3,1,4,2],[3,2,4,4],[1,3,2,4],[2,3,3,4]]
-Output: true
-Explanation: All 5 rectangles together form an exact cover of a rectangular region.
-
-
-
Example 2:
-
-
-Input: rectangles = [[1,1,2,3],[1,3,2,4],[3,1,4,2],[3,2,4,4]]
-Output: false
-Explanation: Because there is a gap between the two rectangular regions.
-
-
-
Example 3:
-
-
-Input: rectangles = [[1,1,3,3],[3,1,4,2],[1,3,2,4],[2,2,4,4]]
-Output: false
-Explanation: Because two of the rectangles overlap with each other.
-
Given an integer n, return the least number of perfect square numbers that sum ton.
-
-
A perfect square is an integer that is the square of an integer; in other words, it is the product of some integer with itself. For example, 1, 4, 9, and 16 are perfect squares while 3 and 11 are not.
-
-### Related Topics
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Two Pointers](../../tag/two-pointers/README.md)]
- [[String](../../tag/string/README.md)]
- [[Sliding Window](../../tag/sliding-window/README.md)]
-
-### Similar Questions
- 1. [Minimum Window Substring](../minimum-window-substring) (Hard)
- 1. [Find All Anagrams in a String](../find-all-anagrams-in-a-string) (Medium)
-
-### Hints
-
-Hint 1
-Obviously, brute force will result in TLE. Think of something else.
-
-
-
-Hint 2
-How will you check whether one string is a permutation of another string?
-
-
-
-Hint 3
-One way is to sort the string and then compare. But, Is there a better way?
-
-
-
-Hint 4
-If one string is a permutation of another string then they must one common metric. What is that?
-
-
-
-Hint 5
-Both strings must have same character frequencies, if one is permutation of another. Which data structure should be used to store frequencies?
-
-
-
-Hint 6
-What about hash table? An array of size 26?
-
diff --git a/problems/permutation-in-string/permutation_in_string.go b/problems/permutation-in-string/permutation_in_string.go
deleted file mode 100644
index f59655f61..000000000
--- a/problems/permutation-in-string/permutation_in_string.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem567
diff --git a/problems/permutation-in-string/permutation_in_string_test.go b/problems/permutation-in-string/permutation_in_string_test.go
deleted file mode 100644
index f59655f61..000000000
--- a/problems/permutation-in-string/permutation_in_string_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem567
diff --git a/problems/permutation-sequence/README.md b/problems/permutation-sequence/README.md
deleted file mode 100644
index 6fd641631..000000000
--- a/problems/permutation-sequence/README.md
+++ /dev/null
@@ -1,54 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../spiral-matrix-ii "Spiral Matrix II")
-
-[Next >](../rotate-list "Rotate List")
-
-## [60. Permutation Sequence (Hard)](https://leetcode.com/problems/permutation-sequence "排列序列")
-
-
The set [1, 2, 3, ..., n] contains a total of n! unique permutations.
-
-
By listing and labeling all of the permutations in order, we get the following sequence for n = 3:
-
-
-
"123"
-
"132"
-
"213"
-
"231"
-
"312"
-
"321"
-
-
-
Given n and k, return the kth permutation sequence.
There is a pizza with 3n slices of varying size, you and your friends will take slices of pizza as follows:
-
-
-
You will pick any pizza slice.
-
Your friend Alice will pick the next slice in the anti-clockwise direction of your pick.
-
Your friend Bob will pick the next slice in the clockwise direction of your pick.
-
Repeat until there are no more slices of pizzas.
-
-
-
Given an integer array slices that represent the sizes of the pizza slices in a clockwise direction, return the maximum possible sum of slice sizes that you can pick.
-
-
-
Example 1:
-
-
-Input: slices = [1,2,3,4,5,6]
-Output: 10
-Explanation: Pick pizza slice of size 4, Alice and Bob will pick slices with size 3 and 5 respectively. Then Pick slices with size 6, finally Alice and Bob will pick slice of size 2 and 1 respectively. Total = 4 + 6.
-
-
-
Example 2:
-
-
-Input: slices = [8,9,8,6,1,1]
-Output: 16
-Explanation: Pick pizza slice of size 8 in each turn. If you pick slice with size 9 your partners will pick slices of size 8.
-
-
-
-
Constraints:
-
-
-
3 * n == slices.length
-
1 <= slices.length <= 500
-
1 <= slices[i] <= 1000
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Greedy](../../tag/greedy/README.md)]
- [[Heap (Priority Queue)](../../tag/heap-priority-queue/README.md)]
-
-### Hints
-
-Hint 1
-By studying the pattern of the operations, we can find out that the problem is equivalent to: Given an integer array with size 3N, select N integers with maximum sum and any selected integers are not next to each other in the array.
-
-
-
-Hint 2
-The first one in the array is considered next to the last one in the array. Use Dynamic Programming to solve it.
-
diff --git a/problems/plates-between-candles/README.md b/problems/plates-between-candles/README.md
deleted file mode 100644
index ae2f893fb..000000000
--- a/problems/plates-between-candles/README.md
+++ /dev/null
@@ -1,71 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../two-best-non-overlapping-events "Two Best Non-Overlapping Events")
-
-[Next >](../number-of-valid-move-combinations-on-chessboard "Number of Valid Move Combinations On Chessboard")
-
-## [2055. Plates Between Candles (Medium)](https://leetcode.com/problems/plates-between-candles "蜡烛之间的盘子")
-
-
There is a long table with a line of plates and candles arranged on top of it. You are given a 0-indexed string s consisting of characters '*' and '|' only, where a '*' represents a plate and a '|' represents a candle.
-
-
You are also given a 0-indexed 2D integer array queries where queries[i] = [lefti, righti] denotes the substrings[lefti...righti] (inclusive). For each query, you need to find the number of plates between candles that are in the substring. A plate is considered between candles if there is at least one candle to its left and at least one candle to its right in the substring.
-
-
-
For example, s = "||**||**|*", and a query [3, 8] denotes the substring "*||**|". The number of plates between candles in this substring is 2, as each of the two plates has at least one candle in the substring to its left and right.
-
-
-
Return an integer arrayanswerwhereanswer[i]is the answer to theithquery.
-
-
-
Example 1:
-
-
-Input: s = "**|**|***|", queries = [[2,5],[5,9]]
-Output: [2,3]
-Explanation:
-- queries[0] has two plates between candles.
-- queries[1] has three plates between candles.
-
-
-
Example 2:
-
-
-Input: s = "***|**|*****|**||**|*", queries = [[1,17],[4,5],[14,17],[5,11],[15,16]]
-Output: [9,0,0,0,0]
-Explanation:
-- queries[0] has nine plates between candles.
-- The other queries have zero plates between candles.
-
-
-
-
Constraints:
-
-
-
3 <= s.length <= 105
-
s consists of '*' and '|' characters.
-
1 <= queries.length <= 105
-
queries[i].length == 2
-
0 <= lefti <= righti < s.length
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[String](../../tag/string/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
- [[Prefix Sum](../../tag/prefix-sum/README.md)]
-
-### Hints
-
-Hint 1
-Can you find the indices of the most left and right candles for a given substring, perhaps by using binary search (or better) over an array of indices of all the bars?
-
-
-
-Hint 2
-Once the indices of the most left and right bars are determined, how can you efficiently count the number of plates within the range? Prefix sums?
-
diff --git a/problems/play-with-chips/README.md b/problems/play-with-chips/README.md
deleted file mode 100644
index 7c45594d3..000000000
--- a/problems/play-with-chips/README.md
+++ /dev/null
@@ -1,76 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../valid-palindrome-iii "Valid Palindrome III")
-
-[Next >](../longest-arithmetic-subsequence-of-given-difference "Longest Arithmetic Subsequence of Given Difference")
-
-## [1217. Play with Chips (Easy)](https://leetcode.com/problems/play-with-chips "玩筹码")
-
-
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:
-
-
-
Move the i-th chip by 2 units to the left or to the right with a cost of 0.
-
Move the i-th chip by 1 unit to the left or to the right with a cost of 1.
-
-
-
There can be two or more chips at the same position initially.
-
-
Return the minimum cost needed to move all the chips to the same position (any position).
-
-
-
Example 1:
-
-
-Input: chips = [1,2,3]
-Output: 1
-Explanation: Second chip will be moved to positon 3 with cost 1. First chip will be moved to position 3 with cost 0. Total cost is 1.
-
-
-
Example 2:
-
-
-Input: chips = [2,2,2,3,3]
-Output: 2
-Explanation: Both fourth and fifth chip will be moved to position two with cost 1. Total minimum cost will be 2.
-
-
-
-
Constraints:
-
-
-
1 <= chips.length <= 100
-
1 <= chips[i] <= 10^9
-
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Math](../../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/plus-one-linked-list/README.md b/problems/plus-one-linked-list/README.md
deleted file mode 100644
index ae6a641b4..000000000
--- a/problems/plus-one-linked-list/README.md
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../largest-divisible-subset "Largest Divisible Subset")
-
-[Next >](../range-addition "Range Addition")
-
-## [369. Plus One Linked List (Medium)](https://leetcode.com/problems/plus-one-linked-list "给单链表加一")
-
-
Given a non-negative integer represented as non-empty a singly linked list of digits, plus one to the integer.
-
-
You may assume the integer do not contain any leading zero, except the number 0 itself.
-
-
The digits are stored such that the most significant digit is at the head of the list.
You are given a large integer represented as an integer array digits, where each digits[i] is the ith digit of the integer. The digits are ordered from most significant to least significant in left-to-right order. The large integer does not contain any leading 0's.
-
-
Increment the large integer by one and return the resulting array of digits.
-
-
-
Example 1:
-
-
-Input: digits = [1,2,3]
-Output: [1,2,4]
-Explanation: The array represents the integer 123.
-Incrementing by one gives 123 + 1 = 124.
-Thus, the result should be [1,2,4].
-
-
-
Example 2:
-
-
-Input: digits = [4,3,2,1]
-Output: [4,3,2,2]
-Explanation: The array represents the integer 4321.
-Incrementing by one gives 4321 + 1 = 4322.
-Thus, the result should be [4,3,2,2].
-
-
-
Example 3:
-
-
-Input: digits = [0]
-Output: [1]
-Explanation: The array represents the integer 0.
-Incrementing by one gives 0 + 1 = 1.
-Thus, the result should be [1].
-
-
-
Example 4:
-
-
-Input: digits = [9]
-Output: [1,0]
-Explanation: The array represents the integer 9.
-Incrementing by one gives 9 + 1 = 10.
-Thus, the result should be [1,0].
-
There are buckets buckets of liquid, where exactly one of the buckets is poisonous. To figure out which one is poisonous, you feed some number of (poor) pigs the liquid to see whether they will die or not. Unfortunately, you only have minutesToTest minutes to determine which bucket is poisonous.
-
-
You can feed the pigs according to these steps:
-
-
-
Choose some live pigs to feed.
-
For each pig, choose which buckets to feed it. The pig will consume all the chosen buckets simultaneously and will take no time.
-
Wait for minutesToDie minutes. You may not feed any other pigs during this time.
-
After minutesToDie minutes have passed, any pigs that have been fed the poisonous bucket will die, and all others will survive.
-
Repeat this process until you run out of time.
-
-
-
Given buckets, minutesToDie, and minutesToTest, return the minimum number of pigs needed to figure out which bucket is poisonous within the allotted time.
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Combinatorics](../../tag/combinatorics/README.md)]
-
-### Hints
-
-Hint 1
-What if you only have one shot? Eg. 4 buckets, 15 mins to die, and 15 mins to test.
-
-
-
-Hint 2
-How many states can we generate with x pigs and T tests?
-
-
-
-Hint 3
-Find minimum x such that (T+1)^x >= N
-
diff --git a/problems/poor-pigs/poor_pigs.go b/problems/poor-pigs/poor_pigs.go
deleted file mode 100644
index 9a12f0a11..000000000
--- a/problems/poor-pigs/poor_pigs.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem458
diff --git a/problems/poor-pigs/poor_pigs_test.go b/problems/poor-pigs/poor_pigs_test.go
deleted file mode 100644
index 9a12f0a11..000000000
--- a/problems/poor-pigs/poor_pigs_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem458
diff --git a/problems/populating-next-right-pointers-in-each-node-ii/README.md b/problems/populating-next-right-pointers-in-each-node-ii/README.md
deleted file mode 100644
index 7621d80dc..000000000
--- a/problems/populating-next-right-pointers-in-each-node-ii/README.md
+++ /dev/null
@@ -1,69 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../populating-next-right-pointers-in-each-node "Populating Next Right Pointers in Each Node")
-
-[Next >](../pascals-triangle "Pascal's Triangle")
-
-## [117. Populating Next Right Pointers in Each Node II (Medium)](https://leetcode.com/problems/populating-next-right-pointers-in-each-node-ii "填充每个节点的下一个右侧节点指针 II")
-
-
Populate each next pointer to point to its next right node. If there is no next right node, the next pointer should be set to NULL.
-
-
Initially, all next pointers are set to NULL.
-
-
-
Example 1:
-
-
-Input: root = [1,2,3,4,5,null,7]
-Output: [1,#,2,3,#,4,5,7,#]
-Explanation: Given the above binary tree (Figure A), your function should populate each next pointer to point to its next right node, just like in Figure B. The serialized output is in level order as connected by the next pointers, with '#' signifying the end of each level.
-
-
-
Example 2:
-
-
-Input: root = []
-Output: []
-
-
-
-
Constraints:
-
-
-
The number of nodes in the tree is in the range [0, 6000].
-
-100 <= Node.val <= 100
-
-
-
-
Follow-up:
-
-
-
You may only use constant extra space.
-
The recursive approach is fine. You may assume implicit stack space does not count as extra space for this problem.
-
-
-### Related Topics
- [[Tree](../../tag/tree/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Linked List](../../tag/linked-list/README.md)]
- [[Binary Tree](../../tag/binary-tree/README.md)]
-
-### Similar Questions
- 1. [Populating Next Right Pointers in Each Node](../populating-next-right-pointers-in-each-node) (Medium)
diff --git a/problems/populating-next-right-pointers-in-each-node-ii/populating_next_right_pointers_in_each_node_ii.go b/problems/populating-next-right-pointers-in-each-node-ii/populating_next_right_pointers_in_each_node_ii.go
deleted file mode 100644
index c150eb655..000000000
--- a/problems/populating-next-right-pointers-in-each-node-ii/populating_next_right_pointers_in_each_node_ii.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem117
diff --git a/problems/populating-next-right-pointers-in-each-node-ii/populating_next_right_pointers_in_each_node_ii.py b/problems/populating-next-right-pointers-in-each-node-ii/populating_next_right_pointers_in_each_node_ii.py
deleted file mode 100755
index 606b74d60..000000000
--- a/problems/populating-next-right-pointers-in-each-node-ii/populating_next_right_pointers_in_each_node_ii.py
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/usr/bin/env python
-
-"""
-# Definition for a Node.
-class Node:
- def __init__(self, val, left, right, next):
- self.val = val
- self.left = left
- self.right = right
- self.next = next
-"""
-class Solution:
- def connect(self, root: 'Node') -> 'Node':
-
\ No newline at end of file
diff --git a/problems/populating-next-right-pointers-in-each-node-ii/populating_next_right_pointers_in_each_node_ii_test.go b/problems/populating-next-right-pointers-in-each-node-ii/populating_next_right_pointers_in_each_node_ii_test.go
deleted file mode 100644
index c150eb655..000000000
--- a/problems/populating-next-right-pointers-in-each-node-ii/populating_next_right_pointers_in_each_node_ii_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem117
diff --git a/problems/populating-next-right-pointers-in-each-node/README.md b/problems/populating-next-right-pointers-in-each-node/README.md
deleted file mode 100644
index e81ccb3de..000000000
--- a/problems/populating-next-right-pointers-in-each-node/README.md
+++ /dev/null
@@ -1,69 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../distinct-subsequences "Distinct Subsequences")
-
-[Next >](../populating-next-right-pointers-in-each-node-ii "Populating Next Right Pointers in Each Node II")
-
-## [116. Populating Next Right Pointers in Each Node (Medium)](https://leetcode.com/problems/populating-next-right-pointers-in-each-node "填充每个节点的下一个右侧节点指针")
-
-
You are given a perfect binary tree where all leaves are on the same level, and every parent has two children. The binary tree has the following definition:
Populate each next pointer to point to its next right node. If there is no next right node, the next pointer should be set to NULL.
-
-
Initially, all next pointers are set to NULL.
-
-
-
Example 1:
-
-
-Input: root = [1,2,3,4,5,6,7]
-Output: [1,#,2,3,#,4,5,6,7,#]
-Explanation: Given the above perfect binary tree (Figure A), your function should populate each next pointer to point to its next right node, just like in Figure B. The serialized output is in level order as connected by the next pointers, with '#' signifying the end of each level.
-
-
-
Example 2:
-
-
-Input: root = []
-Output: []
-
-
-
-
Constraints:
-
-
-
The number of nodes in the tree is in the range [0, 212 - 1].
-
-1000 <= Node.val <= 1000
-
-
-
-
Follow-up:
-
-
-
You may only use constant extra space.
-
The recursive approach is fine. You may assume implicit stack space does not count as extra space for this problem.
-
-
-### Related Topics
- [[Tree](../../tag/tree/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Binary Tree](../../tag/binary-tree/README.md)]
-
-### Similar Questions
- 1. [Populating Next Right Pointers in Each Node II](../populating-next-right-pointers-in-each-node-ii) (Medium)
- 1. [Binary Tree Right Side View](../binary-tree-right-side-view) (Medium)
diff --git a/problems/populating-next-right-pointers-in-each-node/populating_next_right_pointers_in_each_node.go b/problems/populating-next-right-pointers-in-each-node/populating_next_right_pointers_in_each_node.go
deleted file mode 100644
index 281ca015c..000000000
--- a/problems/populating-next-right-pointers-in-each-node/populating_next_right_pointers_in_each_node.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem116
diff --git a/problems/populating-next-right-pointers-in-each-node/populating_next_right_pointers_in_each_node.py b/problems/populating-next-right-pointers-in-each-node/populating_next_right_pointers_in_each_node.py
deleted file mode 100755
index 606b74d60..000000000
--- a/problems/populating-next-right-pointers-in-each-node/populating_next_right_pointers_in_each_node.py
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/usr/bin/env python
-
-"""
-# Definition for a Node.
-class Node:
- def __init__(self, val, left, right, next):
- self.val = val
- self.left = left
- self.right = right
- self.next = next
-"""
-class Solution:
- def connect(self, root: 'Node') -> 'Node':
-
\ No newline at end of file
diff --git a/problems/populating-next-right-pointers-in-each-node/populating_next_right_pointers_in_each_node_test.go b/problems/populating-next-right-pointers-in-each-node/populating_next_right_pointers_in_each_node_test.go
deleted file mode 100644
index 281ca015c..000000000
--- a/problems/populating-next-right-pointers-in-each-node/populating_next_right_pointers_in_each_node_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem116
diff --git a/problems/positions-of-large-groups/README.md b/problems/positions-of-large-groups/README.md
deleted file mode 100644
index 6431b0375..000000000
--- a/problems/positions-of-large-groups/README.md
+++ /dev/null
@@ -1,65 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../consecutive-numbers-sum "Consecutive Numbers Sum")
-
-[Next >](../masking-personal-information "Masking Personal Information")
-
-## [830. Positions of Large Groups (Easy)](https://leetcode.com/problems/positions-of-large-groups "较大分组的位置")
-
-
In a string s of lowercase letters, these letters form consecutive groups of the same character.
-
-
For example, a string like s = "abbxxxxzyy" has the groups "a", "bb", "xxxx", "z", and "yy".
-
-
A group is identified by an interval [start, end], where start and end denote the start and end indices (inclusive) of the group. In the above example, "xxxx" has the interval [3,6].
-
-
A group is considered large if it has 3 or more characters.
-
-
Return the intervals of every large group sorted in increasing order by start index.
-
-
-
Example 1:
-
-
-Input: s = "abbxxxxzzy"
-Output: [[3,6]]
-Explanation: "xxxx" is the only large group with start index 3 and end index 6.
-
-
-
Example 2:
-
-
-Input: s = "abc"
-Output: []
-Explanation: We have groups "a", "b", and "c", none of which are large groups.
-
-
-
Example 3:
-
-
-Input: s = "abcdddeeeeaabbbcd"
-Output: [[3,5],[6,9],[12,14]]
-Explanation: The large groups are "ddd", "eeee", and "bbb".
-
We want to split a group of n people (labeled from 1 to n) into two groups of any size. Each person may dislike some other people, and they should not go into the same group.
-
-
Given the integer n and the array dislikes where dislikes[i] = [ai, bi] indicates that the person labeled ai does not like the person labeled bi, return trueif it is possible to split everyone into two groups in this way.
-
-
-
Example 1:
-
-
-Input: n = 4, dislikes = [[1,2],[1,3],[2,4]]
-Output: true
-Explanation: group1 [1,4] and group2 [2,3].
-
-
-
Example 2:
-
-
-Input: n = 3, dislikes = [[1,2],[1,3],[2,3]]
-Output: false
-
-
-
Example 3:
-
-
-Input: n = 5, dislikes = [[1,2],[2,3],[3,4],[4,5],[1,5]]
-Output: false
-
-
-
-
Constraints:
-
-
-
1 <= n <= 2000
-
0 <= dislikes.length <= 104
-
dislikes[i].length == 2
-
1 <= dislikes[i][j] <= n
-
ai < bi
-
All the pairs of dislikes are unique.
-
-
-### Related Topics
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Union Find](../../tag/union-find/README.md)]
- [[Graph](../../tag/graph/README.md)]
diff --git a/problems/possible-bipartition/possible_bipartition.go b/problems/possible-bipartition/possible_bipartition.go
deleted file mode 100644
index 793dca90c..000000000
--- a/problems/possible-bipartition/possible_bipartition.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem886
diff --git a/problems/possible-bipartition/possible_bipartition_test.go b/problems/possible-bipartition/possible_bipartition_test.go
deleted file mode 100644
index 793dca90c..000000000
--- a/problems/possible-bipartition/possible_bipartition_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem886
diff --git a/problems/pour-water-between-buckets-to-make-water-levels-equal/README.md b/problems/pour-water-between-buckets-to-make-water-levels-equal/README.md
deleted file mode 100644
index 3c977e969..000000000
--- a/problems/pour-water-between-buckets-to-make-water-levels-equal/README.md
+++ /dev/null
@@ -1,39 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../earliest-possible-day-of-full-bloom "Earliest Possible Day of Full Bloom")
-
-[Next >](../divide-a-string-into-groups-of-size-k "Divide a String Into Groups of Size k")
-
-## [2137. Pour Water Between Buckets to Make Water Levels Equal (Medium)](https://leetcode.com/problems/pour-water-between-buckets-to-make-water-levels-equal "")
-
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
-
-### Hints
-
-Hint 1
-What is the range that the answer must fall into?
-
-
-
-Hint 2
-The answer has to be in the range [0, max(buckets)] (inclusive).
-
-
-
-Hint 3
-For a number x, is there an efficient way to check if it is possible to make the amount of water in each bucket x.
-
-
-
-Hint 4
-Let in be the total amount of water that needs to be poured into buckets and out be the total amount of water that needs to be poured out of buckets to make the amount of water in each bucket x. If out - (out * loss) >= in, then it is possible.
-
diff --git a/problems/pour-water/README.md b/problems/pour-water/README.md
deleted file mode 100644
index 5cb10675a..000000000
--- a/problems/pour-water/README.md
+++ /dev/null
@@ -1,143 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../reach-a-number "Reach a Number")
-
-[Next >](../pyramid-transition-matrix "Pyramid Transition Matrix")
-
-## [755. Pour Water (Medium)](https://leetcode.com/problems/pour-water "倒水")
-
-
-We are given an elevation map, heights[i] representing the height of the terrain at that index. The width at each index is 1. After V units of water fall at index K, how much water is at each index?
-
-Water first drops at index K and rests on top of the highest terrain or water at that index. Then, it flows according to the following rules:
-
If the droplet would eventually fall by moving left, then move left.
-
Otherwise, if the droplet would eventually fall by moving right, then move right.
-
Otherwise, rise at it's current position.
-Here, "eventually fall" means that the droplet will eventually be at a lower level if it moves in that direction.
-Also, "level" means the height of the terrain plus any water in that column.
-
-We can assume there's infinitely high terrain on the two sides out of bounds of the array. Also, there could not be partial water being spread out evenly on more than 1 grid block - each unit of water has to be in exactly one block.
-
-
-
Example 1:
-
-Input: heights = [2,1,1,2,1,2,2], V = 4, K = 3
-Output: [2,2,2,3,2,2,2]
-Explanation:
-# #
-# #
-## # ###
-#########
- 0123456 <- index
-
-The first drop of water lands at index K = 3:
-
-# #
-# w #
-## # ###
-#########
- 0123456
-
-When moving left or right, the water can only move to the same level or a lower level.
-(By level, we mean the total height of the terrain plus any water in that column.)
-Since moving left will eventually make it fall, it moves left.
-(A droplet "made to fall" means go to a lower height than it was at previously.)
-
-# #
-# #
-## w# ###
-#########
- 0123456
-
-Since moving left will not make it fall, it stays in place. The next droplet falls:
-
-# #
-# w #
-## w# ###
-#########
- 0123456
-
-Since the new droplet moving left will eventually make it fall, it moves left.
-Notice that the droplet still preferred to move left,
-even though it could move right (and moving right makes it fall quicker.)
-
-# #
-# w #
-## w# ###
-#########
- 0123456
-
-# #
-# #
-##ww# ###
-#########
- 0123456
-
-After those steps, the third droplet falls.
-Since moving left would not eventually make it fall, it tries to move right.
-Since moving right would eventually make it fall, it moves right.
-
-# #
-# w #
-##ww# ###
-#########
- 0123456
-
-# #
-# #
-##ww#w###
-#########
- 0123456
-
-Finally, the fourth droplet falls.
-Since moving left would not eventually make it fall, it tries to move right.
-Since moving right would not eventually make it fall, it stays in place:
-
-# #
-# w #
-##ww#w###
-#########
- 0123456
-
-The final answer is [2,2,2,3,2,2,2]:
-
- #
- #######
- #######
- 0123456
-
-
-
-
Example 2:
-
-Input: heights = [1,2,3,4], V = 2, K = 2
-Output: [2,3,3,4]
-Explanation:
-The last droplet settles at index 1, since moving further left would not cause it to eventually fall to a lower height.
-
-
-
-
Example 3:
-
-Input: heights = [3,1,3], V = 5, K = 1
-Output: [4,4,4]
-
-
-
-
Note:
-
heights will have length in [1, 100] and contain integers in [0, 99].
You are given an integer array nums. Two players are playing a game with this array: player 1 and player 2.
-
-
Player 1 and player 2 take turns, with player 1 starting first. Both players start the game with a score of 0. At each turn, the player takes one of the numbers from either end of the array (i.e., nums[0] or nums[nums.length - 1]) which reduces the size of the array by 1. The player adds the chosen number to their score. The game ends when there are no more elements in the array.
-
-
Return true if Player 1 can win the game. If the scores of both players are equal, then player 1 is still the winner, and you should also return true. You may assume that both players are playing optimally.
-
-
-
Example 1:
-
-
-Input: nums = [1,5,2]
-Output: false
-Explanation: Initially, player 1 can choose between 1 and 2.
-If he chooses 2 (or 1), then player 2 can choose from 1 (or 2) and 5. If player 2 chooses 5, then player 1 will be left with 1 (or 2).
-So, final score of player 1 is 1 + 2 = 3, and player 2 is 5.
-Hence, player 1 will never be the winner and you need to return false.
-
-
-
Example 2:
-
-
-Input: nums = [1,5,233,7]
-Output: true
-Explanation: Player 1 first chooses 1. Then player 2 has to choose between 5 and 7. No matter which number player 2 choose, player 1 can choose 233.
-Finally, player 1 has more score (234) than player 2 (12), so you need to return True representing player1 can win.
-
Design a special dictionary with some words that searchs the words in it by a prefix and a suffix.
-
-
Implement the WordFilter class:
-
-
-
WordFilter(string[] words) Initializes the object with the words in the dictionary.
-
f(string prefix, string suffix) Returns the index of the word in the dictionary, which has the prefix prefix and the suffix suffix. If there is more than one valid index, return the largest of them. If there is no such word in the dictionary, return -1.
-
-
-
-
Example 1:
-
-
-Input
-["WordFilter", "f"]
-[[["apple"]], ["a", "e"]]
-Output
-[null, 0]
-
-Explanation
-WordFilter wordFilter = new WordFilter(["apple"]);
-wordFilter.f("a", "e"); // return 0, because the word at index 0 has prefix = "a" and suffix = 'e".
-
-
-
-
Constraints:
-
-
-
1 <= words.length <= 15000
-
1 <= words[i].length <= 10
-
1 <= prefix.length, suffix.length <= 10
-
words[i], prefix and suffix consist of lower-case English letters only.
-
At most 15000 calls will be made to the function f.
-
-
-### Related Topics
- [[Design](../../tag/design/README.md)]
- [[Trie](../../tag/trie/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Similar Questions
- 1. [Design Add and Search Words Data Structure](../design-add-and-search-words-data-structure) (Medium)
-
-### Hints
-
-Hint 1
-For a word like "test", consider "#test", "t#test", "st#test", "est#test", "test#test". Then if we have a query like prefix = "te", suffix = "t", we can find it by searching for something we've inserted starting with "t#te".
-
diff --git a/problems/prefix-and-suffix-search/prefix_and_suffix_search.go b/problems/prefix-and-suffix-search/prefix_and_suffix_search.go
deleted file mode 100644
index 0e8ee2555..000000000
--- a/problems/prefix-and-suffix-search/prefix_and_suffix_search.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem745
diff --git a/problems/prefix-and-suffix-search/prefix_and_suffix_search_test.go b/problems/prefix-and-suffix-search/prefix_and_suffix_search_test.go
deleted file mode 100644
index 0e8ee2555..000000000
--- a/problems/prefix-and-suffix-search/prefix_and_suffix_search_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem745
diff --git a/problems/preimage-size-of-factorial-zeroes-function/README.md b/problems/preimage-size-of-factorial-zeroes-function/README.md
deleted file mode 100644
index dc4e6827d..000000000
--- a/problems/preimage-size-of-factorial-zeroes-function/README.md
+++ /dev/null
@@ -1,58 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../number-of-matching-subsequences "Number of Matching Subsequences")
-
-[Next >](../valid-tic-tac-toe-state "Valid Tic-Tac-Toe State")
-
-## [793. Preimage Size of Factorial Zeroes Function (Hard)](https://leetcode.com/problems/preimage-size-of-factorial-zeroes-function "阶乘函数后 K 个零")
-
-
Let f(x) be the number of zeroes at the end of x!. Recall that x! = 1 * 2 * 3 * ... * x and by convention, 0! = 1.
-
-
-
For example, f(3) = 0 because 3! = 6 has no zeroes at the end, while f(11) = 2 because 11! = 39916800 has two zeroes at the end.
-
-
-
Given an integer k, return the number of non-negative integers x have the property that f(x) = k.
-
-
-
Example 1:
-
-
-Input: k = 0
-Output: 5
-Explanation: 0!, 1!, 2!, 3!, and 4! end with k = 0 zeroes.
-
-
-
Example 2:
-
-
-Input: k = 5
-Output: 0
-Explanation: There is no x such that x! ends in k = 5 zeroes.
-
-
-
Example 3:
-
-
-Input: k = 3
-Output: 5
-
-
-
-
Constraints:
-
-
-
0 <= k <= 109
-
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
-
-### Similar Questions
- 1. [Factorial Trailing Zeroes](../factorial-trailing-zeroes) (Medium)
diff --git a/problems/preimage-size-of-factorial-zeroes-function/preimage_size_of_factorial_zeroes_function.go b/problems/preimage-size-of-factorial-zeroes-function/preimage_size_of_factorial_zeroes_function.go
deleted file mode 100644
index b734faf1a..000000000
--- a/problems/preimage-size-of-factorial-zeroes-function/preimage_size_of_factorial_zeroes_function.go
+++ /dev/null
@@ -1,26 +0,0 @@
-package problem793
-
-func preimageSizeFZF(K int) int {
- l, r := 0, 5*(K+1)
- for l <= r {
- m := l + (r-l)/2
- km := zeros(m)
- if km < K {
- l = m + 1
- } else if km > K {
- r = m - 1
- } else {
- return 5
- }
- }
- return 0
-}
-
-func zeros(x int) int {
- r := 0
- for x > 0 {
- r += x / 5
- x /= 5
- }
- return r
-}
diff --git a/problems/preimage-size-of-factorial-zeroes-function/preimage_size_of_factorial_zeroes_function_test.go b/problems/preimage-size-of-factorial-zeroes-function/preimage_size_of_factorial_zeroes_function_test.go
deleted file mode 100644
index 713f17821..000000000
--- a/problems/preimage-size-of-factorial-zeroes-function/preimage_size_of_factorial_zeroes_function_test.go
+++ /dev/null
@@ -1,35 +0,0 @@
-package problem793
-
-import "testing"
-
-type testType struct {
- in int
- want int
-}
-
-func TestPreimageSizeFZF(t *testing.T) {
- tests := [...]testType{
- {
- in: 0,
- want: 5,
- },
- {
- in: 5,
- want: 0,
- },
- {
- in: 17,
- want: 0,
- },
- {
- in: 11,
- want: 0,
- },
- }
- for _, tt := range tests {
- got := preimageSizeFZF(tt.in)
- if got != tt.want {
- t.Fatalf("in: %v, got: %v, want: %v", tt.in, got, tt.want)
- }
- }
-}
diff --git a/problems/previous-permutation-with-one-swap/README.md b/problems/previous-permutation-with-one-swap/README.md
deleted file mode 100644
index 34691ac25..000000000
--- a/problems/previous-permutation-with-one-swap/README.md
+++ /dev/null
@@ -1,65 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../grumpy-bookstore-owner "Grumpy Bookstore Owner")
-
-[Next >](../distant-barcodes "Distant Barcodes")
-
-## [1053. Previous Permutation With One Swap (Medium)](https://leetcode.com/problems/previous-permutation-with-one-swap "交换一次的先前排列")
-
-
Given an array of positive integers arr (not necessarily distinct), return the lexicographically largest permutation that is smaller thanarr, that can be made with exactly one swap (A swap exchanges the positions of two numbers arr[i] and arr[j]). If it cannot be done, then return the same array.
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[Array](../../tag/array/README.md)]
-
-### Hints
-
-Hint 1
-You need to swap two values, one larger than the other. Where is the larger one located?
-
diff --git a/problems/previous-permutation-with-one-swap/previous_permutation_with_one_swap.go b/problems/previous-permutation-with-one-swap/previous_permutation_with_one_swap.go
deleted file mode 100644
index 342701569..000000000
--- a/problems/previous-permutation-with-one-swap/previous_permutation_with_one_swap.go
+++ /dev/null
@@ -1,25 +0,0 @@
-package problem1053
-
-func prevPermOpt1(A []int) []int {
- n := len(A)
- stack, top := make([]int, n), 0
- stack[top] = n - 1
-
- for i := n - 2; i >= 0; i-- {
- if A[i] <= A[stack[top]] {
- top++
- stack[top] = i
- continue
- }
- for top-1 >= 0 &&
- A[stack[top]] < A[stack[top-1]] &&
- A[stack[top-1]] < A[i] {
- top--
- }
- j := stack[top]
- A[i], A[j] = A[j], A[i]
- break
- }
-
- return A
-}
diff --git a/problems/primary-department-for-each-employee/README.md b/problems/primary-department-for-each-employee/README.md
deleted file mode 100644
index cbceac426..000000000
--- a/problems/primary-department-for-each-employee/README.md
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximize-the-beauty-of-the-garden "Maximize the Beauty of the Garden")
-
-[Next >](../check-if-one-string-swap-can-make-strings-equal "Check if One String Swap Can Make Strings Equal")
-
-## [1789. Primary Department for Each Employee (Easy)](https://leetcode.com/problems/primary-department-for-each-employee "员工的直属部门")
-
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/primary-department-for-each-employee/mysql_schemas.sql b/problems/primary-department-for-each-employee/mysql_schemas.sql
deleted file mode 100644
index bae508bb0..000000000
--- a/problems/primary-department-for-each-employee/mysql_schemas.sql
+++ /dev/null
@@ -1,9 +0,0 @@
-Create table If Not Exists Employee (employee_id int, department_id int, primary_flag ENUM('Y','N'));
-Truncate table Employee;
-insert into Employee (employee_id, department_id, primary_flag) values ('1', '1', 'N');
-insert into Employee (employee_id, department_id, primary_flag) values ('2', '1', 'Y');
-insert into Employee (employee_id, department_id, primary_flag) values ('2', '2', 'N');
-insert into Employee (employee_id, department_id, primary_flag) values ('3', '3', 'N');
-insert into Employee (employee_id, department_id, primary_flag) values ('4', '2', 'N');
-insert into Employee (employee_id, department_id, primary_flag) values ('4', '3', 'Y');
-insert into Employee (employee_id, department_id, primary_flag) values ('4', '4', 'N');
diff --git a/problems/prime-arrangements/README.md b/problems/prime-arrangements/README.md
deleted file mode 100644
index bb7caddf2..000000000
--- a/problems/prime-arrangements/README.md
+++ /dev/null
@@ -1,60 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../immediate-food-delivery-ii "Immediate Food Delivery II")
-
-[Next >](../diet-plan-performance "Diet Plan Performance")
-
-## [1175. Prime Arrangements (Easy)](https://leetcode.com/problems/prime-arrangements "质数排列")
-
-
Return the number of permutations of 1 to n so that prime numbers are at prime indices (1-indexed.)
-
-
(Recall that an integer is prime if and only if it is greater than 1, and cannot be written as a product of two positive integers both smaller than it.)
-
-
Since the answer may be large, return the answer modulo 10^9 + 7.
-
-
-
Example 1:
-
-
-Input: n = 5
-Output: 12
-Explanation: For example [1,2,5,4,3] is a valid permutation, but [5,2,3,4,1] is not because the prime number 5 is at index 1.
-
-
-
Example 2:
-
-
-Input: n = 100
-Output: 682289015
-
-
-
-
Constraints:
-
-
-
1 <= n <= 100
-
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
-
-### Hints
-
-Hint 1
-Solve the problem for prime numbers and composite numbers separately.
-
-
-
-Hint 2
-Multiply the number of permutations of prime numbers over prime indices with the number of permutations of composite numbers over composite indices.
-
-
-
-Hint 3
-The number of permutations equals the factorial.
-
diff --git a/problems/prime-number-of-set-bits-in-binary-representation/README.md b/problems/prime-number-of-set-bits-in-binary-representation/README.md
deleted file mode 100644
index 8cc15c482..000000000
--- a/problems/prime-number-of-set-bits-in-binary-representation/README.md
+++ /dev/null
@@ -1,71 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../special-binary-string "Special Binary String")
-
-[Next >](../partition-labels "Partition Labels")
-
-## [762. Prime Number of Set Bits in Binary Representation (Easy)](https://leetcode.com/problems/prime-number-of-set-bits-in-binary-representation "二进制表示中质数个计算置位")
-
-
Given two integers left and right, return the count of numbers in the inclusive range [left, right] having a prime number of set bits in their binary representation.
-
-
Recall that the number of set bits an integer has is the number of 1's present when written in binary.
-
-
-
For example, 21 written in binary is 10101, which has 3 set bits.
-
-
-
-
Example 1:
-
-
-Input: left = 6, right = 10
-Output: 4
-Explanation:
-6 -> 110 (2 set bits, 2 is prime)
-7 -> 111 (3 set bits, 3 is prime)
-8 -> 1000 (1 set bit, 1 is not prime)
-9 -> 1001 (2 set bits, 2 is prime)
-10 -> 1010 (2 set bits, 2 is prime)
-4 numbers have a prime number of set bits.
-
-
-
Example 2:
-
-
-Input: left = 10, right = 15
-Output: 5
-Explanation:
-10 -> 1010 (2 set bits, 2 is prime)
-11 -> 1011 (3 set bits, 3 is prime)
-12 -> 1100 (2 set bits, 2 is prime)
-13 -> 1101 (3 set bits, 3 is prime)
-14 -> 1110 (3 set bits, 3 is prime)
-15 -> 1111 (4 set bits, 4 is not prime)
-5 numbers have a prime number of set bits.
-
-
-
-
Constraints:
-
-
-
1 <= left <= right <= 106
-
0 <= right - left <= 104
-
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
- [[Bit Manipulation](../../tag/bit-manipulation/README.md)]
-
-### Similar Questions
- 1. [Number of 1 Bits](../number-of-1-bits) (Easy)
-
-### Hints
-
-Hint 1
-Write a helper function to count the number of set bits in a number, then check whether the number of set bits is 2, 3, 5, 7, 11, 13, 17 or 19.
-
diff --git a/problems/prime-number-of-set-bits-in-binary-representation/prime_number_of_set_bits_in_binary_representation.go b/problems/prime-number-of-set-bits-in-binary-representation/prime_number_of_set_bits_in_binary_representation.go
deleted file mode 100644
index 6e28fe692..000000000
--- a/problems/prime-number-of-set-bits-in-binary-representation/prime_number_of_set_bits_in_binary_representation.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem762
diff --git a/problems/prime-number-of-set-bits-in-binary-representation/prime_number_of_set_bits_in_binary_representation_test.go b/problems/prime-number-of-set-bits-in-binary-representation/prime_number_of_set_bits_in_binary_representation_test.go
deleted file mode 100644
index 6e28fe692..000000000
--- a/problems/prime-number-of-set-bits-in-binary-representation/prime_number_of_set_bits_in_binary_representation_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem762
diff --git a/problems/prime-palindrome/README.md b/problems/prime-palindrome/README.md
deleted file mode 100644
index 6a821c8e6..000000000
--- a/problems/prime-palindrome/README.md
+++ /dev/null
@@ -1,49 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../smallest-subtree-with-all-the-deepest-nodes "Smallest Subtree with all the Deepest Nodes")
-
-[Next >](../transpose-matrix "Transpose Matrix")
-
-## [866. Prime Palindrome (Medium)](https://leetcode.com/problems/prime-palindrome "回文素数")
-
-
Given an integer n, return the smallest prime palindrome greater than or equal to n.
-
-
An integer is prime if it has exactly two divisors: 1 and itself. Note that 1 is not a prime number.
-
-
-
For example, 2, 3, 5, 7, 11, and 13 are all primes.
-
-
-
An integer is a palindrome if it reads the same from left to right as it does from right to left.
-
-
-
For example, 101 and 12321 are palindromes.
-
-
-
The test cases are generated so that the answer always exists and is in the range [2, 2 * 108].
Given the root of a binary tree, construct a 0-indexedm x n string matrix res that represents a formatted layout of the tree. The formatted layout matrix should be constructed using the following rules:
-
-
-
The height of the tree is height and the number of rows m should be equal to height + 1.
-
The number of columns n should be equal to 2height+1 - 1.
-
Place the root node in the middle of the top row (more formally, at location res[0][(n-1)/2]).
-
For each node that has been placed in the matrix at position res[r][c], place its left child at res[r+1][c-2height-r-1] and its right child at res[r+1][c+2height-r-1].
-
Continue this process until all the nodes in the tree have been placed.
-
Any empty cells should contain the empty string "".
-class FooBar {
- public void foo() {
- for (int i = 0; i < n; i++) {
- print("foo");
- }
- }
-
- public void bar() {
- for (int i = 0; i < n; i++) {
- print("bar");
- }
- }
-}
-
-
-
The same instance of FooBar will be passed to two different threads:
-
-
-
thread A will call foo(), while
-
thread B will call bar().
-
-
-
Modify the given program to output "foobar"n times.
-
-
-
Example 1:
-
-
-Input: n = 1
-Output: "foobar"
-Explanation: There are two threads being fired asynchronously. One of them calls foo(), while the other calls bar().
-"foobar" is being output 1 time.
-
-
-
Example 2:
-
-
-Input: n = 2
-Output: "foobarfoobar"
-Explanation: "foobar" is being output 2 times.
-
-
-
-
Constraints:
-
-
-
1 <= n <= 1000
-
-
-### Related Topics
- [[Concurrency](../../tag/concurrency/README.md)]
-
-### Similar Questions
- 1. [Print in Order](../print-in-order) (Easy)
- 1. [Print Zero Even Odd](../print-zero-even-odd) (Medium)
diff --git a/problems/print-foobar-alternately/print_foobar_alternately.py b/problems/print-foobar-alternately/print_foobar_alternately.py
deleted file mode 100755
index 5b00970e5..000000000
--- a/problems/print-foobar-alternately/print_foobar_alternately.py
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/usr/bin/env python
-
-class FooBar:
- def __init__(self, n):
- self.n = n
-
-
- def foo(self, printFoo: 'Callable[[], None]') -> None:
-
- for i in range(self.n):
-
- # printFoo() outputs "foo". Do not change or remove this line.
- printFoo()
-
-
- def bar(self, printBar: 'Callable[[], None]') -> None:
-
- for i in range(self.n):
-
- # printBar() outputs "bar". Do not change or remove this line.
- printBar()
\ No newline at end of file
diff --git a/problems/print-immutable-linked-list-in-reverse/README.md b/problems/print-immutable-linked-list-in-reverse/README.md
deleted file mode 100644
index 28cd9038f..000000000
--- a/problems/print-immutable-linked-list-in-reverse/README.md
+++ /dev/null
@@ -1,57 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../page-recommendations "Page Recommendations")
-
-[Next >](../minimum-time-visiting-all-points "Minimum Time Visiting All Points")
-
-## [1265. Print Immutable Linked List in Reverse (Medium)](https://leetcode.com/problems/print-immutable-linked-list-in-reverse "逆序打印不可变链表")
-
-You are given an immutable linked list, print out all values of each node in reverse with the help of the following interface:
-
-- ImmutableListNode: An interface of immutable linked list, you are given the head of the list.
-You need to use the following functions to access the linked list (you can't access the ImmutableListNode directly):
-
-- ImmutableListNode.printValue(): Print value of the current node.
-- ImmutableListNode.getNext(): Return the next node.
-The input is only given to initialize the linked list internally. You must solve this problem without modifying the linked list. In other words, you must operate the linked list using only the mentioned APIs.
-
-Follow up:
-
-Could you solve this problem in:
-
-- Constant space complexity?
-- Linear time complexity and less than linear space complexity?
-
-
Example 1:
-
-Input: head = [1,2,3,4]
-Output: [4,3,2,1]
-
-
-
Example 2:
-
-Input: head = [0,-4,-1,3,-5]
-Output: [-5,3,-1,-4,0]
-
-
-
Example 3:
-
-Input: head = [-2,0,6,4,4,-6]
-Output: [-6,4,4,6,0,-2]
-
-
-Constraints:
-
-- The length of the linked list is between [1, 1000].
-- The value of each node in the linked list is between [-1000, 1000].
-
-### Related Topics
- [[Linked List](../../tag/linked-list/README.md)]
- [[Two Pointers](../../tag/two-pointers/README.md)]
- [[Stack](../../tag/stack/README.md)]
- [[Recursion](../../tag/recursion/README.md)]
diff --git a/problems/print-in-order/README.md b/problems/print-in-order/README.md
deleted file mode 100644
index 2f0675943..000000000
--- a/problems/print-in-order/README.md
+++ /dev/null
@@ -1,58 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../reported-posts "Reported Posts")
-
-[Next >](../print-foobar-alternately "Print FooBar Alternately")
-
-## [1114. Print in Order (Easy)](https://leetcode.com/problems/print-in-order "按序打印")
-
-
Suppose we have a class:
-
-
-public class Foo {
- public void first() { print("first"); }
- public void second() { print("second"); }
- public void third() { print("third"); }
-}
-
-
-
The same instance of Foo will be passed to three different threads. Thread A will call first(), thread B will call second(), and thread C will call third(). Design a mechanism and modify the program to ensure that second() is executed after first(), and third() is executed after second().
-
-
Note:
-
-
We do not know how the threads will be scheduled in the operating system, even though the numbers in the input seem to imply the ordering. The input format you see is mainly to ensure our tests' comprehensiveness.
-
-
-
Example 1:
-
-
-Input: nums = [1,2,3]
-Output: "firstsecondthird"
-Explanation: There are three threads being fired asynchronously. The input [1,2,3] means thread A calls first(), thread B calls second(), and thread C calls third(). "firstsecondthird" is the correct output.
-
-
-
Example 2:
-
-
-Input: nums = [1,3,2]
-Output: "firstsecondthird"
-Explanation: The input [1,3,2] means thread A calls first(), thread B calls third(), and thread C calls second(). "firstsecondthird" is the correct output.
-
-
-
-
Constraints:
-
-
-
nums is a permutation of [1, 2, 3].
-
-
-### Related Topics
- [[Concurrency](../../tag/concurrency/README.md)]
-
-### Similar Questions
- 1. [Print FooBar Alternately](../print-foobar-alternately) (Medium)
diff --git a/problems/print-in-order/print_in_order.py b/problems/print-in-order/print_in_order.py
deleted file mode 100755
index 8cabb5e08..000000000
--- a/problems/print-in-order/print_in_order.py
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/usr/bin/env python
-
-class Foo:
- def __init__(self):
- pass
-
-
- def first(self, printFirst: 'Callable[[], None]') -> None:
-
- # printFirst() outputs "first". Do not change or remove this line.
- printFirst()
-
-
- def second(self, printSecond: 'Callable[[], None]') -> None:
-
- # printSecond() outputs "second". Do not change or remove this line.
- printSecond()
-
-
- def third(self, printThird: 'Callable[[], None]') -> None:
-
- # printThird() outputs "third". Do not change or remove this line.
- printThird()
\ No newline at end of file
diff --git a/problems/print-words-vertically/README.md b/problems/print-words-vertically/README.md
deleted file mode 100644
index 76e308fc7..000000000
--- a/problems/print-words-vertically/README.md
+++ /dev/null
@@ -1,66 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-69-number "Maximum 69 Number")
-
-[Next >](../delete-leaves-with-a-given-value "Delete Leaves With a Given Value")
-
-## [1324. Print Words Vertically (Medium)](https://leetcode.com/problems/print-words-vertically "竖直打印单词")
-
-
Given a string s. Return all the words vertically in the same order in which they appear in s.
-Words are returned as a list of strings, complete with spaces when is necessary. (Trailing spaces are not allowed).
-Each word would be put on only one column and that in one column there will be only one word.
-
-
-
Example 1:
-
-
-Input: s = "HOW ARE YOU"
-Output: ["HAY","ORO","WEU"]
-Explanation: Each word is printed vertically.
- "HAY"
- "ORO"
- "WEU"
-
-
-
Example 2:
-
-
-Input: s = "TO BE OR NOT TO BE"
-Output: ["TBONTB","OEROOE"," T"]
-Explanation: Trailing spaces is not allowed.
-"TBONTB"
-"OEROOE"
-" T"
-
-
-
Example 3:
-
-
-Input: s = "CONTEST IS COMING"
-Output: ["CIC","OSO","N M","T I","E N","S G","T"]
-
-
-
-
Constraints:
-
-
-
1 <= s.length <= 200
-
s contains only upper case English letters.
-
It's guaranteed that there is only one space between 2 words.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[String](../../tag/string/README.md)]
- [[Simulation](../../tag/simulation/README.md)]
-
-### Hints
-
-Hint 1
-Use the maximum length of words to determine the length of the returned answer. However, don't forget to remove trailing spaces.
-
diff --git a/problems/print-zero-even-odd/README.md b/problems/print-zero-even-odd/README.md
deleted file mode 100644
index e053c905b..000000000
--- a/problems/print-zero-even-odd/README.md
+++ /dev/null
@@ -1,68 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../print-foobar-alternately "Print FooBar Alternately")
-
-[Next >](../building-h2o "Building H2O")
-
-## [1116. Print Zero Even Odd (Medium)](https://leetcode.com/problems/print-zero-even-odd "打印零与奇偶数")
-
-
You have a function printNumber that can be called with an integer parameter and prints it to the console.
-
-
-
For example, calling printNumber(7) prints 7 to the console.
-
-
-
You are given an instance of the class ZeroEvenOdd that has three functions: zero, even, and odd. The same instance of ZeroEvenOdd will be passed to three different threads:
-
-
-
Thread A: calls zero() that should only output 0's.
-
Thread B: calls even() that should only output even numbers.
-
Thread C: calls odd() that should only output odd numbers.
-
-
-
Modify the given class to output the series "010203040506..." where the length of the series must be 2n.
-
-
Implement the ZeroEvenOdd class:
-
-
-
ZeroEvenOdd(int n) Initializes the object with the number n that represents the numbers that should be printed.
-
void zero(printNumber) Calls printNumber to output one zero.
-
void even(printNumber) Calls printNumber to output one even number.
-
void odd(printNumber) Calls printNumber to output one odd number.
-
-
-
-
Example 1:
-
-
-Input: n = 2
-Output: "0102"
-Explanation: There are three threads being fired asynchronously.
-One of them calls zero(), the other calls even(), and the last one calls odd().
-"0102" is the correct output.
-
-
-
Example 2:
-
-
-Input: n = 5
-Output: "0102030405"
-
-
-
-
Constraints:
-
-
-
1 <= n <= 1000
-
-
-### Related Topics
- [[Concurrency](../../tag/concurrency/README.md)]
-
-### Similar Questions
- 1. [Print FooBar Alternately](../print-foobar-alternately) (Medium)
diff --git a/problems/print-zero-even-odd/print_zero_even_odd.py b/problems/print-zero-even-odd/print_zero_even_odd.py
deleted file mode 100755
index a9951a670..000000000
--- a/problems/print-zero-even-odd/print_zero_even_odd.py
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/usr/bin/env python
-
-class ZeroEvenOdd:
- def __init__(self, n):
- self.n = n
-
-
- # printNumber(x) outputs "x", where x is an integer.
- def zero(self, printNumber: 'Callable[[int], None]') -> None:
-
-
-
- def even(self, printNumber: 'Callable[[int], None]') -> None:
-
-
-
- def odd(self, printNumber: 'Callable[[int], None]') -> None:
\ No newline at end of file
diff --git a/problems/prison-cells-after-n-days/README.md b/problems/prison-cells-after-n-days/README.md
deleted file mode 100644
index 1459ec6aa..000000000
--- a/problems/prison-cells-after-n-days/README.md
+++ /dev/null
@@ -1,66 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../tallest-billboard "Tallest Billboard")
-
-[Next >](../check-completeness-of-a-binary-tree "Check Completeness of a Binary Tree")
-
-## [957. Prison Cells After N Days (Medium)](https://leetcode.com/problems/prison-cells-after-n-days "N 天后的牢房")
-
-
There are 8 prison cells in a row and each cell is either occupied or vacant.
-
-
Each day, whether the cell is occupied or vacant changes according to the following rules:
-
-
-
If a cell has two adjacent neighbors that are both occupied or both vacant, then the cell becomes occupied.
-
Otherwise, it becomes vacant.
-
-
-
Note that because the prison is a row, the first and the last cells in the row can't have two adjacent neighbors.
-
-
You are given an integer array cells where cells[i] == 1 if the ith cell is occupied and cells[i] == 0 if the ith cell is vacant, and you are given an integer n.
-
-
Return the state of the prison after n days (i.e., n such changes described above).
-Input: cells = [1,0,0,1,0,0,1,0], n = 1000000000
-Output: [0,0,1,1,1,1,1,0]
-
-
-
-
Constraints:
-
-
-
cells.length == 8
-
cells[i] is either 0 or 1.
-
1 <= n <= 109
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Math](../../tag/math/README.md)]
- [[Bit Manipulation](../../tag/bit-manipulation/README.md)]
diff --git a/problems/prison-cells-after-n-days/prison_cells_after_n_days.go b/problems/prison-cells-after-n-days/prison_cells_after_n_days.go
deleted file mode 100644
index 9b15fd97d..000000000
--- a/problems/prison-cells-after-n-days/prison_cells_after_n_days.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem957
diff --git a/problems/prison-cells-after-n-days/prison_cells_after_n_days_test.go b/problems/prison-cells-after-n-days/prison_cells_after_n_days_test.go
deleted file mode 100644
index 9b15fd97d..000000000
--- a/problems/prison-cells-after-n-days/prison_cells_after_n_days_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem957
diff --git a/problems/probability-of-a-two-boxes-having-the-same-number-of-distinct-balls/README.md b/problems/probability-of-a-two-boxes-having-the-same-number-of-distinct-balls/README.md
deleted file mode 100644
index 4e558e1e6..000000000
--- a/problems/probability-of-a-two-boxes-having-the-same-number-of-distinct-balls/README.md
+++ /dev/null
@@ -1,91 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../reorder-routes-to-make-all-paths-lead-to-the-city-zero "Reorder Routes to Make All Paths Lead to the City Zero")
-
-[Next >](../calculate-salaries "Calculate Salaries")
-
-## [1467. Probability of a Two Boxes Having The Same Number of Distinct Balls (Hard)](https://leetcode.com/problems/probability-of-a-two-boxes-having-the-same-number-of-distinct-balls "两个盒子中球的颜色数相同的概率")
-
-
Given 2n balls of k distinct colors. You will be given an integer array balls of size k where balls[i] is the number of balls of color i.
-
-
All the balls will be shuffled uniformly at random, then we will distribute the first n balls to the first box and the remaining n balls to the other box (Please read the explanation of the second example carefully).
-
-
Please note that the two boxes are considered different. For example, if we have two balls of colors a and b, and two boxes [] and (), then the distribution [a] (b) is considered different than the distribution [b] (a) (Please read the explanation of the first example carefully).
-
-
Return the probability that the two boxes have the same number of distinct balls. Answers within 10-5 of the actual value will be accepted as correct.
-
-
-
Example 1:
-
-
-Input: balls = [1,1]
-Output: 1.00000
-Explanation: Only 2 ways to divide the balls equally:
-- A ball of color 1 to box 1 and a ball of color 2 to box 2
-- A ball of color 2 to box 1 and a ball of color 1 to box 2
-In both ways, the number of distinct colors in each box is equal. The probability is 2/2 = 1
-
-
-
Example 2:
-
-
-Input: balls = [2,1,1]
-Output: 0.66667
-Explanation: We have the set of balls [1, 1, 2, 3]
-This set of balls will be shuffled randomly and we may have one of the 12 distinct shuffles with equal probability (i.e. 1/12):
-[1,1 / 2,3], [1,1 / 3,2], [1,2 / 1,3], [1,2 / 3,1], [1,3 / 1,2], [1,3 / 2,1], [2,1 / 1,3], [2,1 / 3,1], [2,3 / 1,1], [3,1 / 1,2], [3,1 / 2,1], [3,2 / 1,1]
-After that, we add the first two balls to the first box and the second two balls to the second box.
-We can see that 8 of these 12 possible random distributions have the same number of distinct colors of balls in each box.
-Probability is 8/12 = 0.66667
-
-
-
Example 3:
-
-
-Input: balls = [1,2,1,2]
-Output: 0.60000
-Explanation: The set of balls is [1, 2, 2, 3, 4, 4]. It is hard to display all the 180 possible random shuffles of this set but it is easy to check that 108 of them will have the same number of distinct colors in each box.
-Probability = 108 / 180 = 0.6
-
-
-
-
Constraints:
-
-
-
1 <= balls.length <= 8
-
1 <= balls[i] <= 6
-
sum(balls) is even.
-
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Backtracking](../../tag/backtracking/README.md)]
- [[Combinatorics](../../tag/combinatorics/README.md)]
- [[Probability and Statistics](../../tag/probability-and-statistics/README.md)]
-
-### Hints
-
-Hint 1
-Check how many ways you can distribute the balls between the boxes.
-
-
-
-Hint 2
-Consider that one way you will use (x1, x2, x3, ..., xk) where xi is the number of balls from colour i. The probability of achieving this way randomly is ( (ball1 C x1) * (ball2 C x2) * (ball3 C x3) * ... * (ballk C xk)) / (2n C n).
-
-
-
-Hint 3
-The probability of a draw is the sigma of probabilities of different ways to achieve draw.
-
-
-
-Hint 4
-Can you use Dynamic programming to solve this problem in a better complexity ?
-
diff --git a/problems/process-restricted-friend-requests/README.md b/problems/process-restricted-friend-requests/README.md
deleted file mode 100644
index cd6c67d9f..000000000
--- a/problems/process-restricted-friend-requests/README.md
+++ /dev/null
@@ -1,87 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../decode-the-slanted-ciphertext "Decode the Slanted Ciphertext")
-
-[Next >](../paths-in-maze-that-lead-to-same-room "Paths in Maze That Lead to Same Room")
-
-## [2076. Process Restricted Friend Requests (Hard)](https://leetcode.com/problems/process-restricted-friend-requests "处理含限制条件的好友请求")
-
-
You are given an integer n indicating the number of people in a network. Each person is labeled from 0 to n - 1.
-
-
You are also given a 0-indexed 2D integer array restrictions, where restrictions[i] = [xi, yi] means that person xi and person yicannot become friends,either directly or indirectly through other people.
-
-
Initially, no one is friends with each other. You are given a list of friend requests as a 0-indexed 2D integer array requests, where requests[j] = [uj, vj] is a friend request between person uj and person vj.
-
-
A friend request is successful if uj and vj can be friends. Each friend request is processed in the given order (i.e., requests[j] occurs before requests[j + 1]), and upon a successful request, uj and vjbecome direct friends for all future friend requests.
-
-
Return a boolean arrayresult, where each result[j] is true if the jth friend request is successful or false if it is not.
-
-
Note: If uj and vj are already direct friends, the request is still successful.
-
-
-
Example 1:
-
-
-Input: n = 3, restrictions = [[0,1]], requests = [[0,2],[2,1]]
-Output: [true,false]
-Explanation:
-Request 0: Person 0 and person 2 can be friends, so they become direct friends.
-Request 1: Person 2 and person 1 cannot be friends since person 0 and person 1 would be indirect friends (1--2--0).
-
-
-
Example 2:
-
-
-Input: n = 3, restrictions = [[0,1]], requests = [[1,2],[0,2]]
-Output: [true,false]
-Explanation:
-Request 0: Person 1 and person 2 can be friends, so they become direct friends.
-Request 1: Person 0 and person 2 cannot be friends since person 0 and person 1 would be indirect friends (0--2--1).
-
-
-
Example 3:
-
-
-Input: n = 5, restrictions = [[0,1],[1,2],[2,3]], requests = [[0,4],[1,2],[3,1],[3,4]]
-Output: [true,false,true,false]
-Explanation:
-Request 0: Person 0 and person 4 can be friends, so they become direct friends.
-Request 1: Person 1 and person 2 cannot be friends since they are directly restricted.
-Request 2: Person 3 and person 1 can be friends, so they become direct friends.
-Request 3: Person 3 and person 4 cannot be friends since person 0 and person 1 would be indirect friends (0--4--3--1).
-
-
-
-
Constraints:
-
-
-
2 <= n <= 1000
-
0 <= restrictions.length <= 1000
-
restrictions[i].length == 2
-
0 <= xi, yi <= n - 1
-
xi != yi
-
1 <= requests.length <= 1000
-
requests[j].length == 2
-
0 <= uj, vj <= n - 1
-
uj != vj
-
-
-### Related Topics
- [[Union Find](../../tag/union-find/README.md)]
- [[Graph](../../tag/graph/README.md)]
-
-### Hints
-
-Hint 1
-For each request, we could loop through all restrictions. Can you think of doing a check-in close to O(1)?
-
-
-
-Hint 2
-Could you use Union Find?
-
diff --git a/problems/process-tasks-using-servers/README.md b/problems/process-tasks-using-servers/README.md
deleted file mode 100644
index d2523efe7..000000000
--- a/problems/process-tasks-using-servers/README.md
+++ /dev/null
@@ -1,80 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-value-after-insertion "Maximum Value after Insertion")
-
-[Next >](../minimum-skips-to-arrive-at-meeting-on-time "Minimum Skips to Arrive at Meeting On Time")
-
-## [1882. Process Tasks Using Servers (Medium)](https://leetcode.com/problems/process-tasks-using-servers "使用服务器处理任务")
-
-
You are given two 0-indexed integer arrays servers and tasks of lengths n and m respectively. servers[i] is the weight of the ith server, and tasks[j] is the time needed to process the jth task in seconds.
-
-
Tasks are assigned to the servers using a task queue. Initially, all servers are free, and the queue is empty.
-
-
At second j, the jth task is inserted into the queue (starting with the 0th task being inserted at second 0). As long as there are free servers and the queue is not empty, the task in the front of the queue will be assigned to a free server with the smallest weight, and in case of a tie, it is assigned to a free server with the smallest index.
-
-
If there are no free servers and the queue is not empty, we wait until a server becomes free and immediately assign the next task. If multiple servers become free at the same time, then multiple tasks from the queue will be assigned in order of insertion following the weight and index priorities above.
-
-
A server that is assigned task j at second t will be free again at second t + tasks[j].
-
-
Build an array ans of length m, where ans[j] is the index of the server the jth task will be assigned to.
-
-
Return the array ans.
-
-
-
Example 1:
-
-
-Input: servers = [3,3,2], tasks = [1,2,3,2,1,2]
-Output: [2,2,0,2,1,2]
-Explanation: Events in chronological order go as follows:
-- At second 0, task 0 is added and processed using server 2 until second 1.
-- At second 1, server 2 becomes free. Task 1 is added and processed using server 2 until second 3.
-- At second 2, task 2 is added and processed using server 0 until second 5.
-- At second 3, server 2 becomes free. Task 3 is added and processed using server 2 until second 5.
-- At second 4, task 4 is added and processed using server 1 until second 5.
-- At second 5, all servers become free. Task 5 is added and processed using server 2 until second 7.
-
-
Example 2:
-
-
-Input: servers = [5,1,4,3,2], tasks = [2,1,2,4,5,2,1]
-Output: [1,4,1,4,1,3,2]
-Explanation: Events in chronological order go as follows:
-- At second 0, task 0 is added and processed using server 1 until second 2.
-- At second 1, task 1 is added and processed using server 4 until second 2.
-- At second 2, servers 1 and 4 become free. Task 2 is added and processed using server 1 until second 4.
-- At second 3, task 3 is added and processed using server 4 until second 7.
-- At second 4, server 1 becomes free. Task 4 is added and processed using server 1 until second 9.
-- At second 5, task 5 is added and processed using server 3 until second 7.
-- At second 6, task 6 is added and processed using server 2 until second 7.
-
-
-
-
Constraints:
-
-
-
servers.length == n
-
tasks.length == m
-
1 <= n, m <= 2 * 105
-
1 <= servers[i], tasks[j] <= 2 * 105
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Heap (Priority Queue)](../../tag/heap-priority-queue/README.md)]
-
-### Hints
-
-Hint 1
-You can maintain a Heap of available Servers and a Heap of unavailable servers
-
-
-
-Hint 2
-Note that the tasks will be processed in the input order so you just need to find the x-th server that will be available according to the rules
-
diff --git a/problems/product-of-array-except-self/README.md b/problems/product-of-array-except-self/README.md
deleted file mode 100644
index 0b3fe0d47..000000000
--- a/problems/product-of-array-except-self/README.md
+++ /dev/null
@@ -1,47 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../delete-node-in-a-linked-list "Delete Node in a Linked List")
-
-[Next >](../sliding-window-maximum "Sliding Window Maximum")
-
-## [238. Product of Array Except Self (Medium)](https://leetcode.com/problems/product-of-array-except-self "除自身以外数组的乘积")
-
-
Given an integer array nums, return an arrayanswersuch thatanswer[i]is equal to the product of all the elements ofnumsexceptnums[i].
-
-
The product of any prefix or suffix of nums is guaranteed to fit in a 32-bit integer.
-
-
You must write an algorithm that runs in O(n) time and without using the division operation.
The product of any prefix or suffix of nums is guaranteed to fit in a 32-bit integer.
-
-
-
-
Follow up: Can you solve the problem in O(1) extra space complexity? (The output array does not count as extra space for space complexity analysis.)
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Prefix Sum](../../tag/prefix-sum/README.md)]
-
-### Similar Questions
- 1. [Trapping Rain Water](../trapping-rain-water) (Hard)
- 1. [Maximum Product Subarray](../maximum-product-subarray) (Medium)
- 1. [Paint House II](../paint-house-ii) (Hard)
diff --git a/problems/product-of-array-except-self/product_of_array_except_self.go b/problems/product-of-array-except-self/product_of_array_except_self.go
deleted file mode 100644
index d62cce022..000000000
--- a/problems/product-of-array-except-self/product_of_array_except_self.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem238
diff --git a/problems/product-of-array-except-self/product_of_array_except_self_test.go b/problems/product-of-array-except-self/product_of_array_except_self_test.go
deleted file mode 100644
index d62cce022..000000000
--- a/problems/product-of-array-except-self/product_of_array_except_self_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem238
diff --git a/problems/product-of-the-last-k-numbers/README.md b/problems/product-of-the-last-k-numbers/README.md
deleted file mode 100644
index f09bf9ba2..000000000
--- a/problems/product-of-the-last-k-numbers/README.md
+++ /dev/null
@@ -1,77 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../count-negative-numbers-in-a-sorted-matrix "Count Negative Numbers in a Sorted Matrix")
-
-[Next >](../maximum-number-of-events-that-can-be-attended "Maximum Number of Events That Can Be Attended")
-
-## [1352. Product of the Last K Numbers (Medium)](https://leetcode.com/problems/product-of-the-last-k-numbers "最后 K 个数的乘积")
-
-
Design an algorithm that accepts a stream of integers and retrieves the product of the last k integers of the stream.
-
-
Implement the ProductOfNumbers class:
-
-
-
ProductOfNumbers() Initializes the object with an empty stream.
-
void add(int num) Appends the integer num to the stream.
-
int getProduct(int k) Returns the product of the last k numbers in the current list. You can assume that always the current list has at least k numbers.
-
-
-
The test cases are generated so that, at any time, the product of any contiguous sequence of numbers will fit into a single 32-bit integer without overflowing.
-
-
-
Example:
-
-
-Input
-["ProductOfNumbers","add","add","add","add","add","getProduct","getProduct","getProduct","add","getProduct"]
-[[],[3],[0],[2],[5],[4],[2],[3],[4],[8],[2]]
-
-Output
-[null,null,null,null,null,null,20,40,0,null,32]
-
-Explanation
-ProductOfNumbers productOfNumbers = new ProductOfNumbers();
-productOfNumbers.add(3); // [3]
-productOfNumbers.add(0); // [3,0]
-productOfNumbers.add(2); // [3,0,2]
-productOfNumbers.add(5); // [3,0,2,5]
-productOfNumbers.add(4); // [3,0,2,5,4]
-productOfNumbers.getProduct(2); // return 20. The product of the last 2 numbers is 5 * 4 = 20
-productOfNumbers.getProduct(3); // return 40. The product of the last 3 numbers is 2 * 5 * 4 = 40
-productOfNumbers.getProduct(4); // return 0. The product of the last 4 numbers is 0 * 2 * 5 * 4 = 0
-productOfNumbers.add(8); // [3,0,2,5,4,8]
-productOfNumbers.getProduct(2); // return 32. The product of the last 2 numbers is 4 * 8 = 32
-
-
-
-
Constraints:
-
-
-
0 <= num <= 100
-
1 <= k <= 4 * 104
-
At most 4 * 104 calls will be made to add and getProduct.
-
The product of the stream at any point in time will fit in a 32-bit integer.
-
-
-### Related Topics
- [[Design](../../tag/design/README.md)]
- [[Queue](../../tag/queue/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Math](../../tag/math/README.md)]
- [[Data Stream](../../tag/data-stream/README.md)]
-
-### Hints
-
-Hint 1
-Keep all prefix products of numbers in an array, then calculate the product of last K elements in O(1) complexity.
-
-
-
-Hint 2
-When a zero number is added, clean the array of prefix products.
-
diff --git a/problems/product-of-two-run-length-encoded-arrays/README.md b/problems/product-of-two-run-length-encoded-arrays/README.md
deleted file mode 100644
index 60b12f2ad..000000000
--- a/problems/product-of-two-run-length-encoded-arrays/README.md
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../orders-with-maximum-quantity-above-average "Orders With Maximum Quantity Above Average")
-
-[Next >](../longer-contiguous-segments-of-ones-than-zeros "Longer Contiguous Segments of Ones than Zeros")
-
-## [1868. Product of Two Run-Length Encoded Arrays (Medium)](https://leetcode.com/problems/product-of-two-run-length-encoded-arrays "两个行程编码数组的积")
-
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Two Pointers](../../tag/two-pointers/README.md)]
-
-### Hints
-
-Hint 1
-Keep track of the indices on both RLE arrays and join the parts together.
-
-
-
-Hint 2
-What is the maximum number of segments if we took the minimum number of elements left on both the current segments every time?
-
diff --git a/problems/product-price-at-a-given-date/README.md b/problems/product-price-at-a-given-date/README.md
deleted file mode 100644
index 3a1cd5645..000000000
--- a/problems/product-price-at-a-given-date/README.md
+++ /dev/null
@@ -1,57 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../last-substring-in-lexicographical-order "Last Substring in Lexicographical Order")
-
-[Next >](../single-row-keyboard "Single-Row Keyboard")
-
-## [1164. Product Price at a Given Date (Medium)](https://leetcode.com/problems/product-price-at-a-given-date "指定日期的产品价格")
-
-
Table: Products
-
-
-+---------------+---------+
-| Column Name | Type |
-+---------------+---------+
-| product_id | int |
-| new_price | int |
-| change_date | date |
-+---------------+---------+
-(product_id, change_date) is the primary key of this table.
-Each row of this table indicates that the price of some product was changed to a new price at some date.
-
-
-
-
Write an SQL query to find the prices of all products on 2019-08-16. Assume the price of all products before any change is 10.
-
-
The query result format is in the following example:
-+-------------+-------+
-| Column Name | Type |
-+-------------+-------+
-| sale_id | int |
-| product_id | int |
-| year | int |
-| quantity | int |
-| price | int |
-+-------------+-------+
-(sale_id, year) is the primary key of this table.
-product_id is a foreign key to Product table.
-Note that the price is per unit.
-
-
-
Table: Product
-
-
-+--------------+---------+
-| Column Name | Type |
-+--------------+---------+
-| product_id | int |
-| product_name | varchar |
-+--------------+---------+
-product_id is the primary key of this table.
-
-
-
-
-
Write an SQL query that reports all product names of the products in the Sales table along with their selling year and price.
-+-------------+-------+
-| Column Name | Type |
-+-------------+-------+
-| sale_id | int |
-| product_id | int |
-| year | int |
-| quantity | int |
-| price | int |
-+-------------+-------+
-sale_id is the primary key of this table.
-product_id is a foreign key to Product table.
-Note that the price is per unit.
-
-
-
Table: Product
-
-
-+--------------+---------+
-| Column Name | Type |
-+--------------+---------+
-| product_id | int |
-| product_name | varchar |
-+--------------+---------+
-product_id is the primary key of this table.
-
-
-
-
-
Write an SQL query that reports the total quantity sold for every product id.
-
-
The query result format is in the following example:
-+-------------+-------+
-| Column Name | Type |
-+-------------+-------+
-| sale_id | int |
-| product_id | int |
-| year | int |
-| quantity | int |
-| price | int |
-+-------------+-------+
-sale_id is the primary key of this table.
-product_id is a foreign key to Product table.
-Note that the price is per unit.
-
-
-
Table: Product
-
-
-+--------------+---------+
-| Column Name | Type |
-+--------------+---------+
-| product_id | int |
-| product_name | varchar |
-+--------------+---------+
-product_id is the primary key of this table.
-
-
-
-
-
Write an SQL query that selects the product id, year, quantity, and price for the first year of every product sold.
-
-
The query result format is in the following example:
There is a group of n members, and a list of various crimes they could commit. The ith crime generates a profit[i] and requires group[i] members to participate in it. If a member participates in one crime, that member can't participate in another crime.
-
-
Let's call a profitable scheme any subset of these crimes that generates at least minProfit profit, and the total number of members participating in that subset of crimes is at most n.
-
-
Return the number of schemes that can be chosen. Since the answer may be very large, return it modulo109 + 7.
-
-
-
Example 1:
-
-
-Input: n = 5, minProfit = 3, group = [2,2], profit = [2,3]
-Output: 2
-Explanation: To make a profit of at least 3, the group could either commit crimes 0 and 1, or just crime 1.
-In total, there are 2 schemes.
-
-
Example 2:
-
-
-Input: n = 10, minProfit = 5, group = [2,3,5], profit = [6,7,8]
-Output: 7
-Explanation: To make a profit of at least 5, the group could commit any crimes, as long as they commit one.
-There are 7 possible schemes: (0), (1), (2), (0,1), (0,2), (1,2), and (0,1,2).
-+-------------+---------+
-| Column Name | Type |
-+-------------+---------+
-| project_id | int |
-| employee_id | int |
-+-------------+---------+
-(project_id, employee_id) is the primary key of this table.
-employee_id is a foreign key to Employee table.
-
-
-
Table: Employee
-
-
-+------------------+---------+
-| Column Name | Type |
-+------------------+---------+
-| employee_id | int |
-| name | varchar |
-| experience_years | int |
-+------------------+---------+
-employee_id is the primary key of this table.
-
-
-
-
-
Write an SQL query that reports the average experience years of all the employees for each project, rounded to 2 digits.
-
-
The query result format is in the following example:
-
-
-Project table:
-+-------------+-------------+
-| project_id | employee_id |
-+-------------+-------------+
-| 1 | 1 |
-| 1 | 2 |
-| 1 | 3 |
-| 2 | 1 |
-| 2 | 4 |
-+-------------+-------------+
-
-Employee table:
-+-------------+--------+------------------+
-| employee_id | name | experience_years |
-+-------------+--------+------------------+
-| 1 | Khaled | 3 |
-| 2 | Ali | 2 |
-| 3 | John | 1 |
-| 4 | Doe | 2 |
-+-------------+--------+------------------+
-
-Result table:
-+-------------+---------------+
-| project_id | average_years |
-+-------------+---------------+
-| 1 | 2.00 |
-| 2 | 2.50 |
-+-------------+---------------+
-The average experience years for the first project is (3 + 2 + 1) / 3 = 2.00 and for the second project is (3 + 2) / 2 = 2.50
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
-
-### Similar Questions
- 1. [Project Employees II](../project-employees-ii) (Easy)
diff --git a/problems/project-employees-i/mysql_schemas.sql b/problems/project-employees-i/mysql_schemas.sql
deleted file mode 100644
index 552b78497..000000000
--- a/problems/project-employees-i/mysql_schemas.sql
+++ /dev/null
@@ -1,13 +0,0 @@
-Create table If Not Exists Project (project_id int, employee_id int);
-Create table If Not Exists Employee (employee_id int, name varchar(10), experience_years int);
-Truncate table Project;
-insert into Project (project_id, employee_id) values ('1', '1');
-insert into Project (project_id, employee_id) values ('1', '2');
-insert into Project (project_id, employee_id) values ('1', '3');
-insert into Project (project_id, employee_id) values ('2', '1');
-insert into Project (project_id, employee_id) values ('2', '4');
-Truncate table Employee;
-insert into Employee (employee_id, name, experience_years) values ('1', 'Khaled', '3');
-insert into Employee (employee_id, name, experience_years) values ('2', 'Ali', '2');
-insert into Employee (employee_id, name, experience_years) values ('3', 'John', '1');
-insert into Employee (employee_id, name, experience_years) values ('4', 'Doe', '2');
diff --git a/problems/project-employees-i/project_employees_i.sql b/problems/project-employees-i/project_employees_i.sql
deleted file mode 100644
index bae62cf19..000000000
--- a/problems/project-employees-i/project_employees_i.sql
+++ /dev/null
@@ -1 +0,0 @@
-# Write your MySQL query statement below
diff --git a/problems/project-employees-ii/README.md b/problems/project-employees-ii/README.md
deleted file mode 100644
index bc5178900..000000000
--- a/problems/project-employees-ii/README.md
+++ /dev/null
@@ -1,77 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../project-employees-i "Project Employees I")
-
-[Next >](../project-employees-iii "Project Employees III")
-
-## [1076. Project Employees II (Easy)](https://leetcode.com/problems/project-employees-ii "项目员工II")
-
-
Table: Project
-
-
-+-------------+---------+
-| Column Name | Type |
-+-------------+---------+
-| project_id | int |
-| employee_id | int |
-+-------------+---------+
-(project_id, employee_id) is the primary key of this table.
-employee_id is a foreign key to Employee table.
-
-
-
Table: Employee
-
-
-+------------------+---------+
-| Column Name | Type |
-+------------------+---------+
-| employee_id | int |
-| name | varchar |
-| experience_years | int |
-+------------------+---------+
-employee_id is the primary key of this table.
-
-
-
-
-
Write an SQL query that reports all the projects that have the most employees.
-
-
The query result format is in the following example:
-
-
-Project table:
-+-------------+-------------+
-| project_id | employee_id |
-+-------------+-------------+
-| 1 | 1 |
-| 1 | 2 |
-| 1 | 3 |
-| 2 | 1 |
-| 2 | 4 |
-+-------------+-------------+
-
-Employee table:
-+-------------+--------+------------------+
-| employee_id | name | experience_years |
-+-------------+--------+------------------+
-| 1 | Khaled | 3 |
-| 2 | Ali | 2 |
-| 3 | John | 1 |
-| 4 | Doe | 2 |
-+-------------+--------+------------------+
-
-Result table:
-+-------------+
-| project_id |
-+-------------+
-| 1 |
-+-------------+
-The first project has 3 employees while the second one has 2.
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/project-employees-ii/mysql_schemas.sql b/problems/project-employees-ii/mysql_schemas.sql
deleted file mode 100644
index 552b78497..000000000
--- a/problems/project-employees-ii/mysql_schemas.sql
+++ /dev/null
@@ -1,13 +0,0 @@
-Create table If Not Exists Project (project_id int, employee_id int);
-Create table If Not Exists Employee (employee_id int, name varchar(10), experience_years int);
-Truncate table Project;
-insert into Project (project_id, employee_id) values ('1', '1');
-insert into Project (project_id, employee_id) values ('1', '2');
-insert into Project (project_id, employee_id) values ('1', '3');
-insert into Project (project_id, employee_id) values ('2', '1');
-insert into Project (project_id, employee_id) values ('2', '4');
-Truncate table Employee;
-insert into Employee (employee_id, name, experience_years) values ('1', 'Khaled', '3');
-insert into Employee (employee_id, name, experience_years) values ('2', 'Ali', '2');
-insert into Employee (employee_id, name, experience_years) values ('3', 'John', '1');
-insert into Employee (employee_id, name, experience_years) values ('4', 'Doe', '2');
diff --git a/problems/project-employees-ii/project_employees_ii.sql b/problems/project-employees-ii/project_employees_ii.sql
deleted file mode 100644
index bae62cf19..000000000
--- a/problems/project-employees-ii/project_employees_ii.sql
+++ /dev/null
@@ -1 +0,0 @@
-# Write your MySQL query statement below
diff --git a/problems/project-employees-iii/README.md b/problems/project-employees-iii/README.md
deleted file mode 100644
index 6888a3376..000000000
--- a/problems/project-employees-iii/README.md
+++ /dev/null
@@ -1,79 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../project-employees-ii "Project Employees II")
-
-[Next >](../occurrences-after-bigram "Occurrences After Bigram")
-
-## [1077. Project Employees III (Medium)](https://leetcode.com/problems/project-employees-iii "项目员工 III")
-
-
Table: Project
-
-
-+-------------+---------+
-| Column Name | Type |
-+-------------+---------+
-| project_id | int |
-| employee_id | int |
-+-------------+---------+
-(project_id, employee_id) is the primary key of this table.
-employee_id is a foreign key to Employee table.
-
-
-
Table: Employee
-
-
-+------------------+---------+
-| Column Name | Type |
-+------------------+---------+
-| employee_id | int |
-| name | varchar |
-| experience_years | int |
-+------------------+---------+
-employee_id is the primary key of this table.
-
-
-
-
-
Write an SQL query that reports the most experienced employees in each project. In case of a tie, report all employees with the maximum number of experience years.
-
-
The query result format is in the following example:
-
-
-Project table:
-+-------------+-------------+
-| project_id | employee_id |
-+-------------+-------------+
-| 1 | 1 |
-| 1 | 2 |
-| 1 | 3 |
-| 2 | 1 |
-| 2 | 4 |
-+-------------+-------------+
-
-Employee table:
-+-------------+--------+------------------+
-| employee_id | name | experience_years |
-+-------------+--------+------------------+
-| 1 | Khaled | 3 |
-| 2 | Ali | 2 |
-| 3 | John | 3 |
-| 4 | Doe | 2 |
-+-------------+--------+------------------+
-
-Result table:
-+-------------+---------------+
-| project_id | employee_id |
-+-------------+---------------+
-| 1 | 1 |
-| 1 | 3 |
-| 2 | 1 |
-+-------------+---------------+
-Both employees with id 1 and 3 have the most experience among the employees of the first project. For the second project, the employee with id 1 has the most experience.
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/project-employees-iii/mysql_schemas.sql b/problems/project-employees-iii/mysql_schemas.sql
deleted file mode 100644
index 7e21b2188..000000000
--- a/problems/project-employees-iii/mysql_schemas.sql
+++ /dev/null
@@ -1,13 +0,0 @@
-Create table If Not Exists Project (project_id int, employee_id int);
-Create table If Not Exists Employee (employee_id int, name varchar(10), experience_years int);
-Truncate table Project;
-insert into Project (project_id, employee_id) values ('1', '1');
-insert into Project (project_id, employee_id) values ('1', '2');
-insert into Project (project_id, employee_id) values ('1', '3');
-insert into Project (project_id, employee_id) values ('2', '1');
-insert into Project (project_id, employee_id) values ('2', '4');
-Truncate table Employee;
-insert into Employee (employee_id, name, experience_years) values ('1', 'Khaled', '3');
-insert into Employee (employee_id, name, experience_years) values ('2', 'Ali', '2');
-insert into Employee (employee_id, name, experience_years) values ('3', 'John', '3');
-insert into Employee (employee_id, name, experience_years) values ('4', 'Doe', '2');
diff --git a/problems/project-employees-iii/project_employees_iii.sql b/problems/project-employees-iii/project_employees_iii.sql
deleted file mode 100644
index bae62cf19..000000000
--- a/problems/project-employees-iii/project_employees_iii.sql
+++ /dev/null
@@ -1 +0,0 @@
-# Write your MySQL query statement below
diff --git a/problems/projection-area-of-3d-shapes/README.md b/problems/projection-area-of-3d-shapes/README.md
deleted file mode 100644
index 645e1c1af..000000000
--- a/problems/projection-area-of-3d-shapes/README.md
+++ /dev/null
@@ -1,60 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../reachable-nodes-in-subdivided-graph "Reachable Nodes In Subdivided Graph")
-
-[Next >](../uncommon-words-from-two-sentences "Uncommon Words from Two Sentences")
-
-## [883. Projection Area of 3D Shapes (Easy)](https://leetcode.com/problems/projection-area-of-3d-shapes "三维形体投影面积")
-
-
You are given an n x ngrid where we place some 1 x 1 x 1 cubes that are axis-aligned with the x, y, and z axes.
-
-
Each value v = grid[i][j] represents a tower of v cubes placed on top of the cell (i, j).
-
-
We view the projection of these cubes onto the xy, yz, and zx planes.
-
-
A projection is like a shadow, that maps our 3-dimensional figure to a 2-dimensional plane. We are viewing the "shadow" when looking at the cubes from the top, the front, and the side.
-
-
Return the total area of all three projections.
-
-
-
Example 1:
-
-
-Input: grid = [[1,2],[3,4]]
-Output: 17
-Explanation: Here are the three projections ("shadows") of the shape made with each axis-aligned plane.
-
-
-
Example 2:
-
-
-Input: grid = [[2]]
-Output: 5
-
-
-
Example 3:
-
-
-Input: grid = [[1,0],[0,2]]
-Output: 8
-
-
-
-
Constraints:
-
-
-
n == grid.length == grid[i].length
-
1 <= n <= 50
-
0 <= grid[i][j] <= 50
-
-
-### Related Topics
- [[Geometry](../../tag/geometry/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Math](../../tag/math/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
diff --git a/problems/projection-area-of-3d-shapes/projection_area_of_3d_shapes.go b/problems/projection-area-of-3d-shapes/projection_area_of_3d_shapes.go
deleted file mode 100644
index 504f4d7ce..000000000
--- a/problems/projection-area-of-3d-shapes/projection_area_of_3d_shapes.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem883
diff --git a/problems/projection-area-of-3d-shapes/projection_area_of_3d_shapes_test.go b/problems/projection-area-of-3d-shapes/projection_area_of_3d_shapes_test.go
deleted file mode 100644
index 504f4d7ce..000000000
--- a/problems/projection-area-of-3d-shapes/projection_area_of_3d_shapes_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem883
diff --git a/problems/pseudo-palindromic-paths-in-a-binary-tree/README.md b/problems/pseudo-palindromic-paths-in-a-binary-tree/README.md
deleted file mode 100644
index 80f6d4723..000000000
--- a/problems/pseudo-palindromic-paths-in-a-binary-tree/README.md
+++ /dev/null
@@ -1,70 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-number-of-vowels-in-a-substring-of-given-length "Maximum Number of Vowels in a Substring of Given Length")
-
-[Next >](../max-dot-product-of-two-subsequences "Max Dot Product of Two Subsequences")
-
-## [1457. Pseudo-Palindromic Paths in a Binary Tree (Medium)](https://leetcode.com/problems/pseudo-palindromic-paths-in-a-binary-tree "二叉树中的伪回文路径")
-
-
Given a binary tree where node values are digits from 1 to 9. A path in the binary tree is said to be pseudo-palindromic if at least one permutation of the node values in the path is a palindrome.
-
-
Return the number of pseudo-palindromic paths going from the root node to leaf nodes.
-
-
-
Example 1:
-
-
-
-
-Input: root = [2,3,1,3,1,null,1]
-Output: 2
-Explanation: The figure above represents the given binary tree. There are three paths going from the root node to leaf nodes: the red path [2,3,3], the green path [2,1,1], and the path [2,3,1]. Among these paths only red path and green path are pseudo-palindromic paths since the red path [2,3,3] can be rearranged in [3,2,3] (palindrome) and the green path [2,1,1] can be rearranged in [1,2,1] (palindrome).
-
-
-
Example 2:
-
-
-
-
-Input: root = [2,1,1,1,3,null,null,null,null,null,1]
-Output: 1
-Explanation: The figure above represents the given binary tree. There are three paths going from the root node to leaf nodes: the green path [2,1,1], the path [2,1,3,1], and the path [2,1]. Among these paths only the green path is pseudo-palindromic since [2,1,1] can be rearranged in [1,2,1] (palindrome).
-
-
-
Example 3:
-
-
-Input: root = [9]
-Output: 1
-
-
-
-
Constraints:
-
-
-
The number of nodes in the tree is in the range [1, 105].
-
1 <= Node.val <= 9
-
-
-### Related Topics
- [[Bit Manipulation](../../tag/bit-manipulation/README.md)]
- [[Tree](../../tag/tree/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Binary Tree](../../tag/binary-tree/README.md)]
-
-### Hints
-
-Hint 1
-Note that the node values of a path form a palindrome if at most one digit has an odd frequency (parity).
-
-
-
-Hint 2
-Use a Depth First Search (DFS) keeping the frequency (parity) of the digits. Once you are in a leaf node check if at most one digit has an odd frequency (parity).
-
diff --git a/problems/push-dominoes/README.md b/problems/push-dominoes/README.md
deleted file mode 100644
index 2d7a28c6f..000000000
--- a/problems/push-dominoes/README.md
+++ /dev/null
@@ -1,60 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../new-21-game "New 21 Game")
-
-[Next >](../similar-string-groups "Similar String Groups")
-
-## [838. Push Dominoes (Medium)](https://leetcode.com/problems/push-dominoes "推多米诺")
-
-
There are n dominoes in a line, and we place each domino vertically upright. In the beginning, we simultaneously push some of the dominoes either to the left or to the right.
-
-
After each second, each domino that is falling to the left pushes the adjacent domino on the left. Similarly, the dominoes falling to the right push their adjacent dominoes standing on the right.
-
-
When a vertical domino has dominoes falling on it from both sides, it stays still due to the balance of the forces.
-
-
For the purposes of this question, we will consider that a falling domino expends no additional force to a falling or already fallen domino.
-
-
You are given a string dominoes representing the initial state where:
-
-
-
dominoes[i] = 'L', if the ith domino has been pushed to the left,
-
dominoes[i] = 'R', if the ith domino has been pushed to the right, and
-
dominoes[i] = '.', if the ith domino has not been pushed.
-
-
-
Return a string representing the final state.
-
-
-
Example 1:
-
-
-Input: dominoes = "RR.L"
-Output: "RR.L"
-Explanation: The first domino expends no additional force on the second domino.
-
-
-### Related Topics
- [[Two Pointers](../../tag/two-pointers/README.md)]
- [[String](../../tag/string/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
diff --git a/problems/push-dominoes/push_dominoes.go b/problems/push-dominoes/push_dominoes.go
deleted file mode 100644
index ca0edd34a..000000000
--- a/problems/push-dominoes/push_dominoes.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem838
diff --git a/problems/push-dominoes/push_dominoes_test.go b/problems/push-dominoes/push_dominoes_test.go
deleted file mode 100644
index ca0edd34a..000000000
--- a/problems/push-dominoes/push_dominoes_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem838
diff --git a/problems/put-boxes-into-the-warehouse-i/README.md b/problems/put-boxes-into-the-warehouse-i/README.md
deleted file mode 100644
index a1d6f02d4..000000000
--- a/problems/put-boxes-into-the-warehouse-i/README.md
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../stone-game-v "Stone Game V")
-
-[Next >](../unique-orders-and-customers-per-month "Unique Orders and Customers Per Month")
-
-## [1564. Put Boxes Into the Warehouse I (Medium)](https://leetcode.com/problems/put-boxes-into-the-warehouse-i "把箱子放进仓库里 I")
-
-
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Hints
-
-Hint 1
-Sort the boxes in ascending order, try to process the box with the smallest height first.
-
diff --git a/problems/put-boxes-into-the-warehouse-ii/README.md b/problems/put-boxes-into-the-warehouse-ii/README.md
deleted file mode 100644
index 467663579..000000000
--- a/problems/put-boxes-into-the-warehouse-ii/README.md
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../remove-max-number-of-edges-to-keep-graph-fully-traversable "Remove Max Number of Edges to Keep Graph Fully Traversable")
-
-[Next >](../customer-who-visited-but-did-not-make-any-transactions "Customer Who Visited but Did Not Make Any Transactions")
-
-## [1580. Put Boxes Into the Warehouse II (Medium)](https://leetcode.com/problems/put-boxes-into-the-warehouse-ii "把箱子放进仓库里 II")
-
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Greedy](../../tag/greedy/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Similar Questions
- 1. [Put Boxes Into the Warehouse I](../put-boxes-into-the-warehouse-i) (Medium)
-
-### Hints
-
-Hint 1
-Try to put at least one box in the house pushing it from either side.
-
-
-
-Hint 2
-Once you put one box to the house, you can solve the problem with the same logic used to solve version I. You have a warehouse open from the left only and a warehouse open from the right only.
-
diff --git a/problems/pyramid-transition-matrix/README.md b/problems/pyramid-transition-matrix/README.md
deleted file mode 100644
index d34c72d79..000000000
--- a/problems/pyramid-transition-matrix/README.md
+++ /dev/null
@@ -1,55 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../pour-water "Pour Water")
-
-[Next >](../set-intersection-size-at-least-two "Set Intersection Size At Least Two")
-
-## [756. Pyramid Transition Matrix (Medium)](https://leetcode.com/problems/pyramid-transition-matrix "金字塔转换矩阵")
-
-
We are stacking blocks to form a pyramid. Each block has a color which is a one-letter string.
-
-
We are allowed to place any color block C on top of two adjacent blocks of colors A and B, if and only if ABC is an allowed triple.
-
-
We start with a bottom row of bottom, represented as a single string. We also start with a list of allowed triples allowed. Each allowed triple is represented as a string of length 3.
-
-
Return trueif we can build the pyramid all the way to the top, otherwisefalse.
-
-
-
Example 1:
-
-
-Input: bottom = "BCD", allowed = ["BCC","CDE","CEA","FFF"]
-Output: true
-Explanation: The allowed stacks are shown on the right.
-Starting from the bottom (level 3), we can build "CE" on level 2 and then build "E" on level 1.
-
-
-
Example 2:
-
-
-Input: bottom = "AAAA", allowed = ["AAB","AAC","BCD","BBE","DEF"]
-Output: false
-Explanation: The allowed stacks are shown on the right.
-Starting from the bottom (level 4), there are multiple ways to build level 3 but trying all the possibilites, you will get always stuck before building level 1.
-
-
-
-
Constraints:
-
-
-
2 <= bottom.length <= 6
-
0 <= allowed.length <= 216
-
allowed[i].length == 3
-
The letters in all input strings are from the set {'A', 'B', 'C', 'D', 'E', 'F'}.
-
All the values of allowed are unique.
-
-
-### Related Topics
- [[Bit Manipulation](../../tag/bit-manipulation/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
diff --git a/problems/pyramid-transition-matrix/pyramid_transition_matrix.go b/problems/pyramid-transition-matrix/pyramid_transition_matrix.go
deleted file mode 100644
index a685cb849..000000000
--- a/problems/pyramid-transition-matrix/pyramid_transition_matrix.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem756
diff --git a/problems/pyramid-transition-matrix/pyramid_transition_matrix_test.go b/problems/pyramid-transition-matrix/pyramid_transition_matrix_test.go
deleted file mode 100644
index a685cb849..000000000
--- a/problems/pyramid-transition-matrix/pyramid_transition_matrix_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem756
diff --git a/problems/queens-that-can-attack-the-king/README.md b/problems/queens-that-can-attack-the-king/README.md
deleted file mode 100644
index 9c4914988..000000000
--- a/problems/queens-that-can-attack-the-king/README.md
+++ /dev/null
@@ -1,77 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../split-a-string-in-balanced-strings "Split a String in Balanced Strings")
-
-[Next >](../dice-roll-simulation "Dice Roll Simulation")
-
-## [1222. Queens That Can Attack the King (Medium)](https://leetcode.com/problems/queens-that-can-attack-the-king "可以攻击国王的皇后")
-
-
On an 8x8 chessboard, there can be multiple Black Queens and one White King.
-
-
Given an array of integer coordinates queens that represents the positions of the Black Queens, and a pair of coordinates king that represent the position of the White King, return the coordinates of all the queens (in any order) that can attack the King.
-
-
Example 1:
-
-
-
-
-Input: queens = [[0,1],[1,0],[4,0],[0,4],[3,3],[2,4]], king = [0,0]
-Output: [[0,1],[1,0],[3,3]]
-Explanation:
-The queen at [0,1] can attack the king cause they're in the same row.
-The queen at [1,0] can attack the king cause they're in the same column.
-The queen at [3,3] can attack the king cause they're in the same diagnal.
-The queen at [0,4] can't attack the king cause it's blocked by the queen at [0,1].
-The queen at [4,0] can't attack the king cause it's blocked by the queen at [1,0].
-The queen at [2,4] can't attack the king cause it's not in the same row/column/diagnal as the king.
-
-
-
Example 2:
-
-
-
-
-Input: queens = [[0,0],[1,1],[2,2],[3,4],[3,5],[4,4],[4,5]], king = [3,3]
-Output: [[2,2],[3,4],[4,4]]
-
-
-
Example 3:
-
-
-
-
-Input: queens = [[5,6],[7,7],[2,1],[0,7],[1,6],[5,1],[3,7],[0,3],[4,0],[1,2],[6,3],[5,0],[0,4],[2,2],[1,1],[6,4],[5,4],[0,0],[2,6],[4,5],[5,2],[1,4],[7,5],[2,3],[0,5],[4,2],[1,0],[2,7],[0,1],[4,6],[6,1],[0,6],[4,3],[1,7]], king = [3,4]
-Output: [[2,3],[1,4],[1,6],[3,7],[4,3],[5,4],[4,5]]
-
-
-
Constraints:
-
-
-
1 <= queens.length <= 63
-
queens[i].length == 2
-
0 <= queens[i][j] < 8
-
king.length == 2
-
0 <= king[0], king[1] < 8
-
At most one piece is allowed in a cell.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
- [[Simulation](../../tag/simulation/README.md)]
-
-### Hints
-
-Hint 1
-Check 8 directions around the King.
-
-
-
-Hint 2
-Find the nearest queen in each direction.
-
diff --git a/problems/queries-on-a-permutation-with-key/README.md b/problems/queries-on-a-permutation-with-key/README.md
deleted file mode 100644
index d1f4999c2..000000000
--- a/problems/queries-on-a-permutation-with-key/README.md
+++ /dev/null
@@ -1,74 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../string-matching-in-an-array "String Matching in an Array")
-
-[Next >](../html-entity-parser "HTML Entity Parser")
-
-## [1409. Queries on a Permutation With Key (Medium)](https://leetcode.com/problems/queries-on-a-permutation-with-key "查询带键的排列")
-
-
Given the array queries of positive integers between 1 and m, you have to process all queries[i] (from i=0 to i=queries.length-1) according to the following rules:
-
-
-
In the beginning, you have the permutation P=[1,2,3,...,m].
-
For the current i, find the position of queries[i] in the permutation P (indexing from 0) and then move this at the beginning of the permutation P. Notice that the position of queries[i] in P is the result for queries[i].
-
-
-
Return an array containing the result for the given queries.
-
-
-
Example 1:
-
-
-Input: queries = [3,1,2,1], m = 5
-Output: [2,1,2,1]
-Explanation: The queries are processed as follow:
-For i=0: queries[i]=3, P=[1,2,3,4,5], position of 3 in P is 2, then we move 3 to the beginning of P resulting in P=[3,1,2,4,5].
-For i=1: queries[i]=1, P=[3,1,2,4,5], position of 1 in P is 1, then we move 1 to the beginning of P resulting in P=[1,3,2,4,5].
-For i=2: queries[i]=2, P=[1,3,2,4,5], position of 2 in P is 2, then we move 2 to the beginning of P resulting in P=[2,1,3,4,5].
-For i=3: queries[i]=1, P=[2,1,3,4,5], position of 1 in P is 1, then we move 1 to the beginning of P resulting in P=[1,2,3,4,5].
-Therefore, the array containing the result is [2,1,2,1].
-
-
-
Example 2:
-
-
-Input: queries = [4,1,2,2], m = 4
-Output: [3,1,2,0]
-
-
-
Example 3:
-
-
-Input: queries = [7,5,5,8,3], m = 8
-Output: [6,5,0,7,5]
-
-
-
-
Constraints:
-
-
-
1 <= m <= 10^3
-
1 <= queries.length <= m
-
1 <= queries[i] <= m
-
-
-### Related Topics
- [[Binary Indexed Tree](../../tag/binary-indexed-tree/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Simulation](../../tag/simulation/README.md)]
-
-### Hints
-
-Hint 1
-Create the permutation P=[1,2,...,m], it could be a list for example.
-
-
-
-Hint 2
-For each i, find the position of queries[i] with a simple scan over P and then move this to the beginning.
-
diff --git a/problems/queries-on-number-of-points-inside-a-circle/README.md b/problems/queries-on-number-of-points-inside-a-circle/README.md
deleted file mode 100644
index 1ab1e0aab..000000000
--- a/problems/queries-on-number-of-points-inside-a-circle/README.md
+++ /dev/null
@@ -1,72 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-operations-to-make-the-array-increasing "Minimum Operations to Make the Array Increasing")
-
-[Next >](../maximum-xor-for-each-query "Maximum XOR for Each Query")
-
-## [1828. Queries on Number of Points Inside a Circle (Medium)](https://leetcode.com/problems/queries-on-number-of-points-inside-a-circle "统计一个圆中点的数目")
-
-
You are given an array points where points[i] = [xi, yi] is the coordinates of the ith point on a 2D plane. Multiple points can have the same coordinates.
-
-
You are also given an array queries where queries[j] = [xj, yj, rj] describes a circle centered at (xj, yj) with a radius of rj.
-
-
For each query queries[j], compute the number of points inside the jth circle. Points on the border of the circle are considered inside.
-
-
Return an array answer, where answer[j] is the answer to the jth query.
-
-
-
Example 1:
-
-
-Input: points = [[1,3],[3,3],[5,3],[2,2]], queries = [[2,3,1],[4,3,1],[1,1,2]]
-Output: [3,2,2]
-Explanation: The points and circles are shown above.
-queries[0] is the green circle, queries[1] is the red circle, and queries[2] is the blue circle.
-
-
-
Example 2:
-
-
-Input: points = [[1,1],[2,2],[3,3],[4,4],[5,5]], queries = [[1,2,2],[2,2,2],[4,3,2],[4,3,3]]
-Output: [2,3,2,4]
-Explanation: The points and circles are shown above.
-queries[0] is green, queries[1] is red, queries[2] is blue, and queries[3] is purple.
-
-
-
-
Constraints:
-
-
-
1 <= points.length <= 500
-
points[i].length == 2
-
0 <= xi, yi <= 500
-
1 <= queries.length <= 500
-
queries[j].length == 3
-
0 <= xj, yj <= 500
-
1 <= rj <= 500
-
All coordinates are integers.
-
-
-
-
Follow up: Could you find the answer for each query in better complexity than O(n)?
-
-### Related Topics
- [[Geometry](../../tag/geometry/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Math](../../tag/math/README.md)]
-
-### Hints
-
-Hint 1
-For a point to be inside a circle, the euclidean distance between it and the circle's center needs to be less than or equal to the radius.
-
-
-
-Hint 2
-Brute force for each circle and iterate overall points and find those inside it.
-
diff --git a/problems/queries-quality-and-percentage/README.md b/problems/queries-quality-and-percentage/README.md
deleted file mode 100644
index a856dd542..000000000
--- a/problems/queries-quality-and-percentage/README.md
+++ /dev/null
@@ -1,83 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-moves-to-reach-target-with-rotations "Minimum Moves to Reach Target with Rotations")
-
-[Next >](../team-scores-in-football-tournament "Team Scores in Football Tournament")
-
-## [1211. Queries Quality and Percentage (Easy)](https://leetcode.com/problems/queries-quality-and-percentage "查询结果的质量和占比")
-
-
Table: Queries
-
-
-+-------------+---------+
-| Column Name | Type |
-+-------------+---------+
-| query_name | varchar |
-| result | varchar |
-| position | int |
-| rating | int |
-+-------------+---------+
-There is no primary key for this table, it may have duplicate rows.
-This table contains information collected from some queries on a database.
-The position column has a value from 1 to 500.
-The rating column has a value from 1 to 5. Query with rating less than 3 is a poor query.
-
-
-
-
-
We define query quality as:
-
-
-
The average of the ratio between query rating and its position.
-
-
-
We also define poor query percentage as:
-
-
-
The percentage of all queries with rating less than 3.
-
-
-
Write an SQL query to find each query_name, the quality and poor_query_percentage.
-
-
Both quality and poor_query_percentage should be rounded to 2 decimal places.
-
-
The query result format is in the following example:
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
-
-### Similar Questions
- 1. [Percentage of Users Attended a Contest](../percentage-of-users-attended-a-contest) (Easy)
diff --git a/problems/queries-quality-and-percentage/mysql_schemas.sql b/problems/queries-quality-and-percentage/mysql_schemas.sql
deleted file mode 100644
index 01ae2d169..000000000
--- a/problems/queries-quality-and-percentage/mysql_schemas.sql
+++ /dev/null
@@ -1,8 +0,0 @@
-Create table If Not Exists Queries (query_name varchar(30), result varchar(50), position int, rating int);
-Truncate table Queries;
-insert into Queries (query_name, result, position, rating) values ('Dog', 'Golden Retriever', '1', '5');
-insert into Queries (query_name, result, position, rating) values ('Dog', 'German Shepherd', '2', '5');
-insert into Queries (query_name, result, position, rating) values ('Dog', 'Mule', '200', '1');
-insert into Queries (query_name, result, position, rating) values ('Cat', 'Shirazi', '5', '2');
-insert into Queries (query_name, result, position, rating) values ('Cat', 'Siamese', '3', '3');
-insert into Queries (query_name, result, position, rating) values ('Cat', 'Sphynx', '7', '4');
diff --git a/problems/queue-reconstruction-by-height/README.md b/problems/queue-reconstruction-by-height/README.md
deleted file mode 100644
index 7045e7aa1..000000000
--- a/problems/queue-reconstruction-by-height/README.md
+++ /dev/null
@@ -1,69 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../convert-a-number-to-hexadecimal "Convert a Number to Hexadecimal")
-
-[Next >](../trapping-rain-water-ii "Trapping Rain Water II")
-
-## [406. Queue Reconstruction by Height (Medium)](https://leetcode.com/problems/queue-reconstruction-by-height "根据身高重建队列")
-
-
You are given an array of people, people, which are the attributes of some people in a queue (not necessarily in order). Each people[i] = [hi, ki] represents the ith person of height hi with exactlyki other people in front who have a height greater than or equal to hi.
-
-
Reconstruct and return the queue that is represented by the input array people. The returned queue should be formatted as an array queue, where queue[j] = [hj, kj] is the attributes of the jth person in the queue (queue[0] is the person at the front of the queue).
-
-
-
Example 1:
-
-
-Input: people = [[7,0],[4,4],[7,1],[5,0],[6,1],[5,2]]
-Output: [[5,0],[7,0],[5,2],[6,1],[4,4],[7,1]]
-Explanation:
-Person 0 has height 5 with no other people taller or the same height in front.
-Person 1 has height 7 with no other people taller or the same height in front.
-Person 2 has height 5 with two persons taller or the same height in front, which is person 0 and 1.
-Person 3 has height 6 with one person taller or the same height in front, which is person 1.
-Person 4 has height 4 with four people taller or the same height in front, which are people 0, 1, 2, and 3.
-Person 5 has height 7 with one person taller or the same height in front, which is person 1.
-Hence [[5,0],[7,0],[5,2],[6,1],[4,4],[7,1]] is the reconstructed queue.
-
-
-
Example 2:
-
-
-Input: people = [[6,0],[5,0],[4,0],[3,2],[2,2],[1,4]]
-Output: [[4,0],[5,0],[2,2],[3,2],[1,4],[6,0]]
-
-
-
-
Constraints:
-
-
-
1 <= people.length <= 2000
-
0 <= hi <= 106
-
0 <= ki < people.length
-
It is guaranteed that the queue can be reconstructed.
-
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Similar Questions
- 1. [Count of Smaller Numbers After Self](../count-of-smaller-numbers-after-self) (Hard)
-
-### Hints
-
-Hint 1
-What can you say about the position of the shortest person?
-If the position of the shortest person is i, how many people would be in front of the shortest person?
-
-
-
-Hint 2
-Once you fix the position of the shortest person, what can you say about the position of the second shortest person?
-
diff --git a/problems/queue-reconstruction-by-height/queue_reconstruction_by_height.go b/problems/queue-reconstruction-by-height/queue_reconstruction_by_height.go
deleted file mode 100644
index 9036961c6..000000000
--- a/problems/queue-reconstruction-by-height/queue_reconstruction_by_height.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem406
diff --git a/problems/queue-reconstruction-by-height/queue_reconstruction_by_height_test.go b/problems/queue-reconstruction-by-height/queue_reconstruction_by_height_test.go
deleted file mode 100644
index 9036961c6..000000000
--- a/problems/queue-reconstruction-by-height/queue_reconstruction_by_height_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem406
diff --git a/problems/rabbits-in-forest/README.md b/problems/rabbits-in-forest/README.md
deleted file mode 100644
index 5e6e5e227..000000000
--- a/problems/rabbits-in-forest/README.md
+++ /dev/null
@@ -1,50 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../reaching-points "Reaching Points")
-
-[Next >](../transform-to-chessboard "Transform to Chessboard")
-
-## [781. Rabbits in Forest (Medium)](https://leetcode.com/problems/rabbits-in-forest "森林中的兔子")
-
-
There is a forest with an unknown number of rabbits. We asked n rabbits "How many rabbits have the same color as you?" and collected the answers in an integer array answers where answers[i] is the answer of the ith rabbit.
-
-
Given the array answers, return the minimum number of rabbits that could be in the forest.
-
-
-
Example 1:
-
-
-Input: answers = [1,1,2]
-Output: 5
-Explanation:
-The two rabbits that answered "1" could both be the same color, say red.
-The rabbit that answered "2" can't be red or the answers would be inconsistent.
-Say the rabbit that answered "2" was blue.
-Then there should be 2 other blue rabbits in the forest that didn't answer into the array.
-The smallest possible number of rabbits in the forest is therefore 5: 3 that answered plus 2 that didn't.
-
Your car starts at position 0 and speed +1 on an infinite number line. Your car can go into negative positions. Your car drives automatically according to a sequence of instructions 'A' (accelerate) and 'R' (reverse):
-
-
-
When you get an instruction 'A', your car does the following:
-
-
position += speed
-
speed *= 2
-
-
-
When you get an instruction 'R', your car does the following:
-
-
If your speed is positive then speed = -1
-
otherwise speed = 1
-
- Your position stays the same.
-
-
-
For example, after commands "AAR", your car goes to positions 0 --> 1 --> 3 --> 3, and your speed goes to 1 --> 2 --> 4 --> -1.
-
-
Given a target position target, return the length of the shortest sequence of instructions to get there.
-
-
-
Example 1:
-
-
-Input: target = 3
-Output: 2
-Explanation:
-The shortest instruction sequence is "AA".
-Your position goes from 0 --> 1 --> 3.
-
-
-
Example 2:
-
-
-Input: target = 6
-Output: 5
-Explanation:
-The shortest instruction sequence is "AAARA".
-Your position goes from 0 --> 1 --> 3 --> 7 --> 7 --> 6.
-
There is an m x n binary grid matrix with all the values set 0 initially. Design an algorithm to randomly pick an index (i, j) where matrix[i][j] == 0 and flips it to 1. All the indices (i, j) where matrix[i][j] == 0 should be equally likely to be returned.
-
-
Optimize your algorithm to minimize the number of calls made to the built-in random function of your language and optimize the time and space complexity.
-
-
Implement the Solution class:
-
-
-
Solution(int m, int n) Initializes the object with the size of the binary matrix m and n.
-
int[] flip() Returns a random index [i, j] of the matrix where matrix[i][j] == 0 and flips it to 1.
-
void reset() Resets all the values of the matrix to be 0.
-
-
-
-
Example 1:
-
-
-Input
-["Solution", "flip", "flip", "flip", "reset", "flip"]
-[[3, 1], [], [], [], [], []]
-Output
-[null, [1, 0], [2, 0], [0, 0], null, [2, 0]]
-
-Explanation
-Solution solution = new Solution(3, 1);
-solution.flip(); // return [1, 0], [0,0], [1,0], and [2,0] should be equally likely to be returned.
-solution.flip(); // return [2, 0], Since [1,0] was returned, [2,0] and [0,0]
-solution.flip(); // return [0, 0], Based on the previously returned indices, only [0,0] can be returned.
-solution.reset(); // All the values are reset to 0 and can be returned.
-solution.flip(); // return [2, 0], [0,0], [1,0], and [2,0] should be equally likely to be returned.
-
-
-
-
Constraints:
-
-
-
1 <= m, n <= 104
-
There will be at least one free cell for each call to flip.
-
At most 1000 calls will be made to flip and reset.
Given an integer array nums with possible duplicates, randomly output the index of a given target number. You can assume that the given target number must exist in the array.
-
-
Implement the Solution class:
-
-
-
Solution(int[] nums) Initializes the object with the array nums.
-
int pick(int target) Picks a random index i from nums where nums[i] == target. If there are multiple valid i's, then each index should have an equal probability of returning.
-
-
-
-
Example 1:
-
-
-Input
-["Solution", "pick", "pick", "pick"]
-[[[1, 2, 3, 3, 3]], [3], [1], [3]]
-Output
-[null, 4, 0, 2]
-
-Explanation
-Solution solution = new Solution([1, 2, 3, 3, 3]);
-solution.pick(3); // It should return either index 2, 3, or 4 randomly. Each index should have equal probability of returning.
-solution.pick(1); // It should return 0. Since in the array only nums[0] is equal to 1.
-solution.pick(3); // It should return either index 2, 3, or 4 randomly. Each index should have equal probability of returning.
-
You are given an integer n and an array of unique integers blacklist. Design an algorithm to pick a random integer in the range [0, n - 1] that is not in blacklist. Any integer that is in the mentioned range and not in blacklist should be equally likely returned.
-
-
Optimize your algorithm such that it minimizes the call to the built-in random function of your language.
-
-
Implement the Solution class:
-
-
-
Solution(int n, int[] blacklist) Initializes the object with the integer n and the blacklisted integers blacklist.
-
int pick() Returns a random integer in the range [0, n - 1] and not in blacklist. All the possible integers should be equally likely returned.
-
-
-
-
Example 1:
-
-
-Input
-["Solution", "pick", "pick", "pick", "pick", "pick", "pick", "pick"]
-[[7, [2, 3, 5]], [], [], [], [], [], [], []]
-Output
-[null, 6, 4, 1, 6, 1, 6, 4]
-
-Explanation
-Solution solution = new Solution(7, [2, 3, 5]);
-solution.pick(); // return 6, any integer from [1,4,6] should be ok. Note that for every call of pick, 1, 4, and 6 must be equally likely to be returned (i.e., with probability 1/3).
-solution.pick(); // return 4
-solution.pick(); // return 1
-solution.pick(); // return 6
-solution.pick(); // return 1
-solution.pick(); // return 6
-solution.pick(); // return 4
-
You are given a 0-indexed array of positive integers w where w[i] describes the weight of the ith index.
-
-
You need to implement the function pickIndex(), which randomly picks an index in the range [0, w.length - 1] (inclusive) and returns it. The probability of picking an index i is w[i] / sum(w).
-
-
-
For example, if w = [1, 3], the probability of picking index 0 is 1 / (1 + 3) = 0.25 (i.e., 25%), and the probability of picking index 1 is 3 / (1 + 3) = 0.75 (i.e., 75%).
-
-
-
-
Example 1:
-
-
-Input
-["Solution","pickIndex"]
-[[[1]],[]]
-Output
-[null,0]
-
-Explanation
-Solution solution = new Solution([1]);
-solution.pickIndex(); // return 0. The only option is to return 0 since there is only one element in w.
-
-
-
Example 2:
-
-
-Input
-["Solution","pickIndex","pickIndex","pickIndex","pickIndex","pickIndex"]
-[[[1,3]],[],[],[],[],[]]
-Output
-[null,1,1,1,1,0]
-
-Explanation
-Solution solution = new Solution([1, 3]);
-solution.pickIndex(); // return 1. It is returning the second element (index = 1) that has a probability of 3/4.
-solution.pickIndex(); // return 1
-solution.pickIndex(); // return 1
-solution.pickIndex(); // return 1
-solution.pickIndex(); // return 0. It is returning the first element (index = 0) that has a probability of 1/4.
-
-Since this is a randomization problem, multiple answers are allowed.
-All of the following outputs can be considered correct:
-[null,1,1,1,1,0]
-[null,1,1,1,1,1]
-[null,1,1,1,0,0]
-[null,1,1,1,0,1]
-[null,1,0,1,0,0]
-......
-and so on.
-
You are given an array of non-overlapping axis-aligned rectangles rects where rects[i] = [ai, bi, xi, yi] indicates that (ai, bi) is the bottom-left corner point of the ith rectangle and (xi, yi) is the top-right corner point of the ith rectangle. Design an algorithm to pick a random integer point inside the space covered by one of the given rectangles. A point on the perimeter of a rectangle is included in the space covered by the rectangle.
-
-
Any integer point inside the space covered by one of the given rectangles should be equally likely to be returned.
-
-
Note that an integer point is a point that has integer coordinates.
-
-
Implement the Solution class:
-
-
-
Solution(int[][] rects) Initializes the object with the given rectangles rects.
-
int[] pick() Returns a random integer point [u, v] inside the space covered by one of the given rectangles.
-
-### Related Topics
- [[Reservoir Sampling](../../tag/reservoir-sampling/README.md)]
- [[Math](../../tag/math/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
- [[Ordered Set](../../tag/ordered-set/README.md)]
- [[Prefix Sum](../../tag/prefix-sum/README.md)]
- [[Randomized](../../tag/randomized/README.md)]
-
-### Similar Questions
- 1. [Random Pick with Weight](../random-pick-with-weight) (Medium)
- 1. [Generate Random Point in a Circle](../generate-random-point-in-a-circle) (Medium)
diff --git a/problems/random-point-in-non-overlapping-rectangles/random_point_in_non_overlapping_rectangles.go b/problems/random-point-in-non-overlapping-rectangles/random_point_in_non_overlapping_rectangles.go
deleted file mode 100644
index 11aff1db6..000000000
--- a/problems/random-point-in-non-overlapping-rectangles/random_point_in_non_overlapping_rectangles.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem497
diff --git a/problems/random-point-in-non-overlapping-rectangles/random_point_in_non_overlapping_rectangles_test.go b/problems/random-point-in-non-overlapping-rectangles/random_point_in_non_overlapping_rectangles_test.go
deleted file mode 100644
index 11aff1db6..000000000
--- a/problems/random-point-in-non-overlapping-rectangles/random_point_in_non_overlapping_rectangles_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem497
diff --git a/problems/range-addition-ii/README.md b/problems/range-addition-ii/README.md
deleted file mode 100644
index 8ed1babe6..000000000
--- a/problems/range-addition-ii/README.md
+++ /dev/null
@@ -1,57 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../friend-requests-i-overall-acceptance-rate "Friend Requests I: Overall Acceptance Rate")
-
-[Next >](../minimum-index-sum-of-two-lists "Minimum Index Sum of Two Lists")
-
-## [598. Range Addition II (Easy)](https://leetcode.com/problems/range-addition-ii "范围求和 II")
-
-
You are given an m x n matrix M initialized with all 0's and an array of operations ops, where ops[i] = [ai, bi] means M[x][y] should be incremented by one for all 0 <= x < ai and 0 <= y < bi.
-
-
Count and return the number of maximum integers in the matrix after performing all the operations.
-
-
-
Example 1:
-
-
-Input: m = 3, n = 3, ops = [[2,2],[3,3]]
-Output: 4
-Explanation: The maximum integer in M is 2, and there are four of it in M. So return 4.
-
-
-
Example 2:
-
-
-Input: m = 3, n = 3, ops = [[2,2],[3,3],[3,3],[3,3],[2,2],[3,3],[3,3],[3,3],[2,2],[3,3],[3,3],[3,3]]
-Output: 4
-
-
-
Example 3:
-
-
-Input: m = 3, n = 3, ops = []
-Output: 9
-
-
-
-
Constraints:
-
-
-
1 <= m, n <= 4 * 104
-
0 <= ops.length <= 104
-
ops[i].length == 2
-
1 <= ai <= m
-
1 <= bi <= n
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Math](../../tag/math/README.md)]
-
-### Similar Questions
- 1. [Range Addition](../range-addition) (Medium)
diff --git a/problems/range-addition-ii/range_addition_ii.go b/problems/range-addition-ii/range_addition_ii.go
deleted file mode 100644
index 6e802a816..000000000
--- a/problems/range-addition-ii/range_addition_ii.go
+++ /dev/null
@@ -1,13 +0,0 @@
-package problem598
-
-func maxCount(m int, n int, ops [][]int) int {
- for _, op := range ops {
- if m > op[0] {
- m = op[0]
- }
- if n > op[1] {
- n = op[1]
- }
- }
- return m * n
-}
diff --git a/problems/range-addition-ii/range_addition_ii_test.go b/problems/range-addition-ii/range_addition_ii_test.go
deleted file mode 100644
index aff2a2d6e..000000000
--- a/problems/range-addition-ii/range_addition_ii_test.go
+++ /dev/null
@@ -1,30 +0,0 @@
-package problem598
-
-import "testing"
-
-type testType struct {
- m int
- n int
- ops [][]int
- want int
-}
-
-func TestMaxCount(t *testing.T) {
- tests := [...]testType{
- {
- m: 3,
- n: 3,
- ops: [][]int{
- {2, 2},
- {3, 3},
- },
- want: 4,
- },
- }
- for _, tt := range tests {
- got := maxCount(tt.m, tt.n, tt.ops)
- if got != tt.want {
- t.Fatalf("in: %v, got: %v, want: %v", tt.m, got, tt.want)
- }
- }
-}
diff --git a/problems/range-addition/README.md b/problems/range-addition/README.md
deleted file mode 100644
index 595b65b0a..000000000
--- a/problems/range-addition/README.md
+++ /dev/null
@@ -1,69 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../plus-one-linked-list "Plus One Linked List")
-
-[Next >](../sum-of-two-integers "Sum of Two Integers")
-
-## [370. Range Addition (Medium)](https://leetcode.com/problems/range-addition "区间加法")
-
-
Assume you have an array of length n initialized with all 0's and are given k update operations.
-
-
Each operation is represented as a triplet: [startIndex, endIndex, inc] which increments each element of subarray A[startIndex ... endIndex] (startIndex and endIndex inclusive) with inc.
-
-
Return the modified array after all k operations were executed.
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Prefix Sum](../../tag/prefix-sum/README.md)]
-
-### Similar Questions
- 1. [Range Addition II](../range-addition-ii) (Easy)
-
-### Hints
-
-Hint 1
-Thinking of using advanced data structures? You are thinking it too complicated.
-
-
-
-Hint 2
-For each update operation, do you really need to update all elements between i and j?
-
-
-
-Hint 3
-Update only the first and end element is sufficient.
-
-
-
-Hint 4
-The optimal time complexity is O(k + n) and uses O(1) extra space.
-
diff --git a/problems/range-addition/range_addition.go b/problems/range-addition/range_addition.go
deleted file mode 100644
index a9f16c943..000000000
--- a/problems/range-addition/range_addition.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem370
diff --git a/problems/range-addition/range_addition_test.go b/problems/range-addition/range_addition_test.go
deleted file mode 100644
index a9f16c943..000000000
--- a/problems/range-addition/range_addition_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem370
diff --git a/problems/range-frequency-queries/README.md b/problems/range-frequency-queries/README.md
deleted file mode 100644
index 01668228f..000000000
--- a/problems/range-frequency-queries/README.md
+++ /dev/null
@@ -1,79 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../watering-plants "Watering Plants")
-
-[Next >](../sum-of-k-mirror-numbers "Sum of k-Mirror Numbers")
-
-## [2080. Range Frequency Queries (Medium)](https://leetcode.com/problems/range-frequency-queries "区间内查询数字的频率")
-
-
Design a data structure to find the frequency of a given value in a given subarray.
-
-
The frequency of a value in a subarray is the number of occurrences of that value in the subarray.
-
-
Implement the RangeFreqQuery class:
-
-
-
RangeFreqQuery(int[] arr) Constructs an instance of the class with the given 0-indexed integer array arr.
-
int query(int left, int right, int value) Returns the frequency of value in the subarray arr[left...right].
-
-
-
A subarray is a contiguous sequence of elements within an array. arr[left...right] denotes the subarray that contains the elements of nums between indices left and right (inclusive).
-
-
-
Example 1:
-
-
-Input
-["RangeFreqQuery", "query", "query"]
-[[[12, 33, 4, 56, 22, 2, 34, 33, 22, 12, 34, 56]], [1, 2, 4], [0, 11, 33]]
-Output
-[null, 1, 2]
-
-Explanation
-RangeFreqQuery rangeFreqQuery = new RangeFreqQuery([12, 33, 4, 56, 22, 2, 34, 33, 22, 12, 34, 56]);
-rangeFreqQuery.query(1, 2, 4); // return 1. The value 4 occurs 1 time in the subarray [33, 4]
-rangeFreqQuery.query(0, 11, 33); // return 2. The value 33 occurs 2 times in the whole array.
-
-
-
-
Constraints:
-
-
-
1 <= arr.length <= 105
-
1 <= arr[i], value <= 104
-
0 <= left <= right < arr.length
-
At most 105 calls will be made to query
-
-
-### Related Topics
- [[Design](../../tag/design/README.md)]
- [[Segment Tree](../../tag/segment-tree/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
-
-### Hints
-
-Hint 1
-The queries must be answered efficiently to avoid time limit exceeded verdict.
-
-
-
-Hint 2
-Store the elements of the array in a data structure that helps answering the queries efficiently.
-
-
-
-Hint 3
-Use a hash table that stored for each value, the indices where that value appeared.
-
-
-
-Hint 4
-Use binary search over the indices of a value to find its range frequency.
-
diff --git a/problems/range-module/README.md b/problems/range-module/README.md
deleted file mode 100644
index f4f13ff58..000000000
--- a/problems/range-module/README.md
+++ /dev/null
@@ -1,68 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../best-time-to-buy-and-sell-stock-with-transaction-fee "Best Time to Buy and Sell Stock with Transaction Fee")
-
-[Next >](../max-stack "Max Stack")
-
-## [715. Range Module (Hard)](https://leetcode.com/problems/range-module "Range 模块")
-
-
A Range Module is a module that tracks ranges of numbers. Design a data structure to track the ranges represented as half-open intervals and query about them.
-
-
A half-open interval[left, right) denotes all the real numbers x where left <= x < right.
-
-
Implement the RangeModule class:
-
-
-
RangeModule() Initializes the object of the data structure.
-
void addRange(int left, int right) Adds the half-open interval[left, right), tracking every real number in that interval. Adding an interval that partially overlaps with currently tracked numbers should add any numbers in the interval [left, right) that are not already tracked.
-
boolean queryRange(int left, int right) Returns true if every real number in the interval [left, right) is currently being tracked, and false otherwise.
-
void removeRange(int left, int right) Stops tracking every real number currently being tracked in the half-open interval[left, right).
-
-
-
-
Example 1:
-
-
-Input
-["RangeModule", "addRange", "removeRange", "queryRange", "queryRange", "queryRange"]
-[[], [10, 20], [14, 16], [10, 14], [13, 15], [16, 17]]
-Output
-[null, null, null, true, false, true]
-
-Explanation
-RangeModule rangeModule = new RangeModule();
-rangeModule.addRange(10, 20);
-rangeModule.removeRange(14, 16);
-rangeModule.queryRange(10, 14); // return True,(Every number in [10, 14) is being tracked)
-rangeModule.queryRange(13, 15); // return False,(Numbers like 14, 14.03, 14.17 in [13, 15) are not being tracked)
-rangeModule.queryRange(16, 17); // return True, (The number 16 in [16, 17) is still being tracked, despite the remove operation)
-
-
-
-
Constraints:
-
-
-
1 <= left < right <= 109
-
At most 104 calls will be made to addRange, queryRange, and removeRange.
-
-
-### Related Topics
- [[Design](../../tag/design/README.md)]
- [[Segment Tree](../../tag/segment-tree/README.md)]
- [[Ordered Set](../../tag/ordered-set/README.md)]
-
-### Similar Questions
- 1. [Merge Intervals](../merge-intervals) (Medium)
- 1. [Insert Interval](../insert-interval) (Medium)
- 1. [Data Stream as Disjoint Intervals](../data-stream-as-disjoint-intervals) (Hard)
-
-### Hints
-
-Hint 1
-Maintain a sorted set of disjoint intervals. addRange and removeRange can be performed with time complexity linear to the size of this set; queryRange can be performed with time complexity logarithmic to the size of this set.
-
diff --git a/problems/range-module/range_module.go b/problems/range-module/range_module.go
deleted file mode 100644
index 2261a5f8a..000000000
--- a/problems/range-module/range_module.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem715
diff --git a/problems/range-module/range_module_test.go b/problems/range-module/range_module_test.go
deleted file mode 100644
index 2261a5f8a..000000000
--- a/problems/range-module/range_module_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem715
diff --git a/problems/range-sum-of-bst/README.md b/problems/range-sum-of-bst/README.md
deleted file mode 100644
index db95e3008..000000000
--- a/problems/range-sum-of-bst/README.md
+++ /dev/null
@@ -1,47 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../reorder-data-in-log-files "Reorder Data in Log Files")
-
-[Next >](../minimum-area-rectangle "Minimum Area Rectangle")
-
-## [938. Range Sum of BST (Easy)](https://leetcode.com/problems/range-sum-of-bst "二叉搜索树的范围和")
-
-
Given the root node of a binary search tree and two integers low and high, return the sum of values of all nodes with a value in the inclusive range [low, high].
-
-
-
Example 1:
-
-
-Input: root = [10,5,15,3,7,null,18], low = 7, high = 15
-Output: 32
-Explanation: Nodes 7, 10, and 15 are in the range [7, 15]. 7 + 10 + 15 = 32.
-
-
-
Example 2:
-
-
-Input: root = [10,5,15,3,7,13,18,1,null,6], low = 6, high = 10
-Output: 23
-Explanation: Nodes 6, 7, and 10 are in the range [6, 10]. 6 + 7 + 10 = 23.
-
-
-
-
Constraints:
-
-
-
The number of nodes in the tree is in the range [1, 2 * 104].
-
1 <= Node.val <= 105
-
1 <= low <= high <= 105
-
All Node.val are unique.
-
-
-### Related Topics
- [[Tree](../../tag/tree/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Binary Search Tree](../../tag/binary-search-tree/README.md)]
- [[Binary Tree](../../tag/binary-tree/README.md)]
diff --git a/problems/range-sum-of-bst/range_sum_of_bst.go b/problems/range-sum-of-bst/range_sum_of_bst.go
deleted file mode 100644
index 61d87593d..000000000
--- a/problems/range-sum-of-bst/range_sum_of_bst.go
+++ /dev/null
@@ -1,28 +0,0 @@
-package problem938
-
-import "github.com/awesee/leetcode/internal/kit"
-
-// TreeNode - Definition for a binary tree node.
-type TreeNode = kit.TreeNode
-
-/**
- * Definition for a binary tree node.
- * type TreeNode struct {
- * Val int
- * Left *TreeNode
- * Right *TreeNode
- * }
- */
-func rangeSumBST(root *TreeNode, L int, R int) int {
- ans := 0
- if root.Val >= L && root.Val <= R {
- ans += root.Val
- }
- if root.Left != nil && root.Val > L {
- ans += rangeSumBST(root.Left, L, R)
- }
- if root.Right != nil && root.Val < R {
- ans += rangeSumBST(root.Right, L, R)
- }
- return ans
-}
diff --git a/problems/range-sum-of-bst/range_sum_of_bst_test.go b/problems/range-sum-of-bst/range_sum_of_bst_test.go
deleted file mode 100644
index 86b8e1020..000000000
--- a/problems/range-sum-of-bst/range_sum_of_bst_test.go
+++ /dev/null
@@ -1,37 +0,0 @@
-package problem938
-
-import (
- "testing"
-
- "github.com/awesee/leetcode/internal/kit"
-)
-
-type testType struct {
- in []int
- l int
- r int
- want int
-}
-
-func TestRangeSumBST(t *testing.T) {
- tests := [...]testType{
- {
- in: []int{10, 5, 15, 3, 7, kit.NULL, 18},
- l: 7,
- r: 15,
- want: 32,
- },
- {
- in: []int{10, 5, 15, 3, 7, 13, 18, 1, kit.NULL, 6},
- l: 6,
- r: 10,
- want: 23,
- },
- }
- for _, tt := range tests {
- got := rangeSumBST(kit.SliceInt2TreeNode(tt.in), tt.l, tt.r)
- if got != tt.want {
- t.Fatalf("in: %v, got: %v, want: %v", tt.in, got, tt.want)
- }
- }
-}
diff --git a/problems/range-sum-of-sorted-subarray-sums/README.md b/problems/range-sum-of-sorted-subarray-sums/README.md
deleted file mode 100644
index 6cc505677..000000000
--- a/problems/range-sum-of-sorted-subarray-sums/README.md
+++ /dev/null
@@ -1,67 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../reformat-date "Reformat Date")
-
-[Next >](../minimum-difference-between-largest-and-smallest-value-in-three-moves "Minimum Difference Between Largest and Smallest Value in Three Moves")
-
-## [1508. Range Sum of Sorted Subarray Sums (Medium)](https://leetcode.com/problems/range-sum-of-sorted-subarray-sums "子数组和排序后的区间和")
-
-
You are given the array nums consisting of n positive integers. You computed the sum of all non-empty continuous subarrays from the array and then sorted them in non-decreasing order, creating a new array of n * (n + 1) / 2 numbers.
-
-
Return the sum of the numbers from index left to index right (indexed from 1), inclusive, in the new array. Since the answer can be a huge number return it modulo 109 + 7.
-
-
-
Example 1:
-
-
-Input: nums = [1,2,3,4], n = 4, left = 1, right = 5
-Output: 13
-Explanation: All subarray sums are 1, 3, 6, 10, 2, 5, 9, 3, 7, 4. After sorting them in non-decreasing order we have the new array [1, 2, 3, 3, 4, 5, 6, 7, 9, 10]. The sum of the numbers from index le = 1 to ri = 5 is 1 + 2 + 3 + 3 + 4 = 13.
-
-
-
Example 2:
-
-
-Input: nums = [1,2,3,4], n = 4, left = 3, right = 4
-Output: 6
-Explanation: The given array is the same as example 1. We have the new array [1, 2, 3, 3, 4, 5, 6, 7, 9, 10]. The sum of the numbers from index le = 3 to ri = 4 is 3 + 3 = 6.
-
-
-
Example 3:
-
-
-Input: nums = [1,2,3,4], n = 4, left = 1, right = 10
-Output: 50
-
-
-
-
Constraints:
-
-
-
n == nums.length
-
1 <= nums.length <= 1000
-
1 <= nums[i] <= 100
-
1 <= left <= right <= n * (n + 1) / 2
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Two Pointers](../../tag/two-pointers/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Hints
-
-Hint 1
-Compute all sums and save it in array.
-
-
-
-Hint 2
-Then just go from LEFT to RIGHT index and calculate answer modulo 1e9 + 7.
-
diff --git a/problems/range-sum-query-2d-immutable/README.md b/problems/range-sum-query-2d-immutable/README.md
deleted file mode 100644
index 9b87031fe..000000000
--- a/problems/range-sum-query-2d-immutable/README.md
+++ /dev/null
@@ -1,65 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../range-sum-query-immutable "Range Sum Query - Immutable")
-
-[Next >](../number-of-islands-ii "Number of Islands II")
-
-## [304. Range Sum Query 2D - Immutable (Medium)](https://leetcode.com/problems/range-sum-query-2d-immutable "二维区域和检索 - 矩阵不可变")
-
-
Given a 2D matrix matrix, handle multiple queries of the following type:
-
-
-
Calculate the sum of the elements of matrix inside the rectangle defined by its upper left corner(row1, col1) and lower right corner(row2, col2).
-
-
-
Implement the NumMatrix class:
-
-
-
NumMatrix(int[][] matrix) Initializes the object with the integer matrix matrix.
-
int sumRegion(int row1, int col1, int row2, int col2) Returns the sum of the elements of matrix inside the rectangle defined by its upper left corner(row1, col1) and lower right corner(row2, col2).
-
-
-
-
Example 1:
-
-
-Input
-["NumMatrix", "sumRegion", "sumRegion", "sumRegion"]
-[[[[3, 0, 1, 4, 2], [5, 6, 3, 2, 1], [1, 2, 0, 1, 5], [4, 1, 0, 1, 7], [1, 0, 3, 0, 5]]], [2, 1, 4, 3], [1, 1, 2, 2], [1, 2, 2, 4]]
-Output
-[null, 8, 11, 12]
-
-Explanation
-NumMatrix numMatrix = new NumMatrix([[3, 0, 1, 4, 2], [5, 6, 3, 2, 1], [1, 2, 0, 1, 5], [4, 1, 0, 1, 7], [1, 0, 3, 0, 5]]);
-numMatrix.sumRegion(2, 1, 4, 3); // return 8 (i.e sum of the red rectangle)
-numMatrix.sumRegion(1, 1, 2, 2); // return 11 (i.e sum of the green rectangle)
-numMatrix.sumRegion(1, 2, 2, 4); // return 12 (i.e sum of the blue rectangle)
-
-
-
-
Constraints:
-
-
-
m == matrix.length
-
n == matrix[i].length
-
1 <= m, n <= 200
-
-105 <= matrix[i][j] <= 105
-
0 <= row1 <= row2 < m
-
0 <= col1 <= col2 < n
-
At most 104 calls will be made to sumRegion.
-
-
-### Related Topics
- [[Design](../../tag/design/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
- [[Prefix Sum](../../tag/prefix-sum/README.md)]
-
-### Similar Questions
- 1. [Range Sum Query - Immutable](../range-sum-query-immutable) (Easy)
- 1. [Range Sum Query 2D - Mutable](../range-sum-query-2d-mutable) (Hard)
diff --git a/problems/range-sum-query-2d-immutable/range_sum_query_2d_immutable.go b/problems/range-sum-query-2d-immutable/range_sum_query_2d_immutable.go
deleted file mode 100644
index 0025cde1f..000000000
--- a/problems/range-sum-query-2d-immutable/range_sum_query_2d_immutable.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem304
diff --git a/problems/range-sum-query-2d-immutable/range_sum_query_2d_immutable_test.go b/problems/range-sum-query-2d-immutable/range_sum_query_2d_immutable_test.go
deleted file mode 100644
index 0025cde1f..000000000
--- a/problems/range-sum-query-2d-immutable/range_sum_query_2d_immutable_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem304
diff --git a/problems/range-sum-query-2d-mutable/README.md b/problems/range-sum-query-2d-mutable/README.md
deleted file mode 100644
index 652e5d210..000000000
--- a/problems/range-sum-query-2d-mutable/README.md
+++ /dev/null
@@ -1,54 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../range-sum-query-mutable "Range Sum Query - Mutable")
-
-[Next >](../best-time-to-buy-and-sell-stock-with-cooldown "Best Time to Buy and Sell Stock with Cooldown")
-
-## [308. Range Sum Query 2D - Mutable (Hard)](https://leetcode.com/problems/range-sum-query-2d-mutable "二维区域和检索 - 可变")
-
-
Given a 2D matrix matrix, find the sum of the elements inside the rectangle defined by its upper left corner (row1, col1) and lower right corner (row2, col2).
-
-
-
-The above rectangle (with the red border) is defined by (row1, col1) = (2, 1) and (row2, col2) = (4, 3), which contains sum = 8.
-
Given an integer array nums, handle multiple queries of the following type:
-
-
-
Calculate the sum of the elements of nums between indices left and rightinclusive where left <= right.
-
-
-
Implement the NumArray class:
-
-
-
NumArray(int[] nums) Initializes the object with the integer array nums.
-
int sumRange(int left, int right) Returns the sum of the elements of nums between indices left and rightinclusive (i.e. nums[left] + nums[left + 1] + ... + nums[right]).
-
-### Related Topics
- [[Design](../../tag/design/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Prefix Sum](../../tag/prefix-sum/README.md)]
-
-### Similar Questions
- 1. [Range Sum Query 2D - Immutable](../range-sum-query-2d-immutable) (Medium)
- 1. [Range Sum Query - Mutable](../range-sum-query-mutable) (Medium)
- 1. [Maximum Size Subarray Sum Equals k](../maximum-size-subarray-sum-equals-k) (Medium)
diff --git a/problems/range-sum-query-immutable/range_sum_query_immutable.go b/problems/range-sum-query-immutable/range_sum_query_immutable.go
deleted file mode 100644
index 9b050adcc..000000000
--- a/problems/range-sum-query-immutable/range_sum_query_immutable.go
+++ /dev/null
@@ -1,25 +0,0 @@
-package problem303
-
-type NumArray struct {
- sum []int
-}
-
-func Constructor(nums []int) NumArray {
- sum, na := 0, NumArray{make([]int, len(nums)+1)}
- na.sum[0] = 0
- for i, v := range nums {
- sum += v
- na.sum[i+1] = sum
- }
- return na
-}
-
-func (this *NumArray) SumRange(i int, j int) int {
- return this.sum[j+1] - this.sum[i]
-}
-
-/**
- * Your NumArray object will be instantiated and called as such:
- * obj := Constructor(nums);
- * param_1 := obj.SumRange(i,j);
- */
diff --git a/problems/range-sum-query-immutable/range_sum_query_immutable_test.go b/problems/range-sum-query-immutable/range_sum_query_immutable_test.go
deleted file mode 100644
index 57c2a2e37..000000000
--- a/problems/range-sum-query-immutable/range_sum_query_immutable_test.go
+++ /dev/null
@@ -1,37 +0,0 @@
-package problem303
-
-import "testing"
-
-type testType struct {
- i int
- j int
- want int
-}
-
-func TestConstructor(t *testing.T) {
- nums := []int{-2, 0, 3, -5, 2, -1}
- obj := Constructor(nums)
- tests := [...]testType{
- {
- i: 0,
- j: 2,
- want: 1,
- },
- {
- i: 2,
- j: 5,
- want: -1,
- },
- {
- i: 0,
- j: 5,
- want: -3,
- },
- }
- for _, tt := range tests {
- got := obj.SumRange(tt.i, tt.j)
- if got != tt.want {
- t.Fatalf("in: %v %v, got: %v, want: %v", tt.i, tt.j, got, tt.want)
- }
- }
-}
diff --git a/problems/range-sum-query-mutable/README.md b/problems/range-sum-query-mutable/README.md
deleted file mode 100644
index 9e9b4991a..000000000
--- a/problems/range-sum-query-mutable/README.md
+++ /dev/null
@@ -1,66 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../additive-number "Additive Number")
-
-[Next >](../range-sum-query-2d-mutable "Range Sum Query 2D - Mutable")
-
-## [307. Range Sum Query - Mutable (Medium)](https://leetcode.com/problems/range-sum-query-mutable "区域和检索 - 数组可修改")
-
-
Given an integer array nums, handle multiple queries of the following types:
-
-
-
Update the value of an element in nums.
-
Calculate the sum of the elements of nums between indices left and rightinclusive where left <= right.
-
-
-
Implement the NumArray class:
-
-
-
NumArray(int[] nums) Initializes the object with the integer array nums.
-
void update(int index, int val)Updates the value of nums[index] to be val.
-
int sumRange(int left, int right) Returns the sum of the elements of nums between indices left and rightinclusive (i.e. nums[left] + nums[left + 1] + ... + nums[right]).
-+-------------+---------+
-| Column Name | Type |
-+-------------+---------+
-| id | int |
-| score | decimal |
-+-------------+---------+
-id is the primary key for this table.
-Each row of this table contains the score of a game. Score is a floating point value with two decimal places.
-
-
-
-
-
Write an SQL query to rank the scores. The ranking should be calculated according to the following rules:
-
-
-
The scores should be ranked from the highest to the lowest.
-
If there is a tie between two scores, both should have the same ranking.
-
After a tie, the next ranking number should be the next consecutive integer value. In other words, there should be no holes between ranks.
-
-
-
Return the result table ordered by score in descending order.
-
-
The query result format is in the following example.
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/rank-scores/mysql_schemas.sql b/problems/rank-scores/mysql_schemas.sql
deleted file mode 100644
index e95d6ffae..000000000
--- a/problems/rank-scores/mysql_schemas.sql
+++ /dev/null
@@ -1,8 +0,0 @@
-Create table If Not Exists Scores (id int, score DECIMAL(3,2));
-Truncate table Scores;
-insert into Scores (id, score) values ('1', '3.5');
-insert into Scores (id, score) values ('2', '3.65');
-insert into Scores (id, score) values ('3', '4.0');
-insert into Scores (id, score) values ('4', '3.85');
-insert into Scores (id, score) values ('5', '4.0');
-insert into Scores (id, score) values ('6', '3.65');
diff --git a/problems/rank-scores/rank_scores.sql b/problems/rank-scores/rank_scores.sql
deleted file mode 100644
index bae62cf19..000000000
--- a/problems/rank-scores/rank_scores.sql
+++ /dev/null
@@ -1 +0,0 @@
-# Write your MySQL query statement below
diff --git a/problems/rank-teams-by-votes/README.md b/problems/rank-teams-by-votes/README.md
deleted file mode 100644
index 5c2dc2e62..000000000
--- a/problems/rank-teams-by-votes/README.md
+++ /dev/null
@@ -1,101 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../how-many-numbers-are-smaller-than-the-current-number "How Many Numbers Are Smaller Than the Current Number")
-
-[Next >](../linked-list-in-binary-tree "Linked List in Binary Tree")
-
-## [1366. Rank Teams by Votes (Medium)](https://leetcode.com/problems/rank-teams-by-votes "通过投票对团队排名")
-
-
In a special ranking system, each voter gives a rank from highest to lowest to all teams participated in the competition.
-
-
The ordering of teams is decided by who received the most position-one votes. If two or more teams tie in the first position, we consider the second position to resolve the conflict, if they tie again, we continue this process until the ties are resolved. If two or more teams are still tied after considering all positions, we rank them alphabetically based on their team letter.
-
-
Given an array of strings votes which is the votes of all voters in the ranking systems. Sort all teams according to the ranking system described above.
-
-
Return a string of all teamssorted by the ranking system.
-
-
-
Example 1:
-
-
-Input: votes = ["ABC","ACB","ABC","ACB","ACB"]
-Output: "ACB"
-Explanation: Team A was ranked first place by 5 voters. No other team was voted as first place so team A is the first team.
-Team B was ranked second by 2 voters and was ranked third by 3 voters.
-Team C was ranked second by 3 voters and was ranked third by 2 voters.
-As most of the voters ranked C second, team C is the second team and team B is the third.
-
-
-
Example 2:
-
-
-Input: votes = ["WXYZ","XYZW"]
-Output: "XWYZ"
-Explanation: X is the winner due to tie-breaking rule. X has same votes as W for the first position but X has one vote as second position while W doesn't have any votes as second position.
-
-
-
Example 3:
-
-
-Input: votes = ["ZMNAGUEDSJYLBOPHRQICWFXTVK"]
-Output: "ZMNAGUEDSJYLBOPHRQICWFXTVK"
-Explanation: Only one voter so his votes are used for the ranking.
-
-
-
Example 4:
-
-
-Input: votes = ["BCA","CAB","CBA","ABC","ACB","BAC"]
-Output: "ABC"
-Explanation:
-Team A was ranked first by 2 voters, second by 2 voters and third by 2 voters.
-Team B was ranked first by 2 voters, second by 2 voters and third by 2 voters.
-Team C was ranked first by 2 voters, second by 2 voters and third by 2 voters.
-There is a tie and we rank teams ascending by their IDs.
-
-
-
Example 5:
-
-
-Input: votes = ["M","M","M","M"]
-Output: "M"
-Explanation: Only team M in the competition so it has the first rank.
-
-
-
-
Constraints:
-
-
-
1 <= votes.length <= 1000
-
1 <= votes[i].length <= 26
-
votes[i].length == votes[j].length for 0 <= i, j < votes.length.
-
votes[i][j] is an English upper-case letter.
-
All characters of votes[i] are unique.
-
All the characters that occur in votes[0]also occur in votes[j] where 1 <= j < votes.length.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
- [[Counting](../../tag/counting/README.md)]
-
-### Similar Questions
- 1. [Online Election](../online-election) (Medium)
-
-### Hints
-
-Hint 1
-Build array rank where rank[i][j] is the number of votes for team i to be the j-th rank.
-
-
-
-Hint 2
-Sort the trams by rank array. if rank array is the same for two or more teams, sort them by the ID in ascending order.
-
diff --git a/problems/rank-transform-of-a-matrix/README.md b/problems/rank-transform-of-a-matrix/README.md
deleted file mode 100644
index 50ab56c4c..000000000
--- a/problems/rank-transform-of-a-matrix/README.md
+++ /dev/null
@@ -1,91 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../path-with-minimum-effort "Path With Minimum Effort")
-
-[Next >](../percentage-of-users-attended-a-contest "Percentage of Users Attended a Contest")
-
-## [1632. Rank Transform of a Matrix (Hard)](https://leetcode.com/problems/rank-transform-of-a-matrix "矩阵转换后的秩")
-
-
Given an m x nmatrix, return a new matrix answer where answer[row][col] is the rank of matrix[row][col].
-
-
The rank is an integer that represents how large an element is compared to other elements. It is calculated using the following rules:
-
-
-
The rank is an integer starting from 1.
-
If two elements p and q are in the same row or column, then:
-
-
If p < q then rank(p) < rank(q)
-
If p == q then rank(p) == rank(q)
-
If p > q then rank(p) > rank(q)
-
-
-
The rank should be as small as possible.
-
-
-
The test cases are generated so that answer is unique under the given rules.
-
-
-
Example 1:
-
-
-Input: matrix = [[1,2],[3,4]]
-Output: [[1,2],[2,3]]
-Explanation:
-The rank of matrix[0][0] is 1 because it is the smallest integer in its row and column.
-The rank of matrix[0][1] is 2 because matrix[0][1] > matrix[0][0] and matrix[0][0] is rank 1.
-The rank of matrix[1][0] is 2 because matrix[1][0] > matrix[0][0] and matrix[0][0] is rank 1.
-The rank of matrix[1][1] is 3 because matrix[1][1] > matrix[0][1], matrix[1][1] > matrix[1][0], and both matrix[0][1] and matrix[1][0] are rank 2.
-
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[Union Find](../../tag/union-find/README.md)]
- [[Graph](../../tag/graph/README.md)]
- [[Topological Sort](../../tag/topological-sort/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
-
-### Hints
-
-Hint 1
-Sort the cells by value and process them in increasing order.
-
-
-
-Hint 2
-The rank of a cell is the maximum rank in its row and column plus one.
-
-
-
-Hint 3
-Handle the equal cells by treating them as components using a union-find data structure.
-
diff --git a/problems/rank-transform-of-an-array/README.md b/problems/rank-transform-of-an-array/README.md
deleted file mode 100644
index acf600fb2..000000000
--- a/problems/rank-transform-of-an-array/README.md
+++ /dev/null
@@ -1,69 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../reverse-subarray-to-maximize-array-value "Reverse Subarray To Maximize Array Value")
-
-[Next >](../remove-palindromic-subsequences "Remove Palindromic Subsequences")
-
-## [1331. Rank Transform of an Array (Easy)](https://leetcode.com/problems/rank-transform-of-an-array "数组序号转换")
-
-
Given an array of integers arr, replace each element with its rank.
-
-
The rank represents how large the element is. The rank has the following rules:
-
-
-
Rank is an integer starting from 1.
-
The larger the element, the larger the rank. If two elements are equal, their rank must be the same.
-
Rank should be as small as possible.
-
-
-
-
Example 1:
-
-
-Input: arr = [40,10,20,30]
-Output: [4,1,2,3]
-Explanation: 40 is the largest element. 10 is the smallest. 20 is the second smallest. 30 is the third smallest.
-
-
Example 2:
-
-
-Input: arr = [100,100,100]
-Output: [1,1,1]
-Explanation: Same elements share the same rank.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Hints
-
-Hint 1
-Use a temporary array to copy the array and sort it.
-
-
-
-Hint 2
-The rank of each element is the number of elements smaller than it in the sorted array plus one.
-
diff --git a/problems/ransom-note/README.md b/problems/ransom-note/README.md
deleted file mode 100644
index f917eded4..000000000
--- a/problems/ransom-note/README.md
+++ /dev/null
@@ -1,43 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../linked-list-random-node "Linked List Random Node")
-
-[Next >](../shuffle-an-array "Shuffle an Array")
-
-## [383. Ransom Note (Easy)](https://leetcode.com/problems/ransom-note "赎金信")
-
-
Given two stings ransomNote and magazine, return true if ransomNote can be constructed from magazine and false otherwise.
-
-
Each letter in magazine can only be used once in ransomNote.
You are standing at position 0 on an infinite number line. There is a destination at position target.
-
-
You can make some number of moves numMoves so that:
-
-
-
On each move, you can either go left or right.
-
During the ith move (starting from i == 1 to i == numMoves), you take i steps in the chosen direction.
-
-
-
Given the integer target, return the minimum number of moves required (i.e., the minimum numMoves) to reach the destination.
-
-
-
Example 1:
-
-
-Input: target = 2
-Output: 3
-Explanation:
-On the 1st move, we step from 0 to 1 (1 step).
-On the 2nd move, we step from 1 to -1 (2 steps).
-On the 3rd move, we step from -1 to 2 (3 steps).
-
-
-
Example 2:
-
-
-Input: target = 3
-Output: 2
-Explanation:
-On the 1st move, we step from 0 to 1 (1 step).
-On the 2nd move, we step from 1 to 3 (2 steps).
-
-
-
-
Constraints:
-
-
-
-109 <= target <= 109
-
target != 0
-
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
diff --git a/problems/reach-a-number/reach_a_number.go b/problems/reach-a-number/reach_a_number.go
deleted file mode 100644
index 3c0a54e16..000000000
--- a/problems/reach-a-number/reach_a_number.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem754
diff --git a/problems/reach-a-number/reach_a_number_test.go b/problems/reach-a-number/reach_a_number_test.go
deleted file mode 100644
index 3c0a54e16..000000000
--- a/problems/reach-a-number/reach_a_number_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem754
diff --git a/problems/reachable-nodes-in-subdivided-graph/README.md b/problems/reachable-nodes-in-subdivided-graph/README.md
deleted file mode 100644
index a47afe276..000000000
--- a/problems/reachable-nodes-in-subdivided-graph/README.md
+++ /dev/null
@@ -1,65 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../boats-to-save-people "Boats to Save People")
-
-[Next >](../projection-area-of-3d-shapes "Projection Area of 3D Shapes")
-
-## [882. Reachable Nodes In Subdivided Graph (Hard)](https://leetcode.com/problems/reachable-nodes-in-subdivided-graph "细分图中的可到达结点")
-
-
You are given an undirected graph (the "original graph") with n nodes labeled from 0 to n - 1. You decide to subdivide each edge in the graph into a chain of nodes, with the number of new nodes varying between each edge.
-
-
The graph is given as a 2D array of edges where edges[i] = [ui, vi, cnti] indicates that there is an edge between nodes ui and vi in the original graph, and cnti is the total number of new nodes that you will subdivide the edge into. Note that cnti == 0 means you will not subdivide the edge.
-
-
To subdivide the edge [ui, vi], replace it with (cnti + 1) new edges and cnti new nodes. The new nodes are x1, x2, ..., xcnti, and the new edges are [ui, x1], [x1, x2], [x2, x3], ..., [xcnti+1, xcnti], [xcnti, vi].
-
-
In this new graph, you want to know how many nodes are reachable from the node 0, where a node is reachable if the distance is maxMoves or less.
-
-
Given the original graph and maxMoves, return the number of nodes that are reachable from node 0 in the new graph.
-
-
-
Example 1:
-
-
-Input: edges = [[0,1,10],[0,2,1],[1,2,2]], maxMoves = 6, n = 3
-Output: 13
-Explanation: The edge subdivisions are shown in the image above.
-The nodes that are reachable are highlighted in yellow.
-
-Input: edges = [[1,2,4],[1,4,5],[1,3,1],[2,3,4],[3,4,5]], maxMoves = 17, n = 5
-Output: 1
-Explanation: Node 0 is disconnected from the rest of the graph, so only node 0 is reachable.
-
Given four integers sx, sy, tx, and ty, return true if it is possible to convert the point (sx, sy) to the point (tx, ty)through some operations, or false otherwise.
-
-
The allowed operation on some point (x, y) is to convert it to either (x, x + y) or (x + y, y).
-
-
-
Example 1:
-
-
-Input: sx = 1, sy = 1, tx = 3, ty = 5
-Output: true
-Explanation:
-One series of moves that transforms the starting point to the target is:
-(1, 1) -> (1, 2)
-(1, 2) -> (3, 2)
-(3, 2) -> (3, 5)
-
-
-
Example 2:
-
-
-Input: sx = 1, sy = 1, tx = 2, ty = 2
-Output: false
-
-
-
Example 3:
-
-
-Input: sx = 1, sy = 1, tx = 1, ty = 1
-Output: true
-
-
-
-
Constraints:
-
-
-
1 <= sx, sy, tx, ty <= 109
-
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
diff --git a/problems/reaching-points/reaching_points.go b/problems/reaching-points/reaching_points.go
deleted file mode 100644
index fd7529475..000000000
--- a/problems/reaching-points/reaching_points.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem780
diff --git a/problems/reaching-points/reaching_points_test.go b/problems/reaching-points/reaching_points_test.go
deleted file mode 100644
index fd7529475..000000000
--- a/problems/reaching-points/reaching_points_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem780
diff --git a/problems/read-n-characters-given-read4-ii-call-multiple-times/README.md b/problems/read-n-characters-given-read4-ii-call-multiple-times/README.md
deleted file mode 100644
index 4ceaafb65..000000000
--- a/problems/read-n-characters-given-read4-ii-call-multiple-times/README.md
+++ /dev/null
@@ -1,102 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../read-n-characters-given-read4 "Read N Characters Given Read4")
-
-[Next >](../longest-substring-with-at-most-two-distinct-characters "Longest Substring with At Most Two Distinct Characters")
-
-## [158. Read N Characters Given Read4 II - Call multiple times (Hard)](https://leetcode.com/problems/read-n-characters-given-read4-ii-call-multiple-times "用 Read4 读取 N 个字符 II")
-
-
Given a file and assume that you can only read the file using a given method read4, implement a method read to read n characters. Your method read may be called multiple times.
-
-
-
-
Method read4:
-
-
The API read4 reads 4 consecutive characters from the file, then writes those characters into the buffer array buf.
-
-
The return value is the number of actual characters read.
-
-
Note that read4() has its own file pointer, much like FILE *fp in C.
-
-
Definition of read4:
-
-
- Parameter: char[] buf
- Returns: int
-
-Note: buf[] is destination not source, the results from read4 will be copied to buf[]
-
-
-
Below is a high level example of how read4 works:
-
-
-File file("abcdefghijk"); // File is "abcdefghijk", initially file pointer (fp) points to 'a'
-char[] buf = new char[4]; // Create buffer with enough space to store characters
-read4(buf); // read4 returns 4. Now buf = "abcd", fp points to 'e'
-read4(buf); // read4 returns 4. Now buf = "efgh", fp points to 'i'
-read4(buf); // read4 returns 3. Now buf = "ijk", fp points to end of file
-
-
-
-
-
Method read:
-
-
By using the read4 method, implement the method read that reads n characters from the file and store it in the buffer array buf. Consider that you cannot manipulate the file directly.
-
-
The return value is the number of actual characters read.
-
-
Definition of read:
-
-
- Parameters: char[] buf, int n
- Returns: int
-
-Note: buf[] is destination not source, you will need to write the results to buf[]
-
-
-
-
-
Example 1:
-
-
-File file("abc");
-Solution sol;
-// Assume buf is allocated and guaranteed to have enough space for storing all characters from the file.
-sol.read(buf, 1); // After calling your read method, buf should contain "a". We read a total of 1 character from the file, so return 1.
-sol.read(buf, 2); // Now buf should contain "bc". We read a total of 2 characters from the file, so return 2.
-sol.read(buf, 1); // We have reached the end of file, no more characters can be read. So return 0.
-
-
-
Example 2:
-
-
-File file("abc");
-Solution sol;
-sol.read(buf, 4); // After calling your read method, buf should contain "abc". We read a total of 3 characters from the file, so return 3.
-sol.read(buf, 1); // We have reached the end of file, no more characters can be read. So return 0.
-
-
-
-
-
Note:
-
-
-
Consider that you cannot manipulate the file directly, the file is only accesible for read4 but not for read.
-
The read function may be called multiple times.
-
Please remember to RESET your class variables declared in Solution, as static/class variables are persisted across multiple test cases. Please see here for more details.
-
You may assume the destination buffer array, buf, is guaranteed to have enough space for storing n characters.
-
It is guaranteed that in a given test case the same buffer buf is called by read.
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
- [[Interactive](../../tag/interactive/README.md)]
- [[Simulation](../../tag/simulation/README.md)]
-
-### Similar Questions
- 1. [Read N Characters Given Read4](../read-n-characters-given-read4) (Easy)
diff --git a/problems/read-n-characters-given-read4-ii-call-multiple-times/read_n_characters_given_read4_ii_call_multiple_times.go b/problems/read-n-characters-given-read4-ii-call-multiple-times/read_n_characters_given_read4_ii_call_multiple_times.go
deleted file mode 100644
index abd510725..000000000
--- a/problems/read-n-characters-given-read4-ii-call-multiple-times/read_n_characters_given_read4_ii_call_multiple_times.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem158
diff --git a/problems/read-n-characters-given-read4-ii-call-multiple-times/read_n_characters_given_read4_ii_call_multiple_times_test.go b/problems/read-n-characters-given-read4-ii-call-multiple-times/read_n_characters_given_read4_ii_call_multiple_times_test.go
deleted file mode 100644
index abd510725..000000000
--- a/problems/read-n-characters-given-read4-ii-call-multiple-times/read_n_characters_given_read4_ii_call_multiple_times_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem158
diff --git a/problems/read-n-characters-given-read4/README.md b/problems/read-n-characters-given-read4/README.md
deleted file mode 100644
index 9cb75e643..000000000
--- a/problems/read-n-characters-given-read4/README.md
+++ /dev/null
@@ -1,112 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../binary-tree-upside-down "Binary Tree Upside Down")
-
-[Next >](../read-n-characters-given-read4-ii-call-multiple-times "Read N Characters Given Read4 II - Call multiple times")
-
-## [157. Read N Characters Given Read4 (Easy)](https://leetcode.com/problems/read-n-characters-given-read4 "用 Read4 读取 N 个字符")
-
-
Given a file and assume that you can only read the file using a given method read4, implement a method to read n characters.
-
-
-
-
Method read4:
-
-
The API read4 reads 4 consecutive characters from the file, then writes those characters into the buffer array buf.
-
-
The return value is the number of actual characters read.
-
-
Note that read4() has its own file pointer, much like FILE *fp in C.
-
-
Definition of read4:
-
-
- Parameter: char[] buf
- Returns: int
-
-Note: buf[] is destination not source, the results from read4 will be copied to buf[]
-
-
-
Below is a high level example of how read4 works:
-
-
-File file("abcdefghijk"); // File is "abcdefghijk", initially file pointer (fp) points to 'a'
-char[] buf = new char[4]; // Create buffer with enough space to store characters
-read4(buf); // read4 returns 4. Now buf = "abcd", fp points to 'e'
-read4(buf); // read4 returns 4. Now buf = "efgh", fp points to 'i'
-read4(buf); // read4 returns 3. Now buf = "ijk", fp points to end of file
-
-
-
-
-
Method read:
-
-
By using the read4 method, implement the method read that reads n characters from the file and store it in the buffer array buf. Consider that you cannot manipulate the file directly.
-
-
The return value is the number of actual characters read.
-
-
Definition of read:
-
-
- Parameters: char[] buf, int n
- Returns: int
-
-Note: buf[] is destination not source, you will need to write the results to buf[]
-
-
-
-
-
Example 1:
-
-
-Input: file = "abc", n = 4
-Output: 3
-Explanation: After calling your read method, buf should contain "abc". We read a total of 3 characters from the file, so return 3. Note that "abc" is the file's content, not buf. buf is the destination buffer that you will have to write the results to.
-
-
-
Example 2:
-
-
-Input: file = "abcde", n = 5
-Output: 5
-Explanation: After calling your read method, buf should contain "abcde". We read a total of 5 characters from the file, so return 5.
-
-
-
Example 3:
-
-
-Input: file = "abcdABCD1234", n = 12
-Output: 12
-Explanation: After calling your read method, buf should contain "abcdABCD1234". We read a total of 12 characters from the file, so return 12.
-
-
-
Example 4:
-
-
-Input: file = "leetcode", n = 5
-Output: 5
-Explanation: After calling your read method, buf should contain "leetc". We read a total of 5 characters from the file, so return 5.
-
-
-
-
-
Note:
-
-
-
Consider that you cannot manipulate the file directly, the file is only accesible for read4 but not for read.
-
The read function will only be called once for each test case.
-
You may assume the destination buffer array, buf, is guaranteed to have enough space for storing n characters.
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
- [[Interactive](../../tag/interactive/README.md)]
- [[Simulation](../../tag/simulation/README.md)]
-
-### Similar Questions
- 1. [Read N Characters Given Read4 II - Call multiple times](../read-n-characters-given-read4-ii-call-multiple-times) (Hard)
diff --git a/problems/read-n-characters-given-read4/read_n_characters_given_read4.go b/problems/read-n-characters-given-read4/read_n_characters_given_read4.go
deleted file mode 100644
index 0be8d1def..000000000
--- a/problems/read-n-characters-given-read4/read_n_characters_given_read4.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem157
diff --git a/problems/read-n-characters-given-read4/read_n_characters_given_read4_test.go b/problems/read-n-characters-given-read4/read_n_characters_given_read4_test.go
deleted file mode 100644
index 0be8d1def..000000000
--- a/problems/read-n-characters-given-read4/read_n_characters_given_read4_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem157
diff --git a/problems/rearrange-array-elements-by-sign/README.md b/problems/rearrange-array-elements-by-sign/README.md
deleted file mode 100644
index 42e6a72bd..000000000
--- a/problems/rearrange-array-elements-by-sign/README.md
+++ /dev/null
@@ -1,72 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../count-elements-with-strictly-smaller-and-greater-elements "Count Elements With Strictly Smaller and Greater Elements ")
-
-[Next >](../find-all-lonely-numbers-in-the-array "Find All Lonely Numbers in the Array")
-
-## [2149. Rearrange Array Elements by Sign (Medium)](https://leetcode.com/problems/rearrange-array-elements-by-sign "按符号重排数组")
-
-
You are given a 0-indexed integer array nums of even length consisting of an equal number of positive and negative integers.
-
-
You should rearrange the elements of nums such that the modified array follows the given conditions:
-
-
-
Every consecutive pair of integers have opposite signs.
-
For all integers with the same sign, the order in which they were present in nums is preserved.
-
The rearranged array begins with a positive integer.
-
-
-
Return the modified array after rearranging the elements to satisfy the aforementioned conditions.
-
-
-
Example 1:
-
-
-Input: nums = [3,1,-2,-5,2,-4]
-Output: [3,-2,1,-5,2,-4]
-Explanation:
-The positive integers in nums are [3,1,2]. The negative integers are [-2,-5,-4].
-The only possible way to rearrange them such that they satisfy all conditions is [3,-2,1,-5,2,-4].
-Other ways such as [1,-2,2,-5,3,-4], [3,1,2,-2,-5,-4], [-2,3,-5,1,-4,2] are incorrect because they do not satisfy one or more conditions.
-
-
-
Example 2:
-
-
-Input: nums = [-1,1]
-Output: [1,-1]
-Explanation:
-1 is the only positive integer and -1 the only negative integer in nums.
-So nums is rearranged to [1,-1].
-
-
-
-
Constraints:
-
-
-
2 <= nums.length <= 2 * 105
-
nums.length is even
-
1 <= |nums[i]| <= 105
-
nums consists of equal number of positive and negative integers.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Two Pointers](../../tag/two-pointers/README.md)]
- [[Simulation](../../tag/simulation/README.md)]
-
-### Hints
-
-Hint 1
-Divide the array into two parts- one comprising of only positive integers and the other of negative integers.
-
-
-
-Hint 2
-Merge the two parts to get the resultant array.
-
diff --git a/problems/rearrange-products-table/README.md b/problems/rearrange-products-table/README.md
deleted file mode 100644
index 834046e1b..000000000
--- a/problems/rearrange-products-table/README.md
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../count-pairs-of-equal-substrings-with-minimum-difference "Count Pairs of Equal Substrings With Minimum Difference")
-
-[Next >](../second-largest-digit-in-a-string "Second Largest Digit in a String")
-
-## [1795. Rearrange Products Table (Easy)](https://leetcode.com/problems/rearrange-products-table "每个产品在不同商店的价格")
-
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/rearrange-products-table/mysql_schemas.sql b/problems/rearrange-products-table/mysql_schemas.sql
deleted file mode 100644
index 80706d663..000000000
--- a/problems/rearrange-products-table/mysql_schemas.sql
+++ /dev/null
@@ -1,4 +0,0 @@
-Create table If Not Exists Products (product_id int, store1 int, store2 int, store3 int);
-Truncate table Products;
-insert into Products (product_id, store1, store2, store3) values ('0', '95', '100', '105');
-insert into Products (product_id, store1, store2, store3) values ('1', '70', 'None', '80');
diff --git a/problems/rearrange-spaces-between-words/README.md b/problems/rearrange-spaces-between-words/README.md
deleted file mode 100644
index 96a5b97d5..000000000
--- a/problems/rearrange-spaces-between-words/README.md
+++ /dev/null
@@ -1,56 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../strange-printer-ii "Strange Printer II")
-
-[Next >](../split-a-string-into-the-max-number-of-unique-substrings "Split a String Into the Max Number of Unique Substrings")
-
-## [1592. Rearrange Spaces Between Words (Easy)](https://leetcode.com/problems/rearrange-spaces-between-words "重新排列单词间的空格")
-
-
You are given a string text of words that are placed among some number of spaces. Each word consists of one or more lowercase English letters and are separated by at least one space. It's guaranteed that textcontains at least one word.
-
-
Rearrange the spaces so that there is an equal number of spaces between every pair of adjacent words and that number is maximized. If you cannot redistribute all the spaces equally, place the extra spaces at the end, meaning the returned string should be the same length as text.
-
-
Return the string after rearranging the spaces.
-
-
-
Example 1:
-
-
-Input: text = " this is a sentence "
-Output: "this is a sentence"
-Explanation: There are a total of 9 spaces and 4 words. We can evenly divide the 9 spaces between the words: 9 / (4-1) = 3 spaces.
-
-
-
Example 2:
-
-
-Input: text = " practice makes perfect"
-Output: "practice makes perfect "
-Explanation: There are a total of 7 spaces and 3 words. 7 / (3-1) = 3 spaces plus 1 extra space. We place this extra space at the end of the string.
-
-
-
-
Constraints:
-
-
-
1 <= text.length <= 100
-
text consists of lowercase English letters and ' '.
-
text contains at least one word.
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
-
-### Similar Questions
- 1. [Text Justification](../text-justification) (Hard)
-
-### Hints
-
-Hint 1
-Count the total number of spaces and words. Then use the integer division to determine the numbers of spaces to add between each word and at the end.
-
diff --git a/problems/rearrange-string-k-distance-apart/README.md b/problems/rearrange-string-k-distance-apart/README.md
deleted file mode 100644
index 831175238..000000000
--- a/problems/rearrange-string-k-distance-apart/README.md
+++ /dev/null
@@ -1,55 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../count-numbers-with-unique-digits "Count Numbers with Unique Digits")
-
-[Next >](../logger-rate-limiter "Logger Rate Limiter")
-
-## [358. Rearrange String k Distance Apart (Hard)](https://leetcode.com/problems/rearrange-string-k-distance-apart "K 距离间隔重排字符串")
-
-
Given a non-empty string s and an integer k, rearrange the string such that the same characters are at least distance k from each other.
-
-
All input strings are given in lowercase letters. If it is not possible to rearrange the string, return an empty string "".
-
-
Example 1:
-
-
-
-Input: s = "aabbcc", k = 3
-Output: "abcabc"
-Explanation: The same letters are at least distance 3 from each other.
-
-
-
-
Example 2:
-
-
-Input: s = "aaabc", k = 3
-Output: ""
-Explanation:It is not possible to rearrange the string.
-
-
-
-
Example 3:
-
-
-Input: s = "aaadbbcc", k = 2
-Output: "abacabcd"
-Explanation:The same letters are at least distance 2 from each other.
-
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
- [[Counting](../../tag/counting/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
- [[Heap (Priority Queue)](../../tag/heap-priority-queue/README.md)]
-
-### Similar Questions
- 1. [Task Scheduler](../task-scheduler) (Medium)
- 1. [Reorganize String](../reorganize-string) (Medium)
diff --git a/problems/rearrange-string-k-distance-apart/rearrange_string_k_distance_apart.go b/problems/rearrange-string-k-distance-apart/rearrange_string_k_distance_apart.go
deleted file mode 100644
index a8d67bc26..000000000
--- a/problems/rearrange-string-k-distance-apart/rearrange_string_k_distance_apart.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem358
diff --git a/problems/rearrange-string-k-distance-apart/rearrange_string_k_distance_apart_test.go b/problems/rearrange-string-k-distance-apart/rearrange_string_k_distance_apart_test.go
deleted file mode 100644
index a8d67bc26..000000000
--- a/problems/rearrange-string-k-distance-apart/rearrange_string_k_distance_apart_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem358
diff --git a/problems/rearrange-words-in-a-sentence/README.md b/problems/rearrange-words-in-a-sentence/README.md
deleted file mode 100644
index b920aad7d..000000000
--- a/problems/rearrange-words-in-a-sentence/README.md
+++ /dev/null
@@ -1,71 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../number-of-students-doing-homework-at-a-given-time "Number of Students Doing Homework at a Given Time")
-
-[Next >](../people-whose-list-of-favorite-companies-is-not-a-subset-of-another-list "People Whose List of Favorite Companies Is Not a Subset of Another List")
-
-## [1451. Rearrange Words in a Sentence (Medium)](https://leetcode.com/problems/rearrange-words-in-a-sentence "重新排列句子中的单词")
-
-
Given a sentence text (A sentence is a string of space-separated words) in the following format:
-
-
-
First letter is in upper case.
-
Each word in text are separated by a single space.
-
-
-
Your task is to rearrange the words in text such that all words are rearranged in an increasing order of their lengths. If two words have the same length, arrange them in their original order.
-
-
Return the new text following the format shown above.
-
-
-
Example 1:
-
-
-Input: text = "Leetcode is cool"
-Output: "Is cool leetcode"
-Explanation: There are 3 words, "Leetcode" of length 8, "is" of length 2 and "cool" of length 4.
-Output is ordered by length and the new first word starts with capital letter.
-
-
-
Example 2:
-
-
-Input: text = "Keep calm and code on"
-Output: "On and keep calm code"
-Explanation: Output is ordered as follows:
-"On" 2 letters.
-"and" 3 letters.
-"keep" 4 letters in case of tie order by position in original text.
-"calm" 4 letters.
-"code" 4 letters.
-
-
-
Example 3:
-
-
-Input: text = "To be or not to be"
-Output: "To be or to be not"
-
-
-
-
Constraints:
-
-
-
text begins with a capital letter and then contains lowercase letters and single space between words.
-
1 <= text.length <= 10^5
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Hints
-
-Hint 1
-Store each word and their relative position. Then, sort them by length of words in case of tie by their original order.
-
diff --git a/problems/reconstruct-a-2-row-binary-matrix/README.md b/problems/reconstruct-a-2-row-binary-matrix/README.md
deleted file mode 100644
index 99fabdd1a..000000000
--- a/problems/reconstruct-a-2-row-binary-matrix/README.md
+++ /dev/null
@@ -1,80 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../cells-with-odd-values-in-a-matrix "Cells with Odd Values in a Matrix")
-
-[Next >](../number-of-closed-islands "Number of Closed Islands")
-
-## [1253. Reconstruct a 2-Row Binary Matrix (Medium)](https://leetcode.com/problems/reconstruct-a-2-row-binary-matrix "重构 2 行二进制矩阵")
-
-
Given the following details of a matrix with n columns and 2 rows :
-
-
-
The matrix is a binary matrix, which means each element in the matrix can be 0 or 1.
-
The sum of elements of the 0-th(upper) row is given as upper.
-
The sum of elements of the 1-st(lower) row is given as lower.
-
The sum of elements in the i-th column(0-indexed) is colsum[i], where colsum is given as an integer array with length n.
-
-
-
Your task is to reconstruct the matrix with upper, lower and colsum.
-
-
Return it as a 2-D integer array.
-
-
If there are more than one valid solution, any of them will be accepted.
-
-
If no valid solution exists, return an empty 2-D array.
-
-
-
Example 1:
-
-
-Input: upper = 2, lower = 1, colsum = [1,1,1]
-Output: [[1,1,0],[0,0,1]]
-Explanation: [[1,0,1],[0,1,0]], and [[0,1,1],[1,0,0]] are also correct answers.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Greedy](../../tag/greedy/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
-
-### Similar Questions
- 1. [Find Valid Matrix Given Row and Column Sums](../find-valid-matrix-given-row-and-column-sums) (Medium)
-
-### Hints
-
-Hint 1
-You cannot do anything about colsum[i] = 2 case or colsum[i] = 0 case. Then you put colsum[i] = 1 case to the upper row until upper has reached. Then put the rest into lower row.
-
-
-
-Hint 2
-Fill 0 and 2 first, then fill 1 in the upper row or lower row in turn but be careful about exhausting permitted 1s in each row.
-
diff --git a/problems/reconstruct-itinerary/README.md b/problems/reconstruct-itinerary/README.md
deleted file mode 100644
index 02269425d..000000000
--- a/problems/reconstruct-itinerary/README.md
+++ /dev/null
@@ -1,58 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../verify-preorder-serialization-of-a-binary-tree "Verify Preorder Serialization of a Binary Tree")
-
-[Next >](../largest-bst-subtree "Largest BST Subtree")
-
-## [332. Reconstruct Itinerary (Hard)](https://leetcode.com/problems/reconstruct-itinerary "重新安排行程")
-
-
You are given a list of airline tickets where tickets[i] = [fromi, toi] represent the departure and the arrival airports of one flight. Reconstruct the itinerary in order and return it.
-
-
All of the tickets belong to a man who departs from "JFK", thus, the itinerary must begin with "JFK". If there are multiple valid itineraries, you should return the itinerary that has the smallest lexical order when read as a single string.
-
-
-
For example, the itinerary ["JFK", "LGA"] has a smaller lexical order than ["JFK", "LGB"].
-
-
-
You may assume all tickets form at least one valid itinerary. You must use all the tickets once and only once.
-Input: tickets = [["JFK","SFO"],["JFK","ATL"],["SFO","ATL"],["ATL","JFK"],["ATL","SFO"]]
-Output: ["JFK","ATL","JFK","SFO","ATL","SFO"]
-Explanation: Another possible reconstruction is ["JFK","SFO","ATL","JFK","ATL","SFO"] but it is larger in lexical order.
-
-
-
-
Constraints:
-
-
-
1 <= tickets.length <= 300
-
tickets[i].length == 2
-
fromi.length == 3
-
toi.length == 3
-
fromi and toi consist of uppercase English letters.
We run a preorder depth-first search (DFS) on the root of a binary tree.
-
-
At each node in this traversal, we output D dashes (where D is the depth of this node), then we output the value of this node. If the depth of a node is D, the depth of its immediate child is D + 1. The depth of the root node is 0.
-
-
If a node has only one child, that child is guaranteed to be the left child.
-
-
Given the output traversal of this traversal, recover the tree and return itsroot.
The number of nodes in the original tree is in the range [1, 1000].
-
1 <= Node.val <= 109
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
- [[Tree](../../tag/tree/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Binary Tree](../../tag/binary-tree/README.md)]
-
-### Hints
-
-Hint 1
-Do an iterative depth first search, parsing dashes from the string to inform you how to link the nodes together.
-
diff --git a/problems/recover-binary-search-tree/README.md b/problems/recover-binary-search-tree/README.md
deleted file mode 100644
index d8cfb5216..000000000
--- a/problems/recover-binary-search-tree/README.md
+++ /dev/null
@@ -1,48 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../validate-binary-search-tree "Validate Binary Search Tree")
-
-[Next >](../same-tree "Same Tree")
-
-## [99. Recover Binary Search Tree (Medium)](https://leetcode.com/problems/recover-binary-search-tree "恢复二叉搜索树")
-
-
You are given the root of a binary search tree (BST), where the values of exactly two nodes of the tree were swapped by mistake. Recover the tree without changing its structure.
-
-
-
Example 1:
-
-
-Input: root = [1,3,null,null,2]
-Output: [3,1,null,null,2]
-Explanation: 3 cannot be a left child of 1 because 3 > 1. Swapping 1 and 3 makes the BST valid.
-
-
-
Example 2:
-
-
-Input: root = [3,1,4,null,null,2]
-Output: [2,1,4,null,null,3]
-Explanation: 2 cannot be in the right subtree of 3 because 2 < 3. Swapping 2 and 3 makes the BST valid.
-
-
-
-
Constraints:
-
-
-
The number of nodes in the tree is in the range [2, 1000].
-
-231 <= Node.val <= 231 - 1
-
-
-
-Follow up: A solution using O(n) space is pretty straight-forward. Could you devise a constant O(1) space solution?
-
-### Related Topics
- [[Tree](../../tag/tree/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Binary Search Tree](../../tag/binary-search-tree/README.md)]
- [[Binary Tree](../../tag/binary-tree/README.md)]
diff --git a/problems/recover-binary-search-tree/recover_binary_search_tree.go b/problems/recover-binary-search-tree/recover_binary_search_tree.go
deleted file mode 100644
index b072cd3e6..000000000
--- a/problems/recover-binary-search-tree/recover_binary_search_tree.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem99
diff --git a/problems/recover-binary-search-tree/recover_binary_search_tree_test.go b/problems/recover-binary-search-tree/recover_binary_search_tree_test.go
deleted file mode 100644
index b072cd3e6..000000000
--- a/problems/recover-binary-search-tree/recover_binary_search_tree_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem99
diff --git a/problems/recover-the-original-array/README.md b/problems/recover-the-original-array/README.md
deleted file mode 100644
index 31c4a2224..000000000
--- a/problems/recover-the-original-array/README.md
+++ /dev/null
@@ -1,95 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../intervals-between-identical-elements "Intervals Between Identical Elements")
-
-[Next >](../minimum-operations-to-remove-adjacent-ones-in-matrix "Minimum Operations to Remove Adjacent Ones in Matrix")
-
-## [2122. Recover the Original Array (Hard)](https://leetcode.com/problems/recover-the-original-array "还原原数组")
-
-
Alice had a 0-indexed array arr consisting of npositive integers. She chose an arbitrary positive integerk and created two new 0-indexed integer arrays lower and higher in the following manner:
-
-
-
lower[i] = arr[i] - k, for every index i where 0 <= i < n
-
higher[i] = arr[i] + k, for every index i where 0 <= i < n
-
-
-
Unfortunately, Alice lost all three arrays. However, she remembers the integers that were present in the arrays lower and higher, but not the array each integer belonged to. Help Alice and recover the original array.
-
-
Given an array nums consisting of 2n integers, where exactlyn of the integers were present in lower and the remaining in higher, return the original arrayarr. In case the answer is not unique, return any valid array.
-
-
Note: The test cases are generated such that there exists at least one valid array arr.
-
-
-
Example 1:
-
-
-Input: nums = [2,10,6,4,8,12]
-Output: [3,7,11]
-Explanation:
-If arr = [3,7,11] and k = 1, we get lower = [2,6,10] and higher = [4,8,12].
-Combining lower and higher gives us [2,6,10,4,8,12], which is a permutation of nums.
-Another valid possibility is that arr = [5,7,9] and k = 3. In that case, lower = [2,4,6] and higher = [8,10,12].
-
-
-
Example 2:
-
-
-Input: nums = [1,1,3,3]
-Output: [2,2]
-Explanation:
-If arr = [2,2] and k = 1, we get lower = [1,1] and higher = [3,3].
-Combining lower and higher gives us [1,1,3,3], which is equal to nums.
-Note that arr cannot be [1,3] because in that case, the only possible way to obtain [1,1,3,3] is with k = 0.
-This is invalid since k must be positive.
-
-
-
Example 3:
-
-
-Input: nums = [5,435]
-Output: [220]
-Explanation:
-The only possible combination is arr = [220] and k = 215. Using them, we get lower = [5] and higher = [435].
-
-
-
-
Constraints:
-
-
-
2 * n == nums.length
-
1 <= n <= 1000
-
1 <= nums[i] <= 109
-
The test cases are generated such that there exists at least one valid array arr.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Enumeration](../../tag/enumeration/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Hints
-
-Hint 1
-If we fix the value of k, how can we check if an original array exists for the fixed k?
-
-
-
-Hint 2
-The smallest value of nums is obtained by subtracting k from the smallest value of the original array. How can we use this to reduce the search space for finding a valid k?
-
-
-
-Hint 3
-You can compute every possible k by using the smallest value of nums (as lower[i]) against every other value in nums (as the corresponding higher[i]).
-
-
-
-Hint 4
-For every computed k, greedily pair up the values in nums. This can be done sorting nums, then using a map to store previous values and searching that map for a corresponding lower[i] for the current nums[j] (as higher[i]).
-
diff --git a/problems/rectangle-area-ii/README.md b/problems/rectangle-area-ii/README.md
deleted file mode 100644
index b21a412dc..000000000
--- a/problems/rectangle-area-ii/README.md
+++ /dev/null
@@ -1,49 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximize-distance-to-closest-person "Maximize Distance to Closest Person")
-
-[Next >](../loud-and-rich "Loud and Rich")
-
-## [850. Rectangle Area II (Hard)](https://leetcode.com/problems/rectangle-area-ii "矩形面积 II")
-
-
We are given a list of (axis-aligned) rectangles. Each rectangle[i] = [xi1, yi1, xi2, yi2] , where (xi1, yi1) are the coordinates of the bottom-left corner, and (xi2, yi2) are the coordinates of the top-right corner of the ith rectangle.
-
-
Find the total area covered by all rectangles in the plane. Since the answer may be too large, return it modulo109 + 7.
-
-
-
Example 1:
-
-
-Input: rectangles = [[0,0,2,2],[1,0,2,3],[1,0,3,1]]
-Output: 6
-Explanation: As illustrated in the picture.
-
-
-
Example 2:
-
-
-Input: rectangles = [[0,0,1000000000,1000000000]]
-Output: 49
-Explanation: The answer is 1018 modulo (109 + 7), which is (109)2 = (-7)2 = 49.
-
-
-
-
Constraints:
-
-
-
1 <= rectangles.length <= 200
-
rectanges[i].length = 4
-
0 <= rectangles[i][j] <= 109
-
The total area covered by all rectangles will never exceed 263 - 1 and thus will fit in a 64-bit signed integer.
An axis-aligned rectangle is represented as a list [x1, y1, x2, y2], where (x1, y1) is the coordinate of its bottom-left corner, and (x2, y2) is the coordinate of its top-right corner. Its top and bottom edges are parallel to the X-axis, and its left and right edges are parallel to the Y-axis.
-
-
Two rectangles overlap if the area of their intersection is positive. To be clear, two rectangles that only touch at the corner or edges do not overlap.
-
-
Given two axis-aligned rectangles rec1 and rec2, return true if they overlap, otherwise return false.
rec1 and rec2 represent a valid rectangle with a non-zero area.
-
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
- [[Geometry](../../tag/geometry/README.md)]
-
-### Similar Questions
- 1. [Rectangle Area](../rectangle-area) (Medium)
diff --git a/problems/rectangle-overlap/rectangle_overlap.go b/problems/rectangle-overlap/rectangle_overlap.go
deleted file mode 100644
index 1304599f8..000000000
--- a/problems/rectangle-overlap/rectangle_overlap.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem836
diff --git a/problems/rectangle-overlap/rectangle_overlap_test.go b/problems/rectangle-overlap/rectangle_overlap_test.go
deleted file mode 100644
index 1304599f8..000000000
--- a/problems/rectangle-overlap/rectangle_overlap_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem836
diff --git a/problems/rectangles-area/README.md b/problems/rectangles-area/README.md
deleted file mode 100644
index f64effc69..000000000
--- a/problems/rectangles-area/README.md
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../max-dot-product-of-two-subsequences "Max Dot Product of Two Subsequences")
-
-[Next >](../make-two-arrays-equal-by-reversing-sub-arrays "Make Two Arrays Equal by Reversing Sub-arrays")
-
-## [1459. Rectangles Area (Medium)](https://leetcode.com/problems/rectangles-area "矩形面积")
-
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/rectangles-area/mysql_schemas.sql b/problems/rectangles-area/mysql_schemas.sql
deleted file mode 100644
index 63988bb64..000000000
--- a/problems/rectangles-area/mysql_schemas.sql
+++ /dev/null
@@ -1,5 +0,0 @@
-Create table If Not Exists Points (id int, x_value int, y_value int);
-Truncate table Points;
-insert into Points (id, x_value, y_value) values ('1', '2', '7');
-insert into Points (id, x_value, y_value) values ('2', '4', '8');
-insert into Points (id, x_value, y_value) values ('3', '2', '10');
diff --git a/problems/recyclable-and-low-fat-products/README.md b/problems/recyclable-and-low-fat-products/README.md
deleted file mode 100644
index 1bb3bbf66..000000000
--- a/problems/recyclable-and-low-fat-products/README.md
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../design-most-recently-used-queue "Design Most Recently Used Queue")
-
-[Next >](../minimum-changes-to-make-alternating-binary-string "Minimum Changes To Make Alternating Binary String")
-
-## [1757. Recyclable and Low Fat Products (Easy)](https://leetcode.com/problems/recyclable-and-low-fat-products "可回收且低脂的产品")
-
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/recyclable-and-low-fat-products/mysql_schemas.sql b/problems/recyclable-and-low-fat-products/mysql_schemas.sql
deleted file mode 100644
index bffc7a5fb..000000000
--- a/problems/recyclable-and-low-fat-products/mysql_schemas.sql
+++ /dev/null
@@ -1,7 +0,0 @@
-Create table If Not Exists Products (product_id int, low_fats ENUM('Y', 'N'), recyclable ENUM('Y','N'));
-Truncate table Products;
-insert into Products (product_id, low_fats, recyclable) values ('0', 'Y', 'N');
-insert into Products (product_id, low_fats, recyclable) values ('1', 'Y', 'Y');
-insert into Products (product_id, low_fats, recyclable) values ('2', 'N', 'Y');
-insert into Products (product_id, low_fats, recyclable) values ('3', 'Y', 'Y');
-insert into Products (product_id, low_fats, recyclable) values ('4', 'N', 'N');
diff --git a/problems/redistribute-characters-to-make-all-strings-equal/README.md b/problems/redistribute-characters-to-make-all-strings-equal/README.md
deleted file mode 100644
index 267df957b..000000000
--- a/problems/redistribute-characters-to-make-all-strings-equal/README.md
+++ /dev/null
@@ -1,62 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-cost-to-change-the-final-value-of-expression "Minimum Cost to Change the Final Value of Expression")
-
-[Next >](../maximum-number-of-removable-characters "Maximum Number of Removable Characters")
-
-## [1897. Redistribute Characters to Make All Strings Equal (Easy)](https://leetcode.com/problems/redistribute-characters-to-make-all-strings-equal "重新分配字符使所有字符串都相等")
-
-
You are given an array of strings words (0-indexed).
-
-
In one operation, pick two distinct indices i and j, where words[i] is a non-empty string, and move any character from words[i] to any position in words[j].
-
-
Return trueif you can make every string in wordsequal using any number of operations, and falseotherwise.
-
-
-
Example 1:
-
-
-Input: words = ["abc","aabc","bc"]
-Output: true
-Explanation: Move the first 'a' in words[1] to the front of words[2],
-to make words[1] = "abc" and words[2] = "abc".
-All the strings are now equal to "abc", so return true.
-
-
-
Example 2:
-
-
-Input: words = ["ab","a"]
-Output: false
-Explanation: It is impossible to make all the strings equal using the operation.
-
-
-
-
Constraints:
-
-
-
1 <= words.length <= 100
-
1 <= words[i].length <= 100
-
words[i] consists of lowercase English letters.
-
-
-### Related Topics
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
- [[Counting](../../tag/counting/README.md)]
-
-### Hints
-
-Hint 1
-Characters are independent—only the frequency of characters matters.
-
-
-
-Hint 2
-It is possible to distribute characters if all characters can be divided equally among all strings.
-
diff --git a/problems/reduce-array-size-to-the-half/README.md b/problems/reduce-array-size-to-the-half/README.md
deleted file mode 100644
index 7dcae1f59..000000000
--- a/problems/reduce-array-size-to-the-half/README.md
+++ /dev/null
@@ -1,67 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../the-k-weakest-rows-in-a-matrix "The K Weakest Rows in a Matrix")
-
-[Next >](../maximum-product-of-splitted-binary-tree "Maximum Product of Splitted Binary Tree")
-
-## [1338. Reduce Array Size to The Half (Medium)](https://leetcode.com/problems/reduce-array-size-to-the-half "数组大小减半")
-
-
You are given an integer array arr. You can choose a set of integers and remove all the occurrences of these integers in the array.
-
-
Return the minimum size of the set so that at least half of the integers of the array are removed.
-
-
-
Example 1:
-
-
-Input: arr = [3,3,3,3,5,5,5,2,2,7]
-Output: 2
-Explanation: Choosing {3,7} will make the new array [5,5,5,2,2] which has size 5 (i.e equal to half of the size of the old array).
-Possible sets of size 2 are {3,5},{3,2},{5,2}.
-Choosing set {2,7} is not possible as it will make the new array [3,3,3,3,5,5,5] which has a size greater than half of the size of the old array.
-
-
-
Example 2:
-
-
-Input: arr = [7,7,7,7,7,7]
-Output: 1
-Explanation: The only possible set you can choose is {7}. This will make the new array empty.
-
-
-
-
Constraints:
-
-
-
2 <= arr.length <= 105
-
arr.length is even.
-
1 <= arr[i] <= 105
-
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
- [[Heap (Priority Queue)](../../tag/heap-priority-queue/README.md)]
-
-### Hints
-
-Hint 1
-Count the frequency of each integer in the array.
-
-
-
-Hint 2
-Start with an empty set, add to the set the integer with the maximum frequency.
-
-
-
-Hint 3
-Keep Adding the integer with the max frequency until you remove at least half of the integers.
-
diff --git a/problems/reducing-dishes/README.md b/problems/reducing-dishes/README.md
deleted file mode 100644
index c17b51662..000000000
--- a/problems/reducing-dishes/README.md
+++ /dev/null
@@ -1,71 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../circle-and-rectangle-overlapping "Circle and Rectangle Overlapping")
-
-[Next >](../minimum-subsequence-in-non-increasing-order "Minimum Subsequence in Non-Increasing Order")
-
-## [1402. Reducing Dishes (Hard)](https://leetcode.com/problems/reducing-dishes "做菜顺序")
-
-
A chef has collected data on the satisfaction level of his n dishes. Chef can cook any dish in 1 unit of time.
-
-
Like-time coefficient of a dish is defined as the time taken to cook that dish including previous dishes multiplied by its satisfaction level i.e. time[i] * satisfaction[i].
-
-
Return the maximum sum of like-time coefficient that the chef can obtain after dishes preparation.
-
-
Dishes can be prepared in any order and the chef can discard some dishes to get this maximum value.
-
-
-
Example 1:
-
-
-Input: satisfaction = [-1,-8,0,5,-9]
-Output: 14
-Explanation: After Removing the second and last dish, the maximum total like-time coefficient will be equal to (-1*1 + 0*2 + 5*3 = 14).
-Each dish is prepared in one unit of time.
-
-
Example 2:
-
-
-Input: satisfaction = [4,3,2]
-Output: 20
-Explanation: Dishes can be prepared in any order, (2*1 + 3*2 + 4*3 = 20)
-
-
-
Example 3:
-
-
-Input: satisfaction = [-1,-4,-5]
-Output: 0
-Explanation: People do not like the dishes. No dish is prepared.
-
-
-
-
Constraints:
-
-
-
n == satisfaction.length
-
1 <= n <= 500
-
-1000 <= satisfaction[i] <= 1000
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Greedy](../../tag/greedy/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Hints
-
-Hint 1
-Use dynamic programming to find the optimal solution by saving the previous best like-time coefficient and its corresponding element sum.
-
-
-
-Hint 2
-If adding the current element to the previous best like-time coefficient and its corresponding element sum would increase the best like-time coefficient, then go ahead and add it. Otherwise, keep the previous best like-time coefficient.
-
diff --git a/problems/reduction-operations-to-make-the-array-elements-equal/README.md b/problems/reduction-operations-to-make-the-array-elements-equal/README.md
deleted file mode 100644
index f165aae46..000000000
--- a/problems/reduction-operations-to-make-the-array-elements-equal/README.md
+++ /dev/null
@@ -1,77 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../determine-whether-matrix-can-be-obtained-by-rotation "Determine Whether Matrix Can Be Obtained By Rotation")
-
-[Next >](../minimum-number-of-flips-to-make-the-binary-string-alternating "Minimum Number of Flips to Make the Binary String Alternating")
-
-## [1887. Reduction Operations to Make the Array Elements Equal (Medium)](https://leetcode.com/problems/reduction-operations-to-make-the-array-elements-equal "使数组元素相等的减少操作次数")
-
-
Given an integer array nums, your goal is to make all elements in nums equal. To complete one operation, follow these steps:
-
-
-
Find the largest value in nums. Let its index be i (0-indexed) and its value be largest. If there are multiple elements with the largest value, pick the smallest i.
-
Find the next largest value in numsstrictly smaller than largest. Let its value be nextLargest.
-
Reduce nums[i] to nextLargest.
-
-
-
Return the number of operations to make all elements in nums equal.
-
-
-
Example 1:
-
-
-Input: nums = [5,1,3]
-Output: 3
-Explanation: It takes 3 operations to make all elements in nums equal:
-1. largest = 5 at index 0. nextLargest = 3. Reduce nums[0] to 3. nums = [3,1,3].
-2. largest = 3 at index 0. nextLargest = 1. Reduce nums[0] to 1. nums = [1,1,3].
-3. largest = 3 at index 2. nextLargest = 1. Reduce nums[2] to 1. nums = [1,1,1].
-
-
-
Example 2:
-
-
-Input: nums = [1,1,1]
-Output: 0
-Explanation: All elements in nums are already equal.
-
-
-
Example 3:
-
-
-Input: nums = [1,1,2,2,3]
-Output: 4
-Explanation: It takes 4 operations to make all elements in nums equal:
-1. largest = 3 at index 4. nextLargest = 2. Reduce nums[4] to 2. nums = [1,1,2,2,2].
-2. largest = 2 at index 2. nextLargest = 1. Reduce nums[2] to 1. nums = [1,1,1,2,2].
-3. largest = 2 at index 3. nextLargest = 1. Reduce nums[3] to 1. nums = [1,1,1,1,2].
-4. largest = 2 at index 4. nextLargest = 1. Reduce nums[4] to 1. nums = [1,1,1,1,1].
-
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 5 * 104
-
1 <= nums[i] <= 5 * 104
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Hints
-
-Hint 1
-Sort the array.
-
-
-
-Hint 2
-Try to reduce all elements with maximum value to the next maximum value in one operation.
-
diff --git a/problems/redundant-connection-ii/README.md b/problems/redundant-connection-ii/README.md
deleted file mode 100644
index 5d2839c69..000000000
--- a/problems/redundant-connection-ii/README.md
+++ /dev/null
@@ -1,55 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../redundant-connection "Redundant Connection")
-
-[Next >](../repeated-string-match "Repeated String Match")
-
-## [685. Redundant Connection II (Hard)](https://leetcode.com/problems/redundant-connection-ii "冗余连接 II")
-
-
In this problem, a rooted tree is a directed graph such that, there is exactly one node (the root) for which all other nodes are descendants of this node, plus every node has exactly one parent, except for the root node which has no parents.
-
-
The given input is a directed graph that started as a rooted tree with n nodes (with distinct values from 1 to n), with one additional directed edge added. The added edge has two different vertices chosen from 1 to n, and was not an edge that already existed.
-
-
The resulting graph is given as a 2D-array of edges. Each element of edges is a pair [ui, vi] that represents a directed edge connecting nodes ui and vi, where ui is a parent of child vi.
-
-
Return an edge that can be removed so that the resulting graph is a rooted tree ofnnodes. If there are multiple answers, return the answer that occurs last in the given 2D-array.
In this problem, a tree is an undirected graph that is connected and has no cycles.
-
-
You are given a graph that started as a tree with n nodes labeled from 1 to n, with one additional edge added. The added edge has two different vertices chosen from 1 to n, and was not an edge that already existed. The graph is represented as an array edges of length n where edges[i] = [ai, bi] indicates that there is an edge between nodes ai and bi in the graph.
-
-
Return an edge that can be removed so that the resulting graph is a tree of n nodes. If there are multiple answers, return the answer that occurs last in the input.
Given a date string in the form Day Month Year, where:
-
-
-
Day is in the set {"1st", "2nd", "3rd", "4th", ..., "30th", "31st"}.
-
Month is in the set {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"}.
-
Year is in the range [1900, 2100].
-
-
-
Convert the date string to the format YYYY-MM-DD, where:
-
-
-
YYYY denotes the 4 digit year.
-
MM denotes the 2 digit month.
-
DD denotes the 2 digit day.
-
-
-
-
Example 1:
-
-
-Input: date = "20th Oct 2052"
-Output: "2052-10-20"
-
-
-
Example 2:
-
-
-Input: date = "6th Jun 1933"
-Output: "1933-06-06"
-
-
-
Example 3:
-
-
-Input: date = "26th May 1960"
-Output: "1960-05-26"
-
-
-
-
Constraints:
-
-
-
The given dates are guaranteed to be valid, so no error handling is necessary.
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
-
-### Hints
-
-Hint 1
-Handle the conversions of day, month and year separately.
-
-
-
-Hint 2
-Notice that days always have a two-word ending, so if you erase the last two characters of this days you'll get the number.
-
diff --git a/problems/reformat-department-table/README.md b/problems/reformat-department-table/README.md
deleted file mode 100644
index 22185b884..000000000
--- a/problems/reformat-department-table/README.md
+++ /dev/null
@@ -1,65 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../number-of-valid-words-for-each-puzzle "Number of Valid Words for Each Puzzle")
-
-[Next >](../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 "重新格式化部门表")
-
-
Table: Department
-
-
-+-------------+---------+
-| Column Name | Type |
-+-------------+---------+
-| id | int |
-| revenue | int |
-| month | varchar |
-+-------------+---------+
-(id, month) is the primary key of this table.
-The table has information about the revenue of each department per month.
-The month has values in ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"].
-
-
-
-
-
Write an SQL query to reformat the table such that there is a department id column and a revenue column for each month.
-
-
Return the result table in any order.
-
-
The query result format is in the following example.
-
-
-
Example 1:
-
-
-Input:
-Department table:
-+------+---------+-------+
-| id | revenue | month |
-+------+---------+-------+
-| 1 | 8000 | Jan |
-| 2 | 9000 | Jan |
-| 3 | 10000 | Feb |
-| 1 | 7000 | Feb |
-| 1 | 6000 | Mar |
-+------+---------+-------+
-Output:
-+------+-------------+-------------+-------------+-----+-------------+
-| id | Jan_Revenue | Feb_Revenue | Mar_Revenue | ... | Dec_Revenue |
-+------+-------------+-------------+-------------+-----+-------------+
-| 1 | 8000 | 7000 | 6000 | ... | null |
-| 2 | 9000 | null | null | ... | null |
-| 3 | null | 10000 | null | ... | null |
-+------+-------------+-------------+-------------+-----+-------------+
-Explanation: The revenue from Apr to Dec is null.
-Note that the result table has 13 columns (1 for the department id + 12 for the months).
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/reformat-department-table/mysql_schemas.sql b/problems/reformat-department-table/mysql_schemas.sql
deleted file mode 100644
index 1c652dfcf..000000000
--- a/problems/reformat-department-table/mysql_schemas.sql
+++ /dev/null
@@ -1,7 +0,0 @@
-Create table If Not Exists Department (id int, revenue int, month varchar(5));
-Truncate table Department;
-insert into Department (id, revenue, month) values ('1', '8000', 'Jan');
-insert into Department (id, revenue, month) values ('2', '9000', 'Jan');
-insert into Department (id, revenue, month) values ('3', '10000', 'Feb');
-insert into Department (id, revenue, month) values ('1', '7000', 'Feb');
-insert into Department (id, revenue, month) values ('1', '6000', 'Mar');
diff --git a/problems/reformat-phone-number/README.md b/problems/reformat-phone-number/README.md
deleted file mode 100644
index d4dc85908..000000000
--- a/problems/reformat-phone-number/README.md
+++ /dev/null
@@ -1,84 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../daily-leads-and-partners "Daily Leads and Partners")
-
-[Next >](../maximum-erasure-value "Maximum Erasure Value")
-
-## [1694. Reformat Phone Number (Easy)](https://leetcode.com/problems/reformat-phone-number "重新格式化电话号码")
-
-
You are given a phone number as a string number. number consists of digits, spaces ' ', and/or dashes '-'.
-
-
You would like to reformat the phone number in a certain manner. Firstly, remove all spaces and dashes. Then, group the digits from left to right into blocks of length 3 until there are 4 or fewer digits. The final digits are then grouped as follows:
-
-
-
2 digits: A single block of length 2.
-
3 digits: A single block of length 3.
-
4 digits: Two blocks of length 2 each.
-
-
-
The blocks are then joined by dashes. Notice that the reformatting process should never produce any blocks of length 1 and produce at most two blocks of length 2.
-
-
Return the phone number after formatting.
-
-
-
Example 1:
-
-
-Input: number = "1-23-45 6"
-Output: "123-456"
-Explanation: The digits are "123456".
-Step 1: There are more than 4 digits, so group the next 3 digits. The 1st block is "123".
-Step 2: There are 3 digits remaining, so put them in a single block of length 3. The 2nd block is "456".
-Joining the blocks gives "123-456".
-
-
-
Example 2:
-
-
-Input: number = "123 4-567"
-Output: "123-45-67"
-Explanation: The digits are "1234567".
-Step 1: There are more than 4 digits, so group the next 3 digits. The 1st block is "123".
-Step 2: There are 4 digits left, so split them into two blocks of length 2. The blocks are "45" and "67".
-Joining the blocks gives "123-45-67".
-
-
-
Example 3:
-
-
-Input: number = "123 4-5678"
-Output: "123-456-78"
-Explanation: The digits are "12345678".
-Step 1: The 1st block is "123".
-Step 2: The 2nd block is "456".
-Step 3: There are 2 digits left, so put them in a single block of length 2. The 3rd block is "78".
-Joining the blocks gives "123-456-78".
-
-
-
-
Constraints:
-
-
-
2 <= number.length <= 100
-
number consists of digits and the characters '-' and ' '.
-
There are at least two digits in number.
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
-
-### Hints
-
-Hint 1
-Discard all the spaces and dashes.
-
-
-
-Hint 2
-Use a while loop. While the string still has digits, check its length and see which rule to apply.
-
diff --git a/problems/reformat-the-string/README.md b/problems/reformat-the-string/README.md
deleted file mode 100644
index 9b928f238..000000000
--- a/problems/reformat-the-string/README.md
+++ /dev/null
@@ -1,79 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../restore-the-array "Restore The Array")
-
-[Next >](../display-table-of-food-orders-in-a-restaurant "Display Table of Food Orders in a Restaurant")
-
-## [1417. Reformat The String (Easy)](https://leetcode.com/problems/reformat-the-string "重新格式化字符串")
-
-
Given alphanumeric string s. (Alphanumeric string is a string consisting of lowercase English letters and digits).
-
-
You have to find a permutation of the string where no letter is followed by another letter and no digit is followed by another digit. That is, no two adjacent characters have the same type.
-
-
Return the reformatted string or return an empty string if it is impossible to reformat the string.
-
-
-
Example 1:
-
-
-Input: s = "a0b1c2"
-Output: "0a1b2c"
-Explanation: No two adjacent characters have the same type in "0a1b2c". "a0b1c2", "0a1b2c", "0c2a1b" are also valid permutations.
-
-
-
Example 2:
-
-
-Input: s = "leetcode"
-Output: ""
-Explanation: "leetcode" has only characters so we cannot separate them by digits.
-
-
-
Example 3:
-
-
-Input: s = "1229857369"
-Output: ""
-Explanation: "1229857369" has only digits so we cannot separate them by characters.
-
-
-
Example 4:
-
-
-Input: s = "covid2019"
-Output: "c2o0v1i9d"
-
-
-
Example 5:
-
-
-Input: s = "ab123"
-Output: "1a2b3"
-
-
-
-
Constraints:
-
-
-
1 <= s.length <= 500
-
s consists of only lowercase English letters and/or digits.
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
-
-### Hints
-
-Hint 1
-Count the number of letters and digits in the string. if cntLetters - cntDigits has any of the values [-1, 0, 1] we have an answer, otherwise we don't have any answer.
-
-
-
-Hint 2
-Build the string anyway as you wish. Keep in mind that you need to start with the type that have more characters if cntLetters ≠ cntDigits.
-
diff --git a/problems/reformat-the-string/reformat_the_string.go b/problems/reformat-the-string/reformat_the_string.go
deleted file mode 100644
index 840d70c1d..000000000
--- a/problems/reformat-the-string/reformat_the_string.go
+++ /dev/null
@@ -1,26 +0,0 @@
-package problem1417
-
-func reformat(s string) string {
- i, j, l := 0, 1, len(s)
- str := make([]byte, l+1)
- for _, c := range s {
- if '0' <= c && c <= '9' {
- if i > l {
- return ""
- }
- str[i], i = byte(c), i+2
- } else if j > l {
- return ""
- } else {
- str[j], j = byte(c), j+2
- }
- }
- if i == l || j == l {
- return string(str[:l])
- }
- if i == l-1 {
- str[i] = str[0]
- return string(str[1 : l+1])
- }
- return ""
-}
diff --git a/problems/reformat-the-string/reformat_the_string_test.go b/problems/reformat-the-string/reformat_the_string_test.go
deleted file mode 100644
index 691a6f023..000000000
--- a/problems/reformat-the-string/reformat_the_string_test.go
+++ /dev/null
@@ -1,63 +0,0 @@
-package problem1417
-
-import "testing"
-
-type testType struct {
- in string
- want string
-}
-
-func TestReformat(t *testing.T) {
- tests := [...]testType{
- {
- in: "a0b1c2",
- want: "0a1b2c",
- },
- {
- in: "leetcode",
- want: "",
- },
- {
- in: "1229857369",
- want: "",
- },
- {
- in: "covid2019",
- want: "c0o1v9i2d",
- },
- {
- in: "ab123",
- want: "1a2b3",
- },
- {
- in: "ec",
- want: "",
- },
- {
- in: "abcd12345",
- want: "1a2b3c4d5",
- },
- {
- in: "12345abcd",
- want: "1a2b3c4d5",
- },
- {
- in: "77",
- want: "",
- },
- {
- in: "1",
- want: "1",
- },
- {
- in: "a",
- want: "a",
- },
- }
- for _, tt := range tests {
- got := reformat(tt.in)
- if got != tt.want {
- t.Fatalf("in: %v, got: %v, want: %v", tt.in, got, tt.want)
- }
- }
-}
diff --git a/problems/regions-cut-by-slashes/README.md b/problems/regions-cut-by-slashes/README.md
deleted file mode 100644
index a92996173..000000000
--- a/problems/regions-cut-by-slashes/README.md
+++ /dev/null
@@ -1,72 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../check-completeness-of-a-binary-tree "Check Completeness of a Binary Tree")
-
-[Next >](../delete-columns-to-make-sorted-iii "Delete Columns to Make Sorted III")
-
-## [959. Regions Cut By Slashes (Medium)](https://leetcode.com/problems/regions-cut-by-slashes "由斜杠划分区域")
-
-
An n x n grid is composed of 1 x 1 squares where each 1 x 1 square consists of a '/', '\', or blank space ' '. These characters divide the square into contiguous regions.
-
-
Given the grid grid represented as a string array, return the number of regions.
-
-
Note that backslash characters are escaped, so a '\' is represented as '\\'.
-
-
-
Example 1:
-
-
-Input: grid = [" /","/ "]
-Output: 2
-
-
-
Example 2:
-
-
-Input: grid = [" /"," "]
-Output: 1
-
-
-
Example 3:
-
-
-Input: grid = ["\\/","/\\"]
-Output: 4
-Explanation: (Recall that because \ characters are escaped, "\\/" refers to \/, and "/\\" refers to /\.)
-
-
-
Example 4:
-
-
-Input: grid = ["/\\","\\/"]
-Output: 5
-Explanation: (Recall that because \ characters are escaped, "\\/" refers to \/, and "/\\" refers to /\.)
-
Given an input string s and a pattern p, implement regular expression matching with support for '.' and '*' where:
-
-
-
'.' Matches any single character.
-
'*' Matches zero or more of the preceding element.
-
-
-
The matching should cover the entire input string (not partial).
-
-
-
Example 1:
-
-
-Input: s = "aa", p = "a"
-Output: false
-Explanation: "a" does not match the entire string "aa".
-
-
-
Example 2:
-
-
-Input: s = "aa", p = "a*"
-Output: true
-Explanation: '*' means zero or more of the preceding element, 'a'. Therefore, by repeating 'a' once, it becomes "aa".
-
-
-
Example 3:
-
-
-Input: s = "ab", p = ".*"
-Output: true
-Explanation: ".*" means "zero or more (*) of any character (.)".
-
-
-
Example 4:
-
-
-Input: s = "aab", p = "c*a*b"
-Output: true
-Explanation: c can be repeated 0 times, a can be repeated 1 time. Therefore, it matches "aab".
-
-
-
Example 5:
-
-
-Input: s = "mississippi", p = "mis*is*p*."
-Output: false
-
-
-
-
Constraints:
-
-
-
1 <= s.length <= 20
-
1 <= p.length <= 30
-
s contains only lowercase English letters.
-
p contains only lowercase English letters, '.', and '*'.
-
It is guaranteed for each appearance of the character '*', there will be a previous valid character to match.
You are given an integer array score of size n, where score[i] is the score of the ith athlete in a competition. All the scores are guaranteed to be unique.
-
-
The athletes are placed based on their scores, where the 1st place athlete has the highest score, the 2nd place athlete has the 2nd highest score, and so on. The placement of each athlete determines their rank:
-
-
-
The 1st place athlete's rank is "Gold Medal".
-
The 2nd place athlete's rank is "Silver Medal".
-
The 3rd place athlete's rank is "Bronze Medal".
-
For the 4th place to the nth place athlete, their rank is their placement number (i.e., the xth place athlete's rank is "x").
-
-
-
Return an array answer of size n where answer[i] is the rank of the ith athlete.
-
-
-
Example 1:
-
-
-Input: score = [5,4,3,2,1]
-Output: ["Gold Medal","Silver Medal","Bronze Medal","4","5"]
-Explanation: The placements are [1st, 2nd, 3rd, 4th, 5th].
-
-
Example 2:
-
-
-Input: score = [10,3,8,9,4]
-Output: ["Gold Medal","5","Bronze Medal","Silver Medal","4"]
-Explanation: The placements are [1st, 5th, 3rd, 2nd, 4th].
-
-
Given two arrays arr1 and arr2, the elements of arr2 are distinct, and all elements in arr2 are also in arr1.
-
-
Sort the elements of arr1 such that the relative ordering of items in arr1 are the same as in arr2. Elements that do not appear in arr2 should be placed at the end of arr1 in ascending order.
You are given a string s and an integer k, a kduplicate 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.
-
-
We repeatedly make kduplicate removals on s until we no longer can.
-
-
Return the final string after all such duplicate removals have been made. It is guaranteed that the answer is unique.
-
-
-
Example 1:
-
-
-Input: s = "abcd", k = 2
-Output: "abcd"
-Explanation: There's nothing to delete.
-
-
Example 2:
-
-
-Input: s = "deeedbbcccbdaa", k = 3
-Output: "aa"
-Explanation:
-First delete "eee" and "ccc", get "ddbbbdaa"
-Then delete "bbb", get "dddaa"
-Finally delete "ddd", get "aa"
-
-
Example 3:
-
-
-Input: s = "pbbcggttciiippooaais", k = 2
-Output: "ps"
-
-
-
-
Constraints:
-
-
-
1 <= s.length <= 105
-
2 <= k <= 104
-
s only contains lower case English letters.
-
-
-### Related Topics
- [[Stack](../../tag/stack/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Hints
-
-Hint 1
-Use a stack to store the characters, when there are k same characters, delete them.
-
-
-
-Hint 2
-To make it more efficient, use a pair to store the value and the count of each character.
-
diff --git a/problems/remove-all-adjacent-duplicates-in-string/README.md b/problems/remove-all-adjacent-duplicates-in-string/README.md
deleted file mode 100644
index 47d5e9e54..000000000
--- a/problems/remove-all-adjacent-duplicates-in-string/README.md
+++ /dev/null
@@ -1,53 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../last-stone-weight "Last Stone Weight")
-
-[Next >](../longest-string-chain "Longest String Chain")
-
-## [1047. Remove All Adjacent Duplicates In String (Easy)](https://leetcode.com/problems/remove-all-adjacent-duplicates-in-string "删除字符串中的所有相邻重复项")
-
-
You are given a string s consisting of lowercase English letters. A duplicate removal consists of choosing two adjacent and equal letters and removing them.
-
-
We repeatedly make duplicate removals on s until we no longer can.
-
-
Return the final string after all such duplicate removals have been made. It can be proven that the answer is unique.
-
-
-
Example 1:
-
-
-Input: s = "abbaca"
-Output: "ca"
-Explanation:
-For example, in "abbaca" we could remove "bb" since the letters are adjacent and equal, and this is the only possible move. The result of this move is that the string is "aaca", of which only "aa" is possible, so the final string is "ca".
-
-
-
Example 2:
-
-
-Input: s = "azxxzy"
-Output: "ay"
-
-
-
-
Constraints:
-
-
-
1 <= s.length <= 105
-
s consists of lowercase English letters.
-
-
-### Related Topics
- [[Stack](../../tag/stack/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Hints
-
-Hint 1
-Use a stack to process everything greedily.
-
diff --git a/problems/remove-all-adjacent-duplicates-in-string/remove_all_adjacent_duplicates_in_string.go b/problems/remove-all-adjacent-duplicates-in-string/remove_all_adjacent_duplicates_in_string.go
deleted file mode 100644
index fc316bbbb..000000000
--- a/problems/remove-all-adjacent-duplicates-in-string/remove_all_adjacent_duplicates_in_string.go
+++ /dev/null
@@ -1,14 +0,0 @@
-package problem1047
-
-func removeDuplicates(S string) string {
- ans := make([]byte, 0, len(S))
- for i := 0; i < len(S); i++ {
- n := len(ans) - 1
- if n >= 0 && ans[n] == S[i] {
- ans = ans[:n]
- } else {
- ans = append(ans, S[i])
- }
- }
- return string(ans)
-}
diff --git a/problems/remove-all-adjacent-duplicates-in-string/remove_all_adjacent_duplicates_in_string_test.go b/problems/remove-all-adjacent-duplicates-in-string/remove_all_adjacent_duplicates_in_string_test.go
deleted file mode 100644
index 5ba27ce9d..000000000
--- a/problems/remove-all-adjacent-duplicates-in-string/remove_all_adjacent_duplicates_in_string_test.go
+++ /dev/null
@@ -1,27 +0,0 @@
-package problem1047
-
-import "testing"
-
-type testType struct {
- in string
- want string
-}
-
-func TestRemoveDuplicates(t *testing.T) {
- tests := [...]testType{
- {
- in: "abbaca",
- want: "ca",
- },
- {
- in: "aaabaca",
- want: "abaca",
- },
- }
- for _, tt := range tests {
- got := removeDuplicates(tt.in)
- if got != tt.want {
- t.Fatalf("in: %v, got: %v, want: %v", tt.in, got, tt.want)
- }
- }
-}
diff --git a/problems/remove-all-occurrences-of-a-substring/README.md b/problems/remove-all-occurrences-of-a-substring/README.md
deleted file mode 100644
index f73fbe00d..000000000
--- a/problems/remove-all-occurrences-of-a-substring/README.md
+++ /dev/null
@@ -1,71 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../remove-one-element-to-make-the-array-strictly-increasing "Remove One Element to Make the Array Strictly Increasing")
-
-[Next >](../maximum-alternating-subsequence-sum "Maximum Alternating Subsequence Sum")
-
-## [1910. Remove All Occurrences of a Substring (Medium)](https://leetcode.com/problems/remove-all-occurrences-of-a-substring "删除一个字符串中所有出现的给定子字符串")
-
-
Given two strings s and part, perform the following operation on s until all occurrences of the substring part are removed:
-
-
-
Find the leftmost occurrence of the substring part and remove it from s.
-
-
-
Return s after removing all occurrences of part.
-
-
A substring is a contiguous sequence of characters in a string.
-
-
-
Example 1:
-
-
-Input: s = "daabcbaabcbc", part = "abc"
-Output: "dab"
-Explanation: The following operations are done:
-- s = "daabcbaabcbc", remove "abc" starting at index 2, so s = "dabaabcbc".
-- s = "dabaabcbc", remove "abc" starting at index 4, so s = "dababc".
-- s = "dababc", remove "abc" starting at index 3, so s = "dab".
-Now s has no occurrences of "abc".
-
-
-
Example 2:
-
-
-Input: s = "axxxxyyyyb", part = "xy"
-Output: "ab"
-Explanation: The following operations are done:
-- s = "axxxxyyyyb", remove "xy" starting at index 4 so s = "axxxyyyb".
-- s = "axxxyyyb", remove "xy" starting at index 3 so s = "axxyyb".
-- s = "axxyyb", remove "xy" starting at index 2 so s = "axyb".
-- s = "axyb", remove "xy" starting at index 1 so s = "ab".
-Now s has no occurrences of "xy".
-
-
-
-
Constraints:
-
-
-
1 <= s.length <= 1000
-
1 <= part.length <= 1000
-
s and part consists of lowercase English letters.
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
-
-### Hints
-
-Hint 1
-Note that a new occurrence of pattern can appear if you remove an old one, For example, s = "ababcc" and pattern = "abc".
-
-
-
-Hint 2
-You can maintain a stack of characters and if the last character of the pattern size in the stack match the pattern remove them
-
diff --git a/problems/remove-all-ones-with-row-and-column-flips/README.md b/problems/remove-all-ones-with-row-and-column-flips/README.md
deleted file mode 100644
index f1857a910..000000000
--- a/problems/remove-all-ones-with-row-and-column-flips/README.md
+++ /dev/null
@@ -1,46 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-employees-to-be-invited-to-a-meeting "Maximum Employees to Be Invited to a Meeting")
-
-[Next >](../capitalize-the-title "Capitalize the Title")
-
-## [2128. Remove All Ones With Row and Column Flips (Medium)](https://leetcode.com/problems/remove-all-ones-with-row-and-column-flips "")
-
-
-
-### Related Topics
- [[Bit Manipulation](../../tag/bit-manipulation/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Math](../../tag/math/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
-
-### Hints
-
-Hint 1
-Does the order, in which you do the operations, matter?
-
-
-
-Hint 2
-No, it does not. An element will keep its original value if the number of operations done on it is even and vice versa. This also means that doing more than 1 operation on the same row or column is unproductive.
-
-
-
-Hint 3
-Try working backward, start with a matrix of all zeros and try to construct grid using operations.
-
-
-
-Hint 4
-Start with operations on columns, after doing them what do you notice about each row?
-
-
-
-Hint 5
-Each row is the exact same. If we then flip some rows, that leaves only two possible arrangements for each row: the same as the original or the opposite.
-
diff --git a/problems/remove-boxes/README.md b/problems/remove-boxes/README.md
deleted file mode 100644
index 30282b6d7..000000000
--- a/problems/remove-boxes/README.md
+++ /dev/null
@@ -1,62 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../boundary-of-binary-tree "Boundary of Binary Tree")
-
-[Next >](../number-of-provinces "Number of Provinces")
-
-## [546. Remove Boxes (Hard)](https://leetcode.com/problems/remove-boxes "移除盒子")
-
-
You are given several boxes with different colors represented by different positive numbers.
-
-
You may experience several rounds to remove boxes until there is no box left. Each time you can choose some continuous boxes with the same color (i.e., composed of k boxes, k >= 1), remove them and get k * k points.
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Memoization](../../tag/memoization/README.md)]
-
-### Similar Questions
- 1. [Strange Printer](../strange-printer) (Hard)
diff --git a/problems/remove-boxes/remove_boxes.go b/problems/remove-boxes/remove_boxes.go
deleted file mode 100644
index d42b0a8c0..000000000
--- a/problems/remove-boxes/remove_boxes.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem546
diff --git a/problems/remove-boxes/remove_boxes_test.go b/problems/remove-boxes/remove_boxes_test.go
deleted file mode 100644
index d42b0a8c0..000000000
--- a/problems/remove-boxes/remove_boxes_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem546
diff --git a/problems/remove-colored-pieces-if-both-neighbors-are-the-same-color/README.md b/problems/remove-colored-pieces-if-both-neighbors-are-the-same-color/README.md
deleted file mode 100644
index c8b5cd729..000000000
--- a/problems/remove-colored-pieces-if-both-neighbors-are-the-same-color/README.md
+++ /dev/null
@@ -1,100 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-number-of-moves-to-seat-everyone "Minimum Number of Moves to Seat Everyone")
-
-[Next >](../the-time-when-the-network-becomes-idle "The Time When the Network Becomes Idle")
-
-## [2038. Remove Colored Pieces if Both Neighbors are the Same Color (Medium)](https://leetcode.com/problems/remove-colored-pieces-if-both-neighbors-are-the-same-color "如果相邻两个颜色均相同则删除当前颜色")
-
-
There are n pieces arranged in a line, and each piece is colored either by 'A' or by 'B'. You are given a string colors of length n where colors[i] is the color of the ith piece.
-
-
Alice and Bob are playing a game where they take alternating turns removing pieces from the line. In this game, Alice moves first.
-
-
-
Alice is only allowed to remove a piece colored 'A' if both its neighbors are also colored 'A'. She is not allowed to remove pieces that are colored 'B'.
-
Bob is only allowed to remove a piece colored 'B' if both its neighbors are also colored 'B'. He is not allowed to remove pieces that are colored 'A'.
-
Alice and Bob cannot remove pieces from the edge of the line.
-
If a player cannot make a move on their turn, that player loses and the other player wins.
-
-
-
Assuming Alice and Bob play optimally, return true if Alice wins, or return false if Bob wins.
-
-
-
Example 1:
-
-
-Input: colors = "AAABABB"
-Output: true
-Explanation:
-AAABABB -> AABABB
-Alice moves first.
-She removes the second 'A' from the left since that is the only 'A' whose neighbors are both 'A'.
-
-Now it's Bob's turn.
-Bob cannot make a move on his turn since there are no 'B's whose neighbors are both 'B'.
-Thus, Alice wins, so return true.
-
-
-
Example 2:
-
-
-Input: colors = "AA"
-Output: false
-Explanation:
-Alice has her turn first.
-There are only two 'A's and both are on the edge of the line, so she cannot move on her turn.
-Thus, Bob wins, so return false.
-
-
-
Example 3:
-
-
-Input: colors = "ABBBBBBBAAA"
-Output: false
-Explanation:
-ABBBBBBBAAA -> ABBBBBBBAA
-Alice moves first.
-Her only option is to remove the second to last 'A' from the right.
-
-ABBBBBBBAA -> ABBBBBBAA
-Next is Bob's turn.
-He has many options for which 'B' piece to remove. He can pick any.
-
-On Alice's second turn, she has no more pieces that she can remove.
-Thus, Bob wins, so return false.
-
-
-
-
Constraints:
-
-
-
1 <= colors.length <= 105
-
colors consists of only the letters 'A' and 'B'
-
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[Math](../../tag/math/README.md)]
- [[String](../../tag/string/README.md)]
- [[Game Theory](../../tag/game-theory/README.md)]
-
-### Hints
-
-Hint 1
-Does the number of moves a player can make depend on what the other player does? No
-
-
-
-Hint 2
-How many moves can Alice make if colors == "AAAAAA"
-
-
-
-Hint 3
-If a group of n consecutive pieces has the same color, the player can take n - 2 of those pieces if n is greater than or equal to 3
-
diff --git a/problems/remove-comments/README.md b/problems/remove-comments/README.md
deleted file mode 100644
index 49f4c74c0..000000000
--- a/problems/remove-comments/README.md
+++ /dev/null
@@ -1,115 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../accounts-merge "Accounts Merge")
-
-[Next >](../candy-crush "Candy Crush")
-
-## [722. Remove Comments (Medium)](https://leetcode.com/problems/remove-comments "删除注释")
-
-
Given a C++ program, remove comments from it. The program source is an array of strings source where source[i] is the ith line of the source code. This represents the result of splitting the original source code string by the newline character '\n'.
-
-
In C++, there are two types of comments, line comments, and block comments.
-
-
-
The string "//" denotes a line comment, which represents that it and the rest of the characters to the right of it in the same line should be ignored.
-
The string "/*" denotes a block comment, which represents that all characters until the next (non-overlapping) occurrence of "*/" should be ignored. (Here, occurrences happen in reading order: line by line from left to right.) To be clear, the string "/*/" does not yet end the block comment, as the ending would be overlapping the beginning.
-
-
-
The first effective comment takes precedence over others.
-
-
-
For example, if the string "//" occurs in a block comment, it is ignored.
-
Similarly, if the string "/*" occurs in a line or block comment, it is also ignored.
-
-
-
If a certain line of code is empty after removing comments, you must not output that line: each string in the answer list will be non-empty.
-
-
There will be no control characters, single quote, or double quote characters.
-
-
-
For example, source = "string s = "/* Not a comment. */";" will not be a test case.
-
-
-
Also, nothing else such as defines or macros will interfere with the comments.
-
-
It is guaranteed that every open block comment will eventually be closed, so "/*" outside of a line or block comment always starts a new comment.
-
-
Finally, implicit newline characters can be deleted by block comments. Please see the examples below for details.
-
-
After removing the comments from the source code, return the source code in the same format.
-
-
-
Example 1:
-
-
-Input: source = ["/*Test program */", "int main()", "{ ", " // variable declaration ", "int a, b, c;", "/* This is a test", " multiline ", " comment for ", " testing */", "a = b + c;", "}"]
-Output: ["int main()","{ "," ","int a, b, c;","a = b + c;","}"]
-Explanation: The line by line code is visualized as below:
-/*Test program */
-int main()
-{
- // variable declaration
-int a, b, c;
-/* This is a test
- multiline
- comment for
- testing */
-a = b + c;
-}
-The string /* denotes a block comment, including line 1 and lines 6-9. The string // denotes line 4 as comments.
-The line by line output code is visualized as below:
-int main()
-{
-
-int a, b, c;
-a = b + c;
-}
-
-
-
Example 2:
-
-
-Input: source = ["a/*comment", "line", "more_comment*/b"]
-Output: ["ab"]
-Explanation: The original source string is "a/*comment\nline\nmore_comment*/b", where we have bolded the newline characters. After deletion, the implicit newline characters are deleted, leaving the string "ab", which when delimited by newline characters becomes ["ab"].
-
-
-
-
Constraints:
-
-
-
1 <= source.length <= 100
-
0 <= source[i].length <= 80
-
source[i] consists of printable ASCII characters.
-
Every open block comment is eventually closed.
-
There are no single-quote or double-quote in the input.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Similar Questions
- 1. [Mini Parser](../mini-parser) (Medium)
- 1. [Ternary Expression Parser](../ternary-expression-parser) (Medium)
-
-### Hints
-
-Hint 1
-Carefully parse each line according to the following rules:
-
-* If we start a block comment and we aren't in a block, then we will skip over the next two characters and change our state to be in a block.
-
-* If we end a block comment and we are in a block, then we will skip over the next two characters and change our state to be *not* in a block.
-
-* If we start a line comment and we aren't in a block, then we will ignore the rest of the line.
-
-* If we aren't in a block comment (and it wasn't the start of a comment), we will record the character we are at.
-
-* At the end of each line, if we aren't in a block, we will record the line.
-
diff --git a/problems/remove-comments/remove_comments.go b/problems/remove-comments/remove_comments.go
deleted file mode 100644
index b58fe61e2..000000000
--- a/problems/remove-comments/remove_comments.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem722
diff --git a/problems/remove-comments/remove_comments_test.go b/problems/remove-comments/remove_comments_test.go
deleted file mode 100644
index b58fe61e2..000000000
--- a/problems/remove-comments/remove_comments_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem722
diff --git a/problems/remove-covered-intervals/README.md b/problems/remove-covered-intervals/README.md
deleted file mode 100644
index 22a2a0ad3..000000000
--- a/problems/remove-covered-intervals/README.md
+++ /dev/null
@@ -1,59 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../element-appearing-more-than-25-in-sorted-array "Element Appearing More Than 25% In Sorted Array")
-
-[Next >](../minimum-falling-path-sum-ii "Minimum Falling Path Sum II")
-
-## [1288. Remove Covered Intervals (Medium)](https://leetcode.com/problems/remove-covered-intervals "删除被覆盖区间")
-
-
Given an array intervals where intervals[i] = [li, ri] represent the interval [li, ri), remove all intervals that are covered by another interval in the list.
-
-
The interval [a, b) is covered by the interval [c, d) if and only if c <= a and b <= d.
-
-
Return the number of remaining intervals.
-
-
-
Example 1:
-
-
-Input: intervals = [[1,4],[3,6],[2,8]]
-Output: 2
-Explanation: Interval [3,6] is covered by [2,8], therefore it is removed.
-
-
-
Example 2:
-
-
-Input: intervals = [[1,4],[2,3]]
-Output: 1
-
-
-
-
Constraints:
-
-
-
1 <= intervals.length <= 1000
-
intervals[i].length == 2
-
0 <= li <= ri <= 105
-
All the given intervals are unique.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Hints
-
-Hint 1
-How to check if an interval is covered by another?
-
-
-
-Hint 2
-Compare each interval to all others and check if it is covered by any interval.
-
diff --git a/problems/remove-duplicate-letters/README.md b/problems/remove-duplicate-letters/README.md
deleted file mode 100644
index e61c74e31..000000000
--- a/problems/remove-duplicate-letters/README.md
+++ /dev/null
@@ -1,52 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../count-of-smaller-numbers-after-self "Count of Smaller Numbers After Self")
-
-[Next >](../shortest-distance-from-all-buildings "Shortest Distance from All Buildings")
-
-## [316. Remove Duplicate Letters (Medium)](https://leetcode.com/problems/remove-duplicate-letters "去除重复字母")
-
-
Given a string s, remove duplicate letters so that every letter appears once and only once. You must make sure your result is the smallest in lexicographical order among all possible results.
-
-### Related Topics
- [[Stack](../../tag/stack/README.md)]
- [[Greedy](../../tag/greedy/README.md)]
- [[String](../../tag/string/README.md)]
- [[Monotonic Stack](../../tag/monotonic-stack/README.md)]
-
-### Hints
-
-Hint 1
-Greedily try to add one missing character. How to check if adding some character will not cause problems ? Use bit-masks to check whether you will be able to complete the sub-sequence if you add the character at some index i.
-
diff --git a/problems/remove-duplicate-letters/remove_duplicate_letters.go b/problems/remove-duplicate-letters/remove_duplicate_letters.go
deleted file mode 100644
index 2a0584d9e..000000000
--- a/problems/remove-duplicate-letters/remove_duplicate_letters.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem316
diff --git a/problems/remove-duplicate-letters/remove_duplicate_letters_test.go b/problems/remove-duplicate-letters/remove_duplicate_letters_test.go
deleted file mode 100644
index 2a0584d9e..000000000
--- a/problems/remove-duplicate-letters/remove_duplicate_letters_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem316
diff --git a/problems/remove-duplicates-from-an-unsorted-linked-list/README.md b/problems/remove-duplicates-from-an-unsorted-linked-list/README.md
deleted file mode 100644
index 27ee4a822..000000000
--- a/problems/remove-duplicates-from-an-unsorted-linked-list/README.md
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../find-xor-sum-of-all-pairs-bitwise-and "Find XOR Sum of All Pairs Bitwise AND")
-
-[Next >](../sum-of-digits-in-base-k "Sum of Digits in Base K")
-
-## [1836. Remove Duplicates From an Unsorted Linked List (Medium)](https://leetcode.com/problems/remove-duplicates-from-an-unsorted-linked-list "从未排序的链表中移除重复元素")
-
-
-
-### Related Topics
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Linked List](../../tag/linked-list/README.md)]
-
-### Hints
-
-Hint 1
-Is there a way we can know beforehand which nodes to delete?
-
-
-
-Hint 2
-Count the number of appearances for each number.
-
diff --git a/problems/remove-duplicates-from-sorted-array-ii/README.md b/problems/remove-duplicates-from-sorted-array-ii/README.md
deleted file mode 100644
index 8d14937d8..000000000
--- a/problems/remove-duplicates-from-sorted-array-ii/README.md
+++ /dev/null
@@ -1,73 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../word-search "Word Search")
-
-[Next >](../search-in-rotated-sorted-array-ii "Search in Rotated Sorted Array II")
-
-## [80. Remove Duplicates from Sorted Array II (Medium)](https://leetcode.com/problems/remove-duplicates-from-sorted-array-ii "删除有序数组中的重复项 II")
-
-
Given an integer array nums sorted in non-decreasing order, remove some duplicates in-place such that each unique element appears at most twice. The relative order of the elements should be kept the same.
-
-
Since it is impossible to change the length of the array in some languages, you must instead have the result be placed in the first part of the array nums. More formally, if there are k elements after removing the duplicates, then the first k elements of nums should hold the final result. It does not matter what you leave beyond the first k elements.
-
-
Return k after placing the final result in the first k slots of nums.
-
-
Do not allocate extra space for another array. You must do this by modifying the input array in-place with O(1) extra memory.
-
-
Custom Judge:
-
-
The judge will test your solution with the following code:
-
-
-int[] nums = [...]; // Input array
-int[] expectedNums = [...]; // The expected answer with correct length
-
-int k = removeDuplicates(nums); // Calls your implementation
-
-assert k == expectedNums.length;
-for (int i = 0; i < k; i++) {
- assert nums[i] == expectedNums[i];
-}
-
-
-
If all assertions pass, then your solution will be accepted.
-
-
-
Example 1:
-
-
-Input: nums = [1,1,1,2,2,3]
-Output: 5, nums = [1,1,2,2,3,_]
-Explanation: Your function should return k = 5, with the first five elements of nums being 1, 1, 2, 2 and 3 respectively.
-It does not matter what you leave beyond the returned k (hence they are underscores).
-
-
-
Example 2:
-
-
-Input: nums = [0,0,1,1,1,1,2,3,3]
-Output: 7, nums = [0,0,1,1,2,3,3,_,_]
-Explanation: Your function should return k = 7, with the first seven elements of nums being 0, 0, 1, 1, 2, 3 and 3 respectively.
-It does not matter what you leave beyond the returned k (hence they are underscores).
-
Given an integer array nums sorted in non-decreasing order, remove the duplicates in-place such that each unique element appears only once. The relative order of the elements should be kept the same.
-
-
Since it is impossible to change the length of the array in some languages, you must instead have the result be placed in the first part of the array nums. More formally, if there are k elements after removing the duplicates, then the first k elements of nums should hold the final result. It does not matter what you leave beyond the first k elements.
-
-
Return k after placing the final result in the first k slots of nums.
-
-
Do not allocate extra space for another array. You must do this by modifying the input array in-place with O(1) extra memory.
-
-
Custom Judge:
-
-
The judge will test your solution with the following code:
-
-
-int[] nums = [...]; // Input array
-int[] expectedNums = [...]; // The expected answer with correct length
-
-int k = removeDuplicates(nums); // Calls your implementation
-
-assert k == expectedNums.length;
-for (int i = 0; i < k; i++) {
- assert nums[i] == expectedNums[i];
-}
-
-
-
If all assertions pass, then your solution will be accepted.
-
-
-
Example 1:
-
-
-Input: nums = [1,1,2]
-Output: 2, nums = [1,2,_]
-Explanation: Your function should return k = 2, with the first two elements of nums being 1 and 2 respectively.
-It does not matter what you leave beyond the returned k (hence they are underscores).
-
-
-
Example 2:
-
-
-Input: nums = [0,0,1,1,1,2,2,3,3,4]
-Output: 5, nums = [0,1,2,3,4,_,_,_,_,_]
-Explanation: Your function should return k = 5, with the first five elements of nums being 0, 1, 2, 3, and 4 respectively.
-It does not matter what you leave beyond the returned k (hence they are underscores).
-
-
-
-
Constraints:
-
-
-
0 <= nums.length <= 3 * 104
-
-100 <= nums[i] <= 100
-
nums is sorted in non-decreasing order.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Two Pointers](../../tag/two-pointers/README.md)]
-
-### Similar Questions
- 1. [Remove Element](../remove-element) (Easy)
- 1. [Remove Duplicates from Sorted Array II](../remove-duplicates-from-sorted-array-ii) (Medium)
-
-### Hints
-
-Hint 1
-In this problem, the key point to focus on is the input array being sorted. As far as duplicate elements are concerned, what is their positioning in the array when the given array is sorted? Look at the image above for the answer. If we know the position of one of the elements, do we also know the positioning of all the duplicate elements?
-
-
-
-
-
-
-Hint 2
-We need to modify the array in-place and the size of the final array would potentially be smaller than the size of the input array. So, we ought to use a two-pointer approach here. One, that would keep track of the current element in the original array and another one for just the unique elements.
-
-
-
-Hint 3
-Essentially, once an element is encountered, you simply need to bypass its duplicates and move on to the next unique element.
-
diff --git a/problems/remove-duplicates-from-sorted-array/remove_duplicates_from_sorted_array.go b/problems/remove-duplicates-from-sorted-array/remove_duplicates_from_sorted_array.go
deleted file mode 100644
index 8e56b5d11..000000000
--- a/problems/remove-duplicates-from-sorted-array/remove_duplicates_from_sorted_array.go
+++ /dev/null
@@ -1,15 +0,0 @@
-package problem26
-
-func removeDuplicates(nums []int) int {
- top, l := 0, len(nums)
- if l == 0 {
- return 0
- }
- for i := 1; i < l; i++ {
- if nums[i] != nums[top] {
- top++
- nums[top] = nums[i]
- }
- }
- return top + 1
-}
diff --git a/problems/remove-duplicates-from-sorted-array/remove_duplicates_from_sorted_array_test.go b/problems/remove-duplicates-from-sorted-array/remove_duplicates_from_sorted_array_test.go
deleted file mode 100644
index 5680e875a..000000000
--- a/problems/remove-duplicates-from-sorted-array/remove_duplicates_from_sorted_array_test.go
+++ /dev/null
@@ -1,46 +0,0 @@
-package problem26
-
-import (
- "reflect"
- "testing"
-)
-
-type testType struct {
- in []int
- want []int
-}
-
-func TestRemoveDuplicates(t *testing.T) {
- tests := [...]testType{
- {
- in: []int{1, 1, 2},
- want: []int{1, 2},
- },
- {
- in: []int{0, 0, 1, 1, 1, 2, 2, 3, 3, 4},
- want: []int{0, 1, 2, 3, 4},
- },
- {
- in: []int{1, 2, 3, 4},
- want: []int{1, 2, 3, 4},
- },
- {
- in: []int{1, 2, 2, 3, 3, 3, 4, 4, 4, 4},
- want: []int{1, 2, 3, 4},
- },
- {
- in: []int{},
- want: []int{},
- },
- }
-
- for _, tt := range tests {
- nums := make([]int, len(tt.in))
- copy(nums, tt.in)
- l := removeDuplicates(nums)
- got := nums[:l]
- if !reflect.DeepEqual(got, tt.want) {
- t.Fatalf("in: %v, got: %v, want: %v", tt.in, got, tt.want)
- }
- }
-}
diff --git a/problems/remove-duplicates-from-sorted-list-ii/README.md b/problems/remove-duplicates-from-sorted-list-ii/README.md
deleted file mode 100644
index fb75f2c4c..000000000
--- a/problems/remove-duplicates-from-sorted-list-ii/README.md
+++ /dev/null
@@ -1,45 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../search-in-rotated-sorted-array-ii "Search in Rotated Sorted Array II")
-
-[Next >](../remove-duplicates-from-sorted-list "Remove Duplicates from Sorted List")
-
-## [82. Remove Duplicates from Sorted List II (Medium)](https://leetcode.com/problems/remove-duplicates-from-sorted-list-ii "删除排序链表中的重复元素 II")
-
-
Given the head of a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list. Return the linked list sorted as well.
-
-
-
Example 1:
-
-
-Input: head = [1,2,3,3,4,4,5]
-Output: [1,2,5]
-
-
-
Example 2:
-
-
-Input: head = [1,1,1,2,3]
-Output: [2,3]
-
-
-
-
Constraints:
-
-
-
The number of nodes in the list is in the range [0, 300].
-
-100 <= Node.val <= 100
-
The list is guaranteed to be sorted in ascending order.
Given an integer array nums and an integer val, remove all occurrences of val in numsin-place. The relative order of the elements may be changed.
-
-
Since it is impossible to change the length of the array in some languages, you must instead have the result be placed in the first part of the array nums. More formally, if there are k elements after removing the duplicates, then the first k elements of nums should hold the final result. It does not matter what you leave beyond the first k elements.
-
-
Return k after placing the final result in the first k slots of nums.
-
-
Do not allocate extra space for another array. You must do this by modifying the input array in-place with O(1) extra memory.
-
-
Custom Judge:
-
-
The judge will test your solution with the following code:
-
-
-int[] nums = [...]; // Input array
-int val = ...; // Value to remove
-int[] expectedNums = [...]; // The expected answer with correct length.
- // It is sorted with no values equaling val.
-
-int k = removeElement(nums, val); // Calls your implementation
-
-assert k == expectedNums.length;
-sort(nums, 0, k); // Sort the first k elements of nums
-for (int i = 0; i < actualLength; i++) {
- assert nums[i] == expectedNums[i];
-}
-
-
-
If all assertions pass, then your solution will be accepted.
-
-
-
Example 1:
-
-
-Input: nums = [3,2,2,3], val = 3
-Output: 2, nums = [2,2,_,_]
-Explanation: Your function should return k = 2, with the first two elements of nums being 2.
-It does not matter what you leave beyond the returned k (hence they are underscores).
-
-
-
Example 2:
-
-
-Input: nums = [0,1,2,2,3,0,4,2], val = 2
-Output: 5, nums = [0,1,4,0,3,_,_,_]
-Explanation: Your function should return k = 5, with the first five elements of nums containing 0, 0, 1, 3, and 4.
-Note that the five elements can be returned in any order.
-It does not matter what you leave beyond the returned k (hence they are underscores).
-
-
-
-
Constraints:
-
-
-
0 <= nums.length <= 100
-
0 <= nums[i] <= 50
-
0 <= val <= 100
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Two Pointers](../../tag/two-pointers/README.md)]
-
-### Similar Questions
- 1. [Remove Duplicates from Sorted Array](../remove-duplicates-from-sorted-array) (Easy)
- 1. [Remove Linked List Elements](../remove-linked-list-elements) (Easy)
- 1. [Move Zeroes](../move-zeroes) (Easy)
-
-### Hints
-
-Hint 1
-The problem statement clearly asks us to modify the array in-place and it also says that the element beyond the new length of the array can be anything. Given an element, we need to remove all the occurrences of it from the array. We don't technically need to remove that element per-say, right?
-
-
-
-Hint 2
-We can move all the occurrences of this element to the end of the array. Use two pointers!
-
-
-
-
-Hint 3
-Yet another direction of thought is to consider the elements to be removed as non-existent. In a single pass, if we keep copying the visible elements in-place, that should also solve this problem for us.
-
diff --git a/problems/remove-element/remove_element.go b/problems/remove-element/remove_element.go
deleted file mode 100644
index 582ac0057..000000000
--- a/problems/remove-element/remove_element.go
+++ /dev/null
@@ -1,12 +0,0 @@
-package problem27
-
-func removeElement(nums []int, val int) int {
- l := 0
- for _, v := range nums {
- if v != val {
- nums[l] = v
- l++
- }
- }
- return l
-}
diff --git a/problems/remove-element/remove_element_test.go b/problems/remove-element/remove_element_test.go
deleted file mode 100644
index b7658f30f..000000000
--- a/problems/remove-element/remove_element_test.go
+++ /dev/null
@@ -1,52 +0,0 @@
-package problem27
-
-import (
- "reflect"
- "testing"
-)
-
-type testType struct {
- in []int
- val int
- want []int
-}
-
-func TestRemoveElement(t *testing.T) {
- tests := [...]testType{
- {
- in: []int{3, 2, 2, 3},
- val: 3,
- want: []int{2, 2},
- },
- {
- in: []int{0, 1, 2, 2, 3, 0, 4, 2},
- val: 2,
- want: []int{0, 1, 3, 0, 4},
- },
- {
- in: []int{1, 2, 3, 4, 5},
- val: 6,
- want: []int{1, 2, 3, 4, 5},
- },
- {
- in: []int{1, 2, 2, 3, 3, 3, 4, 4, 4, 4},
- val: 4,
- want: []int{1, 2, 2, 3, 3, 3},
- },
- {
- in: []int{},
- val: 1,
- want: []int{},
- },
- }
-
- for _, tt := range tests {
- nums := make([]int, len(tt.in))
- copy(nums, tt.in)
- l := removeElement(nums, tt.val)
- got := nums[:l]
- if !reflect.DeepEqual(got, tt.want) {
- t.Fatalf("in: %v, got: %v, want: %v", tt.in, got, tt.want)
- }
- }
-}
diff --git a/problems/remove-interval/README.md b/problems/remove-interval/README.md
deleted file mode 100644
index bce96a0c0..000000000
--- a/problems/remove-interval/README.md
+++ /dev/null
@@ -1,48 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../hexspeak "Hexspeak")
-
-[Next >](../delete-tree-nodes "Delete Tree Nodes")
-
-## [1272. Remove Interval (Medium)](https://leetcode.com/problems/remove-interval "删除区间")
-
-
Given a sorted list of disjoint intervals, each interval intervals[i] = [a, b] represents the set of real numbers x such that a <= x < b.
-
-
We remove the intersections between any interval in intervals and the interval toBeRemoved.
-
-
Return a sorted list of intervals after all such removals.
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
-
-### Hints
-
-Hint 1
-Solve the problem for every interval alone.
-
-
-
-Hint 2
-Divide the problem into cases according to the position of the two intervals.
-
diff --git a/problems/remove-invalid-parentheses/README.md b/problems/remove-invalid-parentheses/README.md
deleted file mode 100644
index 81d23cba2..000000000
--- a/problems/remove-invalid-parentheses/README.md
+++ /dev/null
@@ -1,110 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../longest-increasing-subsequence "Longest Increasing Subsequence")
-
-[Next >](../smallest-rectangle-enclosing-black-pixels "Smallest Rectangle Enclosing Black Pixels")
-
-## [301. Remove Invalid Parentheses (Hard)](https://leetcode.com/problems/remove-invalid-parentheses "删除无效的括号")
-
-
Given a string s that contains parentheses and letters, remove the minimum number of invalid parentheses to make the input string valid.
-
-
Return all the possible results. You may return the answer in any order.
-
-
-
Example 1:
-
-
-Input: s = "()())()"
-Output: ["(())()","()()()"]
-
-
-
Example 2:
-
-
-Input: s = "(a)())()"
-Output: ["(a())()","(a)()()"]
-
-
-
Example 3:
-
-
-Input: s = ")("
-Output: [""]
-
-
-
-
Constraints:
-
-
-
1 <= s.length <= 25
-
s consists of lowercase English letters and parentheses '(' and ')'.
-
There will be at most 20 parentheses in s.
-
-
-### Related Topics
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[String](../../tag/string/README.md)]
- [[Backtracking](../../tag/backtracking/README.md)]
-
-### Similar Questions
- 1. [Valid Parentheses](../valid-parentheses) (Easy)
-
-### Hints
-
-Hint 1
-Since we don't know which of the brackets can possibly be removed, we try out all the options!
-
-
-
-Hint 2
-We can use recursion to try out all possibilities for the given expression. For each of the brackets, we have 2 options:
-
-
-
We keep the bracket and add it to the expression that we are building on the fly during recursion.
-
OR, we can discard the bracket and move on.
-
-
-
-
-Hint 3
-The one thing all these valid expressions have in common is that they will all be of the same length i.e. as compared to the original expression, all of these expressions will have the same number of characters removed.
-
-Can we somehow find the number of misplaced parentheses and use it in our solution?
-
-
-
-Hint 4
-The one thing all these valid expressions have in common is that they will all be of the same length i.e. as compared to the original expression, all of these expressions will have the same number of characters removed.
-
-Can we somehow find the number of misplaced parentheses and use it in our solution?
-
-
-
-Hint 5
-For every left parenthesis, we should have a corresponding right parenthesis. We can make use of two counters which keep track of misplaced left and right parenthesis and in one iteration we can find out these two values.
-
-
-0 1 2 3 4 5 6 7
-( ) ) ) ( ( ( )
-i = 0, left = 1, right = 0
-i = 1, left = 0, right = 0
-i = 2, left = 0, right = 1
-i = 3, left = 0, right = 2
-i = 4, left = 1, right = 2
-i = 5, left = 2, right = 2
-i = 6, left = 3, right = 2
-i = 7, left = 2, right = 2
-
-
-We have 2 misplaced left and 2 misplaced right parentheses.
-
-
-
-Hint 6
-We found out that the exact number of left and right parenthesis that has to be removed to get a valid expression. So, e.g. in a 1000 parentheses string, if there are 2 misplaced left and 2 misplaced right parentheses, after we are done discarding 2 left and 2 right parentheses, we will have only one option per remaining character in the expression i.e. to consider them. We can't discard them.
-
diff --git a/problems/remove-invalid-parentheses/remove_invalid_parentheses.go b/problems/remove-invalid-parentheses/remove_invalid_parentheses.go
deleted file mode 100644
index 28d7ed9df..000000000
--- a/problems/remove-invalid-parentheses/remove_invalid_parentheses.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem301
diff --git a/problems/remove-invalid-parentheses/remove_invalid_parentheses_test.go b/problems/remove-invalid-parentheses/remove_invalid_parentheses_test.go
deleted file mode 100644
index 28d7ed9df..000000000
--- a/problems/remove-invalid-parentheses/remove_invalid_parentheses_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem301
diff --git a/problems/remove-k-digits/README.md b/problems/remove-k-digits/README.md
deleted file mode 100644
index 51f3dea55..000000000
--- a/problems/remove-k-digits/README.md
+++ /dev/null
@@ -1,58 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../binary-watch "Binary Watch")
-
-[Next >](../frog-jump "Frog Jump")
-
-## [402. Remove K Digits (Medium)](https://leetcode.com/problems/remove-k-digits "移掉 K 位数字")
-
-
Given string num representing a non-negative integer num, and an integer k, return the smallest possible integer after removingkdigits fromnum.
-
-
-
Example 1:
-
-
-Input: num = "1432219", k = 3
-Output: "1219"
-Explanation: Remove the three digits 4, 3, and 2 to form the new number 1219 which is the smallest.
-
-
-
Example 2:
-
-
-Input: num = "10200", k = 1
-Output: "200"
-Explanation: Remove the leading 1 and the number is 200. Note that the output must not contain leading zeroes.
-
-
-
Example 3:
-
-
-Input: num = "10", k = 2
-Output: "0"
-Explanation: Remove all the digits from the number and it is left with nothing which is 0.
-
-
-
-
Constraints:
-
-
-
1 <= k <= num.length <= 105
-
num consists of only digits.
-
num does not have any leading zeros except for the zero itself.
Given the head of a linked list and an integer val, remove all the nodes of the linked list that has Node.val == val, and return the new head.
-
-
-
Example 1:
-
-
-Input: head = [1,2,6,3,4,5,6], val = 6
-Output: [1,2,3,4,5]
-
-
-
Example 2:
-
-
-Input: head = [], val = 1
-Output: []
-
-
-
Example 3:
-
-
-Input: head = [7,7,7,7], val = 7
-Output: []
-
-
-
-
Constraints:
-
-
-
The number of nodes in the list is in the range [0, 104].
-
1 <= Node.val <= 50
-
0 <= val <= 50
-
-
-### Related Topics
- [[Recursion](../../tag/recursion/README.md)]
- [[Linked List](../../tag/linked-list/README.md)]
-
-### Similar Questions
- 1. [Remove Element](../remove-element) (Easy)
- 1. [Delete Node in a Linked List](../delete-node-in-a-linked-list) (Easy)
diff --git a/problems/remove-linked-list-elements/remove_linked_list_elements.go b/problems/remove-linked-list-elements/remove_linked_list_elements.go
deleted file mode 100644
index 3a6c5403c..000000000
--- a/problems/remove-linked-list-elements/remove_linked_list_elements.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem203
diff --git a/problems/remove-linked-list-elements/remove_linked_list_elements_test.go b/problems/remove-linked-list-elements/remove_linked_list_elements_test.go
deleted file mode 100644
index 3a6c5403c..000000000
--- a/problems/remove-linked-list-elements/remove_linked_list_elements_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem203
diff --git a/problems/remove-max-number-of-edges-to-keep-graph-fully-traversable/README.md b/problems/remove-max-number-of-edges-to-keep-graph-fully-traversable/README.md
deleted file mode 100644
index 11e59e27d..000000000
--- a/problems/remove-max-number-of-edges-to-keep-graph-fully-traversable/README.md
+++ /dev/null
@@ -1,93 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-time-to-make-rope-colorful "Minimum Time to Make Rope Colorful")
-
-[Next >](../put-boxes-into-the-warehouse-ii "Put Boxes Into the Warehouse II")
-
-## [1579. Remove Max Number of Edges to Keep Graph Fully Traversable (Hard)](https://leetcode.com/problems/remove-max-number-of-edges-to-keep-graph-fully-traversable "保证图可完全遍历")
-
-
Alice and Bob have an undirected graph of n nodes and 3 types of edges:
-
-
-
Type 1: Can be traversed by Alice only.
-
Type 2: Can be traversed by Bob only.
-
Type 3: Can by traversed by both Alice and Bob.
-
-
-
Given an array edges where edges[i] = [typei, ui, vi] represents a bidirectional edge of type typei between nodes ui and vi, find the maximum number of edges you can remove so that after removing the edges, the graph can still be fully traversed by both Alice and Bob. The graph is fully traversed by Alice and Bob if starting from any node, they can reach all other nodes.
-
-
Return the maximum number of edges you can remove, or return-1if it's impossible for the graph to be fully traversed by Alice and Bob.
-
-
-
Example 1:
-
-
-
-
-Input: n = 4, edges = [[3,1,2],[3,2,3],[1,1,3],[1,2,4],[1,1,2],[2,3,4]]
-Output: 2
-Explanation: If we remove the 2 edges [1,1,2] and [1,1,3]. The graph will still be fully traversable by Alice and Bob. Removing any additional edge will not make it so. So the maximum number of edges we can remove is 2.
-
-
-
Example 2:
-
-
-
-
-Input: n = 4, edges = [[3,1,2],[3,2,3],[1,1,4],[2,1,4]]
-Output: 0
-Explanation: Notice that removing any edge will not make the graph fully traversable by Alice and Bob.
-
-
-
Example 3:
-
-
-
-
-Input: n = 4, edges = [[3,2,3],[1,1,2],[2,3,4]]
-Output: -1
-Explanation: In the current graph, Alice cannot reach node 4 from the other nodes. Likewise, Bob cannot reach 1. Therefore it's impossible to make the graph fully traversable.
-
-
-
-
-
Constraints:
-
-
-
1 <= n <= 10^5
-
1 <= edges.length <= min(10^5, 3 * n * (n-1) / 2)
-
edges[i].length == 3
-
1 <= edges[i][0] <= 3
-
1 <= edges[i][1] < edges[i][2] <= n
-
All tuples (typei, ui, vi) are distinct.
-
-
-### Related Topics
- [[Union Find](../../tag/union-find/README.md)]
- [[Graph](../../tag/graph/README.md)]
-
-### Hints
-
-Hint 1
-Build the network instead of removing extra edges.
-
-
-
-Hint 2
-Suppose you have the final graph (after removing extra edges). Consider the subgraph with only the edges that Alice can traverse. What structure does this subgraph have? How many edges are there?
-
-
-
-Hint 3
-Use disjoint set union data structure for both Alice and Bob.
-
-
-
-Hint 4
-Always use Type 3 edges first, and connect the still isolated ones using other edges.
-
diff --git a/problems/remove-nth-node-from-end-of-list/README.md b/problems/remove-nth-node-from-end-of-list/README.md
deleted file mode 100644
index 908f284b4..000000000
--- a/problems/remove-nth-node-from-end-of-list/README.md
+++ /dev/null
@@ -1,59 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../4sum "4Sum")
-
-[Next >](../valid-parentheses "Valid Parentheses")
-
-## [19. Remove Nth Node From End of List (Medium)](https://leetcode.com/problems/remove-nth-node-from-end-of-list "删除链表的倒数第 N 个结点")
-
-
Given the head of a linked list, remove the nth node from the end of the list and return its head.
-
-
-
Example 1:
-
-
-Input: head = [1,2,3,4,5], n = 2
-Output: [1,2,3,5]
-
-
-
Example 2:
-
-
-Input: head = [1], n = 1
-Output: []
-
-
-
Example 3:
-
-
-Input: head = [1,2], n = 1
-Output: [1]
-
-
-
-
Constraints:
-
-
-
The number of nodes in the list is sz.
-
1 <= sz <= 30
-
0 <= Node.val <= 100
-
1 <= n <= sz
-
-
-
-
Follow up: Could you do this in one pass?
-
-### Related Topics
- [[Linked List](../../tag/linked-list/README.md)]
- [[Two Pointers](../../tag/two-pointers/README.md)]
-
-### Hints
-
-Hint 1
-Maintain two pointers and update one with a delay of n steps.
-
diff --git a/problems/remove-nth-node-from-end-of-list/remove_nth_node_from_end_of_list.go b/problems/remove-nth-node-from-end-of-list/remove_nth_node_from_end_of_list.go
deleted file mode 100644
index 713467b36..000000000
--- a/problems/remove-nth-node-from-end-of-list/remove_nth_node_from_end_of_list.go
+++ /dev/null
@@ -1,28 +0,0 @@
-package problem19
-
-import "github.com/awesee/leetcode/internal/kit"
-
-// ListNode - Definition for singly-linked list.
-type ListNode = kit.ListNode
-
-/**
- * Definition for singly-linked list.
- * type ListNode struct {
- * Val int
- * Next *ListNode
- * }
- */
-func removeNthFromEnd(head *ListNode, n int) *ListNode {
- ans := &ListNode{Next: head}
- pos := ans
- for head != nil {
- head = head.Next
- if n > 0 {
- n--
- } else {
- pos = pos.Next
- }
- }
- pos.Next = pos.Next.Next
- return ans.Next
-}
diff --git a/problems/remove-nth-node-from-end-of-list/remove_nth_node_from_end_of_list_test.go b/problems/remove-nth-node-from-end-of-list/remove_nth_node_from_end_of_list_test.go
deleted file mode 100644
index f8dc2cff8..000000000
--- a/problems/remove-nth-node-from-end-of-list/remove_nth_node_from_end_of_list_test.go
+++ /dev/null
@@ -1,40 +0,0 @@
-package problem19
-
-import (
- "reflect"
- "testing"
-
- "github.com/awesee/leetcode/internal/kit"
-)
-
-type testType struct {
- in []int
- n int
- want []int
-}
-
-func TestRemoveNthFromEnd(t *testing.T) {
- tests := [...]testType{
- {
- in: []int{1, 2, 3, 4, 5},
- n: 2,
- want: []int{1, 2, 3, 5},
- },
- {
- in: []int{1, 2, 3, 4, 5},
- n: 5,
- want: []int{2, 3, 4, 5},
- },
- {
- in: []int{1, 2, 3, 4, 5},
- n: 1,
- want: []int{1, 2, 3, 4},
- },
- }
- for _, tt := range tests {
- got := removeNthFromEnd(kit.SliceInt2ListNode(tt.in), tt.n)
- if !reflect.DeepEqual(kit.ListNode2SliceInt(got), tt.want) {
- t.Fatalf("in: %v, got: %v, want: %v", tt.in, got, tt.want)
- }
- }
-}
diff --git a/problems/remove-one-element-to-make-the-array-strictly-increasing/README.md b/problems/remove-one-element-to-make-the-array-strictly-increasing/README.md
deleted file mode 100644
index 2a1183730..000000000
--- a/problems/remove-one-element-to-make-the-array-strictly-increasing/README.md
+++ /dev/null
@@ -1,69 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../game-of-nim "Game of Nim")
-
-[Next >](../remove-all-occurrences-of-a-substring "Remove All Occurrences of a Substring")
-
-## [1909. Remove One Element to Make the Array Strictly Increasing (Easy)](https://leetcode.com/problems/remove-one-element-to-make-the-array-strictly-increasing "删除一个元素使数组严格递增")
-
-
Given a 0-indexed integer array nums, return trueif it can be made strictly increasing after removing exactly one element, or false otherwise. If the array is already strictly increasing, return true.
-
-
The array nums is strictly increasing if nums[i - 1] < nums[i] for each index (1 <= i < nums.length).
-
-
-
Example 1:
-
-
-Input: nums = [1,2,10,5,7]
-Output: true
-Explanation: By removing 10 at index 2 from nums, it becomes [1,2,5,7].
-[1,2,5,7] is strictly increasing, so return true.
-
-
-
Example 2:
-
-
-Input: nums = [2,3,1,2]
-Output: false
-Explanation:
-[3,1,2] is the result of removing the element at index 0.
-[2,1,2] is the result of removing the element at index 1.
-[2,3,2] is the result of removing the element at index 2.
-[2,3,1] is the result of removing the element at index 3.
-No resulting array is strictly increasing, so return false.
-
-
Example 3:
-
-
-Input: nums = [1,1,1]
-Output: false
-Explanation: The result of removing any element is [1,1].
-[1,1] is not strictly increasing, so return false.
-
-
-
-
Constraints:
-
-
-
2 <= nums.length <= 1000
-
1 <= nums[i] <= 1000
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
-
-### Hints
-
-Hint 1
-For each index i in nums remove this index.
-
-
-
-Hint 2
-If the array becomes sorted return true, otherwise revert to the original array and try different index.
-
diff --git a/problems/remove-outermost-parentheses/README.md b/problems/remove-outermost-parentheses/README.md
deleted file mode 100644
index 50cf3f963..000000000
--- a/problems/remove-outermost-parentheses/README.md
+++ /dev/null
@@ -1,74 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../number-of-enclaves "Number of Enclaves")
-
-[Next >](../sum-of-root-to-leaf-binary-numbers "Sum of Root To Leaf Binary Numbers")
-
-## [1021. Remove Outermost Parentheses (Easy)](https://leetcode.com/problems/remove-outermost-parentheses "删除最外层的括号")
-
-
A valid parentheses string is either empty "", "(" + A + ")", or A + B, where A and B are valid parentheses strings, and + represents string concatenation.
-
-
-
For example, "", "()", "(())()", and "(()(()))" are all valid parentheses strings.
-
-
-
A valid parentheses string s is primitive if it is nonempty, and there does not exist a way to split it into s = A + B, with A and B nonempty valid parentheses strings.
-
-
Given a valid parentheses string s, consider its primitive decomposition: s = P1 + P2 + ... + Pk, where Pi are primitive valid parentheses strings.
-
-
Return safter removing the outermost parentheses of every primitive string in the primitive decomposition of s.
-
-
-
Example 1:
-
-
-Input: s = "(()())(())"
-Output: "()()()"
-Explanation:
-The input string is "(()())(())", with primitive decomposition "(()())" + "(())".
-After removing outer parentheses of each part, this is "()()" + "()" = "()()()".
-
-
-
Example 2:
-
-
-Input: s = "(()())(())(()(()))"
-Output: "()()()()(())"
-Explanation:
-The input string is "(()())(())(()(()))", with primitive decomposition "(()())" + "(())" + "(()(()))".
-After removing outer parentheses of each part, this is "()()" + "()" + "()(())" = "()()()()(())".
-
-
-
Example 3:
-
-
-Input: s = "()()"
-Output: ""
-Explanation:
-The input string is "()()", with primitive decomposition "()" + "()".
-After removing outer parentheses of each part, this is "" + "" = "".
-
-
-
-
Constraints:
-
-
-
1 <= s.length <= 105
-
s[i] is either '(' or ')'.
-
s is a valid parentheses string.
-
-
-### Related Topics
- [[Stack](../../tag/stack/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Hints
-
-Hint 1
-Can you find the primitive decomposition? The number of ( and ) characters must be equal.
-
diff --git a/problems/remove-outermost-parentheses/remove_outermost_parentheses.go b/problems/remove-outermost-parentheses/remove_outermost_parentheses.go
deleted file mode 100644
index 0bcef81ef..000000000
--- a/problems/remove-outermost-parentheses/remove_outermost_parentheses.go
+++ /dev/null
@@ -1,16 +0,0 @@
-package problem1021
-
-func removeOuterParentheses(S string) string {
- ans, n := make([]rune, 0, len(S)), 0
- for _, c := range S {
- if c == '(' {
- n++
- } else {
- n--
- }
- if (c == '(' && n != 1) || (c == ')' && n != 0) {
- ans = append(ans, c)
- }
- }
- return string(ans)
-}
diff --git a/problems/remove-outermost-parentheses/remove_outermost_parentheses_test.go b/problems/remove-outermost-parentheses/remove_outermost_parentheses_test.go
deleted file mode 100644
index a2c1f36ca..000000000
--- a/problems/remove-outermost-parentheses/remove_outermost_parentheses_test.go
+++ /dev/null
@@ -1,31 +0,0 @@
-package problem1021
-
-import "testing"
-
-type testType struct {
- in string
- want string
-}
-
-func TestRemoveOuterParentheses(t *testing.T) {
- tests := [...]testType{
- {
- in: "(()())(())",
- want: "()()()",
- },
- {
- in: "(()())(())(()(()))",
- want: "()()()()(())",
- },
- {
- in: "()()",
- want: "",
- },
- }
- for _, tt := range tests {
- got := removeOuterParentheses(tt.in)
- if got != tt.want {
- t.Fatalf("in: %v, got: %v, want: %v", tt.in, got, tt.want)
- }
- }
-}
diff --git a/problems/remove-palindromic-subsequences/README.md b/problems/remove-palindromic-subsequences/README.md
deleted file mode 100644
index 9127113a0..000000000
--- a/problems/remove-palindromic-subsequences/README.md
+++ /dev/null
@@ -1,70 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../rank-transform-of-an-array "Rank Transform of an Array")
-
-[Next >](../filter-restaurants-by-vegan-friendly-price-and-distance "Filter Restaurants by Vegan-Friendly, Price and Distance")
-
-## [1332. Remove Palindromic Subsequences (Easy)](https://leetcode.com/problems/remove-palindromic-subsequences "删除回文子序列")
-
-
You are given a string s consisting only of letters 'a' and 'b'. In a single step you can remove one palindromic subsequence from s.
-
-
Return the minimum number of steps to make the given string empty.
-
-
A string is a subsequence of a given string if it is generated by deleting some characters of a given string without changing its order. Note that a subsequence does not necessarily need to be contiguous.
-
-
A string is called palindrome if is one that reads the same backward as well as forward.
-
-
-
Example 1:
-
-
-Input: s = "ababa"
-Output: 1
-Explanation: s is already a palindrome, so its entirety can be removed in a single step.
-
-
-
Example 2:
-
-
-Input: s = "abb"
-Output: 2
-Explanation: "abb" -> "bb" -> "".
-Remove palindromic subsequence "a" then "bb".
-
-
-
Example 3:
-
-
-Input: s = "baabb"
-Output: 2
-Explanation: "baabb" -> "b" -> "".
-Remove palindromic subsequence "baab" then "b".
-
-
-
-
Constraints:
-
-
-
1 <= s.length <= 1000
-
s[i] is either 'a' or 'b'.
-
-
-### Related Topics
- [[Two Pointers](../../tag/two-pointers/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Hints
-
-Hint 1
-Use the fact that string contains only 2 characters.
-
-
-
-Hint 2
-Are subsequences composed of only one type of letter always palindrome strings ?
-
diff --git a/problems/remove-palindromic-subsequences/remove_palindromic_subsequences.go b/problems/remove-palindromic-subsequences/remove_palindromic_subsequences.go
deleted file mode 100644
index 4b96049a9..000000000
--- a/problems/remove-palindromic-subsequences/remove_palindromic_subsequences.go
+++ /dev/null
@@ -1,13 +0,0 @@
-package problem1332
-
-func removePalindromeSub(s string) int {
- if s == "" {
- return 0
- }
- for i, j := 0, len(s)-1; i < j; i, j = i+1, j-1 {
- if s[i] != s[j] {
- return 2
- }
- }
- return 1
-}
diff --git a/problems/remove-palindromic-subsequences/remove_palindromic_subsequences_test.go b/problems/remove-palindromic-subsequences/remove_palindromic_subsequences_test.go
deleted file mode 100644
index d91a2bfff..000000000
--- a/problems/remove-palindromic-subsequences/remove_palindromic_subsequences_test.go
+++ /dev/null
@@ -1,39 +0,0 @@
-package problem1332
-
-import "testing"
-
-type testType struct {
- in string
- want int
-}
-
-func TestRemovePalindromeSub(t *testing.T) {
- tests := [...]testType{
- {
- in: "ababa",
- want: 1,
- },
- {
- in: "abb",
- want: 2,
- },
- {
- in: "baabb",
- want: 2,
- },
- {
- in: "",
- want: 0,
- },
- {
- in: "aaabbbaaabbb",
- want: 2,
- },
- }
- for _, tt := range tests {
- got := removePalindromeSub(tt.in)
- if got != tt.want {
- t.Fatalf("in: %v, got: %v, want: %v", tt.in, got, tt.want)
- }
- }
-}
diff --git a/problems/remove-stones-to-minimize-the-total/README.md b/problems/remove-stones-to-minimize-the-total/README.md
deleted file mode 100644
index 64414e15e..000000000
--- a/problems/remove-stones-to-minimize-the-total/README.md
+++ /dev/null
@@ -1,77 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../check-if-string-is-a-prefix-of-array "Check If String Is a Prefix of Array")
-
-[Next >](../minimum-number-of-swaps-to-make-the-string-balanced "Minimum Number of Swaps to Make the String Balanced")
-
-## [1962. Remove Stones to Minimize the Total (Medium)](https://leetcode.com/problems/remove-stones-to-minimize-the-total "移除石子使总数最小")
-
-
You are given a 0-indexed integer array piles, where piles[i] represents the number of stones in the ith pile, and an integer k. You should apply the following operation exactlyk times:
-
-
-
Choose any piles[i] and removefloor(piles[i] / 2) stones from it.
-
-
-
Notice that you can apply the operation on the same pile more than once.
-
-
Return the minimum possible total number of stones remaining after applying the k operations.
-
-
floor(x) is the greatest integer that is smaller than or equal to x (i.e., rounds x down).
-
-
-
Example 1:
-
-
-Input: piles = [5,4,9], k = 2
-Output: 12
-Explanation: Steps of a possible scenario are:
-- Apply the operation on pile 2. The resulting piles are [5,4,5].
-- Apply the operation on pile 0. The resulting piles are [3,4,5].
-The total number of stones in [3,4,5] is 12.
-
-
-
Example 2:
-
-
-Input: piles = [4,3,6,7], k = 3
-Output: 12
-Explanation: Steps of a possible scenario are:
-- Apply the operation on pile 2. The resulting piles are [4,3,3,7].
-- Apply the operation on pile 3. The resulting piles are [4,3,3,4].
-- Apply the operation on pile 0. The resulting piles are [2,3,3,4].
-The total number of stones in [2,3,3,4] is 12.
-
-
-
-
Constraints:
-
-
-
1 <= piles.length <= 105
-
1 <= piles[i] <= 104
-
1 <= k <= 105
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Heap (Priority Queue)](../../tag/heap-priority-queue/README.md)]
-
-### Hints
-
-Hint 1
-Choose the pile with the maximum number of stones each time.
-
-
-
-Hint 2
-Use a data structure that helps you find the mentioned pile each time efficiently.
-
-
-
-Hint 3
-One such data structure is a Priority Queue.
-
diff --git a/problems/remove-sub-folders-from-the-filesystem/README.md b/problems/remove-sub-folders-from-the-filesystem/README.md
deleted file mode 100644
index 18bd119aa..000000000
--- a/problems/remove-sub-folders-from-the-filesystem/README.md
+++ /dev/null
@@ -1,73 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../check-if-it-is-a-straight-line "Check If It Is a Straight Line")
-
-[Next >](../replace-the-substring-for-balanced-string "Replace the Substring for Balanced String")
-
-## [1233. Remove Sub-Folders from the Filesystem (Medium)](https://leetcode.com/problems/remove-sub-folders-from-the-filesystem "删除子文件夹")
-
-
Given a list of folders folder, return the folders after removing all sub-folders in those folders. You may return the answer in any order.
-
-
If a folder[i] is located within another folder[j], it is called a sub-folder of it.
-
-
The format of a path is one or more concatenated strings of the form: '/' followed by one or more lowercase English letters.
-
-
-
For example, "/leetcode" and "/leetcode/problems" are valid paths while an empty string and "/" are not.
-
-
-
-
Example 1:
-
-
-Input: folder = ["/a","/a/b","/c/d","/c/d/e","/c/f"]
-Output: ["/a","/c/d","/c/f"]
-Explanation: Folders "/a/b/" is a subfolder of "/a" and "/c/d/e" is inside of folder "/c/d" in our filesystem.
-
-
-
Example 2:
-
-
-Input: folder = ["/a","/a/b/c","/a/b/d"]
-Output: ["/a"]
-Explanation: Folders "/a/b/c" and "/a/b/d/" will be removed because they are subfolders of "/a".
-
folder[i] contains only lowercase letters and '/'.
-
folder[i] always starts with the character '/'.
-
Each folder name is unique.
-
-
-### Related Topics
- [[Trie](../../tag/trie/README.md)]
- [[Array](../../tag/array/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Hints
-
-Hint 1
-Sort the folders lexicographically.
-
-
-
-Hint 2
-Insert the current element in an array and then loop until we get rid of all of their subfolders, repeat this until no element is left.
-
diff --git a/problems/remove-vowels-from-a-string/README.md b/problems/remove-vowels-from-a-string/README.md
deleted file mode 100644
index 35d9277c6..000000000
--- a/problems/remove-vowels-from-a-string/README.md
+++ /dev/null
@@ -1,56 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../number-of-days-in-a-month "Number of Days in a Month")
-
-[Next >](../maximum-average-subtree "Maximum Average Subtree")
-
-## [1119. Remove Vowels from a String (Easy)](https://leetcode.com/problems/remove-vowels-from-a-string "删去字符串中的元音")
-
-
Given a string S, remove the vowels 'a', 'e', 'i', 'o', and 'u' from it, and return the new string.
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
-
-### Similar Questions
- 1. [Reverse Vowels of a String](../reverse-vowels-of-a-string) (Easy)
-
-### Hints
-
-Hint 1
-How to erase vowels in a string?
-
-
-
-Hint 2
-Loop over the string and check every character, if it is a vowel ignore it otherwise add it to the answer.
-
diff --git a/problems/remove-zero-sum-consecutive-nodes-from-linked-list/README.md b/problems/remove-zero-sum-consecutive-nodes-from-linked-list/README.md
deleted file mode 100644
index 674f758f7..000000000
--- a/problems/remove-zero-sum-consecutive-nodes-from-linked-list/README.md
+++ /dev/null
@@ -1,72 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../compare-strings-by-frequency-of-the-smallest-character "Compare Strings by Frequency of the Smallest Character")
-
-[Next >](../dinner-plate-stacks "Dinner Plate Stacks")
-
-## [1171. Remove Zero Sum Consecutive Nodes from Linked List (Medium)](https://leetcode.com/problems/remove-zero-sum-consecutive-nodes-from-linked-list "从链表中删去总和值为零的连续节点")
-
-
Given the head of a linked list, we repeatedly delete consecutive sequences of nodes that sum to 0 until there are no such sequences.
-
-
After doing so, return the head of the final linked list. You may return any such answer.
-
-
-
(Note that in the examples below, all sequences are serializations of ListNode objects.)
-
-
Example 1:
-
-
-Input: head = [1,2,-3,3,1]
-Output: [3,1]
-Note: The answer [1,2,1] would also be accepted.
-
-
-
Example 2:
-
-
-Input: head = [1,2,3,-3,4]
-Output: [1,2,4]
-
-
-
Example 3:
-
-
-Input: head = [1,2,3,-3,-2]
-Output: [1]
-
-
-
-
Constraints:
-
-
-
The given linked list will contain between 1 and 1000 nodes.
-
Each node in the linked list has -1000 <= node.val <= 1000.
-
-
-### Related Topics
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Linked List](../../tag/linked-list/README.md)]
-
-### Similar Questions
- 1. [Delete N Nodes After M Nodes of a Linked List](../delete-n-nodes-after-m-nodes-of-a-linked-list) (Easy)
-
-### Hints
-
-Hint 1
-Convert the linked list into an array.
-
-
-
-Hint 2
-While you can find a non-empty subarray with sum = 0, erase it.
-
-
-
-Hint 3
-Convert the array into a linked list.
-
diff --git a/problems/removing-minimum-and-maximum-from-array/README.md b/problems/removing-minimum-and-maximum-from-array/README.md
deleted file mode 100644
index 6a9d08876..000000000
--- a/problems/removing-minimum-and-maximum-from-array/README.md
+++ /dev/null
@@ -1,94 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../k-radius-subarray-averages "K Radius Subarray Averages")
-
-[Next >](../find-all-people-with-secret "Find All People With Secret")
-
-## [2091. Removing Minimum and Maximum From Array (Medium)](https://leetcode.com/problems/removing-minimum-and-maximum-from-array "从数组中移除最大值和最小值")
-
-
You are given a 0-indexed array of distinct integers nums.
-
-
There is an element in nums that has the lowest value and an element that has the highest value. We call them the minimum and maximum respectively. Your goal is to remove both these elements from the array.
-
-
A deletion is defined as either removing an element from the front of the array or removing an element from the back of the array.
-
-
Return the minimum number of deletions it would take to remove both the minimum and maximum element from the array.
-
-
-
Example 1:
-
-
-Input: nums = [2,10,7,5,4,1,8,6]
-Output: 5
-Explanation:
-The minimum element in the array is nums[5], which is 1.
-The maximum element in the array is nums[1], which is 10.
-We can remove both the minimum and maximum by removing 2 elements from the front and 3 elements from the back.
-This results in 2 + 3 = 5 deletions, which is the minimum number possible.
-
-
-
Example 2:
-
-
-Input: nums = [0,-4,19,1,8,-2,-3,5]
-Output: 3
-Explanation:
-The minimum element in the array is nums[1], which is -4.
-The maximum element in the array is nums[2], which is 19.
-We can remove both the minimum and maximum by removing 3 elements from the front.
-This results in only 3 deletions, which is the minimum number possible.
-
-
-
Example 3:
-
-
-Input: nums = [101]
-Output: 1
-Explanation:
-There is only one element in the array, which makes it both the minimum and maximum element.
-We can remove it with 1 deletion.
-
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 105
-
-105 <= nums[i] <= 105
-
The integers in nums are distinct.
-
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[Array](../../tag/array/README.md)]
-
-### Hints
-
-Hint 1
-There can only be three scenarios for deletions such that both minimum and maximum elements are removed:
-
-
-
-Hint 2
-Scenario 1: Both elements are removed by only deleting from the front.
-
-
-
-Hint 3
-Scenario 2: Both elements are removed by only deleting from the back.
-
-
-
-Hint 4
-Scenario 3: Delete from the front to remove one of the elements, and delete from the back to remove the other element.
-
-
-
-Hint 5
-Compare which of the three scenarios results in the minimum number of moves.
-
diff --git a/problems/removing-minimum-number-of-magic-beans/README.md b/problems/removing-minimum-number-of-magic-beans/README.md
deleted file mode 100644
index 0e495bb15..000000000
--- a/problems/removing-minimum-number-of-magic-beans/README.md
+++ /dev/null
@@ -1,85 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-operations-to-make-the-array-alternating "Minimum Operations to Make the Array Alternating")
-
-[Next >](../maximum-and-sum-of-array "Maximum AND Sum of Array")
-
-## [2171. Removing Minimum Number of Magic Beans (Medium)](https://leetcode.com/problems/removing-minimum-number-of-magic-beans "拿出最少数目的魔法豆")
-
-
You are given an array of positive integers beans, where each integer represents the number of magic beans found in a particular magic bag.
-
-
Remove any number of beans (possibly none) from each bag such that the number of beans in each remaining non-empty bag (still containing at least one bean) is equal. Once a bean has been removed from a bag, you are not allowed to return it to any of the bags.
-
-
Return the minimum number of magic beans that you have to remove.
-
-
-
Example 1:
-
-
-Input: beans = [4,1,6,5]
-Output: 4
-Explanation:
-- We remove 1 bean from the bag with only 1 bean.
- This results in the remaining bags: [4,0,6,5]
-- Then we remove 2 beans from the bag with 6 beans.
- This results in the remaining bags: [4,0,4,5]
-- Then we remove 1 bean from the bag with 5 beans.
- This results in the remaining bags: [4,0,4,4]
-We removed a total of 1 + 2 + 1 = 4 beans to make the remaining non-empty bags have an equal number of beans.
-There are no other solutions that remove 4 beans or fewer.
-
-
-
Example 2:
-
-
-Input: beans = [2,10,3,2]
-Output: 7
-Explanation:
-- We remove 2 beans from one of the bags with 2 beans.
- This results in the remaining bags: [0,10,3,2]
-- Then we remove 2 beans from the other bag with 2 beans.
- This results in the remaining bags: [0,10,3,0]
-- Then we remove 3 beans from the bag with 3 beans.
- This results in the remaining bags: [0,10,0,0]
-We removed a total of 2 + 2 + 3 = 7 beans to make the remaining non-empty bags have an equal number of beans.
-There are no other solutions that removes 7 beans or fewer.
-
-
-
-
Constraints:
-
-
-
1 <= beans.length <= 105
-
1 <= beans[i] <= 105
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Prefix Sum](../../tag/prefix-sum/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Hints
-
-Hint 1
-Notice that if we choose to make x bags of beans empty, we should choose the x bags with the least amount of beans.
-
-
-
-Hint 2
-Notice that if the minimum number of beans in a non-empty bag is m, then the best way to make all bags have an equal amount of beans is to reduce all the bags to have m beans.
-
-
-
-Hint 3
-Can we iterate over how many bags we should remove and choose the one that minimizes the total amount of beans to remove?
-
-
-
-Hint 4
-Sort the bags of beans first.
-
diff --git a/problems/reorder-data-in-log-files/README.md b/problems/reorder-data-in-log-files/README.md
deleted file mode 100644
index be87a55e4..000000000
--- a/problems/reorder-data-in-log-files/README.md
+++ /dev/null
@@ -1,64 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../stamping-the-sequence "Stamping The Sequence")
-
-[Next >](../range-sum-of-bst "Range Sum of BST")
-
-## [937. Reorder Data in Log Files (Easy)](https://leetcode.com/problems/reorder-data-in-log-files "重新排列日志文件")
-
-
You are given an array of logs. Each log is a space-delimited string of words, where the first word is the identifier.
-
-
There are two types of logs:
-
-
-
Letter-logs: All words (except the identifier) consist of lowercase English letters.
-
Digit-logs: All words (except the identifier) consist of digits.
-
-
-
Reorder these logs so that:
-
-
-
The letter-logs come before all digit-logs.
-
The letter-logs are sorted lexicographically by their contents. If their contents are the same, then sort them lexicographically by their identifiers.
-
The digit-logs maintain their relative ordering.
-
-
-
Return the final order of the logs.
-
-
-
Example 1:
-
-
-Input: logs = ["dig1 8 1 5 1","let1 art can","dig2 3 6","let2 own kit dig","let3 art zero"]
-Output: ["let1 art can","let3 art zero","let2 own kit dig","dig1 8 1 5 1","dig2 3 6"]
-Explanation:
-The letter-log contents are all different, so their ordering is "art can", "art zero", "own kit dig".
-The digit-logs have a relative order of "dig1 8 1 5 1", "dig2 3 6".
-
You are given the head of a singly linked-list. The list can be represented as:
-
-
-L0 → L1 → … → Ln - 1 → Ln
-
-
-
Reorder the list to be on the following form:
-
-
-L0 → Ln → L1 → Ln - 1 → L2 → Ln - 2 → …
-
-
-
You may not modify the values in the list's nodes. Only nodes themselves may be changed.
-
-
-
Example 1:
-
-
-Input: head = [1,2,3,4]
-Output: [1,4,2,3]
-
-
-
Example 2:
-
-
-Input: head = [1,2,3,4,5]
-Output: [1,5,2,4,3]
-
-
-
-
Constraints:
-
-
-
The number of nodes in the list is in the range [1, 5 * 104].
-
1 <= Node.val <= 1000
-
-
-### Related Topics
- [[Stack](../../tag/stack/README.md)]
- [[Recursion](../../tag/recursion/README.md)]
- [[Linked List](../../tag/linked-list/README.md)]
- [[Two Pointers](../../tag/two-pointers/README.md)]
diff --git a/problems/reorder-list/reorder_list.go b/problems/reorder-list/reorder_list.go
deleted file mode 100644
index d77f3c172..000000000
--- a/problems/reorder-list/reorder_list.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem143
diff --git a/problems/reorder-list/reorder_list_test.go b/problems/reorder-list/reorder_list_test.go
deleted file mode 100644
index d77f3c172..000000000
--- a/problems/reorder-list/reorder_list_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem143
diff --git a/problems/reorder-routes-to-make-all-paths-lead-to-the-city-zero/README.md b/problems/reorder-routes-to-make-all-paths-lead-to-the-city-zero/README.md
deleted file mode 100644
index 6743b154d..000000000
--- a/problems/reorder-routes-to-make-all-paths-lead-to-the-city-zero/README.md
+++ /dev/null
@@ -1,68 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-area-of-a-piece-of-cake-after-horizontal-and-vertical-cuts "Maximum Area of a Piece of Cake After Horizontal and Vertical Cuts")
-
-[Next >](../probability-of-a-two-boxes-having-the-same-number-of-distinct-balls "Probability of a Two Boxes Having The Same Number of Distinct Balls")
-
-## [1466. Reorder Routes to Make All Paths Lead to the City Zero (Medium)](https://leetcode.com/problems/reorder-routes-to-make-all-paths-lead-to-the-city-zero "重新规划路线")
-
-
There are n cities numbered from 0 to n - 1 and n - 1 roads such that there is only one way to travel between two different cities (this network form a tree). Last year, The ministry of transport decided to orient the roads in one direction because they are too narrow.
-
-
Roads are represented by connections where connections[i] = [ai, bi] represents a road from city ai to city bi.
-
-
This year, there will be a big event in the capital (city 0), and many people want to travel to this city.
-
-
Your task consists of reorienting some roads such that each city can visit the city 0. Return the minimum number of edges changed.
-
-
It's guaranteed that each city can reach city 0 after reorder.
-
-
-
Example 1:
-
-
-Input: n = 6, connections = [[0,1],[1,3],[2,3],[4,0],[4,5]]
-Output: 3
-Explanation: Change the direction of edges show in red such that each node can reach the node 0 (capital).
-
-
-
Example 2:
-
-
-Input: n = 5, connections = [[1,0],[1,2],[3,2],[3,4]]
-Output: 2
-Explanation: Change the direction of edges show in red such that each node can reach the node 0 (capital).
-
-
-
Example 3:
-
-
-Input: n = 3, connections = [[1,0],[2,0]]
-Output: 0
-
-
-
-
Constraints:
-
-
-
2 <= n <= 5 * 104
-
connections.length == n - 1
-
connections[i].length == 2
-
0 <= ai, bi <= n - 1
-
ai != bi
-
-
-### Related Topics
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Graph](../../tag/graph/README.md)]
-
-### Hints
-
-Hint 1
-Treat the graph as undirected. Start a dfs from the root, if you come across an edge in the forward direction, you need to reverse the edge.
-
diff --git a/problems/reordered-power-of-2/README.md b/problems/reordered-power-of-2/README.md
deleted file mode 100644
index de7e05839..000000000
--- a/problems/reordered-power-of-2/README.md
+++ /dev/null
@@ -1,65 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../binary-gap "Binary Gap")
-
-[Next >](../advantage-shuffle "Advantage Shuffle")
-
-## [869. Reordered Power of 2 (Medium)](https://leetcode.com/problems/reordered-power-of-2 "重新排序得到 2 的幂")
-
-
You are given an integer n. We reorder the digits in any order (including the original order) such that the leading digit is not zero.
-
-
Return trueif and only if we can do this so that the resulting number is a power of two.
Given a string s, rearrange the characters of s so that any two adjacent characters are not the same.
-
-
Return any possible rearrangement ofsor return""if not possible.
-
-
-
Example 1:
-
Input: s = "aab"
-Output: "aba"
-
Example 2:
-
Input: s = "aaab"
-Output: ""
-
-
-
Constraints:
-
-
-
1 <= s.length <= 500
-
s consists of lowercase English letters.
-
-
-### Related Topics
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
- [[Greedy](../../tag/greedy/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
- [[Heap (Priority Queue)](../../tag/heap-priority-queue/README.md)]
- [[Counting](../../tag/counting/README.md)]
-
-### Similar Questions
- 1. [Rearrange String k Distance Apart](../rearrange-string-k-distance-apart) (Hard)
- 1. [Task Scheduler](../task-scheduler) (Medium)
-
-### Hints
-
-Hint 1
-Alternate placing the most common letters.
-
diff --git a/problems/reorganize-string/reorganize_string.go b/problems/reorganize-string/reorganize_string.go
deleted file mode 100644
index fb241f075..000000000
--- a/problems/reorganize-string/reorganize_string.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem767
diff --git a/problems/reorganize-string/reorganize_string_test.go b/problems/reorganize-string/reorganize_string_test.go
deleted file mode 100644
index fb241f075..000000000
--- a/problems/reorganize-string/reorganize_string_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem767
diff --git a/problems/repeated-dna-sequences/README.md b/problems/repeated-dna-sequences/README.md
deleted file mode 100644
index 634d93c7f..000000000
--- a/problems/repeated-dna-sequences/README.md
+++ /dev/null
@@ -1,46 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../reverse-words-in-a-string-ii "Reverse Words in a String II")
-
-[Next >](../best-time-to-buy-and-sell-stock-iv "Best Time to Buy and Sell Stock IV")
-
-## [187. Repeated DNA Sequences (Medium)](https://leetcode.com/problems/repeated-dna-sequences "重复的DNA序列")
-
-
The DNA sequence is composed of a series of nucleotides abbreviated as 'A', 'C', 'G', and 'T'.
-
-
-
For example, "ACGAATTCCG" is a DNA sequence.
-
-
-
When studying DNA, it is useful to identify repeated sequences within the DNA.
-
-
Given a string s that represents a DNA sequence, return all the 10-letter-long sequences (substrings) that occur more than once in a DNA molecule. You may return the answer in any order.
-
-
-
Example 1:
-
Input: s = "AAAAACCCCCAAAAACCCCCCAAAAAGGGTTT"
-Output: ["AAAAACCCCC","CCCCCAAAAA"]
-
Example 2:
-
Input: s = "AAAAAAAAAAAAA"
-Output: ["AAAAAAAAAA"]
-
Given two strings a and b, return the minimum number of times you should repeat string a so that stringbis a substring of it. If it is impossible for b to be a substring of a after repeating it, return -1.
-
-
Notice: string "abc" repeated 0 times is "", repeated 1 time is "abc" and repeated 2 times is "abcabc".
-
-
-
Example 1:
-
-
-Input: a = "abcd", b = "cdabcdab"
-Output: 3
-Explanation: We return 3 because by repeating a three times "abcdabcdabcd", b is a substring of it.
-
You are given a 0-indexed string s that has lowercase English letters in its even indices and digits in its odd indices.
-
-
There is a function shift(c, x), where c is a character and x is a digit, that returns the xth character after c.
-
-
-
For example, shift('a', 5) = 'f' and shift('x', 0) = 'x'.
-
-
-
For every odd index i, you want to replace the digit s[i] with shift(s[i-1], s[i]).
-
-
Return s after replacing all digits. It is guaranteed that shift(s[i-1], s[i]) will never exceed 'z'.
-
-
-
Example 1:
-
-
-Input: s = "a1c1e1"
-Output: "abcdef"
-Explanation: The digits are replaced as follows:
-- s[1] -> shift('a',1) = 'b'
-- s[3] -> shift('c',1) = 'd'
-- s[5] -> shift('e',1) = 'f'
-
-
Example 2:
-
-
-Input: s = "a1b2c3d4e"
-Output: "abbdcfdhe"
-Explanation: The digits are replaced as follows:
-- s[1] -> shift('a',1) = 'b'
-- s[3] -> shift('b',2) = 'd'
-- s[5] -> shift('c',3) = 'f'
-- s[7] -> shift('d',4) = 'h'
-
-
-
Constraints:
-
-
-
1 <= s.length <= 100
-
s consists only of lowercase English letters and digits.
-
shift(s[i-1], s[i]) <= 'z' for all odd indices i.
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
-
-### Hints
-
-Hint 1
-We just need to replace every even positioned character with the character s[i] positions ahead of the character preceding it
-
-
-
-Hint 2
-Get the position of the preceeding character in alphabet then advance it s[i] positions and get the character at that position
-
diff --git a/problems/replace-all-s-to-avoid-consecutive-repeating-characters/README.md b/problems/replace-all-s-to-avoid-consecutive-repeating-characters/README.md
deleted file mode 100644
index e9aadef5e..000000000
--- a/problems/replace-all-s-to-avoid-consecutive-repeating-characters/README.md
+++ /dev/null
@@ -1,57 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../count-all-possible-routes "Count All Possible Routes")
-
-[Next >](../number-of-ways-where-square-of-number-is-equal-to-product-of-two-numbers "Number of Ways Where Square of Number Is Equal to Product of Two Numbers")
-
-## [1576. Replace All ?'s to Avoid Consecutive Repeating Characters (Easy)](https://leetcode.com/problems/replace-all-s-to-avoid-consecutive-repeating-characters "替换所有的问号")
-
-
Given a string s containing only lowercase English letters and the '?' character, convert all the '?' characters into lowercase letters such that the final string does not contain any consecutive repeating characters. You cannot modify the non '?' characters.
-
-
It is guaranteed that there are no consecutive repeating characters in the given string except for '?'.
-
-
Return the final string after all the conversions (possibly zero) have been made. If there is more than one solution, return any of them. It can be shown that an answer is always possible with the given constraints.
-
-
-
Example 1:
-
-
-Input: s = "?zs"
-Output: "azs"
-Explanation: There are 25 solutions for this problem. From "azs" to "yzs", all are valid. Only "z" is an invalid modification as the string will consist of consecutive repeating characters in "zzs".
-
-
-
Example 2:
-
-
-Input: s = "ubv?w"
-Output: "ubvaw"
-Explanation: There are 24 solutions for this problem. Only "v" and "w" are invalid modifications as the strings will consist of consecutive repeating characters in "ubvvw" and "ubvww".
-
-
-
-
Constraints:
-
-
-
1 <= s.length <= 100
-
s consist of lowercase English letters and '?'.
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
-
-### Hints
-
-Hint 1
-Processing string from left to right, whenever you get a ‘?’, check left character and right character, and select a character not equal to either of them
-
-
-
-Hint 2
-Do take care to compare with replaced occurrence of ‘?’ when checking the left character.
-
diff --git a/problems/replace-elements-with-greatest-element-on-right-side/README.md b/problems/replace-elements-with-greatest-element-on-right-side/README.md
deleted file mode 100644
index 211f24d21..000000000
--- a/problems/replace-elements-with-greatest-element-on-right-side/README.md
+++ /dev/null
@@ -1,64 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-candies-you-can-get-from-boxes "Maximum Candies You Can Get from Boxes")
-
-[Next >](../sum-of-mutated-array-closest-to-target "Sum of Mutated Array Closest to Target")
-
-## [1299. Replace Elements with Greatest Element on Right Side (Easy)](https://leetcode.com/problems/replace-elements-with-greatest-element-on-right-side "将每个元素替换为右侧最大元素")
-
-
Given an array arr, replace every element in that array with the greatest element among the elements to its right, and replace the last element with -1.
-
-
After doing so, return the array.
-
-
-
Example 1:
-
-
-Input: arr = [17,18,5,4,6,1]
-Output: [18,6,6,6,1,-1]
-Explanation:
-- index 0 --> the greatest element to the right of index 0 is index 1 (18).
-- index 1 --> the greatest element to the right of index 1 is index 4 (6).
-- index 2 --> the greatest element to the right of index 2 is index 4 (6).
-- index 3 --> the greatest element to the right of index 3 is index 4 (6).
-- index 4 --> the greatest element to the right of index 4 is index 5 (1).
-- index 5 --> there are no elements to the right of index 5, so we put -1.
-
-
-
Example 2:
-
-
-Input: arr = [400]
-Output: [-1]
-Explanation: There are no elements to the right of index 0.
-
-
-
-
Constraints:
-
-
-
1 <= arr.length <= 104
-
1 <= arr[i] <= 105
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
-
-### Similar Questions
- 1. [Two Furthest Houses With Different Colors](../two-furthest-houses-with-different-colors) (Easy)
-
-### Hints
-
-Hint 1
-Loop through the array starting from the end.
-
-
-
-Hint 2
-Keep the maximum value seen so far.
-
diff --git a/problems/replace-employee-id-with-the-unique-identifier/README.md b/problems/replace-employee-id-with-the-unique-identifier/README.md
deleted file mode 100644
index ab56752eb..000000000
--- a/problems/replace-employee-id-with-the-unique-identifier/README.md
+++ /dev/null
@@ -1,82 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../frog-position-after-t-seconds "Frog Position After T Seconds")
-
-[Next >](../find-a-corresponding-node-of-a-binary-tree-in-a-clone-of-that-tree "Find a Corresponding Node of a Binary Tree in a Clone of That Tree")
-
-## [1378. Replace Employee ID With The Unique Identifier (Easy)](https://leetcode.com/problems/replace-employee-id-with-the-unique-identifier "使用唯一标识码替换员工ID")
-
-
Table: Employees
-
-+---------------+---------+
-| Column Name | Type |
-+---------------+---------+
-| id | int |
-| name | varchar |
-+---------------+---------+
-id is the primary key for this table.
-Each row of this table contains the id and the name of an employee in a company.
-
-
-
Table: EmployeeUNI
-
-+---------------+---------+
-| Column Name | Type |
-+---------------+---------+
-| id | int |
-| unique_id | int |
-+---------------+---------+
-(id, unique_id) is the primary key for this table.
-Each row of this table contains the id and the corresponding unique id of an employee in the company.
-
-
-Write an SQL query to show the unique ID of each user, If a user doesn't have a unique ID replace just show null.
-
-Return the result table in any order.
-
-The query result format is in the following example:
-
-Employees table:
-+----+----------+
-| id | name |
-+----+----------+
-| 1 | Alice |
-| 7 | Bob |
-| 11 | Meir |
-| 90 | Winston |
-| 3 | Jonathan |
-+----+----------+
-
-EmployeeUNI table:
-+----+-----------+
-| id | unique_id |
-+----+-----------+
-| 3 | 1 |
-| 11 | 2 |
-| 90 | 3 |
-+----+-----------+
-
-EmployeeUNI table:
-+-----------+----------+
-| unique_id | name |
-+-----------+----------+
-| null | Alice |
-| null | Bob |
-| 2 | Meir |
-| 3 | Winston |
-| 1 | Jonathan |
-+-----------+----------+
-
-Alice and Bob don't have a unique ID, We will show null instead.
-The unique ID of Meir is 2.
-The unique ID of Winston is 3.
-The unique ID of Jonathan is 1.
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/replace-employee-id-with-the-unique-identifier/mysql_schemas.sql b/problems/replace-employee-id-with-the-unique-identifier/mysql_schemas.sql
deleted file mode 100644
index 93fb4473d..000000000
--- a/problems/replace-employee-id-with-the-unique-identifier/mysql_schemas.sql
+++ /dev/null
@@ -1,12 +0,0 @@
-Create table If Not Exists Employees (id int, name varchar(20));
-Create table If Not Exists EmployeeUNI (id int, unique_id int);
-Truncate table Employees;
-insert into Employees (id, name) values ('1', 'Alice');
-insert into Employees (id, name) values ('7', 'Bob');
-insert into Employees (id, name) values ('11', 'Meir');
-insert into Employees (id, name) values ('90', 'Winston');
-insert into Employees (id, name) values ('3', 'Jonathan');
-Truncate table EmployeeUNI;
-insert into EmployeeUNI (id, unique_id) values ('3', '1');
-insert into EmployeeUNI (id, unique_id) values ('11', '2');
-insert into EmployeeUNI (id, unique_id) values ('90', '3');
diff --git a/problems/replace-the-substring-for-balanced-string/README.md b/problems/replace-the-substring-for-balanced-string/README.md
deleted file mode 100644
index dd661d977..000000000
--- a/problems/replace-the-substring-for-balanced-string/README.md
+++ /dev/null
@@ -1,76 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../remove-sub-folders-from-the-filesystem "Remove Sub-Folders from the Filesystem")
-
-[Next >](../maximum-profit-in-job-scheduling "Maximum Profit in Job Scheduling")
-
-## [1234. Replace the Substring for Balanced String (Medium)](https://leetcode.com/problems/replace-the-substring-for-balanced-string "替换子串得到平衡字符串")
-
-
You are given a string containing only 4 kinds of characters 'Q','W', 'E' and 'R'.
-
-
A string is said to be balancedif each of its characters appears n/4 times where n is the length of the string.
-
-
Return the minimum length of the substring that can be replaced with any other string of the same length to make the original string sbalanced.
-
-
Return 0 if the string is already balanced.
-
-
-
Example 1:
-
-
-Input: s = "QWER"
-Output: 0
-Explanation: s is already balanced.
-
-
Example 2:
-
-
-Input: s = "QQWE"
-Output: 1
-Explanation: We need to replace a 'Q' to 'R', so that "RQWE" (or "QRWE") is balanced.
-
-
-
Example 3:
-
-
-Input: s = "QQQW"
-Output: 2
-Explanation: We can replace the first "QQ" to "ER".
-
-
-
Example 4:
-
-
-Input: s = "QQQQ"
-Output: 3
-Explanation: We can replace the last 3 'Q' to make s = "QWER".
-
-
-
-
Constraints:
-
-
-
1 <= s.length <= 10^5
-
s.length is a multiple of 4
-
s contains only 'Q', 'W', 'E' and 'R'.
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
- [[Sliding Window](../../tag/sliding-window/README.md)]
-
-### Hints
-
-Hint 1
-Use 2-pointers algorithm to make sure all amount of characters outside the 2 pointers are smaller or equal to n/4.
-
-
-
-Hint 2
-That means you need to count the amount of each letter and make sure the amount is enough.
-
diff --git a/problems/replace-words/README.md b/problems/replace-words/README.md
deleted file mode 100644
index d8c027369..000000000
--- a/problems/replace-words/README.md
+++ /dev/null
@@ -1,59 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../palindromic-substrings "Palindromic Substrings")
-
-[Next >](../dota2-senate "Dota2 Senate")
-
-## [648. Replace Words (Medium)](https://leetcode.com/problems/replace-words "单词替换")
-
-
In English, we have a concept called root, which can be followed by some other word to form another longer word - let's call this word successor. For example, when the root"an" is followed by the successor word "other", we can form a new word "another".
-
-
Given a dictionary consisting of many roots and a sentence consisting of words separated by spaces, replace all the successors in the sentence with the root forming it. If a successor can be replaced by more than one root, replace it with the root that has the shortest length.
-
-
Return the sentence after the replacement.
-
-
-
Example 1:
-
Input: dictionary = ["cat","bat","rat"], sentence = "the cattle was rattled by the battery"
-Output: "the cat was rat by the bat"
-
Example 2:
-
Input: dictionary = ["a","b","c"], sentence = "aadsfasf absbs bbab cadsfafs"
-Output: "a a b c"
-
Example 3:
-
Input: dictionary = ["a", "aa", "aaa", "aaaa"], sentence = "a aa a aaaa aaa aaa aaa aaaaaa bbb baba ababa"
-Output: "a a a a a a a a bbb baba a"
-
Example 4:
-
Input: dictionary = ["catt","cat","bat","rat"], sentence = "the cattle was rattled by the battery"
-Output: "the cat was rat by the bat"
-
Example 5:
-
Input: dictionary = ["ac","ab"], sentence = "it is abnormal that this solution is accepted"
-Output: "it is ab that this solution is ac"
-
-
-
Constraints:
-
-
-
1 <= dictionary.length <= 1000
-
1 <= dictionary[i].length <= 100
-
dictionary[i] consists of only lower-case letters.
-
1 <= sentence.length <= 10^6
-
sentence consists of only lower-case letters and spaces.
-
The number of words in sentence is in the range [1, 1000]
-
The length of each word in sentence is in the range [1, 1000]
-
Each two consecutive words in sentence will be separated by exactly one space.
-
sentence does not have leading or trailing spaces.
-+--------------+---------+
-| Column Name | Type |
-+--------------+---------+
-| fail_date | date |
-+--------------+---------+
-Primary key for this table is fail_date.
-Failed table contains the days of failed tasks.
-
-
-
Table: Succeeded
-
-
-+--------------+---------+
-| Column Name | Type |
-+--------------+---------+
-| success_date | date |
-+--------------+---------+
-Primary key for this table is success_date.
-Succeeded table contains the days of succeeded tasks.
-
-
-
-
-
A system is running one task every day. Every task is independent of the previous tasks. The tasks can fail or succeed.
-
-
Write an SQL query to generate a report of period_state for each continuous interval of days in the period from 2019-01-01 to 2019-12-31.
-
-
period_state is 'failed' if tasks in this interval failed or 'succeeded' if tasks in this interval succeeded. Interval of days are retrieved as start_date and end_date.
-
-
Order result by start_date.
-
-
The query result format is in the following example:
-
-
-Failed table:
-+-------------------+
-| fail_date |
-+-------------------+
-| 2018-12-28 |
-| 2018-12-29 |
-| 2019-01-04 |
-| 2019-01-05 |
-+-------------------+
-
-Succeeded table:
-+-------------------+
-| success_date |
-+-------------------+
-| 2018-12-30 |
-| 2018-12-31 |
-| 2019-01-01 |
-| 2019-01-02 |
-| 2019-01-03 |
-| 2019-01-06 |
-+-------------------+
-
-
-Result table:
-+--------------+--------------+--------------+
-| period_state | start date | end date |
-+--------------+--------------+--------------+
-| present | 2019-01-01 | 2019-01-03 |
-| missing | 2019-01-04 | 2019-01-05 |
-| present | 2019-01-06 | 2019-01-06 |
-+--------------+--------------+--------------+
-
-The report ignored the system state in 2018 as we care about the system in the period 2019-01-01 to 2019-12-31.
-From 2019-01-01 to 2019-01-03 all tasks succeeded and the system state was "present".
-From 2019-01-04 to 2019-01-05 all tasks failed and system state was "missing".
-From 2019-01-06 to 2019-01-06 all tasks succeeded and system state was "present".
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
-
-### Similar Questions
- 1. [Find the Start and End Number of Continuous Ranges](../find-the-start-and-end-number-of-continuous-ranges) (Medium)
- 1. [Find the Missing IDs](../find-the-missing-ids) (Medium)
diff --git a/problems/report-contiguous-dates/mysql_schemas.sql b/problems/report-contiguous-dates/mysql_schemas.sql
deleted file mode 100644
index 10a26648f..000000000
--- a/problems/report-contiguous-dates/mysql_schemas.sql
+++ /dev/null
@@ -1,14 +0,0 @@
-Create table If Not Exists Failed (fail_date date);
-Create table If Not Exists Succeeded (success_date date);
-Truncate table Failed;
-insert into Failed (fail_date) values ('2018-12-28');
-insert into Failed (fail_date) values ('2018-12-29');
-insert into Failed (fail_date) values ('2019-01-04');
-insert into Failed (fail_date) values ('2019-01-05');
-Truncate table Succeeded;
-insert into Succeeded (success_date) values ('2018-12-30');
-insert into Succeeded (success_date) values ('2018-12-31');
-insert into Succeeded (success_date) values ('2019-01-01');
-insert into Succeeded (success_date) values ('2019-01-02');
-insert into Succeeded (success_date) values ('2019-01-03');
-insert into Succeeded (success_date) values ('2019-01-06');
diff --git a/problems/reported-posts-ii/README.md b/problems/reported-posts-ii/README.md
deleted file mode 100644
index bd1a28b4e..000000000
--- a/problems/reported-posts-ii/README.md
+++ /dev/null
@@ -1,89 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-of-absolute-value-expression "Maximum of Absolute Value Expression")
-
-[Next >](../largest-unique-number "Largest Unique Number")
-
-## [1132. Reported Posts II (Medium)](https://leetcode.com/problems/reported-posts-ii "报告的记录 II")
-
-
Table: Actions
-
-
-+---------------+---------+
-| Column Name | Type |
-+---------------+---------+
-| user_id | int |
-| post_id | int |
-| action_date | date |
-| action | enum |
-| extra | varchar |
-+---------------+---------+
-There is no primary key for this table, it may have duplicate rows.
-The action column is an ENUM type of ('view', 'like', 'reaction', 'comment', 'report', 'share').
-The extra column has optional information about the action such as a reason for report or a type of reaction.
-
-
Table: Removals
-
-
-+---------------+---------+
-| Column Name | Type |
-+---------------+---------+
-| post_id | int |
-| remove_date | date |
-+---------------+---------+
-post_id is the primary key of this table.
-Each row in this table indicates that some post was removed as a result of being reported or as a result of an admin review.
-
-
-
-
-
Write an SQL query to find the average for daily percentage of posts that got removed after being reported as spam, rounded to 2 decimal places.
-
-
The query result format is in the following example:
-
-
-Actions table:
-+---------+---------+-------------+--------+--------+
-| user_id | post_id | action_date | action | extra |
-+---------+---------+-------------+--------+--------+
-| 1 | 1 | 2019-07-01 | view | null |
-| 1 | 1 | 2019-07-01 | like | null |
-| 1 | 1 | 2019-07-01 | share | null |
-| 2 | 2 | 2019-07-04 | view | null |
-| 2 | 2 | 2019-07-04 | report | spam |
-| 3 | 4 | 2019-07-04 | view | null |
-| 3 | 4 | 2019-07-04 | report | spam |
-| 4 | 3 | 2019-07-02 | view | null |
-| 4 | 3 | 2019-07-02 | report | spam |
-| 5 | 2 | 2019-07-03 | view | null |
-| 5 | 2 | 2019-07-03 | report | racism |
-| 5 | 5 | 2019-07-03 | view | null |
-| 5 | 5 | 2019-07-03 | report | racism |
-+---------+---------+-------------+--------+--------+
-
-Removals table:
-+---------+-------------+
-| post_id | remove_date |
-+---------+-------------+
-| 2 | 2019-07-20 |
-| 3 | 2019-07-18 |
-+---------+-------------+
-
-Result table:
-+-----------------------+
-| average_daily_percent |
-+-----------------------+
-| 75.00 |
-+-----------------------+
-The percentage for 2019-07-04 is 50% because only one post of two spam reported posts was removed.
-The percentage for 2019-07-02 is 100% because one post was reported as spam and it was removed.
-The other days had no spam reports so the average is (50 + 100) / 2 = 75%
-Note that the output is only one number and that we do not care about the remove dates.
-+---------------+---------+
-| Column Name | Type |
-+---------------+---------+
-| user_id | int |
-| post_id | int |
-| action_date | date |
-| action | enum |
-| extra | varchar |
-+---------------+---------+
-There is no primary key for this table, it may have duplicate rows.
-The action column is an ENUM type of ('view', 'like', 'reaction', 'comment', 'report', 'share').
-The extra column has optional information about the action such as a reason for report or a type of reaction.
-
-
-
-
Write an SQL query that reports the number of posts reported yesterday for each report reason. Assume today is 2019-07-05.
-
-
The query result format is in the following example:
In MATLAB, there is a handy function called reshape which can reshape an m x n matrix into a new one with a different size r x c keeping its original data.
-
-
You are given an m x n matrix mat and two integers r and c representing the number of rows and the number of columns of the wanted reshaped matrix.
-
-
The reshaped matrix should be filled with all the elements of the original matrix in the same row-traversing order as they were.
-
-
If the reshape operation with given parameters is possible and legal, output the new reshaped matrix; Otherwise, output the original matrix.
-
-
-
Example 1:
-
-
-Input: mat = [[1,2],[3,4]], r = 1, c = 4
-Output: [[1,2,3,4]]
-
-
-
Example 2:
-
-
-Input: mat = [[1,2],[3,4]], r = 2, c = 4
-Output: [[1,2],[3,4]]
-
-
-
-
Constraints:
-
-
-
m == mat.length
-
n == mat[i].length
-
1 <= m, n <= 100
-
-1000 <= mat[i][j] <= 1000
-
1 <= r, c <= 300
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
- [[Simulation](../../tag/simulation/README.md)]
-
-### Hints
-
-Hint 1
-Do you know how 2d matrix is stored in 1d memory? Try to map 2-dimensions into one.
-
-
-
-Hint 2
-M[i][j]=M[n*i+j] , where n is the number of cols.
-This is the one way of converting 2-d indices into one 1-d index.
-Now, how will you convert 1-d index into 2-d indices?
-
-
-
-Hint 3
-Try to use division and modulus to convert 1-d index into 2-d indices.
-
-
-
-Hint 4
-M[i] => M[i/n][i%n] Will it result in right mapping? Take some example and check this formula.
-
diff --git a/problems/reshape-the-matrix/reshape_the_matrix.go b/problems/reshape-the-matrix/reshape_the_matrix.go
deleted file mode 100644
index 1184b8242..000000000
--- a/problems/reshape-the-matrix/reshape_the_matrix.go
+++ /dev/null
@@ -1,23 +0,0 @@
-package problem566
-
-func matrixReshape(nums [][]int, r int, c int) [][]int {
- m, n := len(nums), len(nums[0])
- if m*n != r*c {
- return nums
- }
- ans := make([][]int, r)
- for i := 0; i < r; i++ {
- ans[i] = make([]int, c)
- }
- i, j := 0, 0
- for _, row := range nums {
- for _, v := range row {
- ans[i][j] = v
- if j++; j == c {
- i++
- j = 0
- }
- }
- }
- return ans
-}
diff --git a/problems/reshape-the-matrix/reshape_the_matrix_test.go b/problems/reshape-the-matrix/reshape_the_matrix_test.go
deleted file mode 100644
index 837868aa6..000000000
--- a/problems/reshape-the-matrix/reshape_the_matrix_test.go
+++ /dev/null
@@ -1,48 +0,0 @@
-package problem566
-
-import (
- "reflect"
- "testing"
-)
-
-type testType struct {
- nums [][]int
- r int
- c int
- want [][]int
-}
-
-func TestMatrixReshape(t *testing.T) {
- tests := [...]testType{
- {
- nums: [][]int{
- {1, 2},
- {3, 4},
- },
- r: 1,
- c: 4,
- want: [][]int{
- {1, 2, 3, 4},
- },
- },
- {
- nums: [][]int{
- {1, 2},
- {3, 4},
- },
- r: 2,
- c: 4,
- want: [][]int{
- {1, 2},
- {3, 4},
- },
- },
- }
- for _, tt := range tests {
- got := matrixReshape(tt.nums, tt.r, tt.c)
- if !reflect.DeepEqual(got, tt.want) {
- t.Fatalf("in: %v, got: %v, want: %v", tt.nums, got, tt.want)
-
- }
- }
-}
diff --git a/problems/restaurant-growth/README.md b/problems/restaurant-growth/README.md
deleted file mode 100644
index 4375bf834..000000000
--- a/problems/restaurant-growth/README.md
+++ /dev/null
@@ -1,75 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-distance-to-type-a-word-using-two-fingers "Minimum Distance to Type a Word Using Two Fingers")
-
-[Next >](../ads-performance "Ads Performance")
-
-## [1321. Restaurant Growth (Medium)](https://leetcode.com/problems/restaurant-growth "餐馆营业额变化增长")
-
-
Table: Customer
-
-+---------------+---------+
-| Column Name | Type |
-+---------------+---------+
-| customer_id | int |
-| name | varchar |
-| visited_on | date |
-| amount | int |
-+---------------+---------+
-(customer_id, visited_on) is the primary key for this table.
-This table contains data about customer transactions in a restaurant.
-visited_on is the date on which the customer with ID (customer_id) have visited the restaurant.
-amount is the total paid by a customer.
-
-
-You are the restaurant owner and you want to analyze a possible expansion (there will be at least one customer every day).
-
-Write an SQL query to compute moving average of how much customer paid in a 7 days window (current day + 6 days before) .
-
-The query result format is in the following example:
-
-Return result table ordered by visited_on.
-
-average_amount should be rounded to 2 decimal places, all dates are in the format ('YYYY-MM-DD').
-
-
-Customer table:
-+-------------+--------------+--------------+-------------+
-| customer_id | name | visited_on | amount |
-+-------------+--------------+--------------+-------------+
-| 1 | Jhon | 2019-01-01 | 100 |
-| 2 | Daniel | 2019-01-02 | 110 |
-| 3 | Jade | 2019-01-03 | 120 |
-| 4 | Khaled | 2019-01-04 | 130 |
-| 5 | Winston | 2019-01-05 | 110 |
-| 6 | Elvis | 2019-01-06 | 140 |
-| 7 | Anna | 2019-01-07 | 150 |
-| 8 | Maria | 2019-01-08 | 80 |
-| 9 | Jaze | 2019-01-09 | 110 |
-| 1 | Jhon | 2019-01-10 | 130 |
-| 3 | Jade | 2019-01-10 | 150 |
-+-------------+--------------+--------------+-------------+
-
-Result table:
-+--------------+--------------+----------------+
-| visited_on | amount | average_amount |
-+--------------+--------------+----------------+
-| 2019-01-07 | 860 | 122.86 |
-| 2019-01-08 | 840 | 120 |
-| 2019-01-09 | 840 | 120 |
-| 2019-01-10 | 1000 | 142.86 |
-+--------------+--------------+----------------+
-
-1st moving average from 2019-01-01 to 2019-01-07 has an average_amount of (100 + 110 + 120 + 130 + 110 + 140 + 150)/7 = 122.86
-2nd moving average from 2019-01-02 to 2019-01-08 has an average_amount of (110 + 120 + 130 + 110 + 140 + 150 + 80)/7 = 120
-3rd moving average from 2019-01-03 to 2019-01-09 has an average_amount of (120 + 130 + 110 + 140 + 150 + 80 + 110)/7 = 120
-4th moving average from 2019-01-04 to 2019-01-10 has an average_amount of (130 + 110 + 140 + 150 + 80 + 110 + 130 + 150)/7 = 142.86
-
A valid IP address consists of exactly four integers separated by single dots. Each integer is between 0 and 255 (inclusive) and cannot have leading zeros.
-
-
-
For example, "0.1.2.201" and "192.168.1.1" are valid IP addresses, but "0.011.255.245", "192.168.1.312" and "192.168@1.1" are invalid IP addresses.
-
-
-
Given a string s containing only digits, return all possible valid IP addresses that can be formed by inserting dots into s. You are not allowed to reorder or remove any digits in s. You may return the valid IP addresses in any order.
-
-
-
Example 1:
-
Input: s = "25525511135"
-Output: ["255.255.11.135","255.255.111.35"]
-
Example 2:
-
Input: s = "0000"
-Output: ["0.0.0.0"]
-
Example 3:
-
Input: s = "1111"
-Output: ["1.1.1.1"]
-
Example 4:
-
Input: s = "010010"
-Output: ["0.10.0.10","0.100.1.0"]
-
Example 5:
-
Input: s = "101023"
-Output: ["1.0.10.23","1.0.102.3","10.1.0.23","10.10.2.3","101.0.2.3"]
-
-
-
Constraints:
-
-
-
0 <= s.length <= 20
-
s consists of digits only.
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
- [[Backtracking](../../tag/backtracking/README.md)]
-
-### Similar Questions
- 1. [IP to CIDR](../ip-to-cidr) (Medium)
diff --git a/problems/restore-ip-addresses/restore_ip_addresses.go b/problems/restore-ip-addresses/restore_ip_addresses.go
deleted file mode 100644
index abc688137..000000000
--- a/problems/restore-ip-addresses/restore_ip_addresses.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem93
diff --git a/problems/restore-ip-addresses/restore_ip_addresses_test.go b/problems/restore-ip-addresses/restore_ip_addresses_test.go
deleted file mode 100644
index abc688137..000000000
--- a/problems/restore-ip-addresses/restore_ip_addresses_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem93
diff --git a/problems/restore-the-array-from-adjacent-pairs/README.md b/problems/restore-the-array-from-adjacent-pairs/README.md
deleted file mode 100644
index 8569f4741..000000000
--- a/problems/restore-the-array-from-adjacent-pairs/README.md
+++ /dev/null
@@ -1,73 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-number-of-balls-in-a-box "Maximum Number of Balls in a Box")
-
-[Next >](../can-you-eat-your-favorite-candy-on-your-favorite-day "Can You Eat Your Favorite Candy on Your Favorite Day?")
-
-## [1743. Restore the Array From Adjacent Pairs (Medium)](https://leetcode.com/problems/restore-the-array-from-adjacent-pairs "从相邻元素对还原数组")
-
-
There is an integer array nums that consists of nunique elements, but you have forgotten it. However, you do remember every pair of adjacent elements in nums.
-
-
You are given a 2D integer array adjacentPairs of size n - 1 where each adjacentPairs[i] = [ui, vi] indicates that the elements ui and vi are adjacent in nums.
-
-
It is guaranteed that every adjacent pair of elements nums[i] and nums[i+1] will exist in adjacentPairs, either as [nums[i], nums[i+1]] or [nums[i+1], nums[i]]. The pairs can appear in any order.
-
-
Return the original array nums. If there are multiple solutions, return any of them.
-
-
-
Example 1:
-
-
-Input: adjacentPairs = [[2,1],[3,4],[3,2]]
-Output: [1,2,3,4]
-Explanation: This array has all its adjacent pairs in adjacentPairs.
-Notice that adjacentPairs[i] may not be in left-to-right order.
-
-
-
Example 2:
-
-
-Input: adjacentPairs = [[4,-2],[1,4],[-3,1]]
-Output: [-2,4,1,-3]
-Explanation: There can be negative numbers.
-Another solution is [-3,1,4,-2], which would also be accepted.
-
There exists some nums that has adjacentPairs as its pairs.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
-
-### Hints
-
-Hint 1
-Find the first element of nums - it will only appear once in adjacentPairs.
-
-
-
-Hint 2
-The adjacent pairs are like edges of a graph. Perform a depth-first search from the first element.
-
diff --git a/problems/restore-the-array/README.md b/problems/restore-the-array/README.md
deleted file mode 100644
index caa50f9a9..000000000
--- a/problems/restore-the-array/README.md
+++ /dev/null
@@ -1,68 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../the-k-th-lexicographical-string-of-all-happy-strings-of-length-n "The k-th Lexicographical String of All Happy Strings of Length n")
-
-[Next >](../reformat-the-string "Reformat The String")
-
-## [1416. Restore The Array (Hard)](https://leetcode.com/problems/restore-the-array "恢复数组")
-
-
A program was supposed to print an array of integers. The program forgot to print whitespaces and the array is printed as a string of digits s and all we know is that all integers in the array were in the range [1, k] and there are no leading zeros in the array.
-
-
Given the string s and the integer k, return the number of the possible arrays that can be printed as s using the mentioned program. Since the answer may be very large, return it modulo109 + 7.
-
-
-
Example 1:
-
-
-Input: s = "1000", k = 10000
-Output: 1
-Explanation: The only possible array is [1000]
-
-
-
Example 2:
-
-
-Input: s = "1000", k = 10
-Output: 0
-Explanation: There cannot be an array that was printed this way and has all integer >= 1 and <= 10.
-
-
-
Example 3:
-
-
-Input: s = "1317", k = 2000
-Output: 8
-Explanation: Possible arrays are [1317],[131,7],[13,17],[1,317],[13,1,7],[1,31,7],[1,3,17],[1,3,1,7]
-
-
-
-
Constraints:
-
-
-
1 <= s.length <= 105
-
s consists of only digits and does not contain leading zeros.
-
1 <= k <= 109
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Similar Questions
- 1. [Number of Ways to Separate Numbers](../number-of-ways-to-separate-numbers) (Hard)
-
-### Hints
-
-Hint 1
-Use dynamic programming. Build an array dp where dp[i] is the number of ways you can divide the string starting from index i to the end.
-
-
-
-Hint 2
-Keep in mind that the answer is modulo 10^9 + 7 and take the mod for each operation.
-
diff --git a/problems/reveal-cards-in-increasing-order/README.md b/problems/reveal-cards-in-increasing-order/README.md
deleted file mode 100644
index 8250a5d91..000000000
--- a/problems/reveal-cards-in-increasing-order/README.md
+++ /dev/null
@@ -1,69 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../largest-time-for-given-digits "Largest Time for Given Digits")
-
-[Next >](../flip-equivalent-binary-trees "Flip Equivalent Binary Trees")
-
-## [950. Reveal Cards In Increasing Order (Medium)](https://leetcode.com/problems/reveal-cards-in-increasing-order "按递增顺序显示卡牌")
-
-
You are given an integer array deck. There is a deck of cards where every card has a unique integer. The integer on the ith card is deck[i].
-
-
You can order the deck in any order you want. Initially, all the cards start face down (unrevealed) in one deck.
-
-
You will do the following steps repeatedly until all cards are revealed:
-
-
-
Take the top card of the deck, reveal it, and take it out of the deck.
-
If there are still cards in the deck then put the next top card of the deck at the bottom of the deck.
-
If there are still unrevealed cards, go back to step 1. Otherwise, stop.
-
-
-
Return an ordering of the deck that would reveal the cards in increasing order.
-
-
Note that the first entry in the answer is considered to be the top of the deck.
-
-
-
Example 1:
-
-
-Input: deck = [17,13,11,2,3,5,7]
-Output: [2,13,3,11,5,17,7]
-Explanation:
-We get the deck in the order [17,13,11,2,3,5,7] (this order does not matter), and reorder it.
-After reordering, the deck starts as [2,13,3,11,5,17,7], where 2 is the top of the deck.
-We reveal 2, and move 13 to the bottom. The deck is now [3,11,5,17,7,13].
-We reveal 3, and move 11 to the bottom. The deck is now [5,17,7,13,11].
-We reveal 5, and move 17 to the bottom. The deck is now [7,13,11,17].
-We reveal 7, and move 13 to the bottom. The deck is now [11,17,13].
-We reveal 11, and move 17 to the bottom. The deck is now [13,17].
-We reveal 13, and move 17 to the bottom. The deck is now [17].
-We reveal 17.
-Since all the cards revealed are in increasing order, the answer is correct.
-
Note that in some languages, such as Java, there is no unsigned integer type. In this case, both input and output will be given as a signed integer type. They should not affect your implementation, as the integer's internal binary representation is the same, whether it is signed or unsigned.
-
In Java, the compiler represents the signed integers using 2's complement notation. Therefore, in Example 2 above, the input represents the signed integer -3 and the output represents the signed integer -1073741825.
-
-
-
-
Example 1:
-
-
-Input: n = 00000010100101000001111010011100
-Output: 964176192 (00111001011110000010100101000000)
-Explanation: The input binary string 00000010100101000001111010011100 represents the unsigned integer 43261596, so return 964176192 which its binary representation is 00111001011110000010100101000000.
-
-
-
Example 2:
-
-
-Input: n = 11111111111111111111111111111101
-Output: 3221225471 (10111111111111111111111111111111)
-Explanation: The input binary string 11111111111111111111111111111101 represents the unsigned integer 4294967293, so return 3221225471 which its binary representation is 10111111111111111111111111111111.
-
-
-
-
Constraints:
-
-
-
The input must be a binary string of length 32
-
-
-
-
Follow up: If this function is called many times, how would you optimize it?
Given a signed 32-bit integer x, return x with its digits reversed. If reversing x causes the value to go outside the signed 32-bit integer range [-231, 231 - 1], then return 0.
-
-
Assume the environment does not allow you to store 64-bit integers (signed or unsigned).
-
-
-
Example 1:
-
Input: x = 123
-Output: 321
-
Example 2:
-
Input: x = -123
-Output: -321
-
Example 3:
-
Input: x = 120
-Output: 21
-
Example 4:
-
Input: x = 0
-Output: 0
-
-
-
Constraints:
-
-
-
-231 <= x <= 231 - 1
-
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
-
-### Similar Questions
- 1. [String to Integer (atoi)](../string-to-integer-atoi) (Medium)
- 1. [Reverse Bits](../reverse-bits) (Easy)
diff --git a/problems/reverse-integer/reverse_integer.go b/problems/reverse-integer/reverse_integer.go
deleted file mode 100644
index e624a2578..000000000
--- a/problems/reverse-integer/reverse_integer.go
+++ /dev/null
@@ -1,15 +0,0 @@
-package problem7
-
-import "math"
-
-func reverse(x int) int {
- r := 0
- for x != 0 {
- r = r*10 + x%10
- if r > math.MaxInt32 || r < math.MinInt32 {
- return 0
- }
- x /= 10
- }
- return r
-}
diff --git a/problems/reverse-integer/reverse_integer_test.go b/problems/reverse-integer/reverse_integer_test.go
deleted file mode 100644
index 1d20103c0..000000000
--- a/problems/reverse-integer/reverse_integer_test.go
+++ /dev/null
@@ -1,23 +0,0 @@
-package problem7
-
-import (
- "math"
- "testing"
-)
-
-func TestReverse(t *testing.T) {
- tests := map[int]int{
- 123: 321,
- -123: -321,
- 120: 21,
- math.MaxInt32: 0,
- math.MinInt32: 0,
- }
-
- for in, want := range tests {
- got := reverse(in)
- if got != want {
- t.Fatalf("in: %v, got: %v, want: %v", in, got, want)
- }
- }
-}
diff --git a/problems/reverse-linked-list-ii/README.md b/problems/reverse-linked-list-ii/README.md
deleted file mode 100644
index e348ad947..000000000
--- a/problems/reverse-linked-list-ii/README.md
+++ /dev/null
@@ -1,48 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../decode-ways "Decode Ways")
-
-[Next >](../restore-ip-addresses "Restore IP Addresses")
-
-## [92. Reverse Linked List II (Medium)](https://leetcode.com/problems/reverse-linked-list-ii "反转链表 II")
-
-
Given the head of a singly linked list and two integers left and right where left <= right, reverse the nodes of the list from position left to position right, and return the reversed list.
-
-
-
Example 1:
-
-
-Input: head = [1,2,3,4,5], left = 2, right = 4
-Output: [1,4,3,2,5]
-
-
-
Example 2:
-
-
-Input: head = [5], left = 1, right = 1
-Output: [5]
-
-
-
-
Constraints:
-
-
-
The number of nodes in the list is n.
-
1 <= n <= 500
-
-500 <= Node.val <= 500
-
1 <= left <= right <= n
-
-
-
-Follow up: Could you do it in one pass?
-
-### Related Topics
- [[Linked List](../../tag/linked-list/README.md)]
-
-### Similar Questions
- 1. [Reverse Linked List](../reverse-linked-list) (Easy)
diff --git a/problems/reverse-linked-list-ii/reverse_linked_list_ii.go b/problems/reverse-linked-list-ii/reverse_linked_list_ii.go
deleted file mode 100644
index d62c62485..000000000
--- a/problems/reverse-linked-list-ii/reverse_linked_list_ii.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem92
diff --git a/problems/reverse-linked-list-ii/reverse_linked_list_ii_test.go b/problems/reverse-linked-list-ii/reverse_linked_list_ii_test.go
deleted file mode 100644
index d62c62485..000000000
--- a/problems/reverse-linked-list-ii/reverse_linked_list_ii_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem92
diff --git a/problems/reverse-linked-list/README.md b/problems/reverse-linked-list/README.md
deleted file mode 100644
index be9956cae..000000000
--- a/problems/reverse-linked-list/README.md
+++ /dev/null
@@ -1,58 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../isomorphic-strings "Isomorphic Strings")
-
-[Next >](../course-schedule "Course Schedule")
-
-## [206. Reverse Linked List (Easy)](https://leetcode.com/problems/reverse-linked-list "反转链表")
-
-
Given the head of a singly linked list, reverse the list, and return the reversed list.
-
-
-
Example 1:
-
-
-Input: head = [1,2,3,4,5]
-Output: [5,4,3,2,1]
-
-
-
Example 2:
-
-
-Input: head = [1,2]
-Output: [2,1]
-
-
-
Example 3:
-
-
-Input: head = []
-Output: []
-
-
-
-
Constraints:
-
-
-
The number of nodes in the list is the range [0, 5000].
-
-5000 <= Node.val <= 5000
-
-
-
-
Follow up: A linked list can be reversed either iteratively or recursively. Could you implement both?
-
-### Related Topics
- [[Linked List](../../tag/linked-list/README.md)]
- [[Recursion](../../tag/recursion/README.md)]
-
-### Similar Questions
- 1. [Reverse Linked List II](../reverse-linked-list-ii) (Medium)
- 1. [Binary Tree Upside Down](../binary-tree-upside-down) (Medium)
- 1. [Palindrome Linked List](../palindrome-linked-list) (Easy)
- 1. [Reverse Nodes in Even Length Groups](../reverse-nodes-in-even-length-groups) (Medium)
- 1. [Maximum Twin Sum of a Linked List](../maximum-twin-sum-of-a-linked-list) (Medium)
diff --git a/problems/reverse-linked-list/reverse_linked_list.go b/problems/reverse-linked-list/reverse_linked_list.go
deleted file mode 100644
index d46a6bf54..000000000
--- a/problems/reverse-linked-list/reverse_linked_list.go
+++ /dev/null
@@ -1,21 +0,0 @@
-package problem206
-
-import "github.com/awesee/leetcode/internal/kit"
-
-// ListNode - Definition for singly-linked list.
-type ListNode = kit.ListNode
-
-/**
- * Definition for singly-linked list.
- * type ListNode struct {
- * Val int
- * Next *ListNode
- * }
- */
-func reverseList(head *ListNode) *ListNode {
- var pre *ListNode
- for head != nil {
- pre, head, head.Next = head, head.Next, pre
- }
- return pre
-}
diff --git a/problems/reverse-linked-list/reverse_linked_list_test.go b/problems/reverse-linked-list/reverse_linked_list_test.go
deleted file mode 100644
index 47f5c2046..000000000
--- a/problems/reverse-linked-list/reverse_linked_list_test.go
+++ /dev/null
@@ -1,28 +0,0 @@
-package problem206
-
-import (
- "reflect"
- "testing"
-
- "github.com/awesee/leetcode/internal/kit"
-)
-
-type testType struct {
- in []int
- want []int
-}
-
-func TestReverseList(t *testing.T) {
- tests := [...]testType{
- {
- in: []int{1, 2, 3, 4, 5},
- want: []int{5, 4, 3, 2, 1},
- },
- }
- for _, tt := range tests {
- got := kit.ListNode2SliceInt(reverseList(kit.SliceInt2ListNode(tt.in)))
- if !reflect.DeepEqual(got, tt.want) {
- t.Fatalf("in: %v, got: %v, want: %v", tt.in, got, tt.want)
- }
- }
-}
diff --git a/problems/reverse-nodes-in-even-length-groups/README.md b/problems/reverse-nodes-in-even-length-groups/README.md
deleted file mode 100644
index ff39ee8c6..000000000
--- a/problems/reverse-nodes-in-even-length-groups/README.md
+++ /dev/null
@@ -1,103 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../time-needed-to-buy-tickets "Time Needed to Buy Tickets")
-
-[Next >](../decode-the-slanted-ciphertext "Decode the Slanted Ciphertext")
-
-## [2074. Reverse Nodes in Even Length Groups (Medium)](https://leetcode.com/problems/reverse-nodes-in-even-length-groups "反转偶数长度组的节点")
-
-
You are given the head of a linked list.
-
-
The nodes in the linked list are sequentially assigned to non-empty groups whose lengths form the sequence of the natural numbers (1, 2, 3, 4, ...). The length of a group is the number of nodes assigned to it. In other words,
-
-
-
The 1st node is assigned to the first group.
-
The 2nd and the 3rd nodes are assigned to the second group.
-
The 4th, 5th, and 6th nodes are assigned to the third group, and so on.
-
-
-
Note that the length of the last group may be less than or equal to 1 + the length of the second to last group.
-
-
Reverse the nodes in each group with an even length, and return theheadof the modified linked list.
-
-
-
Example 1:
-
-
-Input: head = [5,2,6,3,9,1,7,3,8,4]
-Output: [5,6,2,3,9,1,4,8,3,7]
-Explanation:
-- The length of the first group is 1, which is odd, hence no reversal occurs.
-- The length of the second group is 2, which is even, hence the nodes are reversed.
-- The length of the third group is 3, which is odd, hence no reversal occurs.
-- The length of the last group is 4, which is even, hence the nodes are reversed.
-
-
-
Example 2:
-
-
-Input: head = [1,1,0,6]
-Output: [1,0,1,6]
-Explanation:
-- The length of the first group is 1. No reversal occurs.
-- The length of the second group is 2. The nodes are reversed.
-- The length of the last group is 1. No reversal occurs.
-
-
-
Example 3:
-
-
-Input: head = [1,1,0,6,5]
-Output: [1,0,1,5,6]
-Explanation:
-- The length of the first group is 1. No reversal occurs.
-- The length of the second group is 2. The nodes are reversed.
-- The length of the last group is 2. The nodes are reversed.
-
-
-
-
Constraints:
-
-
-
The number of nodes in the list is in the range [1, 105].
-
0 <= Node.val <= 105
-
-
-### Related Topics
- [[Linked List](../../tag/linked-list/README.md)]
-
-### Hints
-
-Hint 1
-Consider the list structure ...A → (B → ... → C) → D..., where the nodes between B and C (inclusive) form a group, A is the last node of the previous group, and D is the first node of the next group. How can you utilize this structure?
-
-
-
-Hint 2
-Suppose you have B → ... → C reversed (because it was of even length) so that it is now C → ... → B. What references do you need to fix so that the transitions between the previous, current, and next groups are correct?
-
-
-
-Hint 3
-A.next should be set to C, and B.next should be set to D.
-
-
-
-Hint 4
-Once the current group is finished being modified, you need to find the new A, B, C, and D nodes for the next group. How can you use the old A, B, C, and D nodes to find the new ones?
-
-
-
-Hint 5
-The new A is either the old B or old C depending on if the group was of even or odd length. The new B is always the old D. The new C and D can be found based on the new B and the next group's length.
-
-
-
-Hint 6
-You can set the initial values of A, B, C, and D to A = null, B = head, C = head, D = head.next. Repeat the steps from the previous hints until D is null.
-
diff --git a/problems/reverse-nodes-in-k-group/README.md b/problems/reverse-nodes-in-k-group/README.md
deleted file mode 100644
index 7ad436a04..000000000
--- a/problems/reverse-nodes-in-k-group/README.md
+++ /dev/null
@@ -1,67 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../swap-nodes-in-pairs "Swap Nodes in Pairs")
-
-[Next >](../remove-duplicates-from-sorted-array "Remove Duplicates from Sorted Array")
-
-## [25. Reverse Nodes in k-Group (Hard)](https://leetcode.com/problems/reverse-nodes-in-k-group "K 个一组翻转链表")
-
-
Given a linked list, reverse the nodes of a linked list k at a time and return its modified list.
-
-
k is a positive integer and is less than or equal to the length of the linked list. If the number of nodes is not a multiple of k then left-out nodes, in the end, should remain as it is.
-
-
You may not alter the values in the list's nodes, only nodes themselves may be changed.
-
-
-
Example 1:
-
-
-Input: head = [1,2,3,4,5], k = 2
-Output: [2,1,4,3,5]
-
-
-
Example 2:
-
-
-Input: head = [1,2,3,4,5], k = 3
-Output: [3,2,1,4,5]
-
-
-
Example 3:
-
-
-Input: head = [1,2,3,4,5], k = 1
-Output: [1,2,3,4,5]
-
-
-
Example 4:
-
-
-Input: head = [1], k = 1
-Output: [1]
-
-
-
-
Constraints:
-
-
-
The number of nodes in the list is in the range sz.
-
1 <= sz <= 5000
-
0 <= Node.val <= 1000
-
1 <= k <= sz
-
-
-
-Follow-up: Can you solve the problem in O(1) extra memory space?
-
-### Related Topics
- [[Recursion](../../tag/recursion/README.md)]
- [[Linked List](../../tag/linked-list/README.md)]
-
-### Similar Questions
- 1. [Swap Nodes in Pairs](../swap-nodes-in-pairs) (Medium)
diff --git a/problems/reverse-nodes-in-k-group/reverse_nodes_in_k_group.go b/problems/reverse-nodes-in-k-group/reverse_nodes_in_k_group.go
deleted file mode 100644
index 32e3b6af1..000000000
--- a/problems/reverse-nodes-in-k-group/reverse_nodes_in_k_group.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem25
diff --git a/problems/reverse-nodes-in-k-group/reverse_nodes_in_k_group_test.go b/problems/reverse-nodes-in-k-group/reverse_nodes_in_k_group_test.go
deleted file mode 100644
index 32e3b6af1..000000000
--- a/problems/reverse-nodes-in-k-group/reverse_nodes_in_k_group_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem25
diff --git a/problems/reverse-only-letters/README.md b/problems/reverse-only-letters/README.md
deleted file mode 100644
index d614140f3..000000000
--- a/problems/reverse-only-letters/README.md
+++ /dev/null
@@ -1,51 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../word-subsets "Word Subsets")
-
-[Next >](../maximum-sum-circular-subarray "Maximum Sum Circular Subarray")
-
-## [917. Reverse Only Letters (Easy)](https://leetcode.com/problems/reverse-only-letters "仅仅反转字母")
-
-
Given a string s, reverse the string according to the following rules:
-
-
-
All the characters that are not English letters remain in the same position.
-
All the English letters (lowercase or uppercase) should be reversed.
-
-
-
Return s after reversing it.
-
-
-
Example 1:
-
Input: s = "ab-cd"
-Output: "dc-ba"
-
Example 2:
-
Input: s = "a-bC-dEf-ghIj"
-Output: "j-Ih-gfE-dCba"
-
Example 3:
-
Input: s = "Test1ng-Leet=code-Q!"
-Output: "Qedo1ct-eeLg=ntse-T!"
-
-
-
Constraints:
-
-
-
1 <= s.length <= 100
-
s consists of characters with ASCII values in the range [33, 122].
-
s does not contain '\"' or '\\'.
-
-
-### Related Topics
- [[Two Pointers](../../tag/two-pointers/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Hints
-
-Hint 1
-This problem is exactly like reversing a normal string except that there are certain characters that we have to simply skip. That should be easy enough to do if you know how to reverse a string using the two-pointer approach.
-
diff --git a/problems/reverse-only-letters/reverse_only_letters.go b/problems/reverse-only-letters/reverse_only_letters.go
deleted file mode 100644
index 8dc50ab80..000000000
--- a/problems/reverse-only-letters/reverse_only_letters.go
+++ /dev/null
@@ -1,20 +0,0 @@
-package problem917
-
-import "unicode"
-
-func reverseOnlyLetters(S string) string {
- s := []rune(S)
- i, j := 0, len(s)-1
- for i < j {
- if !unicode.IsLetter(rune(S[i])) {
- i++
- } else if !unicode.IsLetter(rune(S[j])) {
- j--
- } else {
- s[i], s[j] = s[j], s[i]
- i++
- j--
- }
- }
- return string(s)
-}
diff --git a/problems/reverse-only-letters/reverse_only_letters_test.go b/problems/reverse-only-letters/reverse_only_letters_test.go
deleted file mode 100644
index 467e56dc8..000000000
--- a/problems/reverse-only-letters/reverse_only_letters_test.go
+++ /dev/null
@@ -1,31 +0,0 @@
-package problem917
-
-import "testing"
-
-type testType struct {
- in string
- want string
-}
-
-func TestReverseOnlyLetters(t *testing.T) {
- tests := [...]testType{
- {
- in: "ab-cd",
- want: "dc-ba",
- },
- {
- in: "a-bC-dEf-ghIj",
- want: "j-Ih-gfE-dCba",
- },
- {
- in: "Test1ng-Leet=code-Q!",
- want: "Qedo1ct-eeLg=ntse-T!",
- },
- }
- for _, tt := range tests {
- got := reverseOnlyLetters(tt.in)
- if got != tt.want {
- t.Fatalf("in: %v, got: %v, want: %v", tt.in, got, tt.want)
- }
- }
-}
diff --git a/problems/reverse-pairs/README.md b/problems/reverse-pairs/README.md
deleted file mode 100644
index ad153a41e..000000000
--- a/problems/reverse-pairs/README.md
+++ /dev/null
@@ -1,45 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../construct-the-rectangle "Construct the Rectangle")
-
-[Next >](../target-sum "Target Sum")
-
-## [493. Reverse Pairs (Hard)](https://leetcode.com/problems/reverse-pairs "翻转对")
-
-
Given an integer array nums, return the number of reverse pairs in the array.
-
-
A reverse pair is a pair (i, j) where 0 <= i < j < nums.length and nums[i] > 2 * nums[j].
-
-
-
Example 1:
-
Input: nums = [1,3,2,3,1]
-Output: 2
-
Example 2:
-
Input: nums = [2,4,3,5,1]
-Output: 3
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 5 * 104
-
-231 <= nums[i] <= 231 - 1
-
-
-### Related Topics
- [[Binary Indexed Tree](../../tag/binary-indexed-tree/README.md)]
- [[Segment Tree](../../tag/segment-tree/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
- [[Divide and Conquer](../../tag/divide-and-conquer/README.md)]
- [[Ordered Set](../../tag/ordered-set/README.md)]
- [[Merge Sort](../../tag/merge-sort/README.md)]
-
-### Similar Questions
- 1. [Count of Smaller Numbers After Self](../count-of-smaller-numbers-after-self) (Hard)
- 1. [Count of Range Sum](../count-of-range-sum) (Hard)
diff --git a/problems/reverse-pairs/reverse_pairs.go b/problems/reverse-pairs/reverse_pairs.go
deleted file mode 100644
index c85372a6c..000000000
--- a/problems/reverse-pairs/reverse_pairs.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem493
diff --git a/problems/reverse-pairs/reverse_pairs_test.go b/problems/reverse-pairs/reverse_pairs_test.go
deleted file mode 100644
index c85372a6c..000000000
--- a/problems/reverse-pairs/reverse_pairs_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem493
diff --git a/problems/reverse-prefix-of-word/README.md b/problems/reverse-prefix-of-word/README.md
deleted file mode 100644
index 37f9b97e9..000000000
--- a/problems/reverse-prefix-of-word/README.md
+++ /dev/null
@@ -1,72 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../smallest-greater-multiple-made-of-two-digits "Smallest Greater Multiple Made of Two Digits")
-
-[Next >](../number-of-pairs-of-interchangeable-rectangles "Number of Pairs of Interchangeable Rectangles")
-
-## [2000. Reverse Prefix of Word (Easy)](https://leetcode.com/problems/reverse-prefix-of-word "反转单词前缀")
-
-
Given a 0-indexed string word and a character ch, reverse the segment of word that starts at index 0 and ends at the index of the first occurrence of ch (inclusive). If the character ch does not exist in word, do nothing.
-
-
-
For example, if word = "abcdefd" and ch = "d", then you should reverse the segment that starts at 0 and ends at 3 (inclusive). The resulting string will be "dcbaefd".
-
-
-
Return the resulting string.
-
-
-
Example 1:
-
-
-Input: word = "abcdefd", ch = "d"
-Output: "dcbaefd"
-Explanation: The first occurrence of "d" is at index 3.
-Reverse the part of word from 0 to 3 (inclusive), the resulting string is "dcbaefd".
-
-
-
Example 2:
-
-
-Input: word = "xyxzxe", ch = "z"
-Output: "zxyxxe"
-Explanation: The first and only occurrence of "z" is at index 3.
-Reverse the part of word from 0 to 3 (inclusive), the resulting string is "zxyxxe".
-
-
-
Example 3:
-
-
-Input: word = "abcd", ch = "z"
-Output: "abcd"
-Explanation: "z" does not exist in word.
-You should not do any reverse operation, the resulting string is "abcd".
-
-
-
-
Constraints:
-
-
-
1 <= word.length <= 250
-
word consists of lowercase English letters.
-
ch is a lowercase English letter.
-
-
-### Related Topics
- [[Two Pointers](../../tag/two-pointers/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Hints
-
-Hint 1
-Find the first index where ch appears.
-
-
-
-Hint 2
-Find a way to reverse a substring of word.
-
diff --git a/problems/reverse-string-ii/README.md b/problems/reverse-string-ii/README.md
deleted file mode 100644
index 0ae3f3651..000000000
--- a/problems/reverse-string-ii/README.md
+++ /dev/null
@@ -1,41 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../single-element-in-a-sorted-array "Single Element in a Sorted Array")
-
-[Next >](../01-matrix "01 Matrix")
-
-## [541. Reverse String II (Easy)](https://leetcode.com/problems/reverse-string-ii "反转字符串 II")
-
-
Given a string s and an integer k, reverse the first k characters for every 2k characters counting from the start of the string.
-
-
If there are fewer than k characters left, reverse all of them. If there are less than 2k but greater than or equal to k characters, then reverse the first k characters and left the other as original.
-
-
-
Example 1:
-
Input: s = "abcdefg", k = 2
-Output: "bacdfeg"
-
Example 2:
-
Input: s = "abcd", k = 2
-Output: "bacd"
-
-
-
Constraints:
-
-
-
1 <= s.length <= 104
-
s consists of only lowercase English letters.
-
1 <= k <= 104
-
-
-### Related Topics
- [[Two Pointers](../../tag/two-pointers/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Similar Questions
- 1. [Reverse String](../reverse-string) (Easy)
- 1. [Reverse Words in a String III](../reverse-words-in-a-string-iii) (Easy)
diff --git a/problems/reverse-string-ii/reverse_string_ii.go b/problems/reverse-string-ii/reverse_string_ii.go
deleted file mode 100644
index 39535fc53..000000000
--- a/problems/reverse-string-ii/reverse_string_ii.go
+++ /dev/null
@@ -1,14 +0,0 @@
-package problem541
-
-func reverseStr(s string, k int) string {
- ss, l := []rune(s), len(s)-1
- for i := 0; i < l; i += 2 * k {
- for m, n := i, i+k-1; m < n; m, n = m+1, n-1 {
- if n > l {
- n = l
- }
- ss[m], ss[n] = ss[n], ss[m]
- }
- }
- return string(ss)
-}
diff --git a/problems/reverse-string-ii/reverse_string_ii_test.go b/problems/reverse-string-ii/reverse_string_ii_test.go
deleted file mode 100644
index 5d58a0b8b..000000000
--- a/problems/reverse-string-ii/reverse_string_ii_test.go
+++ /dev/null
@@ -1,40 +0,0 @@
-package problem541
-
-import "testing"
-
-type testType struct {
- s string
- k int
- want string
-}
-
-func TestReverseStr(t *testing.T) {
- tests := [...]testType{
- {
- s: "abcdefg",
- k: 2,
- want: "bacdfeg",
- },
- {
- s: "abcdefg",
- k: 4,
- want: "dcbaefg",
- },
- {
- s: "abcd",
- k: 4,
- want: "dcba",
- },
- {
- s: "abcdefg",
- k: 8,
- want: "gfedcba",
- },
- }
- for _, tt := range tests {
- got := reverseStr(tt.s, tt.k)
- if got != tt.want {
- t.Fatalf("in: %v %v, got: %v, want: %v", tt.s, tt.k, got, tt.want)
- }
- }
-}
diff --git a/problems/reverse-string/README.md b/problems/reverse-string/README.md
deleted file mode 100644
index af5bd5a71..000000000
--- a/problems/reverse-string/README.md
+++ /dev/null
@@ -1,47 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../integer-break "Integer Break")
-
-[Next >](../reverse-vowels-of-a-string "Reverse Vowels of a String")
-
-## [344. Reverse String (Easy)](https://leetcode.com/problems/reverse-string "反转字符串")
-
-
Write a function that reverses a string. The input string is given as an array of characters s.
-
-
You must do this by modifying the input array in-place with O(1) extra memory.
-
-
-
Example 1:
-
Input: s = ["h","e","l","l","o"]
-Output: ["o","l","l","e","h"]
-
Example 2:
-
Input: s = ["H","a","n","n","a","h"]
-Output: ["h","a","n","n","a","H"]
-
A word is defined as a sequence of non-space characters.
-
The input string does not contain leading or trailing spaces.
-
The words are always separated by a single space.
-
-
-
Follow up: Could you do it in-place without allocating extra space?
-
-### Related Topics
- [[Two Pointers](../../tag/two-pointers/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Similar Questions
- 1. [Reverse Words in a String](../reverse-words-in-a-string) (Medium)
- 1. [Rotate Array](../rotate-array) (Medium)
diff --git a/problems/reverse-words-in-a-string-ii/reverse_words_in_a_string_ii.go b/problems/reverse-words-in-a-string-ii/reverse_words_in_a_string_ii.go
deleted file mode 100644
index ebd030477..000000000
--- a/problems/reverse-words-in-a-string-ii/reverse_words_in_a_string_ii.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem186
diff --git a/problems/reverse-words-in-a-string-ii/reverse_words_in_a_string_ii_test.go b/problems/reverse-words-in-a-string-ii/reverse_words_in_a_string_ii_test.go
deleted file mode 100644
index ebd030477..000000000
--- a/problems/reverse-words-in-a-string-ii/reverse_words_in_a_string_ii_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem186
diff --git a/problems/reverse-words-in-a-string-iii/README.md b/problems/reverse-words-in-a-string-iii/README.md
deleted file mode 100644
index 68b40c93c..000000000
--- a/problems/reverse-words-in-a-string-iii/README.md
+++ /dev/null
@@ -1,40 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../next-greater-element-iii "Next Greater Element III")
-
-[Next >](../logical-or-of-two-binary-grids-represented-as-quad-trees "Logical OR of Two Binary Grids Represented as Quad-Trees")
-
-## [557. Reverse Words in a String III (Easy)](https://leetcode.com/problems/reverse-words-in-a-string-iii "反转字符串中的单词 III")
-
-
Given a string s, reverse the order of characters in each word within a sentence while still preserving whitespace and initial word order.
-
-
-
Example 1:
-
Input: s = "Let's take LeetCode contest"
-Output: "s'teL ekat edoCteeL tsetnoc"
-
Example 2:
-
Input: s = "God Ding"
-Output: "doG gniD"
-
-
-
Constraints:
-
-
-
1 <= s.length <= 5 * 104
-
s contains printable ASCII characters.
-
s does not contain any leading or trailing spaces.
-
There is at least one word in s.
-
All the words in s are separated by a single space.
-
-
-### Related Topics
- [[Two Pointers](../../tag/two-pointers/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Similar Questions
- 1. [Reverse String II](../reverse-string-ii) (Easy)
diff --git a/problems/reverse-words-in-a-string-iii/reverse_words_in_a_string_iii.go b/problems/reverse-words-in-a-string-iii/reverse_words_in_a_string_iii.go
deleted file mode 100644
index f32cc2049..000000000
--- a/problems/reverse-words-in-a-string-iii/reverse_words_in_a_string_iii.go
+++ /dev/null
@@ -1,14 +0,0 @@
-package problem557
-
-func reverseWords(s string) string {
- ss, pre, l := []byte(s+" "), 0, len(s)
- for cur, c := range ss {
- if c == ' ' {
- for i, j := pre, cur-1; i < j; i, j = i+1, j-1 {
- ss[i], ss[j] = ss[j], ss[i]
- }
- pre = cur + 1
- }
- }
- return string(ss[:l])
-}
diff --git a/problems/reverse-words-in-a-string-iii/reverse_words_in_a_string_iii_test.go b/problems/reverse-words-in-a-string-iii/reverse_words_in_a_string_iii_test.go
deleted file mode 100644
index 374779bab..000000000
--- a/problems/reverse-words-in-a-string-iii/reverse_words_in_a_string_iii_test.go
+++ /dev/null
@@ -1,23 +0,0 @@
-package problem557
-
-import "testing"
-
-type testType struct {
- in string
- want string
-}
-
-func TestReverseWords(t *testing.T) {
- tests := [...]testType{
- {
- in: "Let's take LeetCode contest",
- want: "s'teL ekat edoCteeL tsetnoc",
- },
- }
- for _, tt := range tests {
- got := reverseWords(tt.in)
- if got != tt.want {
- t.Fatalf("in: %v, got: %v, want: %v", tt.in, got, tt.want)
- }
- }
-}
diff --git a/problems/reverse-words-in-a-string/README.md b/problems/reverse-words-in-a-string/README.md
deleted file mode 100644
index 0a2002fd0..000000000
--- a/problems/reverse-words-in-a-string/README.md
+++ /dev/null
@@ -1,63 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../evaluate-reverse-polish-notation "Evaluate Reverse Polish Notation")
-
-[Next >](../maximum-product-subarray "Maximum Product Subarray")
-
-## [151. Reverse Words in a String (Medium)](https://leetcode.com/problems/reverse-words-in-a-string "翻转字符串里的单词")
-
-
Given an input string s, reverse the order of the words.
-
-
A word is defined as a sequence of non-space characters. The words in s will be separated by at least one space.
-
-
Return a string of the words in reverse order concatenated by a single space.
-
-
Note that s may contain leading or trailing spaces or multiple spaces between two words. The returned string should only have a single space separating the words. Do not include any extra spaces.
-
-
-
Example 1:
-
-
-Input: s = "the sky is blue"
-Output: "blue is sky the"
-
-
-
Example 2:
-
-
-Input: s = " hello world "
-Output: "world hello"
-Explanation: Your reversed string should not contain leading or trailing spaces.
-
-
-
Example 3:
-
-
-Input: s = "a good example"
-Output: "example good a"
-Explanation: You need to reduce multiple spaces between two words to a single space in the reversed string.
-
-
-
-
Constraints:
-
-
-
1 <= s.length <= 104
-
s contains English letters (upper-case and lower-case), digits, and spaces ' '.
-
There is at least one word in s.
-
-
-
-
Follow-up: If the string data type is mutable in your language, can you solve it in-place with O(1) extra space?
-
-### Related Topics
- [[Two Pointers](../../tag/two-pointers/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Similar Questions
- 1. [Reverse Words in a String II](../reverse-words-in-a-string-ii) (Medium)
diff --git a/problems/reverse-words-in-a-string/reverse_words_in_a_string.go b/problems/reverse-words-in-a-string/reverse_words_in_a_string.go
deleted file mode 100644
index bc759673f..000000000
--- a/problems/reverse-words-in-a-string/reverse_words_in_a_string.go
+++ /dev/null
@@ -1,15 +0,0 @@
-package problem151
-
-import (
- "regexp"
- "strings"
-)
-
-func reverseWords(s string) string {
- reg := regexp.MustCompile(`\S+`)
- words := reg.FindAllString(s, -1)
- for i, j := 0, len(words)-1; i < j; i, j = i+1, j-1 {
- words[i], words[j] = words[j], words[i]
- }
- return strings.Join(words, " ")
-}
diff --git a/problems/reverse-words-in-a-string/reverse_words_in_a_string_test.go b/problems/reverse-words-in-a-string/reverse_words_in_a_string_test.go
deleted file mode 100644
index a4038c9d2..000000000
--- a/problems/reverse-words-in-a-string/reverse_words_in_a_string_test.go
+++ /dev/null
@@ -1,31 +0,0 @@
-package problem151
-
-import "testing"
-
-type testType struct {
- in string
- want string
-}
-
-func TestReverseWords(t *testing.T) {
- tests := [...]testType{
- {
- in: "the sky is blue",
- want: "blue is sky the",
- },
- {
- in: " hello world! ",
- want: "world! hello",
- },
- {
- in: "a good example",
- want: "example good a",
- },
- }
- for _, tt := range tests {
- got := reverseWords(tt.in)
- if got != tt.want {
- t.Fatalf("in: %v, got: %v, want: %v", tt.in, got, tt.want)
- }
- }
-}
diff --git a/problems/richest-customer-wealth/README.md b/problems/richest-customer-wealth/README.md
deleted file mode 100644
index b977f74c4..000000000
--- a/problems/richest-customer-wealth/README.md
+++ /dev/null
@@ -1,71 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-number-of-removals-to-make-mountain-array "Minimum Number of Removals to Make Mountain Array")
-
-[Next >](../find-the-most-competitive-subsequence "Find the Most Competitive Subsequence")
-
-## [1672. Richest Customer Wealth (Easy)](https://leetcode.com/problems/richest-customer-wealth "最富有客户的资产总量")
-
-
You are given an m x n integer grid accounts where accounts[i][j] is the amount of money the ith customer has in the jth bank. Return the wealth that the richest customer has.
-
-
A customer's wealth is the amount of money they have in all their bank accounts. The richest customer is the customer that has the maximum wealth.
-
-
-
Example 1:
-
-
-Input: accounts = [[1,2,3],[3,2,1]]
-Output: 6
-Explanation:
-1st customer has wealth = 1 + 2 + 3 = 6
-2nd customer has wealth = 3 + 2 + 1 = 6
-Both customers are considered the richest with a wealth of 6 each, so return 6.
-
-
-
Example 2:
-
-
-Input: accounts = [[1,5],[7,3],[3,5]]
-Output: 10
-Explanation:
-1st customer has wealth = 6
-2nd customer has wealth = 10
-3rd customer has wealth = 8
-The 2nd customer is the richest with a wealth of 10.
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
-
-### Hints
-
-Hint 1
-Calculate the wealth of each customer
-
-
-
-Hint 2
-Find the maximum element in array.
-
diff --git a/problems/rings-and-rods/README.md b/problems/rings-and-rods/README.md
deleted file mode 100644
index 3944e5b9c..000000000
--- a/problems/rings-and-rods/README.md
+++ /dev/null
@@ -1,83 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../sequentially-ordinal-rank-tracker "Sequentially Ordinal Rank Tracker")
-
-[Next >](../sum-of-subarray-ranges "Sum of Subarray Ranges")
-
-## [2103. Rings and Rods (Easy)](https://leetcode.com/problems/rings-and-rods "环和杆")
-
-
There are n rings and each ring is either red, green, or blue. The rings are distributed across ten rods labeled from 0 to 9.
-
-
You are given a string rings of length 2n that describes the n rings that are placed onto the rods. Every two characters in rings forms a color-position pair that is used to describe each ring where:
-
-
-
The first character of the ith pair denotes the ith ring's color ('R', 'G', 'B').
-
The second character of the ith pair denotes the rod that the ith ring is placed on ('0' to '9').
-
-
-
For example, "R3G2B1" describes n == 3 rings: a red ring placed onto the rod labeled 3, a green ring placed onto the rod labeled 2, and a blue ring placed onto the rod labeled 1.
-
-
Return the number of rods that have all three colors of rings on them.
-
-
-
Example 1:
-
-
-Input: rings = "B0B6G0R6R0R6G9"
-Output: 1
-Explanation:
-- The rod labeled 0 holds 3 rings with all colors: red, green, and blue.
-- The rod labeled 6 holds 3 rings, but it only has red and blue.
-- The rod labeled 9 holds only a green ring.
-Thus, the number of rods with all three colors is 1.
-
-
-
Example 2:
-
-
-Input: rings = "B0R0G0R9R0B0G0"
-Output: 1
-Explanation:
-- The rod labeled 0 holds 6 rings with all colors: red, green, and blue.
-- The rod labeled 9 holds only a red ring.
-Thus, the number of rods with all three colors is 1.
-
-
-
Example 3:
-
-
-Input: rings = "G4"
-Output: 0
-Explanation:
-Only one ring is given. Thus, no rods have all three colors.
-
-
-
-
Constraints:
-
-
-
rings.length == 2 * n
-
1 <= n <= 100
-
rings[i] where i is even is either 'R', 'G', or 'B' (0-indexed).
-
rings[i] where i is odd is a digit from '0' to '9' (0-indexed).
-
-
-### Related Topics
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Hints
-
-Hint 1
-For every rod, look through ‘rings’ to see if the rod contains all colors.
-
-
-
-Hint 2
-Create 3 booleans, 1 for each color, to store if that color is present for the current rod. If all 3 are true after looking through the string, then the rod contains all the colors.
-
diff --git a/problems/rising-temperature/README.md b/problems/rising-temperature/README.md
deleted file mode 100644
index 8ec7df841..000000000
--- a/problems/rising-temperature/README.md
+++ /dev/null
@@ -1,59 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../delete-duplicate-emails "Delete Duplicate Emails")
-
-[Next >](../house-robber "House Robber")
-
-## [197. Rising Temperature (Easy)](https://leetcode.com/problems/rising-temperature "上升的温度")
-
-
Table: Weather
-
-
-+---------------+---------+
-| Column Name | Type |
-+---------------+---------+
-| id | int |
-| recordDate | date |
-| temperature | int |
-+---------------+---------+
-id is the primary key for this table.
-This table contains information about the temperature in a certain day.
-
-
-
-
-
Write an SQL query to find all dates' id with higher temperature compared to its previous dates (yesterday).
-
-
Return the result table in any order.
-
-
The query result format is in the following example:
-
-
-Weather
-+----+------------+-------------+
-| id | recordDate | Temperature |
-+----+------------+-------------+
-| 1 | 2015-01-01 | 10 |
-| 2 | 2015-01-02 | 25 |
-| 3 | 2015-01-03 | 20 |
-| 4 | 2015-01-04 | 30 |
-+----+------------+-------------+
-
-Result table:
-+----+
-| id |
-+----+
-| 2 |
-| 4 |
-+----+
-In 2015-01-02, temperature was higher than the previous day (10 -> 25).
-In 2015-01-04, temperature was higher than the previous day (20 -> 30).
-
We can use run-length encoding (i.e., RLE) to encode a sequence of integers. In a run-length encoded array of even length encoding (0-indexed), for all even i, encoding[i] tells us the number of times that the non-negative integer value encoding[i + 1] is repeated in the sequence.
-
-
-
For example, the sequence arr = [8,8,8,5,5] can be encoded to be encoding = [3,8,2,5]. encoding = [3,8,0,9,2,5] and encoding = [2,8,1,8,2,5] are also valid RLE of arr.
-
-
-
Given a run-length encoded array, design an iterator that iterates through it.
-
-
Implement the RLEIterator class:
-
-
-
RLEIterator(int[] encoded) Initializes the object with the encoded array encoded.
-
int next(int n) Exhausts the next n elements and returns the last element exhausted in this way. If there is no element left to exhaust, return -1 instead.
-
-
-
-
Example 1:
-
-
-Input
-["RLEIterator", "next", "next", "next", "next"]
-[[[3, 8, 0, 9, 2, 5]], [2], [1], [1], [2]]
-Output
-[null, 8, 8, 5, -1]
-
-Explanation
-RLEIterator rLEIterator = new RLEIterator([3, 8, 0, 9, 2, 5]); // This maps to the sequence [8,8,8,5,5].
-rLEIterator.next(2); // exhausts 2 terms of the sequence, returning 8. The remaining sequence is now [8, 5, 5].
-rLEIterator.next(1); // exhausts 1 term of the sequence, returning 8. The remaining sequence is now [5, 5].
-rLEIterator.next(1); // exhausts 1 term of the sequence, returning 5. The remaining sequence is now [5].
-rLEIterator.next(2); // exhausts 2 terms, returning -1. This is because the first term exhausted was 5,
-but the second term did not exist. Since the last term exhausted does not exist, we return -1.
-
On an infinite plane, a robot initially stands at (0, 0) and faces north. The robot can receive one of three instructions:
-
-
-
"G": go straight 1 unit;
-
"L": turn 90 degrees to the left;
-
"R": turn 90 degrees to the right.
-
-
-
The robot performs the instructions given in order, and repeats them forever.
-
-
Return true if and only if there exists a circle in the plane such that the robot never leaves the circle.
-
-
-
Example 1:
-
-
-Input: instructions = "GGLLGG"
-Output: true
-Explanation: The robot moves from (0,0) to (0,2), turns 180 degrees, and then returns to (0,0).
-When repeating these instructions, the robot remains in the circle of radius 2 centered at the origin.
-
-
Example 2:
-
-
-Input: instructions = "GG"
-Output: false
-Explanation: The robot moves north indefinitely.
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
- [[String](../../tag/string/README.md)]
- [[Simulation](../../tag/simulation/README.md)]
-
-### Hints
-
-Hint 1
-Calculate the final vector of how the robot travels after executing all instructions once - it consists of a change in position plus a change in direction.
-
-
-
-Hint 2
-The robot stays in the circle iff (looking at the final vector) it changes direction (ie. doesn't stay pointing north), or it moves 0.
-
diff --git a/problems/robot-bounded-in-circle/robot_bounded_in_circle.go b/problems/robot-bounded-in-circle/robot_bounded_in_circle.go
deleted file mode 100644
index 4509b82f0..000000000
--- a/problems/robot-bounded-in-circle/robot_bounded_in_circle.go
+++ /dev/null
@@ -1,16 +0,0 @@
-package problem1041
-
-func isRobotBounded(instructions string) bool {
- x, y, dx, dy := 0, 0, 0, 1
- for _, i := range instructions {
- switch i {
- case 'G':
- x, y = x+dx, y+dy
- case 'L':
- dx, dy = -dy, dx
- case 'R':
- dx, dy = dy, -dx
- }
- }
- return x == 0 && y == 0 || dx != 0 || dy != 1
-}
diff --git a/problems/robot-bounded-in-circle/robot_bounded_in_circle_test.go b/problems/robot-bounded-in-circle/robot_bounded_in_circle_test.go
deleted file mode 100644
index 94cf7a854..000000000
--- a/problems/robot-bounded-in-circle/robot_bounded_in_circle_test.go
+++ /dev/null
@@ -1,47 +0,0 @@
-package problem1041
-
-import "testing"
-
-type testType struct {
- in string
- want bool
-}
-
-func TestIsRobotBounded(t *testing.T) {
- tests := [...]testType{
- {
- in: "GGLLGG",
- want: true,
- },
- {
- in: "GG",
- want: false,
- },
- {
- in: "GL",
- want: true,
- },
- {
- in: "GGLLGGGGRRGG",
- want: true,
- },
- {
- in: "GGRRGG",
- want: true,
- },
- {
- in: "GLRLLGLL",
- want: true,
- },
- {
- in: "GLGRGLGLGLGL",
- want: false,
- },
- }
- for _, tt := range tests {
- got := isRobotBounded(tt.in)
- if got != tt.want {
- t.Fatalf("in: %v, got: %v, want: %v", tt.in, got, tt.want)
- }
- }
-}
diff --git a/problems/robot-return-to-origin/README.md b/problems/robot-return-to-origin/README.md
deleted file mode 100644
index c52e00567..000000000
--- a/problems/robot-return-to-origin/README.md
+++ /dev/null
@@ -1,66 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../coin-path "Coin Path")
-
-[Next >](../find-k-closest-elements "Find K Closest Elements")
-
-## [657. Robot Return to Origin (Easy)](https://leetcode.com/problems/robot-return-to-origin "机器人能否返回原点")
-
-
There is a robot starting at the position (0, 0), the origin, on a 2D plane. Given a sequence of its moves, judge if this robot ends up at (0, 0) after it completes its moves.
-
-
You are given a string moves that represents the move sequence of the robot where moves[i] represents its ith move. Valid moves are 'R' (right), 'L' (left), 'U' (up), and 'D' (down).
-
-
Return true if the robot returns to the origin after it finishes all of its moves, or false otherwise.
-
-
Note: The way that the robot is "facing" is irrelevant. 'R' will always make the robot move to the right once, 'L' will always make it move left, etc. Also, assume that the magnitude of the robot's movement is the same for each move.
-
-
-
Example 1:
-
-
-Input: moves = "UD"
-Output: true
-Explanation: The robot moves up once, and then down once. All moves have the same magnitude, so it ended up at the origin where it started. Therefore, we return true.
-
-
-
Example 2:
-
-
-Input: moves = "LL"
-Output: false
-Explanation: The robot moves left twice. It ends up two "moves" to the left of the origin. We return false because it is not at the origin at the end of its moves.
-
-
-
Example 3:
-
-
-Input: moves = "RRDD"
-Output: false
-
-
-
Example 4:
-
-
-Input: moves = "LDRRLRUULR"
-Output: false
-
-
-
-
Constraints:
-
-
-
1 <= moves.length <= 2 * 104
-
moves only contains the characters 'U', 'D', 'L' and 'R'.
Given a robot cleaner in a room modeled as a grid.
-
-
Each cell in the grid can be empty or blocked.
-
-
The robot cleaner with 4 given APIs can move forward, turn left or turn right. Each turn it made is 90 degrees.
-
-
When it tries to move into a blocked cell, its bumper sensor detects the obstacle and it stays on the current cell.
-
-
Design an algorithm to clean the entire room using only the 4 given APIs shown below.
-
-
-interface Robot {
- // returns true if next cell is open and robot moves into the cell.
- // returns false if next cell is obstacle and robot stays on the current cell.
- boolean move();
-
- // Robot will stay on the same cell after calling turnLeft/turnRight.
- // Each turn will be 90 degrees.
- void turnLeft();
- void turnRight();
-
- // Clean the current cell.
- void clean();
-}
-
-
-
Example:
-
-
Input:
-room = [
- [1,1,1,1,1,0,1,1],
- [1,1,1,1,1,0,1,1],
- [1,0,1,1,1,1,1,1],
- [0,0,0,1,0,0,0,0],
- [1,1,1,1,1,1,1,1]
-],
-row = 1,
-col = 3
-
-Explanation:
-All grids in the room are marked by either 0 or 1.
-0 means the cell is blocked, while 1 means the cell is accessible.
-The robot initially starts at the position of row=1, col=3.
-From the top left corner, its position is one row below and three columns right.
-
-
-
Notes:
-
-
-
The input is only given to initialize the room and the robot's position internally. You must solve this problem "blindfolded". In other words, you must control the robot using only the mentioned 4 APIs, without knowing the room layout and the initial robot's position.
-
The robot's initial position will always be in an accessible cell.
-
The initial direction of the robot will be facing up.
-
All accessible cells are connected, which means the all cells marked as 1 will be accessible by the robot.
-
Assume all four edges of the grid are all surrounded by wall.
-
-
-### Related Topics
- [[Backtracking](../../tag/backtracking/README.md)]
- [[Interactive](../../tag/interactive/README.md)]
-
-### Similar Questions
- 1. [Walls and Gates](../walls-and-gates) (Medium)
- 1. [Shortest Path in a Hidden Grid](../shortest-path-in-a-hidden-grid) (Medium)
- 1. [Minimum Path Cost in a Hidden Grid](../minimum-path-cost-in-a-hidden-grid) (Medium)
diff --git a/problems/robot-room-cleaner/robot_room_cleaner.go b/problems/robot-room-cleaner/robot_room_cleaner.go
deleted file mode 100644
index c6b621c9d..000000000
--- a/problems/robot-room-cleaner/robot_room_cleaner.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem489
diff --git a/problems/robot-room-cleaner/robot_room_cleaner_test.go b/problems/robot-room-cleaner/robot_room_cleaner_test.go
deleted file mode 100644
index c6b621c9d..000000000
--- a/problems/robot-room-cleaner/robot_room_cleaner_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem489
diff --git a/problems/roman-to-integer/README.md b/problems/roman-to-integer/README.md
deleted file mode 100644
index 16486d247..000000000
--- a/problems/roman-to-integer/README.md
+++ /dev/null
@@ -1,97 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../integer-to-roman "Integer to Roman")
-
-[Next >](../longest-common-prefix "Longest Common Prefix")
-
-## [13. Roman to Integer (Easy)](https://leetcode.com/problems/roman-to-integer "罗马数字转整数")
-
-
Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M.
For example, 2 is written as II in Roman numeral, just two one's added together. 12 is written as XII, which is simply X + II. The number 27 is written as XXVII, which is XX + V + II.
-
-
Roman numerals are usually written largest to smallest from left to right. However, the numeral for four is not IIII. Instead, the number four is written as IV. Because the one is before the five we subtract it making four. The same principle applies to the number nine, which is written as IX. There are six instances where subtraction is used:
-
-
-
I can be placed before V (5) and X (10) to make 4 and 9.
-
X can be placed before L (50) and C (100) to make 40 and 90.
-
C can be placed before D (500) and M (1000) to make 400 and 900.
-
-
-
Given a roman numeral, convert it to an integer.
-
-
-
Example 1:
-
-
-Input: s = "III"
-Output: 3
-
-
-
Example 2:
-
-
-Input: s = "IV"
-Output: 4
-
-
-
Example 3:
-
-
-Input: s = "IX"
-Output: 9
-
-
-
Example 4:
-
-
-Input: s = "LVIII"
-Output: 58
-Explanation: L = 50, V= 5, III = 3.
-
-
-
Example 5:
-
-
-Input: s = "MCMXCIV"
-Output: 1994
-Explanation: M = 1000, CM = 900, XC = 90 and IV = 4.
-
-
-
-
Constraints:
-
-
-
1 <= s.length <= 15
-
s contains only the characters ('I', 'V', 'X', 'L', 'C', 'D', 'M').
-
It is guaranteed that s is a valid roman numeral in the range [1, 3999].
-
-
-### Related Topics
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Math](../../tag/math/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Similar Questions
- 1. [Integer to Roman](../integer-to-roman) (Medium)
-
-### Hints
-
-Hint 1
-Problem is simpler to solve by working the string from back to front and using a map.
-
diff --git a/problems/roman-to-integer/roman_to_integer.go b/problems/roman-to-integer/roman_to_integer.go
deleted file mode 100644
index a5b020f29..000000000
--- a/problems/roman-to-integer/roman_to_integer.go
+++ /dev/null
@@ -1,25 +0,0 @@
-package problem13
-
-func romanToInt(s string) int {
- m := map[byte]int{
- 'I': 1,
- 'V': 5,
- 'X': 10,
- 'L': 50,
- 'C': 100,
- 'D': 500,
- 'M': 1000,
- }
- ans, p := 0, 0
- for i := 0; i < len(s); i++ {
- k := s[i]
- if v, ok := m[k]; ok {
- if v > p {
- ans -= p * 2
- }
- ans += v
- p = v
- }
- }
- return ans
-}
diff --git a/problems/roman-to-integer/roman_to_integer_test.go b/problems/roman-to-integer/roman_to_integer_test.go
deleted file mode 100644
index 5ccfa1daf..000000000
--- a/problems/roman-to-integer/roman_to_integer_test.go
+++ /dev/null
@@ -1,20 +0,0 @@
-package problem13
-
-import "testing"
-
-func TestRomanToInt(t *testing.T) {
- tests := map[string]int{
- "III": 3,
- "IV": 4,
- "IX": 9,
- "LVIII": 58,
- "MCMXCIV": 1994,
- }
-
- for in, want := range tests {
- got := romanToInt(in)
- if got != want {
- t.Fatalf("in: %v, got: %v, want: %v", in, got, want)
- }
- }
-}
diff --git a/problems/rotate-array/README.md b/problems/rotate-array/README.md
deleted file mode 100644
index 9b80793b2..000000000
--- a/problems/rotate-array/README.md
+++ /dev/null
@@ -1,83 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../best-time-to-buy-and-sell-stock-iv "Best Time to Buy and Sell Stock IV")
-
-[Next >](../reverse-bits "Reverse Bits")
-
-## [189. Rotate Array (Medium)](https://leetcode.com/problems/rotate-array "轮转数组")
-
-
Given an array, rotate the array to the right by k steps, where k is non-negative.
-
-
-
Example 1:
-
-
-Input: nums = [1,2,3,4,5,6,7], k = 3
-Output: [5,6,7,1,2,3,4]
-Explanation:
-rotate 1 steps to the right: [7,1,2,3,4,5,6]
-rotate 2 steps to the right: [6,7,1,2,3,4,5]
-rotate 3 steps to the right: [5,6,7,1,2,3,4]
-
-
-
Example 2:
-
-
-Input: nums = [-1,-100,3,99], k = 2
-Output: [3,99,-1,-100]
-Explanation:
-rotate 1 steps to the right: [99,-1,-100,3]
-rotate 2 steps to the right: [3,99,-1,-100]
-
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 105
-
-231 <= nums[i] <= 231 - 1
-
0 <= k <= 105
-
-
-
-
Follow up:
-
-
-
Try to come up with as many solutions as you can. There are at least three different ways to solve this problem.
-
Could you do it in-place with O(1) extra space?
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Math](../../tag/math/README.md)]
- [[Two Pointers](../../tag/two-pointers/README.md)]
-
-### Similar Questions
- 1. [Rotate List](../rotate-list) (Medium)
- 1. [Reverse Words in a String II](../reverse-words-in-a-string-ii) (Medium)
-
-### Hints
-
-Hint 1
-The easiest solution would use additional memory and that is perfectly fine.
-
-
-
-Hint 2
-The actual trick comes when trying to solve this problem without using any additional memory. This means you need to use the original array somehow to move the elements around. Now, we can place each element in its original location and shift all the elements around it to adjust as that would be too costly and most likely will time out on larger input arrays.
-
-
-
-Hint 3
-One line of thought is based on reversing the array (or parts of it) to obtain the desired result. Think about how reversal might potentially help us out by using an example.
-
-
-
-Hint 4
-The other line of thought is a tad bit complicated but essentially it builds on the idea of placing each element in its original position while keeping track of the element originally in that position. Basically, at every step, we place an element in its rightful position and keep track of the element already there or the one being overwritten in an additional variable. We can't do this in one linear pass and the idea here is based on cyclic-dependencies between elements.
-
diff --git a/problems/rotate-array/rotate_array.go b/problems/rotate-array/rotate_array.go
deleted file mode 100644
index b468bdaba..000000000
--- a/problems/rotate-array/rotate_array.go
+++ /dev/null
@@ -1,14 +0,0 @@
-package problem189
-
-func rotate(nums []int, k int) {
- l := len(nums)
- k %= l
- s := make([]int, l)
- copy(s, nums)
- for i, v := range s[l-k:] {
- nums[i] = v
- }
- for i, v := range s[:l-k] {
- nums[k+i] = v
- }
-}
diff --git a/problems/rotate-array/rotate_array_test.go b/problems/rotate-array/rotate_array_test.go
deleted file mode 100644
index 98283b6bc..000000000
--- a/problems/rotate-array/rotate_array_test.go
+++ /dev/null
@@ -1,41 +0,0 @@
-package problem189
-
-import (
- "reflect"
- "testing"
-)
-
-type castType struct {
- nums []int
- k int
- want []int
-}
-
-func TestRotate(t *testing.T) {
- tests := [...]castType{
- {
- nums: []int{1, 2, 3, 4, 5, 6, 7},
- k: 3,
- want: []int{5, 6, 7, 1, 2, 3, 4},
- },
- {
- nums: []int{-1, -100, 3, 99},
- k: 2,
- want: []int{3, 99, -1, -100},
- },
- {
- nums: []int{-1},
- k: 2,
- want: []int{-1},
- },
- }
-
- for _, tt := range tests {
- got := make([]int, len(tt.nums))
- copy(got, tt.nums)
- rotate(got, tt.k)
- if !reflect.DeepEqual(got, tt.want) {
- t.Fatalf("in: %v %v, got: %v, want: %v", tt.nums, tt.k, got, tt.want)
- }
- }
-}
diff --git a/problems/rotate-function/README.md b/problems/rotate-function/README.md
deleted file mode 100644
index 1dd719a63..000000000
--- a/problems/rotate-function/README.md
+++ /dev/null
@@ -1,58 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../longest-substring-with-at-least-k-repeating-characters "Longest Substring with At Least K Repeating Characters")
-
-[Next >](../integer-replacement "Integer Replacement")
-
-## [396. Rotate Function (Medium)](https://leetcode.com/problems/rotate-function "旋转函数")
-
-
You are given an integer array nums of length n.
-
-
Assume arrk to be an array obtained by rotating nums by k positions clock-wise. We define the rotation functionF on nums as follow:
You are given an n x n 2D matrix representing an image, rotate the image by 90 degrees (clockwise).
-
-
You have to rotate the image in-place, which means you have to modify the input 2D matrix directly. DO NOT allocate another 2D matrix and do the rotation.
An integer x is a good if after rotating each digit individually by 180 degrees, we get a valid number that is different from x. Each digit must be rotated - we cannot choose to leave it alone.
-
-
A number is valid if each digit remains a digit after rotation. For example:
-
-
-
0, 1, and 8 rotate to themselves,
-
2 and 5 rotate to each other (in this case they are rotated in a different direction, in other words, 2 or 5 gets mirrored),
-
6 and 9 rotate to each other, and
-
the rest of the numbers do not rotate to any other number and become invalid.
-
-
-
Given an integer n, return the number of good integers in the range [1, n].
-
-
-
Example 1:
-
-
-Input: n = 10
-Output: 4
-Explanation: There are four good numbers in the range [1, 10] : 2, 5, 6, 9.
-Note that 1 and 10 are not good numbers, since they remain unchanged after rotating.
-
You are given an m x n matrix of characters box representing a side-view of a box. Each cell of the box is one of the following:
-
-
-
A stone '#'
-
A stationary obstacle '*'
-
Empty '.'
-
-
-
The box is rotated 90 degrees clockwise, causing some of the stones to fall due to gravity. Each stone falls down until it lands on an obstacle, another stone, or the bottom of the box. Gravity does not affect the obstacles' positions, and the inertia from the box's rotation does not affect the stones' horizontal positions.
-
-
It is guaranteed that each stone in box rests on an obstacle, another stone, or the bottom of the box.
-
-
Return an n x m matrix representing the box after the rotation described above.
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Two Pointers](../../tag/two-pointers/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
-
-### Hints
-
-Hint 1
-Rotate the box using the relation rotatedBox[i][j] = box[m - 1 - j][i].
-
-
-
-Hint 2
-Start iterating from the bottom of the box and for each empty cell check if there is any stone above it with no obstacles between them.
-
diff --git a/problems/rotting-oranges/README.md b/problems/rotting-oranges/README.md
deleted file mode 100644
index d1b38db31..000000000
--- a/problems/rotting-oranges/README.md
+++ /dev/null
@@ -1,66 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../cousins-in-binary-tree "Cousins in Binary Tree")
-
-[Next >](../minimum-number-of-k-consecutive-bit-flips "Minimum Number of K Consecutive Bit Flips")
-
-## [994. Rotting Oranges (Medium)](https://leetcode.com/problems/rotting-oranges "腐烂的橘子")
-
-
You are given an m x ngrid where each cell can have one of three values:
-
-
-
0 representing an empty cell,
-
1 representing a fresh orange, or
-
2 representing a rotten orange.
-
-
-
Every minute, any fresh orange that is 4-directionally adjacent to a rotten orange becomes rotten.
-
-
Return the minimum number of minutes that must elapse until no cell has a fresh orange. If this is impossible, return-1.
-Input: grid = [[2,1,1],[0,1,1],[1,0,1]]
-Output: -1
-Explanation: The orange in the bottom left corner (row 2, column 0) is never rotten, because rotting only happens 4-directionally.
-
-
-
Example 3:
-
-
-Input: grid = [[0,2]]
-Output: 0
-Explanation: Since there are already no fresh oranges at minute 0, the answer is just 0.
-
-
-
-
Constraints:
-
-
-
m == grid.length
-
n == grid[i].length
-
1 <= m, n <= 10
-
grid[i][j] is 0, 1, or 2.
-
-
-### Related Topics
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
-
-### Similar Questions
- 1. [Walls and Gates](../walls-and-gates) (Medium)
diff --git a/problems/rotting-oranges/rotting_oranges.go b/problems/rotting-oranges/rotting_oranges.go
deleted file mode 100644
index c534aa233..000000000
--- a/problems/rotting-oranges/rotting_oranges.go
+++ /dev/null
@@ -1,35 +0,0 @@
-package problem994
-
-func orangesRotting(grid [][]int) int {
- r, c, minutes := len(grid), len(grid[0]), 0
- freshCount, rottens := 0, make([]int, 0)
- for i := 0; i < r; i++ {
- for j := 0; j < c; j++ {
- if grid[i][j] == 1 {
- freshCount++
- } else if grid[i][j] == 2 {
- rottens = append(rottens, i*c+j)
- }
- }
- }
- for l := len(rottens); l > 0 && freshCount > 0; l = len(rottens) {
- for _, p := range rottens {
- for k := 0; k < 4; k++ {
- i, j := p/c+k-2, p%c+k-1
- if k == 0 {
- i += 2
- } else if k == 3 {
- j -= 2
- }
- if 0 <= i && i < r && 0 <= j && j < c && grid[i][j] == 1 {
- grid[i][j], freshCount, rottens = 2, freshCount-1, append(rottens, i*c+j)
- }
- }
- }
- minutes, rottens = minutes+1, rottens[l:]
- }
- if freshCount > 0 {
- return -1
- }
- return minutes
-}
diff --git a/problems/rotting-oranges/rotting_oranges_test.go b/problems/rotting-oranges/rotting_oranges_test.go
deleted file mode 100644
index 9ba440447..000000000
--- a/problems/rotting-oranges/rotting_oranges_test.go
+++ /dev/null
@@ -1,47 +0,0 @@
-package problem994
-
-import "testing"
-
-type testType struct {
- in [][]int
- want int
-}
-
-func TestOrangesRotting(t *testing.T) {
- tests := [...]testType{
- {
- in: [][]int{
- {2, 1, 1},
- {1, 1, 0},
- {0, 1, 1},
- },
- want: 4,
- },
- {
- in: [][]int{
- {2, 1, 1},
- {0, 1, 1},
- {1, 0, 1},
- },
- want: -1,
- },
- {
- in: [][]int{
- {0, 2},
- },
- want: 0,
- },
- {
- in: [][]int{
- {1, 2},
- },
- want: 1,
- },
- }
- for _, tt := range tests {
- got := orangesRotting(tt.in)
- if got != tt.want {
- t.Fatalf("in: %v, got: %v, want: %v", tt.in, got, tt.want)
- }
- }
-}
diff --git a/problems/running-sum-of-1d-array/README.md b/problems/running-sum-of-1d-array/README.md
deleted file mode 100644
index 00ceb6f78..000000000
--- a/problems/running-sum-of-1d-array/README.md
+++ /dev/null
@@ -1,56 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../sales-by-day-of-the-week "Sales by Day of the Week")
-
-[Next >](../least-number-of-unique-integers-after-k-removals "Least Number of Unique Integers after K Removals")
-
-## [1480. Running Sum of 1d Array (Easy)](https://leetcode.com/problems/running-sum-of-1d-array "一维数组的动态和")
-
-
Given an array nums. We define a running sum of an array as runningSum[i] = sum(nums[0]…nums[i]).
-
-
Return the running sum of nums.
-
-
-
Example 1:
-
-
-Input: nums = [1,2,3,4]
-Output: [1,3,6,10]
-Explanation: Running sum is obtained as follows: [1, 1+2, 1+2+3, 1+2+3+4].
-
-
Example 2:
-
-
-Input: nums = [1,1,1,1,1]
-Output: [1,2,3,4,5]
-Explanation: Running sum is obtained as follows: [1, 1+1, 1+1+1, 1+1+1+1, 1+1+1+1+1].
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Prefix Sum](../../tag/prefix-sum/README.md)]
-
-### Hints
-
-Hint 1
-Think about how we can calculate the i-th number in the running sum from the (i-1)-th number.
-
diff --git a/problems/running-total-for-different-genders/README.md b/problems/running-total-for-different-genders/README.md
deleted file mode 100644
index 107500405..000000000
--- a/problems/running-total-for-different-genders/README.md
+++ /dev/null
@@ -1,78 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../verbal-arithmetic-puzzle "Verbal Arithmetic Puzzle")
-
-[Next >](../decrypt-string-from-alphabet-to-integer-mapping "Decrypt String from Alphabet to Integer Mapping")
-
-## [1308. Running Total for Different Genders (Medium)](https://leetcode.com/problems/running-total-for-different-genders "不同性别每日分数总计")
-
-
Table: Scores
-
-+---------------+---------+
-| Column Name | Type |
-+---------------+---------+
-| player_name | varchar |
-| gender | varchar |
-| day | date |
-| score_points | int |
-+---------------+---------+
-(gender, day) is the primary key for this table.
-A competition is held between females team and males team.
-Each row of this table indicates that a player_name and with gender has scored score_point in someday.
-Gender is 'F' if the player is in females team and 'M' if the player is in males team.
-
-
-Write an SQL query to find the total score for each gender at each day.
-
-Order the result table by gender and day
-
-The query result format is in the following example:
-
-Scores table:
-+-------------+--------+------------+--------------+
-| player_name | gender | day | score_points |
-+-------------+--------+------------+--------------+
-| Aron | F | 2020-01-01 | 17 |
-| Alice | F | 2020-01-07 | 23 |
-| Bajrang | M | 2020-01-07 | 7 |
-| Khali | M | 2019-12-25 | 11 |
-| Slaman | M | 2019-12-30 | 13 |
-| Joe | M | 2019-12-31 | 3 |
-| Jose | M | 2019-12-18 | 2 |
-| Priya | F | 2019-12-31 | 23 |
-| Priyanka | F | 2019-12-30 | 17 |
-+-------------+--------+------------+--------------+
-Result table:
-+--------+------------+-------+
-| gender | day | total |
-+--------+------------+-------+
-| F | 2019-12-30 | 17 |
-| F | 2019-12-31 | 40 |
-| F | 2020-01-01 | 57 |
-| F | 2020-01-07 | 80 |
-| M | 2019-12-18 | 2 |
-| M | 2019-12-25 | 13 |
-| M | 2019-12-30 | 26 |
-| M | 2019-12-31 | 29 |
-| M | 2020-01-07 | 36 |
-+--------+------------+-------+
-For females team:
-First day is 2019-12-30, Priyanka scored 17 points and the total score for the team is 17.
-Second day is 2019-12-31, Priya scored 23 points and the total score for the team is 40.
-Third day is 2020-01-01, Aron scored 17 points and the total score for the team is 57.
-Fourth day is 2020-01-07, Alice scored 23 points and the total score for the team is 80.
-For males team:
-First day is 2019-12-18, Jose scored 2 points and the total score for the team is 2.
-Second day is 2019-12-25, Khali scored 11 points and the total score for the team is 13.
-Third day is 2019-12-30, Slaman scored 13 points and the total score for the team is 26.
-Fourth day is 2019-12-31, Joe scored 3 points and the total score for the team is 29.
-Fifth day is 2020-01-07, Bajrang scored 7 points and the total score for the team is 36.
-
You are given a 2D array of integers envelopes where envelopes[i] = [wi, hi] represents the width and the height of an envelope.
-
-
One envelope can fit into another if and only if both the width and height of one envelope are greater than the other envelope's width and height.
-
-
Return the maximum number of envelopes you can Russian doll (i.e., put one inside the other).
-
-
Note: You cannot rotate an envelope.
-
-
-
Example 1:
-
-
-Input: envelopes = [[5,4],[6,4],[6,7],[2,3]]
-Output: 3
-Explanation: The maximum number of envelopes you can Russian doll is 3 ([2,3] => [5,4] => [6,7]).
-
-+--------------+---------+
-| Column Name | Type |
-+--------------+---------+
-| product_id | int |
-| product_name | varchar |
-| unit_price | int |
-+--------------+---------+
-product_id is the primary key of this table.
-
-
-
Table: Sales
-
-
-+-------------+---------+
-| Column Name | Type |
-+-------------+---------+
-| seller_id | int |
-| product_id | int |
-| buyer_id | int |
-| sale_date | date |
-| quantity | int |
-| price | int |
-+------ ------+---------+
-This table has no primary key, it can have repeated rows.
-product_id is a foreign key to Product table.
-
-
-
-
-
Write an SQL query that reports the best seller by total sales price, If there is a tie, report them all.
-
-
The query result format is in the following example:
-+--------------+---------+
-| Column Name | Type |
-+--------------+---------+
-| product_id | int |
-| product_name | varchar |
-| unit_price | int |
-+--------------+---------+
-product_id is the primary key of this table.
-
-
-
Table: Sales
-
-
-+-------------+---------+
-| Column Name | Type |
-+-------------+---------+
-| seller_id | int |
-| product_id | int |
-| buyer_id | int |
-| sale_date | date |
-| quantity | int |
-| price | int |
-+------ ------+---------+
-This table has no primary key, it can have repeated rows.
-product_id is a foreign key to Product table.
-
-
-
-
-
Write an SQL query that reports the buyers who have bought S8 but not iPhone. Note that S8 and iPhone are products present in the Product table.
-
-
The query result format is in the following example:
-+--------------+---------+
-| Column Name | Type |
-+--------------+---------+
-| product_id | int |
-| product_name | varchar |
-| unit_price | int |
-+--------------+---------+
-product_id is the primary key of this table.
-
-
-
Table: Sales
-
-
-+-------------+---------+
-| Column Name | Type |
-+-------------+---------+
-| seller_id | int |
-| product_id | int |
-| buyer_id | int |
-| sale_date | date |
-| quantity | int |
-| price | int |
-+------ ------+---------+
-This table has no primary key, it can have repeated rows.
-product_id is a foreign key to Product table.
-
-
-
-
-
Write an SQL query that reports the products that were only sold in spring 2019. That is, between 2019-01-01 and 2019-03-31 inclusive.
-
-
The query result format is in the following example:
-The table salesperson holds the salesperson information. Every salesperson has a sales_id and a name.
-
-
Table: company
-
-
-+---------+--------+------------+
-| com_id | name | city |
-+---------+--------+------------+
-| 1 | RED | Boston |
-| 2 | ORANGE | New York |
-| 3 | YELLOW | Boston |
-| 4 | GREEN | Austin |
-+---------+--------+------------+
-
-The table company holds the company information. Every company has a com_id and a name.
-
-
-The table orders holds the sales record information, salesperson and customer company are represented by sales_id and com_id.
-
-
output
-
-
-+------+
-| name |
-+------+
-| Amy |
-| Mark |
-| Alex |
-+------+
-
-
-
Explanation
-
-
According to order '3' and '4' in table orders, it is easy to tell only salesperson 'John' and 'Alex' have sales to company 'RED',
-so we need to output all the other names in table salesperson.
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
-
-### Hints
-
-Hint 1
-You need to query who sold to company 'RED' first, then output the sales person who is not in the first query result.
-
diff --git a/problems/sales-person/mysql_schemas.sql b/problems/sales-person/mysql_schemas.sql
deleted file mode 100644
index b583e9691..000000000
--- a/problems/sales-person/mysql_schemas.sql
+++ /dev/null
@@ -1,19 +0,0 @@
-Create table If Not Exists SalesPerson (sales_id int, name varchar(255), salary int, commission_rate int, hire_date date);
-Create table If Not Exists Company (com_id int, name varchar(255), city varchar(255));
-Create table If Not Exists Orders (order_id int, order_date date, com_id int, sales_id int, amount int);
-Truncate table SalesPerson;
-insert into SalesPerson (sales_id, name, salary, commission_rate, hire_date) values ('1', 'John', '100000', '6', '4/1/2006');
-insert into SalesPerson (sales_id, name, salary, commission_rate, hire_date) values ('2', 'Amy', '12000', '5', '5/1/2010');
-insert into SalesPerson (sales_id, name, salary, commission_rate, hire_date) values ('3', 'Mark', '65000', '12', '12/25/2008');
-insert into SalesPerson (sales_id, name, salary, commission_rate, hire_date) values ('4', 'Pam', '25000', '25', '1/1/2005');
-insert into SalesPerson (sales_id, name, salary, commission_rate, hire_date) values ('5', 'Alex', '5000', '10', '2/3/2007');
-Truncate table Company;
-insert into Company (com_id, name, city) values ('1', 'RED', 'Boston');
-insert into Company (com_id, name, city) values ('2', 'ORANGE', 'New York');
-insert into Company (com_id, name, city) values ('3', 'YELLOW', 'Boston');
-insert into Company (com_id, name, city) values ('4', 'GREEN', 'Austin');
-Truncate table Orders;
-insert into Orders (order_id, order_date, com_id, sales_id, amount) values ('1', '1/1/2014', '3', '4', '10000');
-insert into Orders (order_id, order_date, com_id, sales_id, amount) values ('2', '2/1/2014', '4', '5', '5000');
-insert into Orders (order_id, order_date, com_id, sales_id, amount) values ('3', '3/1/2014', '1', '1', '50000');
-insert into Orders (order_id, order_date, com_id, sales_id, amount) values ('4', '4/1/2014', '1', '4', '25000');
diff --git a/problems/sales-person/sales_person.sql b/problems/sales-person/sales_person.sql
deleted file mode 100644
index bae62cf19..000000000
--- a/problems/sales-person/sales_person.sql
+++ /dev/null
@@ -1 +0,0 @@
-# Write your MySQL query statement below
diff --git a/problems/same-tree/README.md b/problems/same-tree/README.md
deleted file mode 100644
index 9f6006314..000000000
--- a/problems/same-tree/README.md
+++ /dev/null
@@ -1,52 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../recover-binary-search-tree "Recover Binary Search Tree")
-
-[Next >](../symmetric-tree "Symmetric Tree")
-
-## [100. Same Tree (Easy)](https://leetcode.com/problems/same-tree "相同的树")
-
-
Given the roots of two binary trees p and q, write a function to check if they are the same or not.
-
-
Two binary trees are considered the same if they are structurally identical, and the nodes have the same value.
-
-
-
Example 1:
-
-
-Input: p = [1,2,3], q = [1,2,3]
-Output: true
-
-
-
Example 2:
-
-
-Input: p = [1,2], q = [1,null,2]
-Output: false
-
-
-
Example 3:
-
-
-Input: p = [1,2,1], q = [1,1,2]
-Output: false
-
-
-
-
Constraints:
-
-
-
The number of nodes in both trees is in the range [0, 100].
You are given an array of strings equations that represent relationships between variables where each string equations[i] is of length 4 and takes one of two different forms: "xi==yi" or "xi!=yi".Here, xi and yi are lowercase letters (not necessarily different) that represent one-letter variable names.
-
-
Return true if it is possible to assign integers to variable names so as to satisfy all the given equations, or false otherwise.
-
-
-
Example 1:
-
-
-Input: equations = ["a==b","b!=a"]
-Output: false
-Explanation: If we assign say, a = 1 and b = 1, then the first equation is satisfied, but not the second.
-There is no way to assign the variables to satisfy both equations.
-
-
-
Example 2:
-
-
-Input: equations = ["b==a","a==b"]
-Output: true
-Explanation: We could assign a = 1 and b = 1 to satisfy both equations.
-
We can scramble a string s to get a string t using the following algorithm:
-
-
-
If the length of the string is 1, stop.
-
If the length of the string is > 1, do the following:
-
-
Split the string into two non-empty substrings at a random index, i.e., if the string is s, divide it to x and y where s = x + y.
-
Randomly decide to swap the two substrings or to keep them in the same order. i.e., after this step, s may become s = x + y or s = y + x.
-
Apply step 1 recursively on each of the two substrings x and y.
-
-
-
-
-
Given two strings s1 and s2 of the same length, return true if s2 is a scrambled string of s1, otherwise, return false.
-
-
-
Example 1:
-
-
-Input: s1 = "great", s2 = "rgeat"
-Output: true
-Explanation: One possible scenario applied on s1 is:
-"great" --> "gr/eat" // divide at random index.
-"gr/eat" --> "gr/eat" // random decision is not to swap the two substrings and keep them in order.
-"gr/eat" --> "g/r / e/at" // apply the same algorithm recursively on both substrings. divide at ranom index each of them.
-"g/r / e/at" --> "r/g / e/at" // random decision was to swap the first substring and to keep the second substring in the same order.
-"r/g / e/at" --> "r/g / e/ a/t" // again apply the algorithm recursively, divide "at" to "a/t".
-"r/g / e/ a/t" --> "r/g / e/ a/t" // random decision is to keep both substrings in the same order.
-The algorithm stops now and the result string is "rgeat" which is s2.
-As there is one possible scenario that led s1 to be scrambled to s2, we return true.
-
You are given the root of a binary search tree (BST) and an integer val.
-
-
Find the node in the BST that the node's value equals val and return the subtree rooted with that node. If such a node does not exist, return null.
-
-
-
Example 1:
-
-
-Input: root = [4,2,7,1,3], val = 2
-Output: [2,1,3]
-
-
-
Example 2:
-
-
-Input: root = [4,2,7,1,3], val = 5
-Output: []
-
-
-
-
Constraints:
-
-
-
The number of nodes in the tree is in the range [1, 5000].
-
1 <= Node.val <= 107
-
root is a binary search tree.
-
1 <= val <= 107
-
-
-### Related Topics
- [[Tree](../../tag/tree/README.md)]
- [[Binary Search Tree](../../tag/binary-search-tree/README.md)]
- [[Binary Tree](../../tag/binary-tree/README.md)]
-
-### Similar Questions
- 1. [Closest Binary Search Tree Value](../closest-binary-search-tree-value) (Easy)
- 1. [Insert into a Binary Search Tree](../insert-into-a-binary-search-tree) (Medium)
diff --git a/problems/search-in-a-binary-search-tree/search_in_a_binary_search_tree.go b/problems/search-in-a-binary-search-tree/search_in_a_binary_search_tree.go
deleted file mode 100644
index feb9c531c..000000000
--- a/problems/search-in-a-binary-search-tree/search_in_a_binary_search_tree.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem700
diff --git a/problems/search-in-a-binary-search-tree/search_in_a_binary_search_tree_test.go b/problems/search-in-a-binary-search-tree/search_in_a_binary_search_tree_test.go
deleted file mode 100644
index feb9c531c..000000000
--- a/problems/search-in-a-binary-search-tree/search_in_a_binary_search_tree_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem700
diff --git a/problems/search-in-a-sorted-array-of-unknown-size/README.md b/problems/search-in-a-sorted-array-of-unknown-size/README.md
deleted file mode 100644
index 871493340..000000000
--- a/problems/search-in-a-sorted-array-of-unknown-size/README.md
+++ /dev/null
@@ -1,48 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../insert-into-a-binary-search-tree "Insert into a Binary Search Tree")
-
-[Next >](../kth-largest-element-in-a-stream "Kth Largest Element in a Stream")
-
-## [702. Search in a Sorted Array of Unknown Size (Medium)](https://leetcode.com/problems/search-in-a-sorted-array-of-unknown-size "搜索长度未知的有序数组")
-
-
Given an integer array sorted in ascending order, write a function to search target in nums. If target exists, then return its index, otherwise return -1. However, the array size is unknown to you. You may only access the array using an ArrayReader interface, where ArrayReader.get(k) returns the element of the array at index k (0-indexed).
-
-
You may assume all integers in the array are less than 10000, and if you access the array out of bounds, ArrayReader.get will return 2147483647.
-
-
-
-
Example 1:
-
-
Input:array = [-1,0,3,5,9,12], target = 9
-Output: 4
-Explanation: 9 exists in nums and its index is 4
-
-
-
Example 2:
-
-
Input:array = [-1,0,3,5,9,12], target = 2
-Output: -1
-Explanation: 2 does not exist in nums so return -1
-
-
-
-
Note:
-
-
-
You may assume that all elements in the array are unique.
-
The value of each element in the array will be in the range [-9999, 9999].
There is an integer array nums sorted in non-decreasing order (not necessarily with distinct values).
-
-
Before being passed to your function, nums is rotated at an unknown pivot index k (0 <= k < nums.length) such that the resulting array is [nums[k], nums[k+1], ..., nums[n-1], nums[0], nums[1], ..., nums[k-1]] (0-indexed). For example, [0,1,2,4,4,4,5,6,6,7] might be rotated at pivot index 5 and become [4,5,6,6,7,0,1,2,4,4].
-
-
Given the array numsafter the rotation and an integer target, return true if target is in nums, or false if it is not in nums.
-
-
You must decrease the overall operation steps as much as possible.
Follow up: This problem is similar to Search in Rotated Sorted Array, but nums may contain duplicates. Would this affect the runtime complexity? How and why?
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
-
-### Similar Questions
- 1. [Search in Rotated Sorted Array](../search-in-rotated-sorted-array) (Medium)
diff --git a/problems/search-in-rotated-sorted-array-ii/search_in_rotated_sorted_array_ii.go b/problems/search-in-rotated-sorted-array-ii/search_in_rotated_sorted_array_ii.go
deleted file mode 100644
index f2c28c443..000000000
--- a/problems/search-in-rotated-sorted-array-ii/search_in_rotated_sorted_array_ii.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem81
diff --git a/problems/search-in-rotated-sorted-array-ii/search_in_rotated_sorted_array_ii_test.go b/problems/search-in-rotated-sorted-array-ii/search_in_rotated_sorted_array_ii_test.go
deleted file mode 100644
index f2c28c443..000000000
--- a/problems/search-in-rotated-sorted-array-ii/search_in_rotated_sorted_array_ii_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem81
diff --git a/problems/search-in-rotated-sorted-array/README.md b/problems/search-in-rotated-sorted-array/README.md
deleted file mode 100644
index 1fe16bcb6..000000000
--- a/problems/search-in-rotated-sorted-array/README.md
+++ /dev/null
@@ -1,50 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../longest-valid-parentheses "Longest Valid Parentheses")
-
-[Next >](../find-first-and-last-position-of-element-in-sorted-array "Find First and Last Position of Element in Sorted Array")
-
-## [33. Search in Rotated Sorted Array (Medium)](https://leetcode.com/problems/search-in-rotated-sorted-array "搜索旋转排序数组")
-
-
There is an integer array nums sorted in ascending order (with distinct values).
-
-
Prior to being passed to your function, nums is rotated at an unknown pivot index k (0 <= k < nums.length) such that the resulting array is [nums[k], nums[k+1], ..., nums[n-1], nums[0], nums[1], ..., nums[k-1]] (0-indexed). For example, [0,1,2,4,5,6,7] might be rotated at pivot index 3 and become [4,5,6,7,0,1,2].
-
-
Given the array numsafter the rotation and an integer target, return the index of target if it is in nums, or -1 if it is not in nums.
-
-
You must write an algorithm with O(log n) runtime complexity.
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
-
-### Similar Questions
- 1. [Search in Rotated Sorted Array II](../search-in-rotated-sorted-array-ii) (Medium)
- 1. [Find Minimum in Rotated Sorted Array](../find-minimum-in-rotated-sorted-array) (Medium)
diff --git a/problems/search-in-rotated-sorted-array/search_in_rotated_sorted_array.go b/problems/search-in-rotated-sorted-array/search_in_rotated_sorted_array.go
deleted file mode 100644
index d6a1bba56..000000000
--- a/problems/search-in-rotated-sorted-array/search_in_rotated_sorted_array.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem33
diff --git a/problems/search-in-rotated-sorted-array/search_in_rotated_sorted_array_test.go b/problems/search-in-rotated-sorted-array/search_in_rotated_sorted_array_test.go
deleted file mode 100644
index d6a1bba56..000000000
--- a/problems/search-in-rotated-sorted-array/search_in_rotated_sorted_array_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem33
diff --git a/problems/search-insert-position/README.md b/problems/search-insert-position/README.md
deleted file mode 100644
index 09a83df93..000000000
--- a/problems/search-insert-position/README.md
+++ /dev/null
@@ -1,55 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../find-first-and-last-position-of-element-in-sorted-array "Find First and Last Position of Element in Sorted Array")
-
-[Next >](../valid-sudoku "Valid Sudoku")
-
-## [35. Search Insert Position (Easy)](https://leetcode.com/problems/search-insert-position "搜索插入位置")
-
-
Given a sorted array of distinct integers and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order.
-
-
You must write an algorithm with O(log n) runtime complexity.
-
-
-
Example 1:
-
-
-Input: nums = [1,3,5,6], target = 5
-Output: 2
-
-
-
Example 2:
-
-
-Input: nums = [1,3,5,6], target = 2
-Output: 1
-
-
-
Example 3:
-
-
-Input: nums = [1,3,5,6], target = 7
-Output: 4
-
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 104
-
-104 <= nums[i] <= 104
-
nums contains distinct values sorted in ascending order.
You are given an array of strings products and a string searchWord.
-
-
Design a system that suggests at most three product names from products after each character of searchWord is typed. Suggested products should have common prefix with searchWord. If there are more than three products with a common prefix return the three lexicographically minimums products.
-
-
Return a list of lists of the suggested products after each character of searchWord is typed.
-
-
-
Example 1:
-
-
-Input: products = ["mobile","mouse","moneypot","monitor","mousepad"], searchWord = "mouse"
-Output: [
-["mobile","moneypot","monitor"],
-["mobile","moneypot","monitor"],
-["mouse","mousepad"],
-["mouse","mousepad"],
-["mouse","mousepad"]
-]
-Explanation: products sorted lexicographically = ["mobile","moneypot","monitor","mouse","mousepad"]
-After typing m and mo all products match and we show user ["mobile","moneypot","monitor"]
-After typing mou, mous and mouse the system suggests ["mouse","mousepad"]
-
products[i] consists of lowercase English letters.
-
1 <= searchWord.length <= 1000
-
searchWord consists of lowercase English letters.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[String](../../tag/string/README.md)]
- [[Trie](../../tag/trie/README.md)]
-
-### Hints
-
-Hint 1
-Brute force is a good choice because length of the string is ≤ 1000.
-
-
-
-Hint 2
-Binary search the answer.
-
-
-
-Hint 3
-Use Trie data structure to store the best three matching. Traverse the Trie.
-
diff --git a/problems/seat-reservation-manager/README.md b/problems/seat-reservation-manager/README.md
deleted file mode 100644
index 83f878644..000000000
--- a/problems/seat-reservation-manager/README.md
+++ /dev/null
@@ -1,75 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../replace-all-digits-with-characters "Replace All Digits with Characters")
-
-[Next >](../maximum-element-after-decreasing-and-rearranging "Maximum Element After Decreasing and Rearranging")
-
-## [1845. Seat Reservation Manager (Medium)](https://leetcode.com/problems/seat-reservation-manager "座位预约管理系统")
-
-
Design a system that manages the reservation state of n seats that are numbered from 1 to n.
-
-
Implement the SeatManager class:
-
-
-
SeatManager(int n) Initializes a SeatManager object that will manage n seats numbered from 1 to n. All seats are initially available.
-
int reserve() Fetches the smallest-numbered unreserved seat, reserves it, and returns its number.
-
void unreserve(int seatNumber) Unreserves the seat with the given seatNumber.
-
-
-
-
Example 1:
-
-
-Input
-["SeatManager", "reserve", "reserve", "unreserve", "reserve", "reserve", "reserve", "reserve", "unreserve"]
-[[5], [], [], [2], [], [], [], [], [5]]
-Output
-[null, 1, 2, null, 2, 3, 4, 5, null]
-
-Explanation
-SeatManager seatManager = new SeatManager(5); // Initializes a SeatManager with 5 seats.
-seatManager.reserve(); // All seats are available, so return the lowest numbered seat, which is 1.
-seatManager.reserve(); // The available seats are [2,3,4,5], so return the lowest of them, which is 2.
-seatManager.unreserve(2); // Unreserve seat 2, so now the available seats are [2,3,4,5].
-seatManager.reserve(); // The available seats are [2,3,4,5], so return the lowest of them, which is 2.
-seatManager.reserve(); // The available seats are [3,4,5], so return the lowest of them, which is 3.
-seatManager.reserve(); // The available seats are [4,5], so return the lowest of them, which is 4.
-seatManager.reserve(); // The only available seat is seat 5, so return 5.
-seatManager.unreserve(5); // Unreserve seat 5, so now the available seats are [5].
-
-
-
-
Constraints:
-
-
-
1 <= n <= 105
-
1 <= seatNumber <= n
-
For each call to reserve, it is guaranteed that there will be at least one unreserved seat.
-
For each call to unreserve, it is guaranteed that seatNumber will be reserved.
-
At most 105 calls in total will be made to reserve and unreserve.
-
-
-### Related Topics
- [[Design](../../tag/design/README.md)]
- [[Heap (Priority Queue)](../../tag/heap-priority-queue/README.md)]
-
-### Hints
-
-Hint 1
-You need a data structure that maintains the states of the seats. This data structure should also allow you to get the first available seat and flip the state of a seat in a reasonable time.
-
-
-
-Hint 2
-You can let the data structure contain the available seats. Then you want to be able to get the lowest element and erase an element, in a reasonable time.
-
-
-
-Hint 3
-Ordered sets support these operations.
-
diff --git a/problems/second-degree-follower/README.md b/problems/second-degree-follower/README.md
deleted file mode 100644
index da3878fbb..000000000
--- a/problems/second-degree-follower/README.md
+++ /dev/null
@@ -1,51 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../shortest-distance-in-a-line "Shortest Distance in a Line")
-
-[Next >](../average-salary-departments-vs-company "Average Salary: Departments VS Company")
-
-## [614. Second Degree Follower (Medium)](https://leetcode.com/problems/second-degree-follower "二级关注者")
-
-
In facebook, there is a follow table with two columns: followee, follower.
-
-
Please write a sql query to get the amount of each follower’s follower if he/she has one.
-
-
For example:
-
-
-+-------------+------------+
-| followee | follower |
-+-------------+------------+
-| A | B |
-| B | C |
-| B | D |
-| D | E |
-+-------------+------------+
-
-should output:
-
-
-+-------------+------------+
-| follower | num |
-+-------------+------------+
-| B | 2 |
-| D | 1 |
-+-------------+------------+
-
-Explaination:
-Both B and D exist in the follower list, when as a followee, B's follower is C and D, and D's follower is E. A does not exist in follower list.
-
-
-
-Note:
-Followee would not follow himself/herself in all cases.
-Please display the result in follower's alphabet order.
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/second-degree-follower/mysql_schemas.sql b/problems/second-degree-follower/mysql_schemas.sql
deleted file mode 100644
index 1dbb57626..000000000
--- a/problems/second-degree-follower/mysql_schemas.sql
+++ /dev/null
@@ -1,6 +0,0 @@
-Create table If Not Exists Follow (followee varchar(255), follower varchar(255));
-Truncate table Follow;
-insert into Follow (followee, follower) values ('Alice', 'Bob');
-insert into Follow (followee, follower) values ('Bob', 'Cena');
-insert into Follow (followee, follower) values ('Bob', 'Donald');
-insert into Follow (followee, follower) values ('Donald', 'Edward');
diff --git a/problems/second-degree-follower/second_degree_follower.sql b/problems/second-degree-follower/second_degree_follower.sql
deleted file mode 100644
index bae62cf19..000000000
--- a/problems/second-degree-follower/second_degree_follower.sql
+++ /dev/null
@@ -1 +0,0 @@
-# Write your MySQL query statement below
diff --git a/problems/second-highest-salary/README.md b/problems/second-highest-salary/README.md
deleted file mode 100644
index 6cb8a3e24..000000000
--- a/problems/second-highest-salary/README.md
+++ /dev/null
@@ -1,73 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../combine-two-tables "Combine Two Tables")
-
-[Next >](../nth-highest-salary "Nth Highest Salary")
-
-## [176. Second Highest Salary (Medium)](https://leetcode.com/problems/second-highest-salary "第二高的薪水")
-
-
Table: Employee
-
-
-+-------------+------+
-| Column Name | Type |
-+-------------+------+
-| id | int |
-| salary | int |
-+-------------+------+
-id is the primary key column for this table.
-Each row of this table contains information about the salary of an employee.
-
-
-
-
-
Write an SQL query to report the second highest salary from the Employee table. If there is no second highest salary, the query should report null.
-
-
The query result format is in the following example.
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/second-highest-salary/mysql_schemas.sql b/problems/second-highest-salary/mysql_schemas.sql
deleted file mode 100644
index f98a8511a..000000000
--- a/problems/second-highest-salary/mysql_schemas.sql
+++ /dev/null
@@ -1,5 +0,0 @@
-Create table If Not Exists Employee (id int, salary int);
-Truncate table Employee;
-insert into Employee (id, salary) values ('1', '100');
-insert into Employee (id, salary) values ('2', '200');
-insert into Employee (id, salary) values ('3', '300');
diff --git a/problems/second-highest-salary/second_highest_salary.sql b/problems/second-highest-salary/second_highest_salary.sql
deleted file mode 100644
index bae62cf19..000000000
--- a/problems/second-highest-salary/second_highest_salary.sql
+++ /dev/null
@@ -1 +0,0 @@
-# Write your MySQL query statement below
diff --git a/problems/second-largest-digit-in-a-string/README.md b/problems/second-largest-digit-in-a-string/README.md
deleted file mode 100644
index e50360bbb..000000000
--- a/problems/second-largest-digit-in-a-string/README.md
+++ /dev/null
@@ -1,56 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../rearrange-products-table "Rearrange Products Table")
-
-[Next >](../design-authentication-manager "Design Authentication Manager")
-
-## [1796. Second Largest Digit in a String (Easy)](https://leetcode.com/problems/second-largest-digit-in-a-string "字符串中第二大的数字")
-
-
Given an alphanumeric string s, return the second largest numerical digit that appears in s, or -1 if it does not exist.
-
-
An alphanumericstring is a string consisting of lowercase English letters and digits.
-
-
-
Example 1:
-
-
-Input: s = "dfa12321afd"
-Output: 2
-Explanation: The digits that appear in s are [1, 2, 3]. The second largest digit is 2.
-
-
-
Example 2:
-
-
-Input: s = "abc1111"
-Output: -1
-Explanation: The digits that appear in s are [1]. There is no second largest digit.
-
-
-
-
Constraints:
-
-
-
1 <= s.length <= 500
-
s consists of only lowercase English letters and/or digits.
-
-
-### Related Topics
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Hints
-
-Hint 1
-First of all, get the distinct characters since we are only interested in those
-
-
-
-Hint 2
-Let's note that there might not be any digits.
-
diff --git a/problems/second-minimum-node-in-a-binary-tree/README.md b/problems/second-minimum-node-in-a-binary-tree/README.md
deleted file mode 100644
index 3dc88a88f..000000000
--- a/problems/second-minimum-node-in-a-binary-tree/README.md
+++ /dev/null
@@ -1,54 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-swap "Maximum Swap")
-
-[Next >](../bulb-switcher-ii "Bulb Switcher II")
-
-## [671. Second Minimum Node In a Binary Tree (Easy)](https://leetcode.com/problems/second-minimum-node-in-a-binary-tree "二叉树中第二小的节点")
-
-
Given a non-empty special binary tree consisting of nodes with the non-negative value, where each node in this tree has exactly two or zero sub-node. If the node has two sub-nodes, then this node's value is the smaller value among its two sub-nodes. More formally, the property root.val = min(root.left.val, root.right.val) always holds.
-
-
Given such a binary tree, you need to output the second minimum value in the set made of all the nodes' value in the whole tree.
-
-
If no such second minimum value exists, output -1 instead.
-
-
-
-
-
Example 1:
-
-
-Input: root = [2,2,5,null,null,5,7]
-Output: 5
-Explanation: The smallest value is 2, the second smallest value is 5.
-
-
-
Example 2:
-
-
-Input: root = [2,2,2]
-Output: -1
-Explanation: The smallest value is 2, but there isn't any second smallest value.
-
-
-
-
Constraints:
-
-
-
The number of nodes in the tree is in the range [1, 25].
-
1 <= Node.val <= 231 - 1
-
root.val == min(root.left.val, root.right.val) for each internal node of the tree.
-
-
-### Related Topics
- [[Tree](../../tag/tree/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Binary Tree](../../tag/binary-tree/README.md)]
-
-### Similar Questions
- 1. [Kth Smallest Element in a BST](../kth-smallest-element-in-a-bst) (Medium)
diff --git a/problems/second-minimum-node-in-a-binary-tree/second_minimum_node_in_a_binary_tree.go b/problems/second-minimum-node-in-a-binary-tree/second_minimum_node_in_a_binary_tree.go
deleted file mode 100644
index 392972c08..000000000
--- a/problems/second-minimum-node-in-a-binary-tree/second_minimum_node_in_a_binary_tree.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem671
diff --git a/problems/second-minimum-node-in-a-binary-tree/second_minimum_node_in_a_binary_tree_test.go b/problems/second-minimum-node-in-a-binary-tree/second_minimum_node_in_a_binary_tree_test.go
deleted file mode 100644
index 392972c08..000000000
--- a/problems/second-minimum-node-in-a-binary-tree/second_minimum_node_in_a_binary_tree_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem671
diff --git a/problems/second-minimum-time-to-reach-destination/README.md b/problems/second-minimum-time-to-reach-destination/README.md
deleted file mode 100644
index 6511ed733..000000000
--- a/problems/second-minimum-time-to-reach-destination/README.md
+++ /dev/null
@@ -1,94 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../count-number-of-maximum-bitwise-or-subsets "Count Number of Maximum Bitwise-OR Subsets")
-
-[Next >](../sort-linked-list-already-sorted-using-absolute-values "Sort Linked List Already Sorted Using Absolute Values")
-
-## [2045. Second Minimum Time to Reach Destination (Hard)](https://leetcode.com/problems/second-minimum-time-to-reach-destination "到达目的地的第二短时间")
-
-
A city is represented as a bi-directional connected graph with n vertices where each vertex is labeled from 1 to n (inclusive). The edges in the graph are represented as a 2D integer array edges, where each edges[i] = [ui, vi] denotes a bi-directional edge between vertex ui and vertex vi. Every vertex pair is connected by at most one edge, and no vertex has an edge to itself. The time taken to traverse any edge is time minutes.
-
-
Each vertex has a traffic signal which changes its color from green to red and vice versa every change minutes. All signals change at the same time. You can enter a vertex at any time, but can leave a vertex only when the signal is green. You cannot wait at a vertex if the signal is green.
-
-
The second minimum value is defined as the smallest value strictly larger than the minimum value.
-
-
-
For example the second minimum value of [2, 3, 4] is 3, and the second minimum value of [2, 2, 4] is 4.
-
-
-
Given n, edges, time, and change, return the second minimum time it will take to go from vertex 1 to vertex n.
-
-
Notes:
-
-
-
You can go through any vertex any number of times, including1 and n.
-
You can assume that when the journey starts, all signals have just turned green.
-
-
-
-
Example 1:
-
-
-Input: n = 5, edges = [[1,2],[1,3],[1,4],[3,4],[4,5]], time = 3, change = 5
-Output: 13
-Explanation:
-The figure on the left shows the given graph.
-The blue path in the figure on the right is the minimum time path.
-The time taken is:
-- Start at 1, time elapsed=0
-- 1 -> 4: 3 minutes, time elapsed=3
-- 4 -> 5: 3 minutes, time elapsed=6
-Hence the minimum time needed is 6 minutes.
-
-The red path shows the path to get the second minimum time.
-- Start at 1, time elapsed=0
-- 1 -> 3: 3 minutes, time elapsed=3
-- 3 -> 4: 3 minutes, time elapsed=6
-- Wait at 4 for 4 minutes, time elapsed=10
-- 4 -> 5: 3 minutes, time elapsed=13
-Hence the second minimum time is 13 minutes.
-
-
-
Example 2:
-
-
-Input: n = 2, edges = [[1,2]], time = 3, change = 2
-Output: 11
-Explanation:
-The minimum time path is 1 -> 2 with time = 3 minutes.
-The second minimum time path is 1 -> 2 -> 1 -> 2 with time = 11 minutes.
-
-
-
Constraints:
-
-
-
2 <= n <= 104
-
n - 1 <= edges.length <= min(2 * 104, n * (n - 1) / 2)
-
edges[i].length == 2
-
1 <= ui, vi <= n
-
ui != vi
-
There are no duplicate edges.
-
Each vertex can be reached directly or indirectly from every other vertex.
-
1 <= time, change <= 103
-
-
-### Related Topics
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Graph](../../tag/graph/README.md)]
- [[Shortest Path](../../tag/shortest-path/README.md)]
-
-### Hints
-
-Hint 1
-How much is change actually necessary while calculating the required path?
-
-
-
-Hint 2
-How many extra edges do we need to add to the shortest path?
-
diff --git a/problems/self-crossing/README.md b/problems/self-crossing/README.md
deleted file mode 100644
index 39f96b944..000000000
--- a/problems/self-crossing/README.md
+++ /dev/null
@@ -1,53 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../increasing-triplet-subsequence "Increasing Triplet Subsequence")
-
-[Next >](../palindrome-pairs "Palindrome Pairs")
-
-## [335. Self Crossing (Hard)](https://leetcode.com/problems/self-crossing "路径交叉")
-
-
You are given an array of integers distance.
-
-
You start at point (0,0) on an X-Y plane and you move distance[0] meters to the north, then distance[1] meters to the west, distance[2] meters to the south, distance[3] meters to the east, and so on. In other words, after each move, your direction changes counter-clockwise.
-
-
Return true if your path crosses itself, and false if it does not.
A self-dividing number is a number that is divisible by every digit it contains.
-
-
-
For example, 128 is a self-dividing number because 128 % 1 == 0, 128 % 2 == 0, and 128 % 8 == 0.
-
-
-
A self-dividing number is not allowed to contain the digit zero.
-
-
Given two integers left and right, return a list of all the self-dividing numbers in the range[left, right].
-
-
-
Example 1:
-
Input: left = 1, right = 22
-Output: [1,2,3,4,5,6,7,8,9,11,12,15,22]
-
Example 2:
-
Input: left = 47, right = 85
-Output: [48,55,66,77]
-
-
-
Constraints:
-
-
-
1 <= left <= right <= 104
-
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
-
-### Similar Questions
- 1. [Perfect Number](../perfect-number) (Easy)
-
-### Hints
-
-Hint 1
-For each number in the range, check whether it is self dividing by converting that number to a character array (or string in Python), then checking that each digit is nonzero and divides the original number.
-
diff --git a/problems/self-dividing-numbers/self_dividing_numbers.go b/problems/self-dividing-numbers/self_dividing_numbers.go
deleted file mode 100644
index 6726dae2e..000000000
--- a/problems/self-dividing-numbers/self_dividing_numbers.go
+++ /dev/null
@@ -1,15 +0,0 @@
-package problem728
-
-func selfDividingNumbers(left int, right int) []int {
- ans := make([]int, 0)
-flag:
- for i := left; i <= right; i++ {
- for x := i; x > 0; x /= 10 {
- if d := x % 10; d == 0 || i%d != 0 {
- continue flag
- }
- }
- ans = append(ans, i)
- }
- return ans
-}
diff --git a/problems/self-dividing-numbers/self_dividing_numbers_test.go b/problems/self-dividing-numbers/self_dividing_numbers_test.go
deleted file mode 100644
index afefd547b..000000000
--- a/problems/self-dividing-numbers/self_dividing_numbers_test.go
+++ /dev/null
@@ -1,28 +0,0 @@
-package problem728
-
-import (
- "reflect"
- "testing"
-)
-
-type testType struct {
- left int
- right int
- want []int
-}
-
-func TestSelfDividingNumbers(t *testing.T) {
- tests := [...]testType{
- {
- left: 1,
- right: 22,
- want: []int{1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 15, 22},
- },
- }
- for _, tt := range tests {
- got := selfDividingNumbers(tt.left, tt.right)
- if !reflect.DeepEqual(got, tt.want) {
- t.Fatalf("in: %v %v, got: %v, want: %v", tt.left, tt.right, got, tt.want)
- }
- }
-}
diff --git a/problems/sell-diminishing-valued-colored-balls/README.md b/problems/sell-diminishing-valued-colored-balls/README.md
deleted file mode 100644
index e010dd174..000000000
--- a/problems/sell-diminishing-valued-colored-balls/README.md
+++ /dev/null
@@ -1,72 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-deletions-to-make-character-frequencies-unique "Minimum Deletions to Make Character Frequencies Unique")
-
-[Next >](../create-sorted-array-through-instructions "Create Sorted Array through Instructions")
-
-## [1648. Sell Diminishing-Valued Colored Balls (Medium)](https://leetcode.com/problems/sell-diminishing-valued-colored-balls "销售价值减少的颜色球")
-
-
You have an inventory of different colored balls, and there is a customer that wants orders balls of any color.
-
-
The customer weirdly values the colored balls. Each colored ball's value is the number of balls of that color you currently have in your inventory. For example, if you own 6 yellow balls, the customer would pay 6 for the first yellow ball. After the transaction, there are only 5 yellow balls left, so the next yellow ball is then valued at 5 (i.e., the value of the balls decreases as you sell more to the customer).
-
-
You are given an integer array, inventory, where inventory[i] represents the number of balls of the ith color that you initially own. You are also given an integer orders, which represents the total number of balls that the customer wants. You can sell the balls in any order.
-
-
Return the maximum total value that you can attain after selling orders colored balls. As the answer may be too large, return it modulo 109 + 7.
-
-
-
Example 1:
-
-
-Input: inventory = [2,5], orders = 4
-Output: 14
-Explanation: Sell the 1st color 1 time (2) and the 2nd color 3 times (5 + 4 + 3).
-The maximum total value is 2 + 5 + 4 + 3 = 14.
-
-
-
Example 2:
-
-
-Input: inventory = [3,5], orders = 6
-Output: 19
-Explanation: Sell the 1st color 2 times (3 + 2) and the 2nd color 4 times (5 + 4 + 3 + 2).
-The maximum total value is 3 + 2 + 5 + 4 + 3 + 2 = 19.
-
-
-
-
Constraints:
-
-
-
1 <= inventory.length <= 105
-
1 <= inventory[i] <= 109
-
1 <= orders <= min(sum(inventory[i]), 109)
-
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Math](../../tag/math/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
- [[Heap (Priority Queue)](../../tag/heap-priority-queue/README.md)]
-
-### Hints
-
-Hint 1
-Greedily sell the most expensive ball.
-
-
-
-Hint 2
-There is some value k where all balls of value > k are sold, and some, (maybe 0) of balls of value k are sold.
-
-
-
-Hint 3
-Use binary search to find this value k, and use maths to find the total sum.
-
diff --git a/problems/sellers-with-no-sales/README.md b/problems/sellers-with-no-sales/README.md
deleted file mode 100644
index 3d659cfa6..000000000
--- a/problems/sellers-with-no-sales/README.md
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../find-servers-that-handled-most-number-of-requests "Find Servers That Handled Most Number of Requests")
-
-[Next >](../special-array-with-x-elements-greater-than-or-equal-x "Special Array With X Elements Greater Than or Equal X")
-
-## [1607. Sellers With No Sales (Easy)](https://leetcode.com/problems/sellers-with-no-sales "没有卖出的卖家")
-
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
-
-### Similar Questions
- 1. [Customer Who Visited but Did Not Make Any Transactions](../customer-who-visited-but-did-not-make-any-transactions) (Easy)
diff --git a/problems/sellers-with-no-sales/mysql_schemas.sql b/problems/sellers-with-no-sales/mysql_schemas.sql
deleted file mode 100644
index 4e56240ee..000000000
--- a/problems/sellers-with-no-sales/mysql_schemas.sql
+++ /dev/null
@@ -1,19 +0,0 @@
-Create table If Not Exists Customer (customer_id int, customer_name varchar(20));
-Create table If Not Exists Orders (order_id int, sale_date date, order_cost int, customer_id int, seller_id int)
-;
-Create table If Not Exists Seller (seller_id int, seller_name varchar(20))
-;
-Truncate table Customer;
-insert into Customer (customer_id, customer_name) values ('101', 'Alice');
-insert into Customer (customer_id, customer_name) values ('102', 'Bob');
-insert into Customer (customer_id, customer_name) values ('103', 'Charlie');
-Truncate table Orders;
-insert into Orders (order_id, sale_date, order_cost, customer_id, seller_id) values ('1', '2020-03-01', '1500', '101', '1');
-insert into Orders (order_id, sale_date, order_cost, customer_id, seller_id) values ('2', '2020-05-25', '2400', '102', '2');
-insert into Orders (order_id, sale_date, order_cost, customer_id, seller_id) values ('3', '2019-05-25', '800', '101', '3');
-insert into Orders (order_id, sale_date, order_cost, customer_id, seller_id) values ('4', '2020-09-13', '1000', '103', '2');
-insert into Orders (order_id, sale_date, order_cost, customer_id, seller_id) values ('5', '2019-02-11', '700', '101', '2');
-Truncate table Seller;
-insert into Seller (seller_id, seller_name) values ('1', 'Daniel');
-insert into Seller (seller_id, seller_name) values ('2', 'Elizabeth');
-insert into Seller (seller_id, seller_name) values ('3', 'Frank');
diff --git a/problems/sentence-screen-fitting/README.md b/problems/sentence-screen-fitting/README.md
deleted file mode 100644
index e23dcefe5..000000000
--- a/problems/sentence-screen-fitting/README.md
+++ /dev/null
@@ -1,87 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../pacific-atlantic-water-flow "Pacific Atlantic Water Flow")
-
-[Next >](../battleships-in-a-board "Battleships in a Board")
-
-## [418. Sentence Screen Fitting (Medium)](https://leetcode.com/problems/sentence-screen-fitting "屏幕可显示句子的数量")
-
-
Given a rows x cols screen and a sentence represented by a list of non-empty words, find how many times the given sentence can be fitted on the screen.
-
-
-
Note:
-
-
A word cannot be split into two lines.
-
The order of words in the sentence must remain unchanged.
-
Two consecutive words in a line must be separated by a single space.
-
Total words in the sentence won't exceed 100.
-
Length of each word is greater than 0 and won't exceed 10.
-
1 ≤ rows, cols ≤ 20,000.
-
-
-
-
-Example 1:
-
-Input:
-rows = 2, cols = 8, sentence = ["hello", "world"]
-
-Output:
-1
-
-Explanation:
-hello---
-world---
-
-The character '-' signifies an empty space on the screen.
-
-
-
-
-Example 2:
-
-Input:
-rows = 3, cols = 6, sentence = ["a", "bcd", "e"]
-
-Output:
-2
-
-Explanation:
-a-bcd-
-e-a---
-bcd-e-
-
-The character '-' signifies an empty space on the screen.
-
-
-
-
-Example 3:
-
-Input:
-rows = 4, cols = 5, sentence = ["I", "had", "apple", "pie"]
-
-Output:
-1
-
-Explanation:
-I-had
-apple
-pie-I
-had--
-
-The character '-' signifies an empty space on the screen.
-
Given two sentences words1, words2 (each represented as an array of strings), and a list of similar word pairs pairs, determine if two sentences are similar.
-
-
For example, words1 = ["great", "acting", "skills"] and words2 = ["fine", "drama", "talent"] are similar, if the similar word pairs are pairs = [["great", "good"], ["fine", "good"], ["acting","drama"], ["skills","talent"]].
-
-
Note that the similarity relation is transitive. For example, if "great" and "good" are similar, and "fine" and "good" are similar, then "great" and "fine" are similar.
-
-
Similarity is also symmetric. For example, "great" and "fine" being similar is the same as "fine" and "great" being similar.
-
-
Also, a word is always similar with itself. For example, the sentences words1 = ["great"], words2 = ["great"], pairs = [] are similar, even though there are no specified similar word pairs.
-
-
Finally, sentences can only be similar if they have the same number of words. So a sentence like words1 = ["great"] can never be similar to words2 = ["doubleplus","good"].
-
-
Note:
-
-
-
The length of words1 and words2 will not exceed 1000.
-
The length of pairs will not exceed 2000.
-
The length of each pairs[i] will be 2.
-
The length of each words[i] and pairs[i][j] will be in the range [1, 20].
-
-
-
-
-### Related Topics
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Union Find](../../tag/union-find/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Similar Questions
- 1. [Number of Provinces](../number-of-provinces) (Medium)
- 1. [Accounts Merge](../accounts-merge) (Medium)
- 1. [Sentence Similarity](../sentence-similarity) (Easy)
-
-### Hints
-
-Hint 1
-Consider the graphs where each pair in "pairs" is an edge. Two words are similar if they are the same, or are in the same connected component of this graph.
-
diff --git a/problems/sentence-similarity-ii/sentence_similarity_ii.go b/problems/sentence-similarity-ii/sentence_similarity_ii.go
deleted file mode 100644
index 85e42bdd4..000000000
--- a/problems/sentence-similarity-ii/sentence_similarity_ii.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem737
diff --git a/problems/sentence-similarity-ii/sentence_similarity_ii_test.go b/problems/sentence-similarity-ii/sentence_similarity_ii_test.go
deleted file mode 100644
index 85e42bdd4..000000000
--- a/problems/sentence-similarity-ii/sentence_similarity_ii_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem737
diff --git a/problems/sentence-similarity-iii/README.md b/problems/sentence-similarity-iii/README.md
deleted file mode 100644
index 45db111c7..000000000
--- a/problems/sentence-similarity-iii/README.md
+++ /dev/null
@@ -1,68 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../determine-color-of-a-chessboard-square "Determine Color of a Chessboard Square")
-
-[Next >](../count-nice-pairs-in-an-array "Count Nice Pairs in an Array")
-
-## [1813. Sentence Similarity III (Medium)](https://leetcode.com/problems/sentence-similarity-iii "句子相似性 III")
-
-
A sentence is a list of words that are separated by a single space with no leading or trailing spaces. For example, "Hello World", "HELLO", "hello world hello world" are all sentences. Words consist of only uppercase and lowercase English letters.
-
-
Two sentences sentence1 and sentence2 are similar if it is possible to insert an arbitrary sentence (possibly empty) inside one of these sentences such that the two sentences become equal. For example, sentence1 = "Hello my name is Jane" and sentence2 = "Hello Jane" can be made equal by inserting "my name is" between "Hello" and "Jane" in sentence2.
-
-
Given two sentences sentence1 and sentence2, return trueif sentence1and sentence2are similar. Otherwise, return false.
-
-
-
Example 1:
-
-
-Input: sentence1 = "My name is Haley", sentence2 = "My Haley"
-Output: true
-Explanation: sentence2 can be turned to sentence1 by inserting "name is" between "My" and "Haley".
-
-
-
Example 2:
-
-
-Input: sentence1 = "of", sentence2 = "A lot of words"
-Output: false
-Explanation: No single sentence can be inserted inside one of the sentences to make it equal to the other.
-
-
-
Example 3:
-
-
-Input: sentence1 = "Eating right now", sentence2 = "Eating"
-Output: true
-Explanation: sentence2 can be turned to sentence1 by inserting "right now" at the end of the sentence.
-
-
-
-
Constraints:
-
-
-
1 <= sentence1.length, sentence2.length <= 100
-
sentence1 and sentence2 consist of lowercase and uppercase English letters and spaces.
-
The words in sentence1 and sentence2 are separated by a single space.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Two Pointers](../../tag/two-pointers/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Hints
-
-Hint 1
-One way to look at it is to find one sentence as a concatenation of a prefix and suffix from the other sentence.
-
-
-
-Hint 2
-Get the longest common prefix between them and the longest common suffix.
-
diff --git a/problems/sentence-similarity/README.md b/problems/sentence-similarity/README.md
deleted file mode 100644
index 4c2e329ba..000000000
--- a/problems/sentence-similarity/README.md
+++ /dev/null
@@ -1,51 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../flood-fill "Flood Fill")
-
-[Next >](../asteroid-collision "Asteroid Collision")
-
-## [734. Sentence Similarity (Easy)](https://leetcode.com/problems/sentence-similarity "句子相似性")
-
-
Given two sentences words1, words2 (each represented as an array of strings), and a list of similar word pairs pairs, determine if two sentences are similar.
-
-
For example, "great acting skills" and "fine drama talent" are similar, if the similar word pairs are pairs = [["great", "fine"], ["acting","drama"], ["skills","talent"]].
-
-
Note that the similarity relation is not transitive. For example, if "great" and "fine" are similar, and "fine" and "good" are similar, "great" and "good" are not necessarily similar.
-
-
However, similarity is symmetric. For example, "great" and "fine" being similar is the same as "fine" and "great" being similar.
-
-
Also, a word is always similar with itself. For example, the sentences words1 = ["great"], words2 = ["great"], pairs = [] are similar, even though there are no specified similar word pairs.
-
-
Finally, sentences can only be similar if they have the same number of words. So a sentence like words1 = ["great"] can never be similar to words2 = ["doubleplus","good"].
-
-
Note:
-
-
-
The length of words1 and words2 will not exceed 1000.
-
The length of pairs will not exceed 2000.
-
The length of each pairs[i] will be 2.
-
The length of each words[i] and pairs[i][j] will be in the range [1, 20].
-
-
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Similar Questions
- 1. [Number of Provinces](../number-of-provinces) (Medium)
- 1. [Accounts Merge](../accounts-merge) (Medium)
- 1. [Sentence Similarity II](../sentence-similarity-ii) (Medium)
-
-### Hints
-
-Hint 1
-Two words w1 and w2 are similar if and only if w1 == w2, (w1, w2) was a pair, or (w2, w1) was a pair.
-
diff --git a/problems/sentence-similarity/sentence_similarity.go b/problems/sentence-similarity/sentence_similarity.go
deleted file mode 100644
index 48ceabac1..000000000
--- a/problems/sentence-similarity/sentence_similarity.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem734
diff --git a/problems/sentence-similarity/sentence_similarity_test.go b/problems/sentence-similarity/sentence_similarity_test.go
deleted file mode 100644
index 48ceabac1..000000000
--- a/problems/sentence-similarity/sentence_similarity_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem734
diff --git a/problems/sequence-reconstruction/README.md b/problems/sequence-reconstruction/README.md
deleted file mode 100644
index fab41cd33..000000000
--- a/problems/sequence-reconstruction/README.md
+++ /dev/null
@@ -1,76 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../string-compression "String Compression")
-
-[Next >](../add-two-numbers-ii "Add Two Numbers II")
-
-## [444. Sequence Reconstruction (Medium)](https://leetcode.com/problems/sequence-reconstruction "序列重建")
-
-
Check whether the original sequence org can be uniquely reconstructed from the sequences in seqs. The org sequence is a permutation of the integers from 1 to n, with 1 ≤ n ≤ 104. Reconstruction means building a shortest common supersequence of the sequences in seqs (i.e., a shortest sequence so that all sequences in seqs are subsequences of it). Determine whether there is only one sequence that can be reconstructed from seqs and it is the org sequence.
-
-
Example 1:
-
-Input:
-org: [1,2,3], seqs: [[1,2],[1,3]]
-
-Output:
-false
-
-Explanation:
-[1,2,3] is not the only one sequence that can be reconstructed, because [1,3,2] is also a valid sequence that can be reconstructed.
-
-
-
-
Example 2:
-
-Input:
-org: [1,2,3], seqs: [[1,2]]
-
-Output:
-false
-
-Explanation:
-The reconstructed sequence can only be [1,2].
-
-
-
-
Example 3:
-
-Input:
-org: [1,2,3], seqs: [[1,2],[1,3],[2,3]]
-
-Output:
-true
-
-Explanation:
-The sequences [1,2], [1,3], and [2,3] can uniquely reconstruct the original sequence [1,2,3].
-
-UPDATE (2017/1/8):
-The seqs parameter had been changed to a list of list of strings (instead of a 2d array of strings). Please reload the code definition to get the latest changes.
-
-
-### Related Topics
- [[Graph](../../tag/graph/README.md)]
- [[Topological Sort](../../tag/topological-sort/README.md)]
- [[Array](../../tag/array/README.md)]
-
-### Similar Questions
- 1. [Course Schedule II](../course-schedule-ii) (Medium)
diff --git a/problems/sequence-reconstruction/sequence_reconstruction.go b/problems/sequence-reconstruction/sequence_reconstruction.go
deleted file mode 100644
index f14ca7f03..000000000
--- a/problems/sequence-reconstruction/sequence_reconstruction.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem444
diff --git a/problems/sequence-reconstruction/sequence_reconstruction_test.go b/problems/sequence-reconstruction/sequence_reconstruction_test.go
deleted file mode 100644
index f14ca7f03..000000000
--- a/problems/sequence-reconstruction/sequence_reconstruction_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem444
diff --git a/problems/sequential-digits/README.md b/problems/sequential-digits/README.md
deleted file mode 100644
index 9dfeeb487..000000000
--- a/problems/sequential-digits/README.md
+++ /dev/null
@@ -1,45 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../convert-binary-number-in-a-linked-list-to-integer "Convert Binary Number in a Linked List to Integer")
-
-[Next >](../maximum-side-length-of-a-square-with-sum-less-than-or-equal-to-threshold "Maximum Side Length of a Square with Sum Less than or Equal to Threshold")
-
-## [1291. Sequential Digits (Medium)](https://leetcode.com/problems/sequential-digits "顺次数")
-
-
An integer has sequential digits if and only if each digit in the number is one more than the previous digit.
-
-
Return a sorted list of all the integers in the range [low, high] inclusive that have sequential digits.
-
-
-
Example 1:
-
Input: low = 100, high = 300
-Output: [123,234]
-
Example 2:
-
Input: low = 1000, high = 13000
-Output: [1234,2345,3456,4567,5678,6789,12345]
-
-
-
Constraints:
-
-
-
10 <= low <= high <= 10^9
-
-
-### Related Topics
- [[Enumeration](../../tag/enumeration/README.md)]
-
-### Hints
-
-Hint 1
-Generate all numbers with sequential digits and check if they are in the given range.
-
-
-
-Hint 2
-Fix the starting digit then do a recursion that tries to append all valid digits.
-
diff --git a/problems/sequentially-ordinal-rank-tracker/README.md b/problems/sequentially-ordinal-rank-tracker/README.md
deleted file mode 100644
index 4b1402419..000000000
--- a/problems/sequentially-ordinal-rank-tracker/README.md
+++ /dev/null
@@ -1,113 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../detonate-the-maximum-bombs "Detonate the Maximum Bombs")
-
-[Next >](../rings-and-rods "Rings and Rods")
-
-## [2102. Sequentially Ordinal Rank Tracker (Hard)](https://leetcode.com/problems/sequentially-ordinal-rank-tracker "序列顺序查询")
-
-
A scenic location is represented by its name and attractiveness score, where name is a unique string among all locations and score is an integer. Locations can be ranked from the best to the worst. The higher the score, the better the location. If the scores of two locations are equal, then the location with the lexicographically smaller name is better.
-
-
You are building a system that tracks the ranking of locations with the system initially starting with no locations. It supports:
-
-
-
Adding scenic locations, one at a time.
-
Querying the ithbest location of all locations already added, where i is the number of times the system has been queried (including the current query).
-
-
For example, when the system is queried for the 4th time, it returns the 4th best location of all locations already added.
-
-
-
-
-
Note that the test data are generated so that at any time, the number of queries does not exceed the number of locations added to the system.
-
-
Implement the SORTracker class:
-
-
-
SORTracker() Initializes the tracker system.
-
void add(string name, int score) Adds a scenic location with name and score to the system.
-
string get() Queries and returns the ith best location, where i is the number of times this method has been invoked (including this invocation).
-
-
-
-
Example 1:
-
-
-Input
-["SORTracker", "add", "add", "get", "add", "get", "add", "get", "add", "get", "add", "get", "get"]
-[[], ["bradford", 2], ["branford", 3], [], ["alps", 2], [], ["orland", 2], [], ["orlando", 3], [], ["alpine", 2], [], []]
-Output
-[null, null, null, "branford", null, "alps", null, "bradford", null, "bradford", null, "bradford", "orland"]
-
-Explanation
-SORTracker tracker = new SORTracker(); // Initialize the tracker system.
-tracker.add("bradford", 2); // Add location with name="bradford" and score=2 to the system.
-tracker.add("branford", 3); // Add location with name="branford" and score=3 to the system.
-tracker.get(); // The sorted locations, from best to worst, are: branford, bradford.
- // Note that branford precedes bradford due to its higher score (3 > 2).
- // This is the 1st time get() is called, so return the best location: "branford".
-tracker.add("alps", 2); // Add location with name="alps" and score=2 to the system.
-tracker.get(); // Sorted locations: branford, alps, bradford.
- // Note that alps precedes bradford even though they have the same score (2).
- // This is because "alps" is lexicographically smaller than "bradford".
- // Return the 2nd best location "alps", as it is the 2nd time get() is called.
-tracker.add("orland", 2); // Add location with name="orland" and score=2 to the system.
-tracker.get(); // Sorted locations: branford, alps, bradford, orland.
- // Return "bradford", as it is the 3rd time get() is called.
-tracker.add("orlando", 3); // Add location with name="orlando" and score=3 to the system.
-tracker.get(); // Sorted locations: branford, orlando, alps, bradford, orland.
- // Return "bradford".
-tracker.add("alpine", 2); // Add location with name="alpine" and score=2 to the system.
-tracker.get(); // Sorted locations: branford, orlando, alpine, alps, bradford, orland.
- // Return "bradford".
-tracker.get(); // Sorted locations: branford, orlando, alpine, alps, bradford, orland.
- // Return "orland".
-
-
-
-
Constraints:
-
-
-
name consists of lowercase English letters, and is unique among all locations.
-
1 <= name.length <= 10
-
1 <= score <= 105
-
At any time, the number of calls to get does not exceed the number of calls to add.
-
At most 4 * 104 calls in total will be made to add and get.
-
-
-### Related Topics
- [[Design](../../tag/design/README.md)]
- [[Data Stream](../../tag/data-stream/README.md)]
- [[Ordered Set](../../tag/ordered-set/README.md)]
- [[Heap (Priority Queue)](../../tag/heap-priority-queue/README.md)]
-
-### Hints
-
-Hint 1
-If the problem were to find the median of a stream of scenery locations while they are being added, can you solve it?
-
-
-
-Hint 2
-We can use a similar approach as an optimization to avoid repeated sorting.
-
-
-
-Hint 3
-Employ two heaps: left heap and right heap. The left heap is a max-heap, and the right heap is a min-heap. The size of the left heap is k + 1 (best locations), where k is the number of times the get method was invoked. The other locations are maintained in the right heap.
-
-
-
-Hint 4
-Every time when add is being called, we add it to the left heap. If the size of the left heap exceeds k + 1, we move the head element to the right heap.
-
-
-
-Hint 5
-When the get method is invoked again (the k + 1 time it is invoked), we can return the head element of the left heap. But before returning it, if the right heap is not empty, we maintain the left heap to have the best k + 2 items by moving the best location from the right heap to the left heap.
-
diff --git a/problems/serialize-and-deserialize-binary-tree/README.md b/problems/serialize-and-deserialize-binary-tree/README.md
deleted file mode 100644
index 4160e5f76..000000000
--- a/problems/serialize-and-deserialize-binary-tree/README.md
+++ /dev/null
@@ -1,69 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../best-meeting-point "Best Meeting Point")
-
-[Next >](../binary-tree-longest-consecutive-sequence "Binary Tree Longest Consecutive Sequence")
-
-## [297. Serialize and Deserialize Binary Tree (Hard)](https://leetcode.com/problems/serialize-and-deserialize-binary-tree "二叉树的序列化与反序列化")
-
-
Serialization is the process of converting a data structure or object into a sequence of bits so that it can be stored in a file or memory buffer, or transmitted across a network connection link to be reconstructed later in the same or another computer environment.
-
-
Design an algorithm to serialize and deserialize a binary tree. There is no restriction on how your serialization/deserialization algorithm should work. You just need to ensure that a binary tree can be serialized to a string and this string can be deserialized to the original tree structure.
-
-
Clarification: The input/output format is the same as how LeetCode serializes a binary tree. You do not necessarily need to follow this format, so please be creative and come up with different approaches yourself.
The number of nodes in the tree is in the range [0, 104].
-
-1000 <= Node.val <= 1000
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
- [[Tree](../../tag/tree/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Design](../../tag/design/README.md)]
- [[Binary Tree](../../tag/binary-tree/README.md)]
-
-### Similar Questions
- 1. [Encode and Decode Strings](../encode-and-decode-strings) (Medium)
- 1. [Serialize and Deserialize BST](../serialize-and-deserialize-bst) (Medium)
- 1. [Find Duplicate Subtrees](../find-duplicate-subtrees) (Medium)
- 1. [Serialize and Deserialize N-ary Tree](../serialize-and-deserialize-n-ary-tree) (Hard)
diff --git a/problems/serialize-and-deserialize-binary-tree/serialize_and_deserialize_binary_tree.go b/problems/serialize-and-deserialize-binary-tree/serialize_and_deserialize_binary_tree.go
deleted file mode 100644
index 16664e22a..000000000
--- a/problems/serialize-and-deserialize-binary-tree/serialize_and_deserialize_binary_tree.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem297
diff --git a/problems/serialize-and-deserialize-binary-tree/serialize_and_deserialize_binary_tree.py b/problems/serialize-and-deserialize-binary-tree/serialize_and_deserialize_binary_tree.py
deleted file mode 100755
index 2b769700c..000000000
--- a/problems/serialize-and-deserialize-binary-tree/serialize_and_deserialize_binary_tree.py
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/usr/bin/env python
-
-# Definition for a binary tree node.
-# class TreeNode(object):
-# def __init__(self, x):
-# self.val = x
-# self.left = None
-# self.right = None
-
-class Codec:
-
- def serialize(self, root):
- """Encodes a tree to a single string.
-
- :type root: TreeNode
- :rtype: str
- """
-
-
- def deserialize(self, data):
- """Decodes your encoded data to tree.
-
- :type data: str
- :rtype: TreeNode
- """
-
-
-# Your Codec object will be instantiated and called as such:
-# codec = Codec()
-# codec.deserialize(codec.serialize(root))
\ No newline at end of file
diff --git a/problems/serialize-and-deserialize-binary-tree/serialize_and_deserialize_binary_tree_test.go b/problems/serialize-and-deserialize-binary-tree/serialize_and_deserialize_binary_tree_test.go
deleted file mode 100644
index 16664e22a..000000000
--- a/problems/serialize-and-deserialize-binary-tree/serialize_and_deserialize_binary_tree_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem297
diff --git a/problems/serialize-and-deserialize-bst/README.md b/problems/serialize-and-deserialize-bst/README.md
deleted file mode 100644
index 806fb28dd..000000000
--- a/problems/serialize-and-deserialize-bst/README.md
+++ /dev/null
@@ -1,49 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../find-all-numbers-disappeared-in-an-array "Find All Numbers Disappeared in an Array")
-
-[Next >](../delete-node-in-a-bst "Delete Node in a BST")
-
-## [449. Serialize and Deserialize BST (Medium)](https://leetcode.com/problems/serialize-and-deserialize-bst "序列化和反序列化二叉搜索树")
-
-
Serialization is converting a data structure or object into a sequence of bits so that it can be stored in a file or memory buffer, or transmitted across a network connection link to be reconstructed later in the same or another computer environment.
-
-
Design an algorithm to serialize and deserialize a binary search tree. There is no restriction on how your serialization/deserialization algorithm should work. You need to ensure that a binary search tree can be serialized to a string, and this string can be deserialized to the original tree structure.
-
-
The encoded string should be as compact as possible.
-
-
-
Example 1:
-
Input: root = [2,1,3]
-Output: [2,1,3]
-
Example 2:
-
Input: root = []
-Output: []
-
-
-
Constraints:
-
-
-
The number of nodes in the tree is in the range [0, 104].
-
0 <= Node.val <= 104
-
The input tree is guaranteed to be a binary search tree.
-
-
-### Related Topics
- [[Tree](../../tag/tree/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Design](../../tag/design/README.md)]
- [[Binary Search Tree](../../tag/binary-search-tree/README.md)]
- [[String](../../tag/string/README.md)]
- [[Binary Tree](../../tag/binary-tree/README.md)]
-
-### Similar Questions
- 1. [Serialize and Deserialize Binary Tree](../serialize-and-deserialize-binary-tree) (Hard)
- 1. [Find Duplicate Subtrees](../find-duplicate-subtrees) (Medium)
- 1. [Serialize and Deserialize N-ary Tree](../serialize-and-deserialize-n-ary-tree) (Hard)
diff --git a/problems/serialize-and-deserialize-bst/serialize_and_deserialize_bst.go b/problems/serialize-and-deserialize-bst/serialize_and_deserialize_bst.go
deleted file mode 100644
index b46c99fd2..000000000
--- a/problems/serialize-and-deserialize-bst/serialize_and_deserialize_bst.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem449
diff --git a/problems/serialize-and-deserialize-bst/serialize_and_deserialize_bst.py b/problems/serialize-and-deserialize-bst/serialize_and_deserialize_bst.py
deleted file mode 100755
index 2b769700c..000000000
--- a/problems/serialize-and-deserialize-bst/serialize_and_deserialize_bst.py
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/usr/bin/env python
-
-# Definition for a binary tree node.
-# class TreeNode(object):
-# def __init__(self, x):
-# self.val = x
-# self.left = None
-# self.right = None
-
-class Codec:
-
- def serialize(self, root):
- """Encodes a tree to a single string.
-
- :type root: TreeNode
- :rtype: str
- """
-
-
- def deserialize(self, data):
- """Decodes your encoded data to tree.
-
- :type data: str
- :rtype: TreeNode
- """
-
-
-# Your Codec object will be instantiated and called as such:
-# codec = Codec()
-# codec.deserialize(codec.serialize(root))
\ No newline at end of file
diff --git a/problems/serialize-and-deserialize-bst/serialize_and_deserialize_bst_test.go b/problems/serialize-and-deserialize-bst/serialize_and_deserialize_bst_test.go
deleted file mode 100644
index b46c99fd2..000000000
--- a/problems/serialize-and-deserialize-bst/serialize_and_deserialize_bst_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem449
diff --git a/problems/serialize-and-deserialize-n-ary-tree/README.md b/problems/serialize-and-deserialize-n-ary-tree/README.md
deleted file mode 100644
index cacfe9ae5..000000000
--- a/problems/serialize-and-deserialize-n-ary-tree/README.md
+++ /dev/null
@@ -1,46 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../construct-quad-tree "Construct Quad Tree")
-
-[Next >](../n-ary-tree-level-order-traversal "N-ary Tree Level Order Traversal")
-
-## [428. Serialize and Deserialize N-ary Tree (Hard)](https://leetcode.com/problems/serialize-and-deserialize-n-ary-tree "序列化和反序列化 N 叉树")
-
-
Serialization is the process of converting a data structure or object into a sequence of bits so that it can be stored in a file or memory buffer, or transmitted across a network connection link to be reconstructed later in the same or another computer environment.
-
-
Design an algorithm to serialize and deserialize an N-ary tree. An N-ary tree is a rooted tree in which each node has no more than N children. There is no restriction on how your serialization/deserialization algorithm should work. You just need to ensure that an N-ary tree can be serialized to a string and this string can be deserialized to the original tree structure.
-
-
For example, you may serialize the following 3-ary tree
-
-
-
-
-
-
-
-
as [1 [3[5 6] 2 4]]. You do not necessarily need to follow this format, so please be creative and come up with different approaches yourself.
-
-
-
-
Note:
-
-
-
N is in the range of [1, 1000]
-
Do not use class member/global/static variables to store states. Your serialize and deserialize algorithms should be stateless.
-
-
-### Related Topics
- [[Tree](../../tag/tree/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Similar Questions
- 1. [Serialize and Deserialize Binary Tree](../serialize-and-deserialize-binary-tree) (Hard)
- 1. [Serialize and Deserialize BST](../serialize-and-deserialize-bst) (Medium)
- 1. [Encode N-ary Tree to Binary Tree](../encode-n-ary-tree-to-binary-tree) (Hard)
diff --git a/problems/serialize-and-deserialize-n-ary-tree/serialize_and_deserialize_n_ary_tree.go b/problems/serialize-and-deserialize-n-ary-tree/serialize_and_deserialize_n_ary_tree.go
deleted file mode 100644
index d566dc0e3..000000000
--- a/problems/serialize-and-deserialize-n-ary-tree/serialize_and_deserialize_n_ary_tree.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem428
diff --git a/problems/serialize-and-deserialize-n-ary-tree/serialize_and_deserialize_n_ary_tree_test.go b/problems/serialize-and-deserialize-n-ary-tree/serialize_and_deserialize_n_ary_tree_test.go
deleted file mode 100644
index d566dc0e3..000000000
--- a/problems/serialize-and-deserialize-n-ary-tree/serialize_and_deserialize_n_ary_tree_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem428
diff --git a/problems/set-intersection-size-at-least-two/README.md b/problems/set-intersection-size-at-least-two/README.md
deleted file mode 100644
index 948d7ff0a..000000000
--- a/problems/set-intersection-size-at-least-two/README.md
+++ /dev/null
@@ -1,49 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../pyramid-transition-matrix "Pyramid Transition Matrix")
-
-[Next >](../bold-words-in-string "Bold Words in String")
-
-## [757. Set Intersection Size At Least Two (Hard)](https://leetcode.com/problems/set-intersection-size-at-least-two "设置交集大小至少为2")
-
-
An integer interval [a, b] (for integers a < b) is a set of all consecutive integers from a to b, including a and b.
-
-
Find the minimum size of a set S such that for every integer interval A in intervals, the intersection of S with A has a size of at least two.
-
-
-
Example 1:
-
-
-Input: intervals = [[1,3],[1,4],[2,5],[3,5]]
-Output: 3
-Explanation: Consider the set S = {2, 3, 4}. For each interval, there are at least 2 elements from S in the interval.
-Also, there isn't a smaller size set that fulfills the above condition.
-Thus, we output the size of this set, which is 3.
-
-
-
Example 2:
-
-
-Input: intervals = [[1,2],[2,3],[2,4],[4,5]]
-Output: 5
-Explanation: An example of a minimum sized set is {1, 2, 3, 4, 5}.
-
A straightforward solution using O(mn) space is probably a bad idea.
-
A simple improvement uses O(m + n) space, but still not the best solution.
-
Could you devise a constant space solution?
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
-
-### Similar Questions
- 1. [Game of Life](../game-of-life) (Medium)
- 1. [Number of Laser Beams in a Bank](../number-of-laser-beams-in-a-bank) (Medium)
- 1. [Minimum Operations to Remove Adjacent Ones in Matrix](../minimum-operations-to-remove-adjacent-ones-in-matrix) (Hard)
-
-### Hints
-
-Hint 1
-If any cell of the matrix has a zero we can record its row and column number using additional memory.
-But if you don't want to use extra memory then you can manipulate the array instead. i.e. simulating exactly what the question says.
-
-
-
-Hint 2
-Setting cell values to zero on the fly while iterating might lead to discrepancies. What if you use some other integer value as your marker?
-There is still a better approach for this problem with 0(1) space.
-
-
-
-Hint 3
-We could have used 2 sets to keep a record of rows/columns which need to be set to zero. But for an O(1) space solution, you can use one of the rows and and one of the columns to keep track of this information.
-
-
-
-Hint 4
-We can use the first cell of every row and column as a flag. This flag would determine whether a row or column has been set to zero.
-
diff --git a/problems/set-matrix-zeroes/set_matrix_zeroes.go b/problems/set-matrix-zeroes/set_matrix_zeroes.go
deleted file mode 100644
index 3209e90d8..000000000
--- a/problems/set-matrix-zeroes/set_matrix_zeroes.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem73
diff --git a/problems/set-matrix-zeroes/set_matrix_zeroes_test.go b/problems/set-matrix-zeroes/set_matrix_zeroes_test.go
deleted file mode 100644
index 3209e90d8..000000000
--- a/problems/set-matrix-zeroes/set_matrix_zeroes_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem73
diff --git a/problems/set-mismatch/README.md b/problems/set-mismatch/README.md
deleted file mode 100644
index afde337fb..000000000
--- a/problems/set-mismatch/README.md
+++ /dev/null
@@ -1,43 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-average-subarray-ii "Maximum Average Subarray II")
-
-[Next >](../maximum-length-of-pair-chain "Maximum Length of Pair Chain")
-
-## [645. Set Mismatch (Easy)](https://leetcode.com/problems/set-mismatch "错误的集合")
-
-
You have a set of integers s, which originally contains all the numbers from 1 to n. Unfortunately, due to some error, one of the numbers in s got duplicated to another number in the set, which results in repetition of one number and loss of another number.
-
-
You are given an integer array nums representing the data status of this set after the error.
-
-
Find the number that occurs twice and the number that is missing and return them in the form of an array.
Given a 2D grid of size m x n and an integer k. You need to shift the gridk times.
-
-
In one shift operation:
-
-
-
Element at grid[i][j] moves to grid[i][j + 1].
-
Element at grid[i][n - 1] moves to grid[i + 1][0].
-
Element at grid[m - 1][n - 1] moves to grid[0][0].
-
-
-
Return the 2D grid after applying shift operation k times.
-
-
-
Example 1:
-
-
-Input:grid = [[1,2,3],[4,5,6],[7,8,9]], k = 1
-Output: [[9,1,2],[3,4,5],[6,7,8]]
-
-
-
Example 2:
-
-
-Input:grid = [[3,8,1,9],[19,7,2,5],[4,6,11,10],[12,0,21,13]], k = 4
-Output: [[12,0,21,13],[3,8,1,9],[19,7,2,5],[4,6,11,10]]
-
-
-
Example 3:
-
-
-Input:grid = [[1,2,3],[4,5,6],[7,8,9]], k = 9
-Output: [[1,2,3],[4,5,6],[7,8,9]]
-
-
-
-
Constraints:
-
-
-
m == grid.length
-
n == grid[i].length
-
1 <= m <= 50
-
1 <= n <= 50
-
-1000 <= grid[i][j] <= 1000
-
0 <= k <= 100
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
- [[Simulation](../../tag/simulation/README.md)]
-
-### Hints
-
-Hint 1
-Simulate step by step. move grid[i][j] to grid[i][j+1]. handle last column of the grid.
-
-
-
-Hint 2
-Put the matrix row by row to a vector. take k % vector.length and move last k of the vector to the beginning. put the vector to the matrix back the same way.
-
diff --git a/problems/shifting-letters/README.md b/problems/shifting-letters/README.md
deleted file mode 100644
index 8a9fdbb35..000000000
--- a/problems/shifting-letters/README.md
+++ /dev/null
@@ -1,57 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../shortest-path-visiting-all-nodes "Shortest Path Visiting All Nodes")
-
-[Next >](../maximize-distance-to-closest-person "Maximize Distance to Closest Person")
-
-## [848. Shifting Letters (Medium)](https://leetcode.com/problems/shifting-letters "字母移位")
-
-
You are given a string s of lowercase English letters and an integer array shifts of the same length.
-
-
Call the shift() of a letter, the next letter in the alphabet, (wrapping around so that 'z' becomes 'a').
-
-
-
For example, shift('a') = 'b', shift('t') = 'u', and shift('z') = 'a'.
-
-
-
Now for each shifts[i] = x, we want to shift the first i + 1 letters of s, x times.
-
-
Return the final string after all such shifts to s are applied.
-
-
-
Example 1:
-
-
-Input: s = "abc", shifts = [3,5,9]
-Output: "rpl"
-Explanation: We start with "abc".
-After shifting the first 1 letters of s by 3, we have "dbc".
-After shifting the first 2 letters of s by 5, we have "igc".
-After shifting the first 3 letters of s by 9, we have "rpl", the answer.
-
-
-
Example 2:
-
-
-Input: s = "aaa", shifts = [1,2,3]
-Output: "gfd"
-
In LeetCode Store, there are n items to sell. Each item has a price. However, there are some special offers, and a special offer consists of one or more different kinds of items with a sale price.
-
-
You are given an integer array price where price[i] is the price of the ith item, and an integer array needs where needs[i] is the number of pieces of the ith item you want to buy.
-
-
You are also given an array special where special[i] is of size n + 1 where special[i][j] is the number of pieces of the jth item in the ith offer and special[i][n] (i.e., the last integer in the array) is the price of the ith offer.
-
-
Return the lowest price you have to pay for exactly certain items as given, where you could make optimal use of the special offers. You are not allowed to buy more items than you want, even if that would lower the overall price. You could use any of the special offers as many times as you want.
-
-
-
Example 1:
-
-
-Input: price = [2,5], special = [[3,0,5],[1,2,10]], needs = [3,2]
-Output: 14
-Explanation: There are two kinds of items, A and B. Their prices are $2 and $5 respectively.
-In special offer 1, you can pay $5 for 3A and 0B
-In special offer 2, you can pay $10 for 1A and 2B.
-You need to buy 3A and 2B, so you may pay $10 for 1A and 2B (special offer #2), and $4 for 2A.
-
-
-
Example 2:
-
-
-Input: price = [2,3,4], special = [[1,1,0,4],[2,2,1,9]], needs = [1,2,1]
-Output: 11
-Explanation: The price of A is $2, and $3 for B, $4 for C.
-You may pay $4 for 1A and 1B, and $9 for 2A ,2B and 1C.
-You need to buy 1A ,2B and 1C, so you may pay $4 for 1A and 1B (special offer #1), and $3 for 1B, $4 for 1C.
-You cannot add more items, though only $9 for 2A ,2B and 1C.
-
A valid encoding of an array of words is any reference string s and array of indices indices such that:
-
-
-
words.length == indices.length
-
The reference string s ends with the '#' character.
-
For each index indices[i], the substring of s starting from indices[i] and up to (but not including) the next '#' character is equal to words[i].
-
-
-
Given an array of words, return the length of the shortest reference strings possible of any valid encoding of words.
-
-
-
Example 1:
-
-
-Input: words = ["time", "me", "bell"]
-Output: 10
-Explanation: A valid encoding would be s = "time#bell#" and indices = [0, 2, 5].
-words[0] = "time", the substring of s starting from indices[0] = 0 to the next '#' is underlined in "time#bell#"
-words[1] = "me", the substring of s starting from indices[1] = 2 to the next '#' is underlined in "time#bell#"
-words[2] = "bell", the substring of s starting from indices[2] = 5 to the next '#' is underlined in "time#bell#"
-
-
-
Example 2:
-
-
-Input: words = ["t"]
-Output: 2
-Explanation: A valid encoding would be s = "t#" and indices = [0].
-
Given two strings str1 and str2, return the shortest string that has both str1 and str2 as subsequences. If there are multiple valid strings, return any of them.
-
-
A string s is a subsequence of string t if deleting some number of characters from t (possibly 0) results in the string s.
-
-
-
Example 1:
-
-
-Input: str1 = "abac", str2 = "cab"
-Output: "cabac"
-Explanation:
-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.
-
str1 and str2 consist of lowercase English letters.
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Hints
-
-Hint 1
-We can find the length of the longest common subsequence between str1[i:] and str2[j:] (for all (i, j)) by using dynamic programming. We can use this information to recover the longest common supersequence.
-
diff --git a/problems/shortest-common-supersequence/shortest_common_supersequence.go b/problems/shortest-common-supersequence/shortest_common_supersequence.go
deleted file mode 100644
index 86c6404f4..000000000
--- a/problems/shortest-common-supersequence/shortest_common_supersequence.go
+++ /dev/null
@@ -1,64 +0,0 @@
-package problem1092
-
-import "strings"
-
-func shortestCommonSupersequence(A, B string) string {
- m, n := len(A), len(B)
- // 解题思路,
- // 先求出 A 和 B 的 LCS,
- // 然后,在 LCS 上添加缺少的字母
- // 利用 dp 求解 LCS ,
- // dp[i][j]=k 表示 A[:i] 与 B[:j] 的 LCS 的长度为 k
- // 在递归过程中,会出现三种情况:
- // 1. A[i]=B[j], 则 dp[i][j]= dp[i-1][j-1]+1
- // 2. A[i]!=B[j] 且 dp[i-1][j] >= dp[i][j-1],则 dp[i][j]=dp[i-1][j]
- // 3. A[i]!=B[j] 且 dp[i-1][j] < dp[i][j-1],则 dp[i][j]=dp[i][j+1]
-
- dp := [1001][1001]int{}
- b := [1001][1001]int{} // 记录哪种情况发生了,以便添加字母
-
- for i := 1; i <= m; i++ {
- for j := 1; j <= n; j++ {
- if A[i-1] == B[j-1] {
- dp[i][j] = dp[i-1][j-1] + 1
- b[i][j] = 1
- } else if dp[i-1][j] >= dp[i][j-1] {
- dp[i][j] = dp[i-1][j]
- b[i][j] = 2
- } else {
- dp[i][j] = dp[i][j-1]
- b[i][j] = 3
- }
- }
- }
-
- var sb strings.Builder
- var dfs func(int, int)
- dfs = func(i, j int) {
- if i == 0 {
- sb.WriteString(B[:j])
- return
- }
-
- if j == 0 {
- sb.WriteString(A[:i])
- return
- }
-
- switch b[i][j] {
- case 1:
- dfs(i-1, j-1)
- sb.WriteByte(A[i-1])
- case 2:
- dfs(i-1, j)
- sb.WriteByte(A[i-1])
- case 3:
- dfs(i, j-1)
- sb.WriteByte(B[j-1])
- }
- }
-
- dfs(m, n)
-
- return sb.String()
-}
diff --git a/problems/shortest-completing-word/README.md b/problems/shortest-completing-word/README.md
deleted file mode 100644
index 10eb3e10f..000000000
--- a/problems/shortest-completing-word/README.md
+++ /dev/null
@@ -1,64 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../largest-number-at-least-twice-of-others "Largest Number At Least Twice of Others")
-
-[Next >](../contain-virus "Contain Virus")
-
-## [748. Shortest Completing Word (Easy)](https://leetcode.com/problems/shortest-completing-word "最短补全词")
-
-
Given a string licensePlate and an array of strings words, find the shortest completing word in words.
-
-
A completing word is a word that contains all the letters in licensePlate. Ignore numbers and spaces in licensePlate, and treat letters as case insensitive. If a letter appears more than once in licensePlate, then it must appear in the word the same number of times or more.
-
-
For example, if licensePlate = "aBc 12c", then it contains letters 'a', 'b' (ignoring case), and 'c' twice. Possible completing words are "abccdef", "caaacab", and "cbca".
-
-
Return the shortest completing word in words. It is guaranteed an answer exists. If there are multiple shortest completing words, return the first one that occurs in words.
-
-
-
Example 1:
-
-
-Input: licensePlate = "1s3 PSt", words = ["step","steps","stripe","stepple"]
-Output: "steps"
-Explanation: licensePlate contains letters 's', 'p', 's' (ignoring case), and 't'.
-"step" contains 't' and 'p', but only contains 1 's'.
-"steps" contains 't', 'p', and both 's' characters.
-"stripe" is missing an 's'.
-"stepple" is missing an 's'.
-Since "steps" is the only word containing all the letters, that is the answer.
-
-
-
Example 2:
-
-
-Input: licensePlate = "1s3 456", words = ["looks","pest","stew","show"]
-Output: "pest"
-Explanation: licensePlate only contains the letter 's'. All the words contain 's', but among these "pest", "stew", and "show" are shortest. The answer is "pest" because it is the word that appears earliest of the 3.
-
-
-
-
Constraints:
-
-
-
1 <= licensePlate.length <= 7
-
licensePlate contains digits, letters (uppercase or lowercase), or space ' '.
-
1 <= words.length <= 1000
-
1 <= words[i].length <= 15
-
words[i] consists of lower case English letters.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Hints
-
-Hint 1
-Count only the letters (possibly converted to lowercase) of each word. If a word is shorter and the count of each letter is at least the count of that letter in the licensePlate, it is the best answer we've seen yet.
-
diff --git a/problems/shortest-completing-word/shortest_completing_word.go b/problems/shortest-completing-word/shortest_completing_word.go
deleted file mode 100644
index aad7f10d2..000000000
--- a/problems/shortest-completing-word/shortest_completing_word.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem748
diff --git a/problems/shortest-completing-word/shortest_completing_word_test.go b/problems/shortest-completing-word/shortest_completing_word_test.go
deleted file mode 100644
index aad7f10d2..000000000
--- a/problems/shortest-completing-word/shortest_completing_word_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem748
diff --git a/problems/shortest-distance-from-all-buildings/README.md b/problems/shortest-distance-from-all-buildings/README.md
deleted file mode 100644
index d8508700c..000000000
--- a/problems/shortest-distance-from-all-buildings/README.md
+++ /dev/null
@@ -1,50 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../remove-duplicate-letters "Remove Duplicate Letters")
-
-[Next >](../maximum-product-of-word-lengths "Maximum Product of Word Lengths")
-
-## [317. Shortest Distance from All Buildings (Hard)](https://leetcode.com/problems/shortest-distance-from-all-buildings "离建筑物最近的距离")
-
-
You want to build a house on an empty land which reaches all buildings in the shortest amount of distance. You can only move up, down, left and right. You are given a 2D grid of values 0, 1 or 2, where:
-
-
-
Each 0 marks an empty land which you can pass by freely.
-
Each 1 marks a building which you cannot pass through.
-
Each 2 marks an obstacle which you cannot pass through.
-
-
-
Example:
-
-
-Input: [[1,0,2,0,1],[0,0,0,0,0],[0,0,1,0,0]]
-
-1 - 0 - 2 - 0 - 1
-| | | | |
-0 - 0 - 0 - 0 - 0
-| | | | |
-0 - 0 - 1 - 0 - 0
-
-Output: 7
-
-Explanation: Given three buildings at (0,0), (0,4), (2,2), and an obstacle at (0,2),
- the point (1,2) is an ideal empty land to build a house, as the total
- travel distance of 3+3+1=7 is minimal. So return 7.
-
-
Note:
-There will be at least one building. If it is not possible to build such house according to the above rules, return -1.
-
-### Related Topics
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
-
-### Similar Questions
- 1. [Walls and Gates](../walls-and-gates) (Medium)
- 1. [Best Meeting Point](../best-meeting-point) (Hard)
- 1. [As Far from Land as Possible](../as-far-from-land-as-possible) (Medium)
diff --git a/problems/shortest-distance-from-all-buildings/shortest_distance_from_all_buildings.go b/problems/shortest-distance-from-all-buildings/shortest_distance_from_all_buildings.go
deleted file mode 100644
index 5b74b6b4a..000000000
--- a/problems/shortest-distance-from-all-buildings/shortest_distance_from_all_buildings.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem317
diff --git a/problems/shortest-distance-from-all-buildings/shortest_distance_from_all_buildings_test.go b/problems/shortest-distance-from-all-buildings/shortest_distance_from_all_buildings_test.go
deleted file mode 100644
index 5b74b6b4a..000000000
--- a/problems/shortest-distance-from-all-buildings/shortest_distance_from_all_buildings_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem317
diff --git a/problems/shortest-distance-in-a-line/README.md b/problems/shortest-distance-in-a-line/README.md
deleted file mode 100644
index 1d788e5d0..000000000
--- a/problems/shortest-distance-in-a-line/README.md
+++ /dev/null
@@ -1,48 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../shortest-distance-in-a-plane "Shortest Distance in a Plane")
-
-[Next >](../second-degree-follower "Second Degree Follower")
-
-## [613. Shortest Distance in a Line (Easy)](https://leetcode.com/problems/shortest-distance-in-a-line "直线上的最近距离")
-
-Table point holds the x coordinate of some points on x-axis in a plane, which are all integers.
-
-Write a query to find the shortest distance between two points in these points.
-
-
-
-
-| x |
-|-----|
-| -1 |
-| 0 |
-| 2 |
-
-
-
-The shortest distance is '1' obviously, which is from point '-1' to '0'. So the output is as below:
-
-
-
-
-| shortest|
-|---------|
-| 1 |
-
-
-
-Note: Every point is unique, which means there is no duplicates in table point.
-
-
-Follow-up: What if all these points have an id and are arranged from the left most to the right most of x axis?
-
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/shortest-distance-in-a-line/mysql_schemas.sql b/problems/shortest-distance-in-a-line/mysql_schemas.sql
deleted file mode 100644
index bef5a5599..000000000
--- a/problems/shortest-distance-in-a-line/mysql_schemas.sql
+++ /dev/null
@@ -1,5 +0,0 @@
-Create Table If Not Exists Point (x int not null);
-Truncate table Point;
-insert into Point (x) values ('-1');
-insert into Point (x) values ('0');
-insert into Point (x) values ('2');
diff --git a/problems/shortest-distance-in-a-line/shortest_distance_in_a_line.sql b/problems/shortest-distance-in-a-line/shortest_distance_in_a_line.sql
deleted file mode 100644
index 335040c49..000000000
--- a/problems/shortest-distance-in-a-line/shortest_distance_in_a_line.sql
+++ /dev/null
@@ -1,7 +0,0 @@
-# Write your MySQL query statement below
-
-SELECT MIN(ABS(p1.x - p2.x)) AS shortest
-FROM
- point p1
- JOIN
- point p2 ON p1.x != p2.x;
diff --git a/problems/shortest-distance-in-a-plane/README.md b/problems/shortest-distance-in-a-plane/README.md
deleted file mode 100644
index 3f758e57e..000000000
--- a/problems/shortest-distance-in-a-plane/README.md
+++ /dev/null
@@ -1,45 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../valid-triangle-number "Valid Triangle Number")
-
-[Next >](../shortest-distance-in-a-line "Shortest Distance in a Line")
-
-## [612. Shortest Distance in a Plane (Medium)](https://leetcode.com/problems/shortest-distance-in-a-plane "平面上的最近距离")
-
-Table point_2d holds the coordinates (x,y) of some unique points (more than two) in a plane.
-
-Write a query to find the shortest distance between these points rounded to 2 decimals.
-
-
-The shortest distance is 1.00 from point (-1,-1) to (-1,2). So the output should be:
-
-
-
-
-| shortest |
-|----------|
-| 1.00 |
-
-
-
-Note: The longest distance among all the points are less than 10000.
-
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/shortest-distance-in-a-plane/mysql_schemas.sql b/problems/shortest-distance-in-a-plane/mysql_schemas.sql
deleted file mode 100644
index fe36290c3..000000000
--- a/problems/shortest-distance-in-a-plane/mysql_schemas.sql
+++ /dev/null
@@ -1,5 +0,0 @@
-Create Table If Not Exists Point2D (x int not null, y int not null);
-Truncate table Point2D;
-insert into Point2D (x, y) values ('-1', '-1');
-insert into Point2D (x, y) values ('0', '0');
-insert into Point2D (x, y) values ('-1', '-2');
diff --git a/problems/shortest-distance-in-a-plane/shortest_distance_in_a_plane.sql b/problems/shortest-distance-in-a-plane/shortest_distance_in_a_plane.sql
deleted file mode 100644
index bae62cf19..000000000
--- a/problems/shortest-distance-in-a-plane/shortest_distance_in_a_plane.sql
+++ /dev/null
@@ -1 +0,0 @@
-# Write your MySQL query statement below
diff --git a/problems/shortest-distance-to-a-character/README.md b/problems/shortest-distance-to-a-character/README.md
deleted file mode 100644
index 1ae107496..000000000
--- a/problems/shortest-distance-to-a-character/README.md
+++ /dev/null
@@ -1,50 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../short-encoding-of-words "Short Encoding of Words")
-
-[Next >](../card-flipping-game "Card Flipping Game")
-
-## [821. Shortest Distance to a Character (Easy)](https://leetcode.com/problems/shortest-distance-to-a-character "字符的最短距离")
-
-
Given a string s and a character c that occurs in s, return an array of integers answer where answer.length == s.length and answer[i] is the distance from index i to the closest occurrence of character c in s.
-
-
The distance between two indices i and j is abs(i - j), where abs is the absolute value function.
-
-
-
Example 1:
-
-
-Input: s = "loveleetcode", c = "e"
-Output: [3,2,1,0,1,0,0,1,2,2,1,0]
-Explanation: The character 'e' appears at indices 3, 5, 6, and 11 (0-indexed).
-The closest occurrence of 'e' for index 0 is at index 3, so the distance is abs(0 - 3) = 3.
-The closest occurrence of 'e' for index 1 is at index 3, so the distance is abs(1 - 3) = 2.
-For index 4, there is a tie between the 'e' at index 3 and the 'e' at index 5, but the distance is still the same: abs(4 - 3) == abs(4 - 5) = 1.
-The closest occurrence of 'e' for index 8 is at index 6, so the distance is abs(8 - 6) = 2.
-
-
-
Example 2:
-
-
-Input: s = "aaab", c = "b"
-Output: [3,2,1,0]
-
-
-
-
Constraints:
-
-
-
1 <= s.length <= 104
-
s[i] and c are lowercase English letters.
-
It is guaranteed that c occurs at least once in s.
You are given an array colors, in which there are three colors: 1, 2 and 3.
-
-
You are also given some queries. Each query consists of two integers i and c, return the shortest distance between the given index i and the target color c. If there is no solution return -1.
-
-
-
Example 1:
-
-
-Input: colors = [1,1,2,1,3,2,2,3,3], queries = [[1,3],[2,2],[6,1]]
-Output: [3,0,3]
-Explanation:
-The nearest 3 from index 1 is at index 4 (3 steps away).
-The nearest 2 from index 2 is at index 2 itself (0 steps away).
-The nearest 1 from index 6 is at index 3 (3 steps away).
-
-
-
Example 2:
-
-
-Input: colors = [1,2], queries = [[0,3]]
-Output: [-1]
-Explanation: There is no 3 in the array.
-
-
-
-
Constraints:
-
-
-
1 <= colors.length <= 5*10^4
-
1 <= colors[i] <= 3
-
1 <= queries.length <= 5*10^4
-
queries[i].length == 2
-
0 <= queries[i][0] < colors.length
-
1 <= queries[i][1] <= 3
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Hints
-
-Hint 1
-Greedy solution is too slow because of the limits.
-
-
-
-Hint 2
-Can you solve this problem offline by doing some pre-processing?
-
-
-
-Hint 3
-Calculate the answers for all indexes moving to their left and to their right.
-
diff --git a/problems/shortest-palindrome/README.md b/problems/shortest-palindrome/README.md
deleted file mode 100644
index 28f4df0e1..000000000
--- a/problems/shortest-palindrome/README.md
+++ /dev/null
@@ -1,43 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../house-robber-ii "House Robber II")
-
-[Next >](../kth-largest-element-in-an-array "Kth Largest Element in an Array")
-
-## [214. Shortest Palindrome (Hard)](https://leetcode.com/problems/shortest-palindrome "最短回文串")
-
-
You are given a string s. You can convert s to a palindrome by adding characters in front of it.
-
-
Return the shortest palindrome you can find by performing this transformation.
-
-
-
Example 1:
-
Input: s = "aacecaaa"
-Output: "aaacecaaa"
-
Example 2:
-
Input: s = "abcd"
-Output: "dcbabcd"
-
-
-
Constraints:
-
-
-
0 <= s.length <= 5 * 104
-
s consists of lowercase English letters only.
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
- [[String Matching](../../tag/string-matching/README.md)]
- [[Hash Function](../../tag/hash-function/README.md)]
- [[Rolling Hash](../../tag/rolling-hash/README.md)]
-
-### Similar Questions
- 1. [Longest Palindromic Substring](../longest-palindromic-substring) (Medium)
- 1. [Implement strStr()](../implement-strstr) (Easy)
- 1. [Palindrome Pairs](../palindrome-pairs) (Hard)
diff --git a/problems/shortest-palindrome/shortest_palindrome.go b/problems/shortest-palindrome/shortest_palindrome.go
deleted file mode 100644
index 54b8dbd28..000000000
--- a/problems/shortest-palindrome/shortest_palindrome.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem214
diff --git a/problems/shortest-palindrome/shortest_palindrome_test.go b/problems/shortest-palindrome/shortest_palindrome_test.go
deleted file mode 100644
index 54b8dbd28..000000000
--- a/problems/shortest-palindrome/shortest_palindrome_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem214
diff --git a/problems/shortest-path-in-a-grid-with-obstacles-elimination/README.md b/problems/shortest-path-in-a-grid-with-obstacles-elimination/README.md
deleted file mode 100644
index 50024922b..000000000
--- a/problems/shortest-path-in-a-grid-with-obstacles-elimination/README.md
+++ /dev/null
@@ -1,66 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-side-length-of-a-square-with-sum-less-than-or-equal-to-threshold "Maximum Side Length of a Square with Sum Less than or Equal to Threshold")
-
-[Next >](../weather-type-in-each-country "Weather Type in Each Country")
-
-## [1293. Shortest Path in a Grid with Obstacles Elimination (Hard)](https://leetcode.com/problems/shortest-path-in-a-grid-with-obstacles-elimination "网格中的最短路径")
-
-
You are given an m x n integer matrix grid where each cell is either 0 (empty) or 1 (obstacle). You can move up, down, left, or right from and to an empty cell in one step.
-
-
Return the minimum number of steps to walk from the upper left corner (0, 0) to the lower right corner (m - 1, n - 1) given that you can eliminate at mostk obstacles. If it is not possible to find such walk return -1.
-
-
-
Example 1:
-
-
-Input: grid = [[0,0,0],[1,1,0],[0,0,0],[0,1,1],[0,0,0]], k = 1
-Output: 6
-Explanation:
-The shortest path without eliminating any obstacle is 10.
-The shortest path with one obstacle elimination at position (3,2) is 6. Such path is (0,0) -> (0,1) -> (0,2) -> (1,2) -> (2,2) -> (3,2) -> (4,2).
-
-
-
Example 2:
-
-
-Input: grid = [[0,1,1],[1,1,1],[1,0,0]], k = 1
-Output: -1
-Explanation: We need to eliminate at least two obstacles to find such a walk.
-
-
-
-
Constraints:
-
-
-
m == grid.length
-
n == grid[i].length
-
1 <= m, n <= 40
-
1 <= k <= m * n
-
grid[i][j] is either 0or1.
-
grid[0][0] == grid[m - 1][n - 1] == 0
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
-
-### Similar Questions
- 1. [Shortest Path to Get Food](../shortest-path-to-get-food) (Medium)
-
-### Hints
-
-Hint 1
-Use BFS.
-
-
-
-Hint 2
-BFS on (x,y,r) x,y is coordinate, r is remain number of obstacles you can remove.
-
diff --git a/problems/shortest-path-in-a-hidden-grid/README.md b/problems/shortest-path-in-a-hidden-grid/README.md
deleted file mode 100644
index c519f5a97..000000000
--- a/problems/shortest-path-in-a-hidden-grid/README.md
+++ /dev/null
@@ -1,40 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../products-price-for-each-store "Product's Price for Each Store")
-
-[Next >](../find-nearest-point-that-has-the-same-x-or-y-coordinate "Find Nearest Point That Has the Same X or Y Coordinate")
-
-## [1778. Shortest Path in a Hidden Grid (Medium)](https://leetcode.com/problems/shortest-path-in-a-hidden-grid "未知网格中的最短路径")
-
-
-
-### Related Topics
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Graph](../../tag/graph/README.md)]
- [[Interactive](../../tag/interactive/README.md)]
-
-### Similar Questions
- 1. [Robot Room Cleaner](../robot-room-cleaner) (Hard)
- 1. [Minimum Path Cost in a Hidden Grid](../minimum-path-cost-in-a-hidden-grid) (Medium)
-
-### Hints
-
-Hint 1
-The grid is at a maximum 500 x 500, so it is clever to assume that the robot's initial cell is grid[501][501]
-
-
-
-Hint 2
-Run a DFS from the robot's position to make sure that you can reach the target, otherwise you should return -1.
-
-
-
-Hint 3
-Now that you are sure you can reach the target, run BFS to find the shortest path.
-
diff --git a/problems/shortest-path-in-binary-matrix/README.md b/problems/shortest-path-in-binary-matrix/README.md
deleted file mode 100644
index 2922b9f93..000000000
--- a/problems/shortest-path-in-binary-matrix/README.md
+++ /dev/null
@@ -1,66 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../largest-values-from-labels "Largest Values From Labels")
-
-[Next >](../shortest-common-supersequence "Shortest Common Supersequence ")
-
-## [1091. Shortest Path in Binary Matrix (Medium)](https://leetcode.com/problems/shortest-path-in-binary-matrix "二进制矩阵中的最短路径")
-
-
Given an n x n binary matrix grid, return the length of the shortest clear path in the matrix. If there is no clear path, return -1.
-
-
A clear path in a binary matrix is a path from the top-left cell (i.e., (0, 0)) to the bottom-right cell (i.e., (n - 1, n - 1)) such that:
-
-
-
All the visited cells of the path are 0.
-
All the adjacent cells of the path are 8-directionally connected (i.e., they are different and they share an edge or a corner).
-
-
-
The length of a clear path is the number of visited cells of this path.
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
-
-### Hints
-
-Hint 1
-Do a breadth first search to find the shortest path.
-
diff --git a/problems/shortest-path-in-binary-matrix/shortest_path_in_binary_matrix.go b/problems/shortest-path-in-binary-matrix/shortest_path_in_binary_matrix.go
deleted file mode 100644
index d74666772..000000000
--- a/problems/shortest-path-in-binary-matrix/shortest_path_in_binary_matrix.go
+++ /dev/null
@@ -1,41 +0,0 @@
-package problem1091
-
-var dx = []int{-1, -1, -1, 0, 1, 1, 1, 0}
-var dy = []int{-1, 0, 1, 1, 1, 0, -1, -1}
-
-func shortestPathBinaryMatrix(grid [][]int) int {
- if grid[0][0] == 1 {
- return -1
- }
-
- N := len(grid)
-
- cells := make([][2]int, 1, N*N)
- grid[0][0] = 1
- length := 1
-
- for len(cells) > 0 {
- size := len(cells)
- for s := 0; s < size; s++ {
- c := cells[s]
- x, y := c[0], c[1]
- if x == N-1 && y == N-1 {
- return length
- }
- for k := 0; k < 8; k++ {
- i, j := x+dx[k], y+dy[k]
- if i < 0 || N <= i ||
- j < 0 || N <= j ||
- grid[i][j] == 1 {
- continue
- }
- cells = append(cells, [2]int{i, j})
- grid[i][j] = 1
- }
- }
- length++
- cells = cells[size:]
- }
-
- return -1
-}
diff --git a/problems/shortest-path-to-get-all-keys/README.md b/problems/shortest-path-to-get-all-keys/README.md
deleted file mode 100644
index 8499f1d63..000000000
--- a/problems/shortest-path-to-get-all-keys/README.md
+++ /dev/null
@@ -1,70 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../all-nodes-distance-k-in-binary-tree "All Nodes Distance K in Binary Tree")
-
-[Next >](../smallest-subtree-with-all-the-deepest-nodes "Smallest Subtree with all the Deepest Nodes")
-
-## [864. Shortest Path to Get All Keys (Hard)](https://leetcode.com/problems/shortest-path-to-get-all-keys "获取所有钥匙的最短路径")
-
-
You are given an m x n grid grid where:
-
-
-
'.' is an empty cell.
-
'#' is a wall.
-
'@' is the starting point.
-
Lowercase letters represent keys.
-
Uppercase letters represent locks.
-
-
-
You start at the starting point and one move consists of walking one space in one of the four cardinal directions. You cannot walk outside the grid, or walk into a wall.
-
-
If you walk over a key, you can pick it up and you cannot walk over a lock unless you have its corresponding key.
-
-
For some 1 <= k <= 6, there is exactly one lowercase and one uppercase letter of the first k letters of the English alphabet in the grid. This means that there is exactly one key for each lock, and one lock for each key; and also that the letters used to represent the keys and locks were chosen in the same order as the English alphabet.
-
-
Return the lowest number of moves to acquire all keys. If it is impossible, return -1.
-
-
-
Example 1:
-
-
-Input: grid = ["@.a.#","###.#","b.A.B"]
-Output: 8
-Explanation: Note that the goal is to obtain all the keys not to open all the locks.
-
grid[i][j] is either an English letter, '.', '#', or '@'.
-
The number of keys in the grid is in the range [1, 6].
-
Each key in the grid is unique.
-
Each key in the grid has a matching lock.
-
-
-### Related Topics
- [[Bit Manipulation](../../tag/bit-manipulation/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
diff --git a/problems/shortest-path-to-get-all-keys/shortest_path_to_get_all_keys.go b/problems/shortest-path-to-get-all-keys/shortest_path_to_get_all_keys.go
deleted file mode 100644
index 0c0ac7625..000000000
--- a/problems/shortest-path-to-get-all-keys/shortest_path_to_get_all_keys.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem864
diff --git a/problems/shortest-path-to-get-all-keys/shortest_path_to_get_all_keys_test.go b/problems/shortest-path-to-get-all-keys/shortest_path_to_get_all_keys_test.go
deleted file mode 100644
index 0c0ac7625..000000000
--- a/problems/shortest-path-to-get-all-keys/shortest_path_to_get_all_keys_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem864
diff --git a/problems/shortest-path-to-get-food/README.md b/problems/shortest-path-to-get-food/README.md
deleted file mode 100644
index d6251d5c9..000000000
--- a/problems/shortest-path-to-get-food/README.md
+++ /dev/null
@@ -1,44 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../find-followers-count "Find Followers Count")
-
-[Next >](../the-number-of-employees-which-report-to-each-employee "The Number of Employees Which Report to Each Employee")
-
-## [1730. Shortest Path to Get Food (Medium)](https://leetcode.com/problems/shortest-path-to-get-food "获取食物的最短路径")
-
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
-
-### Similar Questions
- 1. [01 Matrix](../01-matrix) (Medium)
- 1. [Shortest Path in a Grid with Obstacles Elimination](../shortest-path-in-a-grid-with-obstacles-elimination) (Hard)
-
-### Hints
-
-Hint 1
-Run BFS starting from the '*' position.
-
-
-
-Hint 2
-Keep the current number of the steps as a state in the queue.
-
-
-
-Hint 3
-The first time you reach a food, return the number of steps as the answer.
-
-
-
-Hint 4
-In case the queue is empty and you still did not manage to reach a food, return -1.
-
diff --git a/problems/shortest-path-visiting-all-nodes/README.md b/problems/shortest-path-visiting-all-nodes/README.md
deleted file mode 100644
index 77c4a02d2..000000000
--- a/problems/shortest-path-visiting-all-nodes/README.md
+++ /dev/null
@@ -1,52 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../hand-of-straights "Hand of Straights")
-
-[Next >](../shifting-letters "Shifting Letters")
-
-## [847. Shortest Path Visiting All Nodes (Hard)](https://leetcode.com/problems/shortest-path-visiting-all-nodes "访问所有节点的最短路径")
-
-
You have an undirected, connected graph of n nodes labeled from 0 to n - 1. You are given an array graph where graph[i] is a list of all the nodes connected with node i by an edge.
-
-
Return the length of the shortest path that visits every node. You may start and stop at any node, you may revisit nodes multiple times, and you may reuse edges.
-
-
-
Example 1:
-
-
-Input: graph = [[1,2,3],[0],[0],[0]]
-Output: 4
-Explanation: One possible path is [1,0,2,0,3]
-
-
-
Example 2:
-
-
-Input: graph = [[1],[0,2,4],[1,3,4],[2],[1,2]]
-Output: 4
-Explanation: One possible path is [0,1,4,2,3]
-
Consider a directed graph, with nodes labelled 0, 1, ..., n-1. In this graph, each edge is either red or blue, and there could be self-edges or parallel edges.
-
-
Each [i, j] in red_edges denotes a red directed edge from node i to node j. Similarly, each [i, j] in blue_edges denotes a blue directed edge from node i to node j.
-
-
Return an array answer of length n, where each answer[X] is the length of the shortest path from node 0 to node X such that the edge colors alternate along the path (or -1 if such a path doesn't exist).
-
-### Related Topics
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Graph](../../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/shortest-subarray-to-be-removed-to-make-array-sorted/README.md b/problems/shortest-subarray-to-be-removed-to-make-array-sorted/README.md
deleted file mode 100644
index 6af342eff..000000000
--- a/problems/shortest-subarray-to-be-removed-to-make-array-sorted/README.md
+++ /dev/null
@@ -1,70 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../number-of-ways-to-split-a-string "Number of Ways to Split a String")
-
-[Next >](../count-all-possible-routes "Count All Possible Routes")
-
-## [1574. Shortest Subarray to be Removed to Make Array Sorted (Medium)](https://leetcode.com/problems/shortest-subarray-to-be-removed-to-make-array-sorted "删除最短的子数组使剩余数组有序")
-
-
Given an integer array arr, remove a subarray (can be empty) from arr such that the remaining elements in arr are non-decreasing.
-
-
Return the length of the shortest subarray to remove.
-
-
A subarray is a contiguous subsequence of the array.
-
-
-
Example 1:
-
-
-Input: arr = [1,2,3,10,4,2,3,5]
-Output: 3
-Explanation: The shortest subarray we can remove is [10,4,2] of length 3. The remaining elements after that will be [1,2,3,3,5] which are sorted.
-Another correct solution is to remove the subarray [3,10,4].
-
-
-
Example 2:
-
-
-Input: arr = [5,4,3,2,1]
-Output: 4
-Explanation: Since the array is strictly decreasing, we can only keep a single element. Therefore we need to remove a subarray of length 4, either [5,4,3,2] or [4,3,2,1].
-
-
-
Example 3:
-
-
-Input: arr = [1,2,3]
-Output: 0
-Explanation: The array is already non-decreasing. We do not need to remove any elements.
-
-
-
-
Constraints:
-
-
-
1 <= arr.length <= 105
-
0 <= arr[i] <= 109
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Two Pointers](../../tag/two-pointers/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
- [[Stack](../../tag/stack/README.md)]
- [[Monotonic Stack](../../tag/monotonic-stack/README.md)]
-
-### Hints
-
-Hint 1
-The key is to find the longest non-decreasing subarray starting with the first element or ending with the last element, respectively.
-
-
-
-Hint 2
-After removing some subarray, the result is the concatenation of a sorted prefix and a sorted suffix, where the last element of the prefix is smaller than the first element of the suffix.
-
diff --git a/problems/shortest-subarray-with-sum-at-least-k/README.md b/problems/shortest-subarray-with-sum-at-least-k/README.md
deleted file mode 100644
index 73131621a..000000000
--- a/problems/shortest-subarray-with-sum-at-least-k/README.md
+++ /dev/null
@@ -1,45 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../score-after-flipping-matrix "Score After Flipping Matrix")
-
-[Next >](../all-nodes-distance-k-in-binary-tree "All Nodes Distance K in Binary Tree")
-
-## [862. Shortest Subarray with Sum at Least K (Hard)](https://leetcode.com/problems/shortest-subarray-with-sum-at-least-k "和至少为 K 的最短子数组")
-
-
Given an integer array nums and an integer k, return the length of the shortest non-empty subarray of nums with a sum of at least k. If there is no such subarray, return -1.
Given an integer array nums, you need to find one continuous subarray that if you only sort this subarray in ascending order, then the whole array will be sorted in ascending order.
-
-
Return the shortest such subarray and output its length.
-
-
-
Example 1:
-
-
-Input: nums = [2,6,4,8,10,9,15]
-Output: 5
-Explanation: You need to sort [6, 4, 8, 10, 9] in ascending order to make the whole array sorted in ascending order.
-
-
-
Example 2:
-
-
-Input: nums = [1,2,3,4]
-Output: 0
-
-
-
Example 3:
-
-
-Input: nums = [1]
-Output: 0
-
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 104
-
-105 <= nums[i] <= 105
-
-
-
-Follow up: Can you solve it in O(n) time complexity?
-
-### Related Topics
- [[Stack](../../tag/stack/README.md)]
- [[Greedy](../../tag/greedy/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Two Pointers](../../tag/two-pointers/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
- [[Monotonic Stack](../../tag/monotonic-stack/README.md)]
diff --git a/problems/shortest-unsorted-continuous-subarray/shortest_unsorted_continuous_subarray.go b/problems/shortest-unsorted-continuous-subarray/shortest_unsorted_continuous_subarray.go
deleted file mode 100644
index eef20a643..000000000
--- a/problems/shortest-unsorted-continuous-subarray/shortest_unsorted_continuous_subarray.go
+++ /dev/null
@@ -1,18 +0,0 @@
-package problem581
-
-func findUnsortedSubarray(nums []int) int {
- m, n, l := 0, -1, len(nums)
- for max, min, i, j := 0, l-1, 1, l-2; i < l; i, j = i+1, j-1 {
- if nums[i] < nums[max] {
- n = i
- } else if nums[i] > nums[max] {
- max = i
- }
- if nums[j] > nums[min] {
- m = j
- } else if nums[j] < nums[min] {
- min = j
- }
- }
- return n - m + 1
-}
diff --git a/problems/shortest-unsorted-continuous-subarray/shortest_unsorted_continuous_subarray_test.go b/problems/shortest-unsorted-continuous-subarray/shortest_unsorted_continuous_subarray_test.go
deleted file mode 100644
index 3a3a4f987..000000000
--- a/problems/shortest-unsorted-continuous-subarray/shortest_unsorted_continuous_subarray_test.go
+++ /dev/null
@@ -1,31 +0,0 @@
-package problem581
-
-import "testing"
-
-type testType struct {
- in []int
- want int
-}
-
-func TestFindUnsortedSubarray(t *testing.T) {
- tests := [...]testType{
- {
- in: []int{2, 6, 4, 8, 10, 9, 15},
- want: 5,
- },
- {
- in: []int{1, 2, 3, 4},
- want: 0,
- },
- {
- in: []int{1, 2, 4, 5, 3},
- want: 3,
- },
- }
- for _, tt := range tests {
- got := findUnsortedSubarray(tt.in)
- if got != tt.want {
- t.Fatalf("in: %v, got: %v, want: %v", tt.in, got, tt.want)
- }
- }
-}
diff --git a/problems/shortest-way-to-form-string/README.md b/problems/shortest-way-to-form-string/README.md
deleted file mode 100644
index 2a8fb3a4b..000000000
--- a/problems/shortest-way-to-form-string/README.md
+++ /dev/null
@@ -1,80 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../distant-barcodes "Distant Barcodes")
-
-[Next >](../confusing-number "Confusing Number")
-
-## [1055. Shortest Way to Form String (Medium)](https://leetcode.com/problems/shortest-way-to-form-string "形成字符串的最短路径")
-
-
From any string, we can form a subsequence of that string by deleting some number of characters (possibly no deletions).
-
-
Given two strings source and target, return the minimum number of subsequences of source such that their concatenation equals target. If the task is impossible, return -1.
-
-
-
-
Example 1:
-
-
-Input: source = "abc", target = "abcbc"
-Output: 2
-Explanation: The target "abcbc" can be formed by "abc" and "bc", which are subsequences of source "abc".
-
-
-
Example 2:
-
-
-Input: source = "abc", target = "acdbc"
-Output: -1
-Explanation: The target string cannot be constructed from the subsequences of source string due to the character "d" in target string.
-
-
-
Example 3:
-
-
-Input: source = "xyz", target = "xzyxz"
-Output: 3
-Explanation: The target string can be constructed as follows "xz" + "y" + "xz".
-
-
-
-
-
Note:
-
-
-
Both the source and target strings consist of only lowercase English letters from "a"-"z".
-
The lengths of source and target string are between 1 and 1000.
-
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[String](../../tag/string/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Similar Questions
- 1. [Is Subsequence](../is-subsequence) (Easy)
-
-### Hints
-
-Hint 1
-Which conditions have to been met in order to be impossible to form the target string?
-
-
-
-Hint 2
-If there exists a character in the target string which doesn't exist in the source string then it will be impossible to form the target string.
-
-
-
-Hint 3
-Assuming we are in the case which is possible to form the target string, how can we assure the minimum number of used subsequences of source?
-
-
-
-Hint 4
-For each used subsequence try to match the leftmost character of the current subsequence with the leftmost character of the target string, if they match then erase both character otherwise erase just the subsequence character whenever the current subsequence gets empty, reset it to a new copy of subsequence and increment the count, do this until the target sequence gets empty. Finally return the count.
-
diff --git a/problems/shortest-word-distance-ii/README.md b/problems/shortest-word-distance-ii/README.md
deleted file mode 100644
index d353dc002..000000000
--- a/problems/shortest-word-distance-ii/README.md
+++ /dev/null
@@ -1,39 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../shortest-word-distance "Shortest Word Distance")
-
-[Next >](../shortest-word-distance-iii "Shortest Word Distance III")
-
-## [244. Shortest Word Distance II (Medium)](https://leetcode.com/problems/shortest-word-distance-ii "最短单词距离 II")
-
-
Design a class which receives a list of words in the constructor, and implements a method that takes two words word1 and word2 and return the shortest distance between these two words in the list. Your method will be called repeatedly many times with different parameters.
-
-
Example:
-Assume that words = ["practice", "makes", "perfect", "coding", "makes"].
Given an integer array nums, design an algorithm to randomly shuffle the array. All permutations of the array should be equally likely as a result of the shuffling.
-
-
Implement the Solution class:
-
-
-
Solution(int[] nums) Initializes the object with the integer array nums.
-
int[] reset() Resets the array to its original configuration and returns it.
-
int[] shuffle() Returns a random shuffling of the array.
-
-
-
-
Example 1:
-
-
-Input
-["Solution", "shuffle", "reset", "shuffle"]
-[[[1, 2, 3]], [], [], []]
-Output
-[null, [3, 1, 2], [1, 2, 3], [1, 3, 2]]
-
-Explanation
-Solution solution = new Solution([1, 2, 3]);
-solution.shuffle(); // Shuffle the array [1,2,3] and return its result.
- // Any permutation of [1,2,3] must be equally likely to be returned.
- // Example: return [3, 1, 2]
-solution.reset(); // Resets the array back to its original configuration [1,2,3]. Return [1, 2, 3]
-solution.shuffle(); // Returns the random shuffling of array [1,2,3]. Example: return [1, 3, 2]
-
-
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 200
-
-106 <= nums[i] <= 106
-
All the elements of nums are unique.
-
At most 5 * 104 calls in total will be made to reset and shuffle.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Math](../../tag/math/README.md)]
- [[Randomized](../../tag/randomized/README.md)]
-
-### Hints
-
-Hint 1
-The solution expects that we always use the original array to shuffle() else some of the test cases fail. (Credits; @snehasingh31)
-
diff --git a/problems/shuffle-an-array/shuffle_an_array.go b/problems/shuffle-an-array/shuffle_an_array.go
deleted file mode 100644
index 39eaeac2e..000000000
--- a/problems/shuffle-an-array/shuffle_an_array.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem384
diff --git a/problems/shuffle-an-array/shuffle_an_array_test.go b/problems/shuffle-an-array/shuffle_an_array_test.go
deleted file mode 100644
index 39eaeac2e..000000000
--- a/problems/shuffle-an-array/shuffle_an_array_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem384
diff --git a/problems/shuffle-string/README.md b/problems/shuffle-string/README.md
deleted file mode 100644
index ab3bf2124..000000000
--- a/problems/shuffle-string/README.md
+++ /dev/null
@@ -1,59 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../patients-with-a-condition "Patients With a Condition")
-
-[Next >](../minimum-suffix-flips "Minimum Suffix Flips")
-
-## [1528. Shuffle String (Easy)](https://leetcode.com/problems/shuffle-string "重新排列字符串")
-
-
You are given a string s and an integer array indices of the same length. The string s will be shuffled such that the character at the ith position moves to indices[i] in the shuffled string.
-
-
Return the shuffled string.
-
-
-
Example 1:
-
-
-Input: s = "codeleet", indices = [4,5,6,7,0,2,1,3]
-Output: "leetcode"
-Explanation: As shown, "codeleet" becomes "leetcode" after shuffling.
-
-
-
Example 2:
-
-
-Input: s = "abc", indices = [0,1,2]
-Output: "abc"
-Explanation: After shuffling, each character remains in its position.
-
-
-
-
Constraints:
-
-
-
s.length == indices.length == n
-
1 <= n <= 100
-
s consists of only lowercase English letters.
-
0 <= indices[i] < n
-
All values of indices are unique.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Hints
-
-Hint 1
-You can create an auxiliary string t of length n.
-
-
-
-Hint 2
-Assign t[indexes[i]] to s[i] for each i from 0 to n-1.
-
diff --git a/problems/shuffle-the-array/README.md b/problems/shuffle-the-array/README.md
deleted file mode 100644
index 9180ca6d1..000000000
--- a/problems/shuffle-the-array/README.md
+++ /dev/null
@@ -1,57 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../find-all-the-lonely-nodes "Find All The Lonely Nodes")
-
-[Next >](../the-k-strongest-values-in-an-array "The k Strongest Values in an Array")
-
-## [1470. Shuffle the Array (Easy)](https://leetcode.com/problems/shuffle-the-array "重新排列数组")
-
-
Given the array nums consisting of 2n elements in the form [x1,x2,...,xn,y1,y2,...,yn].
-
-
Return the array in the form[x1,y1,x2,y2,...,xn,yn].
-
-
-
Example 1:
-
-
-Input: nums = [2,5,1,3,4,7], n = 3
-Output: [2,3,5,4,1,7]
-Explanation: Since x1=2, x2=5, x3=1, y1=3, y2=4, y3=7 then the answer is [2,3,5,4,1,7].
-
-
-
Example 2:
-
-
-Input: nums = [1,2,3,4,4,3,2,1], n = 4
-Output: [1,4,2,3,3,2,4,1]
-
-
-
Example 3:
-
-
-Input: nums = [1,1,2,2], n = 2
-Output: [1,2,1,2]
-
-
-
-
Constraints:
-
-
-
1 <= n <= 500
-
nums.length == 2n
-
1 <= nums[i] <= 10^3
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
-
-### Hints
-
-Hint 1
-Use two pointers to create the new array of 2n elements. The first starting at the beginning and the other starting at (n+1)th position. Alternate between them and create the new array.
-
diff --git a/problems/sign-of-the-product-of-an-array/README.md b/problems/sign-of-the-product-of-an-array/README.md
deleted file mode 100644
index 2ce92356b..000000000
--- a/problems/sign-of-the-product-of-an-array/README.md
+++ /dev/null
@@ -1,72 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../find-customers-with-positive-revenue-this-year "Find Customers With Positive Revenue this Year")
-
-[Next >](../find-the-winner-of-the-circular-game "Find the Winner of the Circular Game")
-
-## [1822. Sign of the Product of an Array (Easy)](https://leetcode.com/problems/sign-of-the-product-of-an-array "数组元素积的符号")
-
-
There is a function signFunc(x) that returns:
-
-
-
1 if x is positive.
-
-1 if x is negative.
-
0 if x is equal to 0.
-
-
-
You are given an integer array nums. Let product be the product of all values in the array nums.
-
-
Return signFunc(product).
-
-
-
Example 1:
-
-
-Input: nums = [-1,-2,-3,-4,3,2,1]
-Output: 1
-Explanation: The product of all values in the array is 144, and signFunc(144) = 1
-
-
-
Example 2:
-
-
-Input: nums = [1,5,0,2,-3]
-Output: 0
-Explanation: The product of all values in the array is 0, and signFunc(0) = 0
-
-
-
Example 3:
-
-
-Input: nums = [-1,1,-1,1,-1]
-Output: -1
-Explanation: The product of all values in the array is -1, and signFunc(-1) = -1
-
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 1000
-
-100 <= nums[i] <= 100
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Math](../../tag/math/README.md)]
-
-### Hints
-
-Hint 1
-If there is a 0 in the array the answer is 0
-
-
-
-Hint 2
-To avoid overflow make all the negative numbers -1 and all positive numbers 1 and calculate the prod
-
diff --git a/problems/similar-rgb-color/README.md b/problems/similar-rgb-color/README.md
deleted file mode 100644
index da973a626..000000000
--- a/problems/similar-rgb-color/README.md
+++ /dev/null
@@ -1,43 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../champagne-tower "Champagne Tower")
-
-[Next >](../minimum-swaps-to-make-sequences-increasing "Minimum Swaps To Make Sequences Increasing")
-
-## [800. Similar RGB Color (Easy)](https://leetcode.com/problems/similar-rgb-color "相似 RGB 颜色")
-
-
In the following, every capital letter represents some hexadecimal digit from 0 to f.
-
-
The red-green-blue color "#AABBCC" can be written as "#ABC" in shorthand. For example, "#15c" is shorthand for the color "#1155cc".
-
-
Now, say the similarity between two colors "#ABCDEF" and "#UVWXYZ" is -(AB - UV)^2 - (CD - WX)^2 - (EF - YZ)^2.
-
-
Given the color "#ABCDEF", return a 7 character color that is most similar to #ABCDEF, and has a shorthand (that is, it can be represented as some "#XYZ"
-
-
-Example 1:
-Input: color = "#09f166"
-Output: "#11ee66"
-Explanation:
-The similarity is -(0x09 - 0x11)^2 -(0xf1 - 0xee)^2 - (0x66 - 0x66)^2 = -64 -9 -0 = -73.
-This is the highest among any shorthand color.
-
-
-
Note:
-
-
-
color is a string of length 7.
-
color is a valid RGB color: for i > 0, color[i] is a hexadecimal digit from 0 to f
-
Any answer which has the same (highest) similarity as the best answer will be accepted.
-
All inputs and outputs should use lowercase letters, and the output is 7 characters.
Two strings X and Y are similar if we can swap two letters (in different positions) of X, so that it equals Y. Also two strings X and Y are similar if they are equal.
-
-
For example, "tars" and "rats" are similar (swapping at positions 0 and 2), and "rats" and "arts" are similar, but "star" is not similar to "tars", "rats", or "arts".
-
-
Together, these form two connected groups by similarity: {"tars", "rats", "arts"} and {"star"}. Notice that "tars" and "arts" are in the same group even though they are not similar. Formally, each group is such that a word is in the group if and only if it is similar to at least one other word in the group.
-
-
We are given a list strs of strings where every string in strs is an anagram of every other string in strs. How many groups are there?
All words in strs have the same length and are anagrams of each other.
-
-
-### Related Topics
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Union Find](../../tag/union-find/README.md)]
- [[String](../../tag/string/README.md)]
diff --git a/problems/similar-string-groups/similar_string_groups.go b/problems/similar-string-groups/similar_string_groups.go
deleted file mode 100644
index 6cceadfa6..000000000
--- a/problems/similar-string-groups/similar_string_groups.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem839
diff --git a/problems/similar-string-groups/similar_string_groups_test.go b/problems/similar-string-groups/similar_string_groups_test.go
deleted file mode 100644
index 6cceadfa6..000000000
--- a/problems/similar-string-groups/similar_string_groups_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem839
diff --git a/problems/simple-bank-system/README.md b/problems/simple-bank-system/README.md
deleted file mode 100644
index 21519e1c9..000000000
--- a/problems/simple-bank-system/README.md
+++ /dev/null
@@ -1,80 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../check-if-numbers-are-ascending-in-a-sentence "Check if Numbers Are Ascending in a Sentence")
-
-[Next >](../count-number-of-maximum-bitwise-or-subsets "Count Number of Maximum Bitwise-OR Subsets")
-
-## [2043. Simple Bank System (Medium)](https://leetcode.com/problems/simple-bank-system "简易银行系统")
-
-
You have been tasked with writing a program for a popular bank that will automate all its incoming transactions (transfer, deposit, and withdraw). The bank has n accounts numbered from 1 to n. The initial balance of each account is stored in a 0-indexed integer array balance, with the (i + 1)th account having an initial balance of balance[i].
-
-
Execute all the valid transactions. A transaction is valid if:
-
-
-
The given account number(s) are between 1 and n, and
-
The amount of money withdrawn or transferred from is less than or equal to the balance of the account.
-
-
-
Implement the Bank class:
-
-
-
Bank(long[] balance) Initializes the object with the 0-indexed integer array balance.
-
boolean transfer(int account1, int account2, long money) Transfers money dollars from the account numbered account1 to the account numbered account2. Return true if the transaction was successful, false otherwise.
-
boolean deposit(int account, long money) Deposit money dollars into the account numbered account. Return true if the transaction was successful, false otherwise.
-
boolean withdraw(int account, long money) Withdraw money dollars from the account numbered account. Return true if the transaction was successful, false otherwise.
-
-
-
-
Example 1:
-
-
-Input
-["Bank", "withdraw", "transfer", "deposit", "transfer", "withdraw"]
-[[[10, 100, 20, 50, 30]], [3, 10], [5, 1, 20], [5, 20], [3, 4, 15], [10, 50]]
-Output
-[null, true, true, true, false, false]
-
-Explanation
-Bank bank = new Bank([10, 100, 20, 50, 30]);
-bank.withdraw(3, 10); // return true, account 3 has a balance of $20, so it is valid to withdraw $10.
- // Account 3 has $20 - $10 = $10.
-bank.transfer(5, 1, 20); // return true, account 5 has a balance of $30, so it is valid to transfer $20.
- // Account 5 has $30 - $20 = $10, and account 1 has $10 + $20 = $30.
-bank.deposit(5, 20); // return true, it is valid to deposit $20 to account 5.
- // Account 5 has $10 + $20 = $30.
-bank.transfer(3, 4, 15); // return false, the current balance of account 3 is $10,
- // so it is invalid to transfer $15 from it.
-bank.withdraw(10, 50); // return false, it is invalid because account 10 does not exist.
-
-
-
-
Constraints:
-
-
-
n == balance.length
-
1 <= n, account, account1, account2 <= 105
-
0 <= balance[i], money <= 1012
-
At most 104 calls will be made to each function transfer, deposit, withdraw.
-
-
-### Related Topics
- [[Design](../../tag/design/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Simulation](../../tag/simulation/README.md)]
-
-### Hints
-
-Hint 1
-How do you determine if a transaction will fail?
-
-
-
-Hint 2
-Simply apply the operations if the transaction is valid.
-
diff --git a/problems/simplified-fractions/README.md b/problems/simplified-fractions/README.md
deleted file mode 100644
index 3b5c60dc4..000000000
--- a/problems/simplified-fractions/README.md
+++ /dev/null
@@ -1,64 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../consecutive-characters "Consecutive Characters")
-
-[Next >](../count-good-nodes-in-binary-tree "Count Good Nodes in Binary Tree")
-
-## [1447. Simplified Fractions (Medium)](https://leetcode.com/problems/simplified-fractions "最简分数")
-
-
Given an integer n, return a list of all simplified fractions between 0 and 1 (exclusive) such that the denominator is less-than-or-equal-to n. The fractions can be in any order.
-
-
-
Example 1:
-
-
-Input: n = 2
-Output: ["1/2"]
-Explanation: "1/2" is the only unique fraction with a denominator less-than-or-equal-to 2.
-
-
Example 2:
-
-
-Input: n = 3
-Output: ["1/2","1/3","2/3"]
-
-
-
Example 3:
-
-
-Input: n = 4
-Output: ["1/2","1/3","1/4","2/3","3/4"]
-Explanation: "2/4" is not a simplified fraction because it can be simplified to "1/2".
-
-
Example 4:
-
-
-Input: n = 1
-Output: []
-
-
-
-
Constraints:
-
-
-
1 <= n <= 100
-
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
-
-### Hints
-
-Hint 1
-A fraction is fully simplified if there is no integer that divides cleanly into the numerator and denominator.
-
-
-
-Hint 2
-In other words the greatest common divisor of the numerator and the denominator of a simplified fraction is 1.
-
diff --git a/problems/simplify-path/README.md b/problems/simplify-path/README.md
deleted file mode 100644
index 3e55de4ff..000000000
--- a/problems/simplify-path/README.md
+++ /dev/null
@@ -1,65 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../climbing-stairs "Climbing Stairs")
-
-[Next >](../edit-distance "Edit Distance")
-
-## [71. Simplify Path (Medium)](https://leetcode.com/problems/simplify-path "简化路径")
-
-
Given a string path, which is an absolute path (starting with a slash '/') to a file or directory in a Unix-style file system, convert it to the simplified canonical path.
-
-
In a Unix-style file system, a period '.' refers to the current directory, a double period '..' refers to the directory up a level, and any multiple consecutive slashes (i.e. '//') are treated as a single slash '/'. For this problem, any other format of periods such as '...' are treated as file/directory names.
-
-
The canonical path should have the following format:
-
-
-
The path starts with a single slash '/'.
-
Any two directories are separated by a single slash '/'.
-
The path does not end with a trailing '/'.
-
The path only contains the directories on the path from the root directory to the target file or directory (i.e., no period '.' or double period '..')
-
-
-
Return the simplified canonical path.
-
-
-
Example 1:
-
-
-Input: path = "/home/"
-Output: "/home"
-Explanation: Note that there is no trailing slash after the last directory name.
-
-
-
Example 2:
-
-
-Input: path = "/../"
-Output: "/"
-Explanation: Going one level up from the root directory is a no-op, as the root level is the highest level you can go.
-
-
-
Example 3:
-
-
-Input: path = "/home//foo/"
-Output: "/home/foo"
-Explanation: In the canonical path, multiple consecutive slashes are replaced by a single one.
-
-
-
-
Constraints:
-
-
-
1 <= path.length <= 3000
-
path consists of English letters, digits, period '.', slash '/' or '_'.
Given an integer array nums, in which exactly two elements appear only once and all the other elements appear exactly twice. Find the two elements that appear only once. You can return the answer in any order.
-
-
You must write an algorithm that runs in linear runtime complexity and uses only constant extra space.
-
-
-
Example 1:
-
-
-Input: nums = [1,2,1,3,2,5]
-Output: [3,5]
-Explanation: [5, 3] is also a valid answer.
-
-
-
Example 2:
-
-
-Input: nums = [-1,0]
-Output: [-1,0]
-
-
-
Example 3:
-
-
-Input: nums = [0,1]
-Output: [1,0]
-
-
-
-
Constraints:
-
-
-
2 <= nums.length <= 3 * 104
-
-231 <= nums[i] <= 231 - 1
-
Each integer in nums will appear twice, only two integers will appear once.
There is a special keyboard with all keys in a single row.
-
-
Given a string keyboard of length 26 indicating the layout of the keyboard (indexed from 0 to 25), initially your finger is at index 0. To type a character, you have to move your finger to the index of the desired character. The time taken to move your finger from index i to index j is |i - j|.
-
-
You want to type a string word. Write a function to calculate how much time it takes to type it with one finger.
-
-
-
Example 1:
-
-
-Input: keyboard = "abcdefghijklmnopqrstuvwxyz", word = "cba"
-Output: 4
-Explanation: The index moves from 0 to 2 to write 'c' then to 1 to write 'b' then to 0 again to write 'a'.
-Total time = 2 + 1 + 1 = 4.
-
-
-
Example 2:
-
-
-Input: keyboard = "pqrstuvwxyzabcdefghijklmno", word = "leetcode"
-Output: 73
-
-
-
-
Constraints:
-
-
-
keyboard.length == 26
-
keyboard contains each English lowercase letter exactly once in some order.
-
1 <= word.length <= 10^4
-
word[i] is an English lowercase letter.
-
-
-### Related Topics
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Hints
-
-Hint 1
-Can be the problem divided in parts, so solving each part and sum their solutions it should return the answer? Yes, you only need to divide the problem in finger jumps.
-
-
-
-Hint 2
-In each finger jump you need to move your finger from one character to another, you need to know its index.
-
-
-
-Hint 3
-Map each character to it's index.
-
-
-
-Hint 4
-Use a hash table to do that.
-
diff --git a/problems/single-threaded-cpu/README.md b/problems/single-threaded-cpu/README.md
deleted file mode 100644
index 4b61ed447..000000000
--- a/problems/single-threaded-cpu/README.md
+++ /dev/null
@@ -1,83 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-ice-cream-bars "Maximum Ice Cream Bars")
-
-[Next >](../find-xor-sum-of-all-pairs-bitwise-and "Find XOR Sum of All Pairs Bitwise AND")
-
-## [1834. Single-Threaded CPU (Medium)](https://leetcode.com/problems/single-threaded-cpu "单线程 CPU")
-
-
You are given n tasks labeled from 0 to n - 1 represented by a 2D integer array tasks, where tasks[i] = [enqueueTimei, processingTimei] means that the ith task will be available to process at enqueueTimei and will take processingTimeito finish processing.
-
-
You have a single-threaded CPU that can process at most one task at a time and will act in the following way:
-
-
-
If the CPU is idle and there are no available tasks to process, the CPU remains idle.
-
If the CPU is idle and there are available tasks, the CPU will choose the one with the shortest processing time. If multiple tasks have the same shortest processing time, it will choose the task with the smallest index.
-
Once a task is started, the CPU will process the entire task without stopping.
-
The CPU can finish a task then start a new one instantly.
-
-
-
Return the order in which the CPU will process the tasks.
-
-
-
Example 1:
-
-
-Input: tasks = [[1,2],[2,4],[3,2],[4,1]]
-Output: [0,2,3,1]
-Explanation: The events go as follows:
-- At time = 1, task 0 is available to process. Available tasks = {0}.
-- Also at time = 1, the idle CPU starts processing task 0. Available tasks = {}.
-- At time = 2, task 1 is available to process. Available tasks = {1}.
-- At time = 3, task 2 is available to process. Available tasks = {1, 2}.
-- Also at time = 3, the CPU finishes task 0 and starts processing task 2 as it is the shortest. Available tasks = {1}.
-- At time = 4, task 3 is available to process. Available tasks = {1, 3}.
-- At time = 5, the CPU finishes task 2 and starts processing task 3 as it is the shortest. Available tasks = {1}.
-- At time = 6, the CPU finishes task 3 and starts processing task 1. Available tasks = {}.
-- At time = 10, the CPU finishes task 1 and becomes idle.
-
-
-
Example 2:
-
-
-Input: tasks = [[7,10],[7,12],[7,5],[7,4],[7,2]]
-Output: [4,3,2,0,1]
-Explanation: The events go as follows:
-- At time = 7, all the tasks become available. Available tasks = {0,1,2,3,4}.
-- Also at time = 7, the idle CPU starts processing task 4. Available tasks = {0,1,2,3}.
-- At time = 9, the CPU finishes task 4 and starts processing task 3. Available tasks = {0,1,2}.
-- At time = 13, the CPU finishes task 3 and starts processing task 2. Available tasks = {0,1}.
-- At time = 18, the CPU finishes task 2 and starts processing task 0. Available tasks = {1}.
-- At time = 28, the CPU finishes task 0 and starts processing task 1. Available tasks = {}.
-- At time = 40, the CPU finishes task 1 and becomes idle.
-
-
-
-
Constraints:
-
-
-
tasks.length == n
-
1 <= n <= 105
-
1 <= enqueueTimei, processingTimei <= 109
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
- [[Heap (Priority Queue)](../../tag/heap-priority-queue/README.md)]
-
-### Hints
-
-Hint 1
-To simulate the problem we first need to note that if at any point in time there are no enqueued tasks we need to wait to the smallest enqueue time of a non-processed element
-
-
-
-Hint 2
-We need a data structure like a min-heap to support choosing the task with the smallest processing time from all the enqueued tasks
-
diff --git a/problems/sliding-puzzle/README.md b/problems/sliding-puzzle/README.md
deleted file mode 100644
index 6b0fb4589..000000000
--- a/problems/sliding-puzzle/README.md
+++ /dev/null
@@ -1,78 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../basic-calculator-iii "Basic Calculator III")
-
-[Next >](../minimize-max-distance-to-gas-station "Minimize Max Distance to Gas Station")
-
-## [773. Sliding Puzzle (Hard)](https://leetcode.com/problems/sliding-puzzle "滑动谜题")
-
-
On an 2 x 3 board, there are five tiles labeled from 1 to 5, and an empty square represented by 0. A move consists of choosing 0 and a 4-directionally adjacent number and swapping it.
-
-
The state of the board is solved if and only if the board is [[1,2,3],[4,5,0]].
-
-
Given the puzzle board board, return the least number of moves required so that the state of the board is solved. If it is impossible for the state of the board to be solved, return -1.
-
-
-
Example 1:
-
-
-Input: board = [[1,2,3],[4,0,5]]
-Output: 1
-Explanation: Swap the 0 and the 5 in one move.
-
-
-
Example 2:
-
-
-Input: board = [[1,2,3],[5,4,0]]
-Output: -1
-Explanation: No number of moves will make the board solved.
-
-
-
Example 3:
-
-
-Input: board = [[4,1,2],[5,0,3]]
-Output: 5
-Explanation: 5 is the smallest number of moves that solves the board.
-An example path:
-After move 0: [[4,1,2],[5,0,3]]
-After move 1: [[4,1,2],[0,5,3]]
-After move 2: [[0,1,2],[4,5,3]]
-After move 3: [[1,0,2],[4,5,3]]
-After move 4: [[1,2,0],[4,5,3]]
-After move 5: [[1,2,3],[4,5,0]]
-
-
-
Example 4:
-
-
-Input: board = [[3,2,4],[1,5,0]]
-Output: 14
-
-
-
-
Constraints:
-
-
-
board.length == 2
-
board[i].length == 3
-
0 <= board[i][j] <= 5
-
Each value board[i][j] is unique.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
-
-### Hints
-
-Hint 1
-Perform a breadth-first-search, where the nodes are the puzzle boards and edges are if two puzzle boards can be transformed into one another with one move.
-
diff --git a/problems/sliding-puzzle/sliding_puzzle.go b/problems/sliding-puzzle/sliding_puzzle.go
deleted file mode 100644
index cee74bbaa..000000000
--- a/problems/sliding-puzzle/sliding_puzzle.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem773
diff --git a/problems/sliding-puzzle/sliding_puzzle_test.go b/problems/sliding-puzzle/sliding_puzzle_test.go
deleted file mode 100644
index cee74bbaa..000000000
--- a/problems/sliding-puzzle/sliding_puzzle_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem773
diff --git a/problems/sliding-window-maximum/README.md b/problems/sliding-window-maximum/README.md
deleted file mode 100644
index 9ba626b8d..000000000
--- a/problems/sliding-window-maximum/README.md
+++ /dev/null
@@ -1,100 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../product-of-array-except-self "Product of Array Except Self")
-
-[Next >](../search-a-2d-matrix-ii "Search a 2D Matrix II")
-
-## [239. Sliding Window Maximum (Hard)](https://leetcode.com/problems/sliding-window-maximum "滑动窗口最大值")
-
-
You are given an array of integers nums, there is a sliding window of size k which is moving from the very left of the array to the very right. You can only see the k numbers in the window. Each time the sliding window moves right by one position.
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Queue](../../tag/queue/README.md)]
- [[Sliding Window](../../tag/sliding-window/README.md)]
- [[Heap (Priority Queue)](../../tag/heap-priority-queue/README.md)]
- [[Monotonic Queue](../../tag/monotonic-queue/README.md)]
-
-### Similar Questions
- 1. [Minimum Window Substring](../minimum-window-substring) (Hard)
- 1. [Min Stack](../min-stack) (Easy)
- 1. [Longest Substring with At Most Two Distinct Characters](../longest-substring-with-at-most-two-distinct-characters) (Medium)
- 1. [Paint House II](../paint-house-ii) (Hard)
- 1. [Jump Game VI](../jump-game-vi) (Medium)
-
-### Hints
-
-Hint 1
-How about using a data structure such as deque (double-ended queue)?
-
-
-
-Hint 2
-The queue size need not be the same as the window’s size.
-
-
-
-Hint 3
-Remove redundant elements and the queue should store only elements that need to be considered.
-
diff --git a/problems/sliding-window-maximum/sliding_window_maximum.go b/problems/sliding-window-maximum/sliding_window_maximum.go
deleted file mode 100644
index 9fdef387a..000000000
--- a/problems/sliding-window-maximum/sliding_window_maximum.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem239
diff --git a/problems/sliding-window-maximum/sliding_window_maximum_test.go b/problems/sliding-window-maximum/sliding_window_maximum_test.go
deleted file mode 100644
index 9fdef387a..000000000
--- a/problems/sliding-window-maximum/sliding_window_maximum_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem239
diff --git a/problems/sliding-window-median/README.md b/problems/sliding-window-median/README.md
deleted file mode 100644
index af143bcb9..000000000
--- a/problems/sliding-window-median/README.md
+++ /dev/null
@@ -1,80 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../largest-palindrome-product "Largest Palindrome Product")
-
-[Next >](../magical-string "Magical String")
-
-## [480. Sliding Window Median (Hard)](https://leetcode.com/problems/sliding-window-median "滑动窗口中位数")
-
-
The median is the middle value in an ordered integer list. If the size of the list is even, there is no middle value. So the median is the mean of the two middle values.
-
-
-
For examples, if arr = [2,3,4], the median is 3.
-
For examples, if arr = [1,2,3,4], the median is (2 + 3) / 2 = 2.5.
-
-
-
You are given an integer array nums and an integer k. There is a sliding window of size k which is moving from the very left of the array to the very right. You can only see the k numbers in the window. Each time the sliding window moves right by one position.
-
-
Return the median array for each window in the original array. Answers within 10-5 of the actual value will be accepted.
-Input: nums = [1,2,3,4,2,3,1,4,2], k = 3
-Output: [2.00000,3.00000,3.00000,3.00000,2.00000,3.00000,2.00000]
-
-
-
-
Constraints:
-
-
-
1 <= k <= nums.length <= 105
-
-231 <= nums[i] <= 231 - 1
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Sliding Window](../../tag/sliding-window/README.md)]
- [[Heap (Priority Queue)](../../tag/heap-priority-queue/README.md)]
-
-### Similar Questions
- 1. [Find Median from Data Stream](../find-median-from-data-stream) (Hard)
-
-### Hints
-
-Hint 1
-The simplest of solutions comes from the basic idea of finding the median given a set of numbers. We know that by definition, a median is the center element (or an average of the two center elements). Given an unsorted list of numbers, how do we find the median element? If you know the answer to this question, can we extend this idea to every sliding window that we come across in the array?
-
-
-
-Hint 2
-Is there a better way to do what we are doing in the above hint? Don't you think there is duplication of calculation being done there? Is there some sort of optimization that we can do to achieve the same result? This approach is merely a modification of the basic approach except that it simply reduces duplication of calculations once done.
-
-
-
-Hint 3
-The third line of thought is also based on this same idea but achieving the result in a different way. We obviously need the window to be sorted for us to be able to find the median. Is there a data-structure out there that we can use (in one or more quantities) to obtain the median element extremely fast, say O(1) time while having the ability to perform the other operations fairly efficiently as well?
-
diff --git a/problems/sliding-window-median/sliding_window_median.go b/problems/sliding-window-median/sliding_window_median.go
deleted file mode 100644
index fdb8acca6..000000000
--- a/problems/sliding-window-median/sliding_window_median.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem480
diff --git a/problems/sliding-window-median/sliding_window_median_test.go b/problems/sliding-window-median/sliding_window_median_test.go
deleted file mode 100644
index fdb8acca6..000000000
--- a/problems/sliding-window-median/sliding_window_median_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem480
diff --git a/problems/slowest-key/README.md b/problems/slowest-key/README.md
deleted file mode 100644
index 96e1088ff..000000000
--- a/problems/slowest-key/README.md
+++ /dev/null
@@ -1,82 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../design-an-expression-tree-with-evaluate-function "Design an Expression Tree With Evaluate Function")
-
-[Next >](../arithmetic-subarrays "Arithmetic Subarrays")
-
-## [1629. Slowest Key (Easy)](https://leetcode.com/problems/slowest-key "按键持续时间最长的键")
-
-
A newly designed keypad was tested, where a tester pressed a sequence of n keys, one at a time.
-
-
You are given a string keysPressed of length n, where keysPressed[i] was the ith key pressed in the testing sequence, and a sorted list releaseTimes, where releaseTimes[i] was the time the ith key was released. Both arrays are 0-indexed. The 0th key was pressed at the time 0, and every subsequent key was pressed at the exact time the previous key was released.
-
-
The tester wants to know the key of the keypress that had the longest duration. The ithkeypress had a duration of releaseTimes[i] - releaseTimes[i - 1], and the 0th keypress had a duration of releaseTimes[0].
-
-
Note that the same key could have been pressed multiple times during the test, and these multiple presses of the same key may not have had the same duration.
-
-
Return the key of the keypress that had the longest duration. If there are multiple such keypresses, return the lexicographically largest key of the keypresses.
-
-
-
Example 1:
-
-
-Input: releaseTimes = [9,29,49,50], keysPressed = "cbcd"
-Output: "c"
-Explanation: The keypresses were as follows:
-Keypress for 'c' had a duration of 9 (pressed at time 0 and released at time 9).
-Keypress for 'b' had a duration of 29 - 9 = 20 (pressed at time 9 right after the release of the previous character and released at time 29).
-Keypress for 'c' had a duration of 49 - 29 = 20 (pressed at time 29 right after the release of the previous character and released at time 49).
-Keypress for 'd' had a duration of 50 - 49 = 1 (pressed at time 49 right after the release of the previous character and released at time 50).
-The longest of these was the keypress for 'b' and the second keypress for 'c', both with duration 20.
-'c' is lexicographically larger than 'b', so the answer is 'c'.
-
-
-
Example 2:
-
-
-Input: releaseTimes = [12,23,36,46,62], keysPressed = "spuda"
-Output: "a"
-Explanation: The keypresses were as follows:
-Keypress for 's' had a duration of 12.
-Keypress for 'p' had a duration of 23 - 12 = 11.
-Keypress for 'u' had a duration of 36 - 23 = 13.
-Keypress for 'd' had a duration of 46 - 36 = 10.
-Keypress for 'a' had a duration of 62 - 46 = 16.
-The longest of these was the keypress for 'a' with duration 16.
-
-
-
Constraints:
-
-
-
releaseTimes.length == n
-
keysPressed.length == n
-
2 <= n <= 1000
-
1 <= releaseTimes[i] <= 109
-
releaseTimes[i] < releaseTimes[i+1]
-
keysPressed contains only lowercase English letters.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Hints
-
-Hint 1
-Get for each press its key and amount of time taken.
-
-
-
-Hint 2
-Iterate on the presses, maintaining the answer so far.
-
-
-
-Hint 3
-The current press will change the answer if and only if its amount of time taken is longer than that of the previous answer, or they are equal but the key is larger than that of the previous answer.
-
diff --git a/problems/smallest-common-region/README.md b/problems/smallest-common-region/README.md
deleted file mode 100644
index 85f65043f..000000000
--- a/problems/smallest-common-region/README.md
+++ /dev/null
@@ -1,74 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../encode-number "Encode Number")
-
-[Next >](../synonymous-sentences "Synonymous Sentences")
-
-## [1257. Smallest Common Region (Medium)](https://leetcode.com/problems/smallest-common-region "最小公共区域")
-
-
You are given some lists of regions where the first region of each list includes all other regions in that list.
-
-
Naturally, if a region X contains another region Y then X is bigger than Y.
-
-
Given two regions region1, region2, find out the smallest region that contains both of them.
-
-
If you are given regions r1, r2 and r3 such that r1 includes r3, it is guaranteed there is no r2 such that r2 includes r3.
-
-It's guaranteed the smallest region exists.
All strings consist of English letters and spaces with at most 20 letters.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
- [[Tree](../../tag/tree/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
-
-### Similar Questions
- 1. [Lowest Common Ancestor of a Binary Search Tree](../lowest-common-ancestor-of-a-binary-search-tree) (Easy)
- 1. [Lowest Common Ancestor of a Binary Tree](../lowest-common-ancestor-of-a-binary-tree) (Medium)
-
-### Hints
-
-Hint 1
-Try to model the problem as a graph problem.
-
-
-
-Hint 2
-The given graph is a tree.
-
-
-
-Hint 3
-The problem is reduced to finding the lowest common ancestor of two nodes in a tree.
-
diff --git a/problems/smallest-good-base/README.md b/problems/smallest-good-base/README.md
deleted file mode 100644
index 99e61b3f4..000000000
--- a/problems/smallest-good-base/README.md
+++ /dev/null
@@ -1,53 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../license-key-formatting "License Key Formatting")
-
-[Next >](../find-permutation "Find Permutation")
-
-## [483. Smallest Good Base (Hard)](https://leetcode.com/problems/smallest-good-base "最小好进制")
-
-
Given an integer n represented as a string, return the smallest good base ofn.
-
-
We call k >= 2 a good base of n, if all digits of n base k are 1's.
-
-
-
Example 1:
-
-
-Input: n = "13"
-Output: "3"
-Explanation: 13 base 3 is 111.
-
-
-
Example 2:
-
-
-Input: n = "4681"
-Output: "8"
-Explanation: 4681 base 8 is 11111.
-
-
-
Example 3:
-
-
-Input: n = "1000000000000000000"
-Output: "999999999999999999"
-Explanation: 1000000000000000000 base 999999999999999999 is 11.
-
-
-
-
Constraints:
-
-
-
n is an integer in the range [3, 1018].
-
n does not contain any leading zeros.
-
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
diff --git a/problems/smallest-good-base/smallest_good_base.go b/problems/smallest-good-base/smallest_good_base.go
deleted file mode 100644
index 34df7d619..000000000
--- a/problems/smallest-good-base/smallest_good_base.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem483
diff --git a/problems/smallest-good-base/smallest_good_base_test.go b/problems/smallest-good-base/smallest_good_base_test.go
deleted file mode 100644
index 34df7d619..000000000
--- a/problems/smallest-good-base/smallest_good_base_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem483
diff --git a/problems/smallest-greater-multiple-made-of-two-digits/README.md b/problems/smallest-greater-multiple-made-of-two-digits/README.md
deleted file mode 100644
index cd7e4bd7f..000000000
--- a/problems/smallest-greater-multiple-made-of-two-digits/README.md
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../gcd-sort-of-an-array "GCD Sort of an Array")
-
-[Next >](../reverse-prefix-of-word "Reverse Prefix of Word")
-
-## [1999. Smallest Greater Multiple Made of Two Digits (Medium)](https://leetcode.com/problems/smallest-greater-multiple-made-of-two-digits "最小的仅由两个数组成的倍数")
-
-
-
-### Hints
-
-Hint 1
-Could you generate all the different numbers comprised of only digit1 and digit2 with the constraints?
-
-
-
-Hint 2
-Going from least to greatest, check if the number you generated is greater than k and a multiple of k.
-
diff --git a/problems/smallest-index-with-equal-value/README.md b/problems/smallest-index-with-equal-value/README.md
deleted file mode 100644
index 48843d83d..000000000
--- a/problems/smallest-index-with-equal-value/README.md
+++ /dev/null
@@ -1,67 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../number-of-valid-move-combinations-on-chessboard "Number of Valid Move Combinations On Chessboard")
-
-[Next >](../find-the-minimum-and-maximum-number-of-nodes-between-critical-points "Find the Minimum and Maximum Number of Nodes Between Critical Points")
-
-## [2057. Smallest Index With Equal Value (Easy)](https://leetcode.com/problems/smallest-index-with-equal-value "值相等的最小索引")
-
-
Given a 0-indexed integer array nums, return the smallest index i of nums such that i mod 10 == nums[i], or -1 if such index does not exist.
-
-
x mod y denotes the remainder when x is divided by y.
-
-
-
Example 1:
-
-
-Input: nums = [0,1,2]
-Output: 0
-Explanation:
-i=0: 0 mod 10 = 0 == nums[0].
-i=1: 1 mod 10 = 1 == nums[1].
-i=2: 2 mod 10 = 2 == nums[2].
-All indices have i mod 10 == nums[i], so we return the smallest index 0.
-
-
-
Example 2:
-
-
-Input: nums = [4,3,2,1]
-Output: 2
-Explanation:
-i=0: 0 mod 10 = 0 != nums[0].
-i=1: 1 mod 10 = 1 != nums[1].
-i=2: 2 mod 10 = 2 == nums[2].
-i=3: 3 mod 10 = 3 != nums[3].
-2 is the only index which has i mod 10 == nums[i].
-
-
-
Example 3:
-
-
-Input: nums = [1,2,3,4,5,6,7,8,9,0]
-Output: -1
-Explanation: No index satisfies i mod 10 == nums[i].
-
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 100
-
0 <= nums[i] <= 9
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
-
-### Hints
-
-Hint 1
-Starting with i=0, check the condition for each index. The first one you find to be true is the smallest index.
-
diff --git a/problems/smallest-integer-divisible-by-k/README.md b/problems/smallest-integer-divisible-by-k/README.md
deleted file mode 100644
index 295bc573d..000000000
--- a/problems/smallest-integer-divisible-by-k/README.md
+++ /dev/null
@@ -1,66 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../best-sightseeing-pair "Best Sightseeing Pair")
-
-[Next >](../binary-string-with-substrings-representing-1-to-n "Binary String With Substrings Representing 1 To N")
-
-## [1015. Smallest Integer Divisible by K (Medium)](https://leetcode.com/problems/smallest-integer-divisible-by-k "可被 K 整除的最小整数")
-
-
Given a positive integer k, you need to find the length of the smallest positive integer n such that n is divisible by k, and n only contains the digit 1.
-
-
Return the length of n. If there is no such n, return -1.
-
-
Note:n may not fit in a 64-bit signed integer.
-
-
-
Example 1:
-
-
-Input: k = 1
-Output: 1
-Explanation: The smallest answer is n = 1, which has length 1.
-
-
-
Example 2:
-
-
-Input: k = 2
-Output: -1
-Explanation: There is no such positive integer n divisible by 2.
-
-
-
Example 3:
-
-
-Input: k = 3
-Output: 3
-Explanation: The smallest answer is n = 111, which has length 3.
-
-
-
-
Constraints:
-
-
-
1 <= k <= 105
-
-
-### Related Topics
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Math](../../tag/math/README.md)]
-
-### Hints
-
-Hint 1
-11111 = 1111 * 10 + 1
-We only need to store remainders modulo K.
-
-
-
-Hint 2
-If we never get a remainder of 0, why would that happen, and how would we know that?
-
diff --git a/problems/smallest-integer-divisible-by-k/smallest_integer_divisible_by_k.go b/problems/smallest-integer-divisible-by-k/smallest_integer_divisible_by_k.go
deleted file mode 100644
index 9221f14fa..000000000
--- a/problems/smallest-integer-divisible-by-k/smallest_integer_divisible_by_k.go
+++ /dev/null
@@ -1,15 +0,0 @@
-package problem1015
-
-func smallestRepunitDivByK(K int) int {
- if K%2 == 0 || K%5 == 0 {
- return -1
- }
-
- r, length := 1%K, 1
- for r != 0 && length <= K {
- r = (r*10 + 1) % K
- length++
- }
-
- return length
-}
diff --git a/problems/smallest-k-length-subsequence-with-occurrences-of-a-letter/README.md b/problems/smallest-k-length-subsequence-with-occurrences-of-a-letter/README.md
deleted file mode 100644
index 172effb70..000000000
--- a/problems/smallest-k-length-subsequence-with-occurrences-of-a-letter/README.md
+++ /dev/null
@@ -1,76 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../stone-game-ix "Stone Game IX")
-
-[Next >](../count-subarrays-with-more-ones-than-zeros "Count Subarrays With More Ones Than Zeros")
-
-## [2030. Smallest K-Length Subsequence With Occurrences of a Letter (Hard)](https://leetcode.com/problems/smallest-k-length-subsequence-with-occurrences-of-a-letter "含特定字母的最小子序列")
-
-
You are given a string s, an integer k, a letter letter, and an integer repetition.
-
-
Return the lexicographically smallest subsequence ofs of lengthkthat has the letterletterappear at leastrepetitiontimes. The test cases are generated so that the letter appears in sat leastrepetition times.
-
-
A subsequence is a string that can be derived from another string by deleting some or no characters without changing the order of the remaining characters.
-
-
A string a is lexicographically smaller than a string b if in the first position where a and b differ, string a has a letter that appears earlier in the alphabet than the corresponding letter in b.
-
-
-
Example 1:
-
-
-Input: s = "leet", k = 3, letter = "e", repetition = 1
-Output: "eet"
-Explanation: There are four subsequences of length 3 that have the letter 'e' appear at least 1 time:
-- "lee" (from "leet")
-- "let" (from "leet")
-- "let" (from "leet")
-- "eet" (from "leet")
-The lexicographically smallest subsequence among them is "eet".
-
-
-
Example 2:
-
-
-Input: s = "leetcode", k = 4, letter = "e", repetition = 2
-Output: "ecde"
-Explanation: "ecde" is the lexicographically smallest subsequence of length 4 that has the letter "e" appear at least 2 times.
-
-
-
Example 3:
-
-
-Input: s = "bb", k = 2, letter = "b", repetition = 2
-Output: "bb"
-Explanation: "bb" is the only subsequence of length 2 that has the letter "b" appear at least 2 times.
-
-
-
-
Constraints:
-
-
-
1 <= repetition <= k <= s.length <= 5 * 104
-
s consists of lowercase English letters.
-
letter is a lowercase English letter, and appears in s at least repetition times.
-
-
-### Related Topics
- [[Stack](../../tag/stack/README.md)]
- [[Greedy](../../tag/greedy/README.md)]
- [[String](../../tag/string/README.md)]
- [[Monotonic Stack](../../tag/monotonic-stack/README.md)]
-
-### Hints
-
-Hint 1
-Use stack. For every character to be appended, decide how many character(s) from the stack needs to get popped based on the stack length and the count of the required character.
-
-
-
-Hint 2
-Pop the extra characters out from the stack and return the characters in the stack (reversed).
-
diff --git a/problems/smallest-missing-genetic-value-in-each-subtree/README.md b/problems/smallest-missing-genetic-value-in-each-subtree/README.md
deleted file mode 100644
index 0a4c2f101..000000000
--- a/problems/smallest-missing-genetic-value-in-each-subtree/README.md
+++ /dev/null
@@ -1,85 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-product-of-the-length-of-two-palindromic-subsequences "Maximum Product of the Length of Two Palindromic Subsequences")
-
-[Next >](../the-number-of-seniors-and-juniors-to-join-the-company "The Number of Seniors and Juniors to Join the Company")
-
-## [2003. Smallest Missing Genetic Value in Each Subtree (Hard)](https://leetcode.com/problems/smallest-missing-genetic-value-in-each-subtree "每棵子树内缺失的最小基因值")
-
-
There is a family tree rooted at 0 consisting of n nodes numbered 0 to n - 1. You are given a 0-indexed integer array parents, where parents[i] is the parent for node i. Since node 0 is the root, parents[0] == -1.
-
-
There are 105 genetic values, each represented by an integer in the inclusive range [1, 105]. You are given a 0-indexed integer array nums, where nums[i] is a distinct genetic value for node i.
-
-
Return an array ans of length n where ans[i] isthe smallest genetic value that is missing from the subtree rooted at nodei.
-
-
The subtree rooted at a node x contains node x and all of its descendant nodes.
-
-
-
Example 1:
-
-
-Input: parents = [-1,0,0,2], nums = [1,2,3,4]
-Output: [5,1,1,1]
-Explanation: The answer for each subtree is calculated as follows:
-- 0: The subtree contains nodes [0,1,2,3] with values [1,2,3,4]. 5 is the smallest missing value.
-- 1: The subtree contains only node 1 with value 2. 1 is the smallest missing value.
-- 2: The subtree contains nodes [2,3] with values [3,4]. 1 is the smallest missing value.
-- 3: The subtree contains only node 3 with value 4. 1 is the smallest missing value.
-
-
-
Example 2:
-
-
-Input: parents = [-1,0,1,0,3,3], nums = [5,4,6,2,1,3]
-Output: [7,1,1,4,2,1]
-Explanation: The answer for each subtree is calculated as follows:
-- 0: The subtree contains nodes [0,1,2,3,4,5] with values [5,4,6,2,1,3]. 7 is the smallest missing value.
-- 1: The subtree contains nodes [1,2] with values [4,6]. 1 is the smallest missing value.
-- 2: The subtree contains only node 2 with value 6. 1 is the smallest missing value.
-- 3: The subtree contains nodes [3,4,5] with values [2,1,3]. 4 is the smallest missing value.
-- 4: The subtree contains only node 4 with value 1. 2 is the smallest missing value.
-- 5: The subtree contains only node 5 with value 3. 1 is the smallest missing value.
-
-
-
Example 3:
-
-
-Input: parents = [-1,2,3,0,2,4,1], nums = [2,3,4,5,6,7,8]
-Output: [1,1,1,1,1,1,1]
-Explanation: The value 1 is missing from all the subtrees.
-
-
-
-
Constraints:
-
-
-
n == parents.length == nums.length
-
2 <= n <= 105
-
0 <= parents[i] <= n - 1 for i != 0
-
parents[0] == -1
-
parents represents a valid tree.
-
1 <= nums[i] <= 105
-
Each nums[i] is distinct.
-
-
-### Related Topics
- [[Tree](../../tag/tree/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Union Find](../../tag/union-find/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Hints
-
-Hint 1
-If the subtree doesn't contain 1, then the missing value will always be 1.
-
-
-
-Hint 2
-What data structure allows us to dynamically update the values that are currently not present?
-
diff --git a/problems/smallest-range-covering-elements-from-k-lists/README.md b/problems/smallest-range-covering-elements-from-k-lists/README.md
deleted file mode 100644
index 7738b24d9..000000000
--- a/problems/smallest-range-covering-elements-from-k-lists/README.md
+++ /dev/null
@@ -1,57 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../design-excel-sum-formula "Design Excel Sum Formula")
-
-[Next >](../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 "最小区间")
-
-
You have k lists of sorted integers in non-decreasing order. Find the smallest range that includes at least one number from each of the k lists.
-
-
We define the range [a, b] is smaller than range [c, d] if b - a < d - cora < c if b - a == d - c.
-
-
-
Example 1:
-
-
-Input: nums = [[4,10,15,24,26],[0,9,12,20],[5,18,22,30]]
-Output: [20,24]
-Explanation:
-List 1: [4, 10, 15, 24,26], 24 is in range [20,24].
-List 2: [0, 9, 12, 20], 20 is in range [20,24].
-List 3: [5, 18, 22, 30], 22 is in range [20,24].
-
You are given an integer array nums and an integer k.
-
-
In one operation, you can choose any index i where 0 <= i < nums.length and change nums[i] to nums[i] + x where x is an integer from the range [-k, k]. You can apply this operation at most once for each index i.
-
-
The score of nums is the difference between the maximum and minimum elements in nums.
-
-
Return the minimum score of nums after applying the mentioned operation at most once for each index in it.
-
-
-
Example 1:
-
-
-Input: nums = [1], k = 0
-Output: 0
-Explanation: The score is max(nums) - min(nums) = 1 - 1 = 0.
-
-
-
Example 2:
-
-
-Input: nums = [0,10], k = 2
-Output: 6
-Explanation: Change nums to be [2, 8]. The score is max(nums) - min(nums) = 8 - 2 = 6.
-
-
-
Example 3:
-
-
-Input: nums = [1,3,6], k = 3
-Output: 0
-Explanation: Change nums to be [4, 4, 4]. The score is max(nums) - min(nums) = 4 - 4 = 0.
-
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 104
-
0 <= nums[i] <= 104
-
0 <= k <= 104
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Math](../../tag/math/README.md)]
diff --git a/problems/smallest-range-i/smallest_range_i.go b/problems/smallest-range-i/smallest_range_i.go
deleted file mode 100644
index 22631dba4..000000000
--- a/problems/smallest-range-i/smallest_range_i.go
+++ /dev/null
@@ -1,17 +0,0 @@
-package problem908
-
-func smallestRangeI(A []int, K int) int {
- min, max := A[0], A[0]
- for _, v := range A {
- if v < min {
- min = v
- } else if v > max {
- max = v
- }
- }
- ans := max - min - 2*K
- if ans < 0 {
- return 0
- }
- return ans
-}
diff --git a/problems/smallest-range-i/smallest_range_i_test.go b/problems/smallest-range-i/smallest_range_i_test.go
deleted file mode 100644
index 69fb1faf8..000000000
--- a/problems/smallest-range-i/smallest_range_i_test.go
+++ /dev/null
@@ -1,45 +0,0 @@
-package problem908
-
-import "testing"
-
-type testType struct {
- in []int
- k int
- want int
-}
-
-func TestSmallestRangeI(t *testing.T) {
- tests := [...]testType{
- {
- in: []int{1},
- k: 0,
- want: 0,
- },
- {
- in: []int{0, 10},
- k: 2,
- want: 6,
- },
- {
- in: []int{1, 3, 6},
- k: 3,
- want: 0,
- },
- {
- in: []int{1, 3, 5, 7, 9},
- k: 1,
- want: 6,
- },
- {
- in: []int{18, 16, 12, 7, 9, 3, 5},
- k: 6,
- want: 3,
- },
- }
- for _, tt := range tests {
- got := smallestRangeI(tt.in, tt.k)
- if got != tt.want {
- t.Fatalf("in: %v, got: %v, want: %v", tt.in, got, tt.want)
- }
- }
-}
diff --git a/problems/smallest-range-ii/README.md b/problems/smallest-range-ii/README.md
deleted file mode 100644
index 8dbed5def..000000000
--- a/problems/smallest-range-ii/README.md
+++ /dev/null
@@ -1,60 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../snakes-and-ladders "Snakes and Ladders")
-
-[Next >](../online-election "Online Election")
-
-## [910. Smallest Range II (Medium)](https://leetcode.com/problems/smallest-range-ii "最小差值 II")
-
-
You are given an integer array nums and an integer k.
-
-
For each index i where 0 <= i < nums.length, change nums[i] to be either nums[i] + k or nums[i] - k.
-
-
The score of nums is the difference between the maximum and minimum elements in nums.
-
-
Return the minimum score of nums after changing the values at each index.
-
-
-
Example 1:
-
-
-Input: nums = [1], k = 0
-Output: 0
-Explanation: The score is max(nums) - min(nums) = 1 - 1 = 0.
-
-
-
Example 2:
-
-
-Input: nums = [0,10], k = 2
-Output: 6
-Explanation: Change nums to be [2, 8]. The score is max(nums) - min(nums) = 8 - 2 = 6.
-
-
-
Example 3:
-
-
-Input: nums = [1,3,6], k = 3
-Output: 3
-Explanation: Change nums to be [4, 6, 3]. The score is max(nums) - min(nums) = 6 - 3 = 3.
-
An image is represented by a binary matrix with 0 as a white pixel and 1 as a black pixel. The black pixels are connected, i.e., there is only one black region. Pixels are connected horizontally and vertically. Given the location (x, y) of one of the black pixels, return the area of the smallest (axis-aligned) rectangle that encloses all black pixels.
-
-
Example:
-
-
-Input:
-[
- "0010",
- "0110",
- "0100"
-]
-and x = 0, y = 2
-
-Output: 6
-
You are given an array nums. You can rotate it by a non-negative integer k so that the array becomes [nums[k], nums[k + 1], ... nums[nums.length - 1], nums[0], nums[1], ..., nums[k-1]]. Afterward, any entries that are less than or equal to their index are worth one point.
-
-
-
For example, if we have nums = [2,4,1,3,0], and we rotate by k = 2, it becomes [1,3,0,2,4]. This is worth 3 points because 1 > 0 [no points], 3 > 1 [no points], 0 <= 2 [one point], 2 <= 3 [one point], 4 <= 4 [one point].
-
-
-
Return the rotation index k that corresponds to the highest score we can achieve if we rotated nums by it. If there are multiple answers, return the smallest such index k.
-
-
-
Example 1:
-
-
-Input: nums = [2,3,1,4,0]
-Output: 3
-Explanation: Scores for each k are listed below:
-k = 0, nums = [2,3,1,4,0], score 2
-k = 1, nums = [3,1,4,0,2], score 3
-k = 2, nums = [1,4,0,2,3], score 3
-k = 3, nums = [4,0,2,3,1], score 4
-k = 4, nums = [0,2,3,1,4], score 3
-So we should choose k = 3, which has the highest score.
-
-
-
Example 2:
-
-
-Input: nums = [1,3,0,2,4]
-Output: 0
-Explanation: nums will always have 3 points no matter how it shifts.
-So we will choose the smallest k, which is 0.
-
The number of nodes in the tree is in the range [1, 8500].
-
0 <= Node.val <= 25
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
- [[Tree](../../tag/tree/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Binary Tree](../../tag/binary-tree/README.md)]
-
-### Similar Questions
- 1. [Sum Root to Leaf Numbers](../sum-root-to-leaf-numbers) (Medium)
- 1. [Binary Tree Paths](../binary-tree-paths) (Easy)
diff --git a/problems/smallest-string-starting-from-leaf/smallest_string_starting_from_leaf.go b/problems/smallest-string-starting-from-leaf/smallest_string_starting_from_leaf.go
deleted file mode 100644
index 739b75edf..000000000
--- a/problems/smallest-string-starting-from-leaf/smallest_string_starting_from_leaf.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem988
diff --git a/problems/smallest-string-with-a-given-numeric-value/README.md b/problems/smallest-string-with-a-given-numeric-value/README.md
deleted file mode 100644
index 031de599d..000000000
--- a/problems/smallest-string-with-a-given-numeric-value/README.md
+++ /dev/null
@@ -1,59 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../check-if-two-string-arrays-are-equivalent "Check If Two String Arrays are Equivalent")
-
-[Next >](../ways-to-make-a-fair-array "Ways to Make a Fair Array")
-
-## [1663. Smallest String With A Given Numeric Value (Medium)](https://leetcode.com/problems/smallest-string-with-a-given-numeric-value "具有给定数值的最小字符串")
-
-
The numeric value of a lowercase character is defined as its position (1-indexed) in the alphabet, so the numeric value of a is 1, the numeric value of b is 2, the numeric value of c is 3, and so on.
-
-
The numeric value of a string consisting of lowercase characters is defined as the sum of its characters' numeric values. For example, the numeric value of the string "abe" is equal to 1 + 2 + 5 = 8.
-
-
You are given two integers n and k. Return the lexicographically smallest string with length equal to n and numeric value equal to k.
-
-
Note that a string x is lexicographically smaller than string y if x comes before y in dictionary order, that is, either x is a prefix of y, or if i is the first position such that x[i] != y[i], then x[i] comes before y[i] in alphabetic order.
-
-
-
Example 1:
-
-
-Input: n = 3, k = 27
-Output: "aay"
-Explanation: The numeric value of the string is 1 + 1 + 25 = 27, and it is the smallest string with such a value and length equal to 3.
-
-
-
Example 2:
-
-
-Input: n = 5, k = 73
-Output: "aaszz"
-
-
-
-
Constraints:
-
-
-
1 <= n <= 105
-
n <= k <= 26 * n
-
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Hints
-
-Hint 1
-Think greedily.
-
-
-
-Hint 2
-If you build the string from the end to the beginning, it will always be optimal to put the highest possible character at the current index.
-
diff --git a/problems/smallest-string-with-swaps/README.md b/problems/smallest-string-with-swaps/README.md
deleted file mode 100644
index 4275dfbf4..000000000
--- a/problems/smallest-string-with-swaps/README.md
+++ /dev/null
@@ -1,87 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../ugly-number-iii "Ugly Number III")
-
-[Next >](../sort-items-by-groups-respecting-dependencies "Sort Items by Groups Respecting Dependencies")
-
-## [1202. Smallest String With Swaps (Medium)](https://leetcode.com/problems/smallest-string-with-swaps "交换字符串中的元素")
-
-
You are given a string s, and an array of pairs of indices in the string pairs where pairs[i] = [a, b] indicates 2 indices(0-indexed) of the string.
-
-
You can swap the characters at any pair of indices in the given pairsany number of times.
-
-
Return the lexicographically smallest string that s can be changed to after using the swaps.
-
-
-
Example 1:
-
-
-Input: s = "dcab", pairs = [[0,3],[1,2]]
-Output: "bacd"
-Explaination:
-Swap s[0] and s[3], s = "bcad"
-Swap s[1] and s[2], s = "bacd"
-
-
-
Example 2:
-
-
-Input: s = "dcab", pairs = [[0,3],[1,2],[0,2]]
-Output: "abcd"
-Explaination:
-Swap s[0] and s[3], s = "bcad"
-Swap s[0] and s[2], s = "acbd"
-Swap s[1] and s[2], s = "abcd"
-
-
Example 3:
-
-
-Input: s = "cba", pairs = [[0,1],[1,2]]
-Output: "abc"
-Explaination:
-Swap s[0] and s[1], s = "bca"
-Swap s[1] and s[2], s = "bac"
-Swap s[0] and s[1], s = "abc"
-
-
-
-
Constraints:
-
-
-
1 <= s.length <= 10^5
-
0 <= pairs.length <= 10^5
-
0 <= pairs[i][0], pairs[i][1] < s.length
-
s only contains lower case English letters.
-
-
-### Related Topics
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Union Find](../../tag/union-find/README.md)]
-
-### Similar Questions
- 1. [Minimize Hamming Distance After Swap Operations](../minimize-hamming-distance-after-swap-operations) (Medium)
- 1. [Process Restricted Friend Requests](../process-restricted-friend-requests) (Hard)
-
-### Hints
-
-Hint 1
-Think of it as a graph problem.
-
-
-
-Hint 2
-Consider the pairs as connected nodes in the graph, what can you do with a connected component of indices ?
-
-
-
-Hint 3
-We can sort each connected component alone to get the lexicographically minimum string.
-
diff --git a/problems/smallest-subsequence-of-distinct-characters/README.md b/problems/smallest-subsequence-of-distinct-characters/README.md
deleted file mode 100644
index 8df56998f..000000000
--- a/problems/smallest-subsequence-of-distinct-characters/README.md
+++ /dev/null
@@ -1,52 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../insufficient-nodes-in-root-to-leaf-paths "Insufficient Nodes in Root to Leaf Paths")
-
-[Next >](../sales-analysis-i "Sales Analysis I")
-
-## [1081. Smallest Subsequence of Distinct Characters (Medium)](https://leetcode.com/problems/smallest-subsequence-of-distinct-characters "不同字符的最小子序列")
-
-
Given a string s, return the lexicographically smallest subsequence ofsthat contains all the distinct characters ofsexactly once.
-
-
-
Example 1:
-
-
-Input: s = "bcabc"
-Output: "abc"
-
-
-
Example 2:
-
-
-Input: s = "cbacdcbc"
-Output: "acdb"
-
-
-
-
Constraints:
-
-
-
1 <= s.length <= 1000
-
s consists of lowercase English letters.
-
-
-
-Note: This question is the same as 316: https://leetcode.com/problems/remove-duplicate-letters/
-
-### Related Topics
- [[Stack](../../tag/stack/README.md)]
- [[Greedy](../../tag/greedy/README.md)]
- [[String](../../tag/string/README.md)]
- [[Monotonic Stack](../../tag/monotonic-stack/README.md)]
-
-### Hints
-
-Hint 1
-Greedily try to add one missing character. How to check if adding some character will not cause problems ? Use bit-masks to check whether you will be able to complete the sub-sequence if you add the character at some index i.
-
diff --git a/problems/smallest-subsequence-of-distinct-characters/smallest_subsequence_of_distinct_characters.go b/problems/smallest-subsequence-of-distinct-characters/smallest_subsequence_of_distinct_characters.go
deleted file mode 100644
index 6be566f4b..000000000
--- a/problems/smallest-subsequence-of-distinct-characters/smallest_subsequence_of_distinct_characters.go
+++ /dev/null
@@ -1,39 +0,0 @@
-package problem1081
-
-import "strings"
-
-func smallestSubsequence(S string) string {
- n := len(S)
-
- last := [26]int{}
- for i, c := range S {
- last[c-'a'] = i
- }
-
- stack, top := make([]int, n), -1
- hasSeen := [26]bool{}
- for i := 0; i < n; i++ {
- c := int(S[i] - 'a')
- if hasSeen[c] {
- continue
- }
- for top >= 0 &&
- stack[top] > c &&
- i < last[stack[top]] {
- pop := stack[top]
- top--
- hasSeen[pop] = false
- }
- top++
- stack[top] = c
- hasSeen[c] = true
- }
-
- var sb strings.Builder
- for i := 0; i <= top; i++ {
- b := byte(stack[i] + 'a')
- sb.WriteByte(b)
- }
-
- return sb.String()
-}
diff --git a/problems/smallest-subtree-with-all-the-deepest-nodes/README.md b/problems/smallest-subtree-with-all-the-deepest-nodes/README.md
deleted file mode 100644
index f7479d7cc..000000000
--- a/problems/smallest-subtree-with-all-the-deepest-nodes/README.md
+++ /dev/null
@@ -1,66 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../shortest-path-to-get-all-keys "Shortest Path to Get All Keys")
-
-[Next >](../prime-palindrome "Prime Palindrome")
-
-## [865. Smallest Subtree with all the Deepest Nodes (Medium)](https://leetcode.com/problems/smallest-subtree-with-all-the-deepest-nodes "具有所有最深节点的最小子树")
-
-
Given the root of a binary tree, the depth of each node is the shortest distance to the root.
-
-
Return the smallest subtree such that it contains all the deepest nodes in the original tree.
-
-
A node is called the deepest if it has the largest depth possible among any node in the entire tree.
-
-
The subtree of a node is a tree consisting of that node, plus the set of all descendants of that node.
-
-
-
Example 1:
-
-
-Input: root = [3,5,1,6,2,0,8,null,null,7,4]
-Output: [2,7,4]
-Explanation: We return the node with value 2, colored in yellow in the diagram.
-The nodes coloured in blue are the deepest nodes of the tree.
-Notice that nodes 5, 3 and 2 contain the deepest nodes in the tree but node 2 is the smallest subtree among them, so we return it.
-
-
-
Example 2:
-
-
-Input: root = [1]
-Output: [1]
-Explanation: The root is the deepest node in the tree.
-
-
-
Example 3:
-
-
-Input: root = [0,1,3,null,2]
-Output: [2]
-Explanation: The deepest node in the tree is 2, the valid subtrees are the subtrees of nodes 2, 1 and 0 but the subtree of node 2 is the smallest.
-
-
-
-
Constraints:
-
-
-
The number of nodes in the tree will be in the range [1, 500].
In a project, you have a list of required skills req_skills, and a list of people. The ith person people[i] contains a list of skills that the person has.
-
-
Consider a sufficient team: a set of people such that for every required skill in req_skills, there is at least one person in the team who has that skill. We can represent these teams by the index of each person.
-
-
-
For example, team = [0, 1, 3] represents the people with skills people[0], people[1], and people[3].
-
-
-
Return any sufficient team of the smallest possible size, represented by the index of each person. You may return the answer in any order.
-
-
It is guaranteed an answer exists.
-
-
-
Example 1:
-
Input: req_skills = ["java","nodejs","reactjs"], people = [["java"],["nodejs"],["nodejs","reactjs"]]
-Output: [0,2]
-
Example 2:
-
Input: req_skills = ["algorithms","math","java","reactjs","csharp","aws"], people = [["algorithms","math","java"],["algorithms","math","reactjs"],["java","csharp","aws"],["reactjs","csharp"],["csharp","math"],["aws","java"]]
-Output: [1,2]
-
-
-
Constraints:
-
-
-
1 <= req_skills.length <= 16
-
1 <= req_skills[i].length <= 16
-
req_skills[i] consists of lowercase English letters.
-
All the strings of req_skills are unique.
-
1 <= people.length <= 60
-
0 <= people[i].length <= 16
-
1 <= people[i][j].length <= 16
-
people[i][j] consists of lowercase English letters.
-
All the strings of people[i] are unique.
-
Every skill in people[i] is a skill in req_skills.
-
It is guaranteed a sufficient team exists.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Bit Manipulation](../../tag/bit-manipulation/README.md)]
- [[Bitmask](../../tag/bitmask/README.md)]
-
-### Similar Questions
- 1. [The Number of Good Subsets](../the-number-of-good-subsets) (Hard)
- 1. [Minimum Number of Work Sessions to Finish the Tasks](../minimum-number-of-work-sessions-to-finish-the-tasks) (Medium)
-
-### 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/smallest-sufficient-team/smallest_sufficient_team.go b/problems/smallest-sufficient-team/smallest_sufficient_team.go
deleted file mode 100644
index 96a34c17e..000000000
--- a/problems/smallest-sufficient-team/smallest_sufficient_team.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem1125
diff --git a/problems/smallest-value-of-the-rearranged-number/README.md b/problems/smallest-value-of-the-rearranged-number/README.md
deleted file mode 100644
index 3d029d147..000000000
--- a/problems/smallest-value-of-the-rearranged-number/README.md
+++ /dev/null
@@ -1,59 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../sort-even-and-odd-indices-independently "Sort Even and Odd Indices Independently")
-
-[Next >](../design-bitset "Design Bitset")
-
-## [2165. Smallest Value of the Rearranged Number (Medium)](https://leetcode.com/problems/smallest-value-of-the-rearranged-number "重排数字的最小值")
-
-
You are given an integer num.Rearrange the digits of num such that its value is minimized and it does not contain any leading zeros.
-
-
Return the rearranged number with minimal value.
-
-
Note that the sign of the number does not change after rearranging the digits.
-
-
-
Example 1:
-
-
-Input: num = 310
-Output: 103
-Explanation: The possible arrangements for the digits of 310 are 013, 031, 103, 130, 301, 310.
-The arrangement with the smallest value that does not contain any leading zeros is 103.
-
-
-
Example 2:
-
-
-Input: num = -7605
-Output: -7650
-Explanation: Some possible arrangements for the digits of -7605 are -7650, -6705, -5076, -0567.
-The arrangement with the smallest value that does not contain any leading zeros is -7650.
-
-
-
-
Constraints:
-
-
-
-1015 <= num <= 1015
-
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Hints
-
-Hint 1
-For positive numbers, the leading digit should be the smallest nonzero digit. Then the remaining digits follow in ascending order.
-
-
-
-Hint 2
-For negative numbers, the digits should be arranged in descending order.
-
diff --git a/problems/snakes-and-ladders/README.md b/problems/snakes-and-ladders/README.md
deleted file mode 100644
index ec54e4fac..000000000
--- a/problems/snakes-and-ladders/README.md
+++ /dev/null
@@ -1,73 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../smallest-range-i "Smallest Range I")
-
-[Next >](../smallest-range-ii "Smallest Range II")
-
-## [909. Snakes and Ladders (Medium)](https://leetcode.com/problems/snakes-and-ladders "蛇梯棋")
-
-
You are given an n x n integer matrix board where the cells are labeled from 1 to n2 in a Boustrophedon style starting from the bottom left of the board (i.e. board[n - 1][0]) and alternating direction each row.
-
-
You start on square 1 of the board. In each move, starting from square curr, do the following:
-
-
-
Choose a destination square next with a label in the range [curr + 1, min(curr + 6, n2)].
-
-
This choice simulates the result of a standard 6-sided die roll: i.e., there are always at most 6 destinations, regardless of the size of the board.
-
-
-
If next has a snake or ladder, you must move to the destination of that snake or ladder. Otherwise, you move to next.
-
The game ends when you reach the square n2.
-
-
-
A board square on row r and column c has a snake or ladder if board[r][c] != -1. The destination of that snake or ladder is board[r][c]. Squares 1 and n2 do not have a snake or ladder.
-
-
Note that you only take a snake or ladder at most once per move. If the destination to a snake or ladder is the start of another snake or ladder, you do not follow the subsequent snake or ladder.
-
-
-
For example, suppose the board is [[-1,4],[-1,3]], and on the first move, your destination square is 2. You follow the ladder to square 3, but do not follow the subsequent ladder to 4.
-
-
-
Return the least number of moves required to reach the square n2. If it is not possible to reach the square, return -1.
-
-
-
Example 1:
-
-
-Input: board = [[-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1],[-1,35,-1,-1,13,-1],[-1,-1,-1,-1,-1,-1],[-1,15,-1,-1,-1,-1]]
-Output: 4
-Explanation:
-In the beginning, you start at square 1 (at row 5, column 0).
-You decide to move to square 2 and must take the ladder to square 15.
-You then decide to move to square 17 and must take the snake to square 13.
-You then decide to move to square 14 and must take the ladder to square 35.
-You then decide to move to square 36, ending the game.
-This is the lowest possible number of moves to reach the last square, so return 4.
-
-
-
Example 2:
-
-
-Input: board = [[-1,-1],[-1,3]]
-Output: 1
-
-
-
-
Constraints:
-
-
-
n == board.length == board[i].length
-
2 <= n <= 20
-
grid[i][j] is either -1 or in the range [1, n2].
-
The squares labeled 1 and n2 do not have any ladders or snakes.
Implement a SnapshotArray that supports the following interface:
-
-
-
SnapshotArray(int length) initializes an array-like data structure with the given length. Initially, each element equals 0.
-
void set(index, val) sets the element at the given index to be equal to val.
-
int snap() takes a snapshot of the array and returns the snap_id: the total number of times we called snap() minus 1.
-
int get(index, snap_id) returns the value at the given index, at the time we took the snapshot with the given snap_id
-
-
-
-
Example 1:
-
-
-Input: ["SnapshotArray","set","snap","set","get"]
-[[3],[0,5],[],[0,6],[0,0]]
-Output: [null,null,0,null,5]
-Explanation:
-SnapshotArray snapshotArr = new SnapshotArray(3); // set the length to be 3
-snapshotArr.set(0,5); // Set array[0] = 5
-snapshotArr.snap(); // Take a snapshot, return snap_id = 0
-snapshotArr.set(0,6);
-snapshotArr.get(0,0); // Get the value of array[0] with snap_id = 0, return 5
-
-
-
Constraints:
-
-
-
1 <= length <= 50000
-
At most 50000 calls will be made to set, snap, and get.
-
0 <= index < length
-
0 <= snap_id < (the total number of times we call snap())
-
0 <= val <= 10^9
-
-
-### Related Topics
- [[Design](../../tag/design/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
-
-### Hints
-
-Hint 1
-Use a list of lists, adding both the element and the snap_id to each index.
-
diff --git a/problems/solve-the-equation/README.md b/problems/solve-the-equation/README.md
deleted file mode 100644
index b3c314bab..000000000
--- a/problems/solve-the-equation/README.md
+++ /dev/null
@@ -1,50 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../decode-ways-ii "Decode Ways II")
-
-[Next >](../design-circular-deque "Design Circular Deque")
-
-## [640. Solve the Equation (Medium)](https://leetcode.com/problems/solve-the-equation "求解方程")
-
-
Solve a given equation and return the value of 'x' in the form of a string "x=#value". The equation contains only '+', '-' operation, the variable 'x' and its coefficient. You should return "No solution" if there is no solution for the equation, or "Infinite solutions" if there are infinite solutions for the equation.
-
-
If there is exactly one solution for the equation, we ensure that the value of 'x' is an integer.
You are given a 0-indexed 2D integer array questions where questions[i] = [pointsi, brainpoweri].
-
-
The array describes the questions of an exam, where you have to process the questions in order (i.e., starting from question 0) and make a decision whether to solve or skip each question. Solving question i will earn you pointsi points but you will be unable to solve each of the next brainpoweri questions. If you skip question i, you get to make the decision on the next question.
-
-
-
For example, given questions = [[3, 2], [4, 3], [4, 4], [2, 5]]:
-
-
If question 0 is solved, you will earn 3 points but you will be unable to solve questions 1 and 2.
-
If instead, question 0 is skipped and question 1 is solved, you will earn 4 points but you will be unable to solve questions 2 and 3.
-
-
-
-
-
Return the maximum points you can earn for the exam.
-
-
-
Example 1:
-
-
-Input: questions = [[3,2],[4,3],[4,4],[2,5]]
-Output: 5
-Explanation: The maximum points can be earned by solving questions 0 and 3.
-- Solve question 0: Earn 3 points, will be unable to solve the next 2 questions
-- Unable to solve questions 1 and 2
-- Solve question 3: Earn 2 points
-Total points earned: 3 + 2 = 5. There is no other way to earn 5 or more points.
-
-
-
Example 2:
-
-
-Input: questions = [[1,1],[2,2],[3,3],[4,4],[5,5]]
-Output: 7
-Explanation: The maximum points can be earned by solving questions 1 and 4.
-- Skip question 0
-- Solve question 1: Earn 2 points, will be unable to solve the next 2 questions
-- Unable to solve questions 2 and 3
-- Solve question 4: Earn 5 points
-Total points earned: 2 + 5 = 7. There is no other way to earn 7 or more points.
-
-
-
-
Constraints:
-
-
-
1 <= questions.length <= 105
-
questions[i].length == 2
-
1 <= pointsi, brainpoweri <= 105
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Hints
-
-Hint 1
-For each question, we can either solve it or skip it. How can we use Dynamic Programming to decide the most optimal option for each problem?
-
-
-
-Hint 2
-We store for each question the maximum points we can earn if we started the exam on that question.
-
-
-
-Hint 3
-If we skip a question, then the answer for it will be the same as the answer for the next question.
-
-
-
-Hint 4
-If we solve a question, then the answer for it will be the points of the current question plus the answer for the next solvable question.
-
-
-
-Hint 5
-The maximum of these two values will be the answer to the current question.
-
diff --git a/problems/sort-an-array/README.md b/problems/sort-an-array/README.md
deleted file mode 100644
index eade2aa53..000000000
--- a/problems/sort-an-array/README.md
+++ /dev/null
@@ -1,40 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../online-election "Online Election")
-
-[Next >](../cat-and-mouse "Cat and Mouse")
-
-## [912. Sort an Array (Medium)](https://leetcode.com/problems/sort-an-array "排序数组")
-
-
Given an array of integers nums, sort the array in ascending order.
Given an array of integers nums, sort the array in increasing order based on the frequency of the values. If multiple values have the same frequency, sort them in decreasing order.
-
-
Return the sorted array.
-
-
-
Example 1:
-
-
-Input: nums = [1,1,2,2,2,3]
-Output: [3,1,1,2,2,2]
-Explanation: '3' has a frequency of 1, '1' has a frequency of 2, and '2' has a frequency of 3.
-
-
-
Example 2:
-
-
-Input: nums = [2,3,1,3,2]
-Output: [1,3,3,2,2]
-Explanation: '2' and '3' both have a frequency of 2, so they are sorted in decreasing order.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Hints
-
-Hint 1
-Count the frequency of each value.
-
-
-
-Hint 2
-Use a custom comparator to compare values by their frequency. If two values have the same frequency, compare their values.
-
diff --git a/problems/sort-array-by-parity-ii/README.md b/problems/sort-array-by-parity-ii/README.md
deleted file mode 100644
index 4e89da7b4..000000000
--- a/problems/sort-array-by-parity-ii/README.md
+++ /dev/null
@@ -1,52 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-add-to-make-parentheses-valid "Minimum Add to Make Parentheses Valid")
-
-[Next >](../3sum-with-multiplicity "3Sum With Multiplicity")
-
-## [922. Sort Array By Parity II (Easy)](https://leetcode.com/problems/sort-array-by-parity-ii "按奇偶排序数组 II")
-
-
Given an array of integers nums, half of the integers in nums are odd, and the other half are even.
-
-
Sort the array so that whenever nums[i] is odd, i is odd, and whenever nums[i] is even, i is even.
-
-
Return any answer array that satisfies this condition.
-
-
-
Example 1:
-
-
-Input: nums = [4,2,5,7]
-Output: [4,5,2,7]
-Explanation: [4,7,2,5], [2,5,4,7], [2,7,4,5] would also have been accepted.
-
Given a string s, sort it in decreasing order based on the frequency of characters, and return the sorted string.
-
-
-
Example 1:
-
-
-Input: s = "tree"
-Output: "eert"
-Explanation: 'e' appears twice while 'r' and 't' both appear once.
-So 'e' must appear before both 'r' and 't'. Therefore "eetr" is also a valid answer.
-
-
-
Example 2:
-
-
-Input: s = "cccaaa"
-Output: "aaaccc"
-Explanation: Both 'c' and 'a' appear three times, so "aaaccc" is also a valid answer.
-Note that "cacaca" is incorrect, as the same characters must be together.
-
-
-
Example 3:
-
-
-Input: s = "Aabb"
-Output: "bbAa"
-Explanation: "bbaA" is also a valid answer, but "Aabb" is incorrect.
-Note that 'A' and 'a' are treated as two different characters.
-
Given an array nums with n objects colored red, white, or blue, sort them in-placeso that objects of the same color are adjacent, with the colors in the order red, white, and blue.
-
-
We will use the integers 0, 1, and 2 to represent the color red, white, and blue, respectively.
-
-
You must solve this problem without using the library's sort function.
Follow up: Could you come up with a one-pass algorithm using only constant extra space?
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Two Pointers](../../tag/two-pointers/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Similar Questions
- 1. [Sort List](../sort-list) (Medium)
- 1. [Wiggle Sort](../wiggle-sort) (Medium)
- 1. [Wiggle Sort II](../wiggle-sort-ii) (Medium)
-
-### Hints
-
-Hint 1
-A rather straight forward solution is a two-pass algorithm using counting sort.
-
-
-
-Hint 2
-Iterate the array counting number of 0's, 1's, and 2's.
-
-
-
-Hint 3
-Overwrite array with the total number of 0's, then 1's and followed by 2's.
-
diff --git a/problems/sort-colors/sort_colors.go b/problems/sort-colors/sort_colors.go
deleted file mode 100644
index 5d1347f5d..000000000
--- a/problems/sort-colors/sort_colors.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem75
diff --git a/problems/sort-colors/sort_colors_test.go b/problems/sort-colors/sort_colors_test.go
deleted file mode 100644
index 5d1347f5d..000000000
--- a/problems/sort-colors/sort_colors_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem75
diff --git a/problems/sort-even-and-odd-indices-independently/README.md b/problems/sort-even-and-odd-indices-independently/README.md
deleted file mode 100644
index 9cf9fc559..000000000
--- a/problems/sort-even-and-odd-indices-independently/README.md
+++ /dev/null
@@ -1,81 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-difference-in-sums-after-removal-of-elements "Minimum Difference in Sums After Removal of Elements")
-
-[Next >](../smallest-value-of-the-rearranged-number "Smallest Value of the Rearranged Number")
-
-## [2164. Sort Even and Odd Indices Independently (Easy)](https://leetcode.com/problems/sort-even-and-odd-indices-independently "对奇偶下标分别排序")
-
-
You are given a 0-indexed integer array nums. Rearrange the values of nums according to the following rules:
-
-
-
Sort the values at odd indices of nums in non-increasing order.
-
-
For example, if nums = [4,1,2,3] before this step, it becomes [4,3,2,1] after. The values at odd indices 1 and 3 are sorted in non-increasing order.
-
-
-
Sort the values at even indices of nums in non-decreasing order.
-
-
For example, if nums = [4,1,2,3] before this step, it becomes [2,1,4,3] after. The values at even indices 0 and 2 are sorted in non-decreasing order.
-
-
-
-
-
Return the array formed after rearranging the values ofnums.
-
-
-
Example 1:
-
-
-Input: nums = [4,1,2,3]
-Output: [2,3,4,1]
-Explanation:
-First, we sort the values present at odd indices (1 and 3) in non-increasing order.
-So, nums changes from [4,1,2,3] to [4,3,2,1].
-Next, we sort the values present at even indices (0 and 2) in non-decreasing order.
-So, nums changes from [4,1,2,3] to [2,3,4,1].
-Thus, the array formed after rearranging the values is [2,3,4,1].
-
-
-
Example 2:
-
-
-Input: nums = [2,1]
-Output: [2,1]
-Explanation:
-Since there is exactly one odd index and one even index, no rearrangement of values takes place.
-The resultant array formed is [2,1], which is the same as the initial array.
-
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 100
-
1 <= nums[i] <= 100
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Hints
-
-Hint 1
-Try to separate the elements at odd indices from the elements at even indices.
-
-
-
-Hint 2
-Sort the two groups of elements individually.
-
-
-
-Hint 3
-Combine them to form the resultant array.
-
diff --git a/problems/sort-features-by-popularity/README.md b/problems/sort-features-by-popularity/README.md
deleted file mode 100644
index 6dd77659d..000000000
--- a/problems/sort-features-by-popularity/README.md
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximize-palindrome-length-from-subsequences "Maximize Palindrome Length From Subsequences")
-
-[Next >](../count-items-matching-a-rule "Count Items Matching a Rule")
-
-## [1772. Sort Features by Popularity (Medium)](https://leetcode.com/problems/sort-features-by-popularity "按受欢迎程度排列功能")
-
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Hints
-
-Hint 1
-Use a hash map to count the frequency of each word of each string.
-
-
-
-Hint 2
-Use the map for sorting the features.
-
diff --git a/problems/sort-integers-by-the-number-of-1-bits/README.md b/problems/sort-integers-by-the-number-of-1-bits/README.md
deleted file mode 100644
index 9ffba5ff0..000000000
--- a/problems/sort-integers-by-the-number-of-1-bits/README.md
+++ /dev/null
@@ -1,65 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../activity-participants "Activity Participants")
-
-[Next >](../apply-discount-every-n-orders "Apply Discount Every n Orders")
-
-## [1356. Sort Integers by The Number of 1 Bits (Easy)](https://leetcode.com/problems/sort-integers-by-the-number-of-1-bits "根据数字二进制下 1 的数目排序")
-
-
You are given an integer array arr. Sort the integers in the array in ascending order by the number of 1's in their binary representation and in case of two or more integers have the same number of 1's you have to sort them in ascending order.
-
-
Return the array after sorting it.
-
-
-
Example 1:
-
-
-Input: arr = [0,1,2,3,4,5,6,7,8]
-Output: [0,1,2,4,8,3,5,6,7]
-Explantion: [0] is the only integer with 0 bits.
-[1,2,4,8] all have 1 bit.
-[3,5,6] have 2 bits.
-[7] has 3 bits.
-The sorted array by bits is [0,1,2,4,8,3,5,6,7]
-
-
-
Example 2:
-
-
-Input: arr = [1024,512,256,128,64,32,16,8,4,2,1]
-Output: [1,2,4,8,16,32,64,128,256,512,1024]
-Explantion: All integers have 1 bit in the binary representation, you should just sort them in ascending order.
-
-
-
-
Constraints:
-
-
-
1 <= arr.length <= 500
-
0 <= arr[i] <= 104
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Bit Manipulation](../../tag/bit-manipulation/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
- [[Counting](../../tag/counting/README.md)]
-
-### Similar Questions
- 1. [Find Subsequence of Length K With the Largest Sum](../find-subsequence-of-length-k-with-the-largest-sum) (Easy)
-
-### Hints
-
-Hint 1
-Simulate the problem. Count the number of 1's in the binary representation of each integer.
-
-
-
-Hint 2
-Sort by the number of 1's ascending and by the value in case of tie.
-
diff --git a/problems/sort-integers-by-the-power-value/README.md b/problems/sort-integers-by-the-power-value/README.md
deleted file mode 100644
index 7a507f22c..000000000
--- a/problems/sort-integers-by-the-power-value/README.md
+++ /dev/null
@@ -1,75 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../cinema-seat-allocation "Cinema Seat Allocation")
-
-[Next >](../pizza-with-3n-slices "Pizza With 3n Slices")
-
-## [1387. Sort Integers by The Power Value (Medium)](https://leetcode.com/problems/sort-integers-by-the-power-value "将整数按权重排序")
-
-
The power of an integer x is defined as the number of steps needed to transform x into 1 using the following steps:
-
-
-
if x is even then x = x / 2
-
if x is odd then x = 3 * x + 1
-
-
-
For example, the power of x = 3 is 7 because 3 needs 7 steps to become 1 (3 --> 10 --> 5 --> 16 --> 8 --> 4 --> 2 --> 1).
-
-
Given three integers lo, hi and k. The task is to sort all integers in the interval [lo, hi] by the power value in ascending order, if two or more integers have the same power value sort them by ascending order.
-
-
Return the kth integer in the range [lo, hi] sorted by the power value.
-
-
Notice that for any integer x(lo <= x <= hi) it is guaranteed that x will transform into 1 using these steps and that the power of x is will fit in a 32-bit signed integer.
-
-
-
Example 1:
-
-
-Input: lo = 12, hi = 15, k = 2
-Output: 13
-Explanation: The power of 12 is 9 (12 --> 6 --> 3 --> 10 --> 5 --> 16 --> 8 --> 4 --> 2 --> 1)
-The power of 13 is 9
-The power of 14 is 17
-The power of 15 is 17
-The interval sorted by the power value [12,13,14,15]. For k = 2 answer is the second element which is 13.
-Notice that 12 and 13 have the same power value and we sorted them in ascending order. Same for 14 and 15.
-
-
-
Example 2:
-
-
-Input: lo = 7, hi = 11, k = 4
-Output: 7
-Explanation: The power array corresponding to the interval [7, 8, 9, 10, 11] is [16, 3, 19, 6, 14].
-The interval sorted by power is [8, 10, 11, 7, 9].
-The fourth number in the sorted array is 7.
-
-
-
-
Constraints:
-
-
-
1 <= lo <= hi <= 1000
-
1 <= k <= hi - lo + 1
-
-
-### Related Topics
- [[Memoization](../../tag/memoization/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Hints
-
-Hint 1
-Use dynamic programming to get the power of each integer of the intervals.
-
-
-
-Hint 2
-Sort all the integers of the interval by the power value and return the k-th in the sorted list.
-
diff --git a/problems/sort-items-by-groups-respecting-dependencies/README.md b/problems/sort-items-by-groups-respecting-dependencies/README.md
deleted file mode 100644
index f6a849031..000000000
--- a/problems/sort-items-by-groups-respecting-dependencies/README.md
+++ /dev/null
@@ -1,76 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../smallest-string-with-swaps "Smallest String With Swaps")
-
-[Next >](../last-person-to-fit-in-the-bus "Last Person to Fit in the Bus")
-
-## [1203. Sort Items by Groups Respecting Dependencies (Hard)](https://leetcode.com/problems/sort-items-by-groups-respecting-dependencies "项目管理")
-
-
There are n items each belonging to zero or one of m groups where group[i] is the group that the i-th item belongs to and it's equal to -1 if the i-th item belongs to no group. The items and the groups are zero indexed. A group can have no item belonging to it.
-
-
Return a sorted list of the items such that:
-
-
-
The items that belong to the same group are next to each other in the sorted list.
-
There are some relations between these items where beforeItems[i] is a list containing all the items that should come before the i-th item in the sorted array (to the left of the i-th item).
-
-
-
Return any solution if there is more than one solution and return an empty list if there is no solution.
-
-
-
Example 1:
-
-
-
-
-Input: n = 8, m = 2, group = [-1,-1,1,0,0,1,0,-1], beforeItems = [[],[6],[5],[6],[3,6],[],[],[]]
-Output: [6,3,4,1,5,2,0,7]
-
-
-
Example 2:
-
-
-Input: n = 8, m = 2, group = [-1,-1,1,0,0,1,0,-1], beforeItems = [[],[6],[5],[6],[3],[],[4],[]]
-Output: []
-Explanation: This is the same as example 1 except that 4 needs to be before 6 in the sorted list.
-
-
-
-
Constraints:
-
-
-
1 <= m <= n <= 3 * 104
-
group.length == beforeItems.length == n
-
-1 <= group[i] <= m - 1
-
0 <= beforeItems[i].length <= n - 1
-
0 <= beforeItems[i][j] <= n - 1
-
i != beforeItems[i][j]
-
beforeItems[i] does not contain duplicates elements.
-
-
-### Related Topics
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Graph](../../tag/graph/README.md)]
- [[Topological Sort](../../tag/topological-sort/README.md)]
-
-### Hints
-
-Hint 1
-Think of it as a graph problem.
-
-
-
-Hint 2
-We need to find a topological order on the dependency graph.
-
-
-
-Hint 3
-Build two graphs, one for the groups and another for the items.
-
diff --git a/problems/sort-linked-list-already-sorted-using-absolute-values/README.md b/problems/sort-linked-list-already-sorted-using-absolute-values/README.md
deleted file mode 100644
index 452636892..000000000
--- a/problems/sort-linked-list-already-sorted-using-absolute-values/README.md
+++ /dev/null
@@ -1,35 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../second-minimum-time-to-reach-destination "Second Minimum Time to Reach Destination")
-
-[Next >](../number-of-valid-words-in-a-sentence "Number of Valid Words in a Sentence")
-
-## [2046. Sort Linked List Already Sorted Using Absolute Values (Medium)](https://leetcode.com/problems/sort-linked-list-already-sorted-using-absolute-values "给按照绝对值排序的链表排序")
-
-
-
-### Related Topics
- [[Linked List](../../tag/linked-list/README.md)]
- [[Two Pointers](../../tag/two-pointers/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Hints
-
-Hint 1
-The nodes with positive values are already in the correct order.
-
-
-
-Hint 2
-Nodes with negative values need to be moved to the front.
-
-
-
-Hint 3
-Nodes with negative values are in reversed order.
-
diff --git a/problems/sort-list/README.md b/problems/sort-list/README.md
deleted file mode 100644
index 123c2e962..000000000
--- a/problems/sort-list/README.md
+++ /dev/null
@@ -1,58 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../insertion-sort-list "Insertion Sort List")
-
-[Next >](../max-points-on-a-line "Max Points on a Line")
-
-## [148. Sort List (Medium)](https://leetcode.com/problems/sort-list "排序链表")
-
-
Given the head of a linked list, return the list after sorting it in ascending order.
-
-
Follow up: Can you sort the linked list in O(n logn) time and O(1) memory (i.e. constant space)?
-
-
-
Example 1:
-
-
-Input: head = [4,2,1,3]
-Output: [1,2,3,4]
-
-
-
Example 2:
-
-
-Input: head = [-1,5,3,4,0]
-Output: [-1,0,3,4,5]
-
-
-
Example 3:
-
-
-Input: head = []
-Output: []
-
-
-
-
Constraints:
-
-
-
The number of nodes in the list is in the range [0, 5 * 104].
A matrix diagonal is a diagonal line of cells starting from some cell in either the topmost row or leftmost column and going in the bottom-right direction until reaching the matrix's end. For example, the matrix diagonal starting from mat[2][0], where mat is a 6 x 3 matrix, includes cells mat[2][0], mat[3][1], and mat[4][2].
-
-
Given an m x n matrix mat of integers, sort each matrix diagonal in ascending order and return the resulting matrix.
-
-
-
Example 1:
-
-
-Input: mat = [[3,3,1,1],[2,2,1,2],[1,1,1,2]]
-Output: [[1,1,1,1],[1,2,2,2],[1,2,3,3]]
-
-
-
Example 2:
-
-
-Input: mat = [[11,25,66,1,69,7],[23,55,17,45,15,52],[75,31,36,44,58,8],[22,27,33,25,68,4],[84,28,14,11,5,50]]
-Output: [[5,17,4,1,52,7],[11,11,25,45,8,69],[14,23,25,44,58,15],[22,27,31,36,50,66],[84,28,75,33,55,68]]
-
-
-
-
Constraints:
-
-
-
m == mat.length
-
n == mat[i].length
-
1 <= m, n <= 100
-
1 <= mat[i][j] <= 100
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
-
-### Hints
-
-Hint 1
-Use a data structure to store all values of each diagonal.
-
-
-
-Hint 2
-How to index the data structure with the id of the diagonal?
-
-
-
-Hint 3
-All cells in the same diagonal (i,j) have the same difference so we can get the diagonal of a cell using the difference i-j.
-
diff --git a/problems/sort-transformed-array/README.md b/problems/sort-transformed-array/README.md
deleted file mode 100644
index 6135d7d68..000000000
--- a/problems/sort-transformed-array/README.md
+++ /dev/null
@@ -1,55 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../logger-rate-limiter "Logger Rate Limiter")
-
-[Next >](../bomb-enemy "Bomb Enemy")
-
-## [360. Sort Transformed Array (Medium)](https://leetcode.com/problems/sort-transformed-array "有序转化数组")
-
-
Given a sorted array of integers nums and integer values a, b and c. Apply a quadratic function of the form f(x) = ax2 + bx + c to each element x in the array.
-
-
The returned array must be in sorted order.
-
-
Expected time complexity: O(n)
-
-
-
Example 1:
-
-
-Input: nums = [-4,-2,2,4], a = 1, b = 3, c = 5
-Output: [3,9,15,33]
-
-
-
-
Example 2:
-
-
-Input: nums = [-4,-2,2,4], a = -1, b = 3, c = 5
-Output: [-23,-5,1,7]
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Math](../../tag/math/README.md)]
- [[Two Pointers](../../tag/two-pointers/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Similar Questions
- 1. [Squares of a Sorted Array](../squares-of-a-sorted-array) (Easy)
-
-### Hints
-
-Hint 1
-x^2 + x will form a parabola.
-
-
-
-Hint 2
-Parameter A in: A * x^2 + B * x + C dictates the shape of the parabola.
-Positive A means the parabola remains concave (high-low-high), but negative A inverts the parabola to be convex (low-high-low).
-
diff --git a/problems/sort-transformed-array/sort_transformed_array.go b/problems/sort-transformed-array/sort_transformed_array.go
deleted file mode 100644
index 66db8b48e..000000000
--- a/problems/sort-transformed-array/sort_transformed_array.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem360
diff --git a/problems/sort-transformed-array/sort_transformed_array_test.go b/problems/sort-transformed-array/sort_transformed_array_test.go
deleted file mode 100644
index 66db8b48e..000000000
--- a/problems/sort-transformed-array/sort_transformed_array_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem360
diff --git a/problems/sorting-the-sentence/README.md b/problems/sorting-the-sentence/README.md
deleted file mode 100644
index 8f696c17d..000000000
--- a/problems/sorting-the-sentence/README.md
+++ /dev/null
@@ -1,68 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../longest-word-with-all-prefixes "Longest Word With All Prefixes")
-
-[Next >](../incremental-memory-leak "Incremental Memory Leak")
-
-## [1859. Sorting the Sentence (Easy)](https://leetcode.com/problems/sorting-the-sentence "将句子排序")
-
-
A sentence is a list of words that are separated by a single space with no leading or trailing spaces. Each word consists of lowercase and uppercase English letters.
-
-
A sentence can be shuffled by appending the 1-indexed word position to each word then rearranging the words in the sentence.
-
-
-
For example, the sentence "This is a sentence" can be shuffled as "sentence4 a3 is2 This1" or "is2 sentence4 This1 a3".
-
-
-
Given a shuffled sentences containing no more than 9 words, reconstruct and return the original sentence.
-
-
-
Example 1:
-
-
-Input: s = "is2 sentence4 This1 a3"
-Output: "This is a sentence"
-Explanation: Sort the words in s to their original positions "This1 is2 a3 sentence4", then remove the numbers.
-
-
-
Example 2:
-
-
-Input: s = "Myself2 Me1 I4 and3"
-Output: "Me Myself and I"
-Explanation: Sort the words in s to their original positions "Me1 Myself2 and3 I4", then remove the numbers.
-
-
-
-
Constraints:
-
-
-
2 <= s.length <= 200
-
s consists of lowercase and uppercase English letters, spaces, and digits from 1 to 9.
-
The number of words in s is between 1 and 9.
-
The words in s are separated by a single space.
-
s contains no leading or trailing spaces.
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Similar Questions
- 1. [Check if Numbers Are Ascending in a Sentence](../check-if-numbers-are-ascending-in-a-sentence) (Easy)
-
-### Hints
-
-Hint 1
-Divide the string into the words as an array of strings
-
-
-
-Hint 2
-Sort the words by removing the last character from each word and sorting according to it
-
diff --git a/problems/soup-servings/README.md b/problems/soup-servings/README.md
deleted file mode 100644
index f49525fb8..000000000
--- a/problems/soup-servings/README.md
+++ /dev/null
@@ -1,58 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../max-increase-to-keep-city-skyline "Max Increase to Keep City Skyline")
-
-[Next >](../expressive-words "Expressive Words")
-
-## [808. Soup Servings (Medium)](https://leetcode.com/problems/soup-servings "分汤")
-
-
There are two types of soup: type A and type B. Initially, we have n ml of each type of soup. There are four kinds of operations:
-
-
-
Serve 100 ml of soup A and 0 ml of soup B,
-
Serve 75 ml of soup A and 25 ml of soup B,
-
Serve 50 ml of soup A and 50 ml of soup B, and
-
Serve 25 ml of soup A and 75 ml of soup B.
-
-
-
When we serve some soup, we give it to someone, and we no longer have it. Each turn, we will choose from the four operations with an equal probability 0.25. If the remaining volume of soup is not enough to complete the operation, we will serve as much as possible. We stop once we no longer have some quantity of both types of soup.
-
-
Note that we do not have an operation where all 100 ml's of soup B are used first.
-
-
Return the probability that soup A will be empty first, plus half the probability that A and B become empty at the same time. Answers within 10-5 of the actual answer will be accepted.
-
-
-
Example 1:
-
-
-Input: n = 50
-Output: 0.62500
-Explanation: If we choose the first two operations, A will become empty first.
-For the third operation, A and B will become empty at the same time.
-For the fourth operation, B will become empty first.
-So the total probability of A becoming empty first plus half the probability that A and B become empty at the same time, is 0.25 * (1 + 1 + 0.5 + 0) = 0.625.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
diff --git a/problems/sparse-matrix-multiplication/sparse_matrix_multiplication.go b/problems/sparse-matrix-multiplication/sparse_matrix_multiplication.go
deleted file mode 100644
index 39919fb1e..000000000
--- a/problems/sparse-matrix-multiplication/sparse_matrix_multiplication.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem311
diff --git a/problems/sparse-matrix-multiplication/sparse_matrix_multiplication_test.go b/problems/sparse-matrix-multiplication/sparse_matrix_multiplication_test.go
deleted file mode 100644
index 39919fb1e..000000000
--- a/problems/sparse-matrix-multiplication/sparse_matrix_multiplication_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem311
diff --git a/problems/special-array-with-x-elements-greater-than-or-equal-x/README.md b/problems/special-array-with-x-elements-greater-than-or-equal-x/README.md
deleted file mode 100644
index acdb00777..000000000
--- a/problems/special-array-with-x-elements-greater-than-or-equal-x/README.md
+++ /dev/null
@@ -1,71 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../sellers-with-no-sales "Sellers With No Sales")
-
-[Next >](../even-odd-tree "Even Odd Tree")
-
-## [1608. Special Array With X Elements Greater Than or Equal X (Easy)](https://leetcode.com/problems/special-array-with-x-elements-greater-than-or-equal-x "特殊数组的特征值")
-
-
You are given an array nums of non-negative integers. nums is considered special if there exists a number x such that there are exactlyx numbers in nums that are greater than or equal tox.
-
-
Notice that xdoes not have to be an element in nums.
-
-
Return xif the array is special, otherwise, return -1. It can be proven that if nums is special, the value for x is unique.
-
-
-
Example 1:
-
-
-Input: nums = [3,5]
-Output: 2
-Explanation: There are 2 values (3 and 5) that are greater than or equal to 2.
-
-
-
Example 2:
-
-
-Input: nums = [0,0]
-Output: -1
-Explanation: No numbers fit the criteria for x.
-If x = 0, there should be 0 numbers >= x, but there are 2.
-If x = 1, there should be 1 number >= x, but there are 0.
-If x = 2, there should be 2 numbers >= x, but there are 0.
-x cannot be greater since there are only 2 numbers in nums.
-
-
-
Example 3:
-
-
-Input: nums = [0,4,3,0,4]
-Output: 3
-Explanation: There are 3 values that are greater than or equal to 3.
-
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 100
-
0 <= nums[i] <= 1000
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Hints
-
-Hint 1
-Count the number of elements greater than or equal to x for each x in the range [0, nums.length].
-
-
-
-Hint 2
-If for any x, the condition satisfies, return that x. Otherwise, there is no answer.
-
diff --git a/problems/special-binary-string/README.md b/problems/special-binary-string/README.md
deleted file mode 100644
index e28a06e4e..000000000
--- a/problems/special-binary-string/README.md
+++ /dev/null
@@ -1,69 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../find-anagram-mappings "Find Anagram Mappings")
-
-[Next >](../prime-number-of-set-bits-in-binary-representation "Prime Number of Set Bits in Binary Representation")
-
-## [761. Special Binary String (Hard)](https://leetcode.com/problems/special-binary-string "特殊的二进制序列")
-
-
Special binary strings are binary strings with the following two properties:
-
-
-
The number of 0's is equal to the number of 1's.
-
Every prefix of the binary string has at least as many 1's as 0's.
-
-
-
You are given a special binary string s.
-
-
A move consists of choosing two consecutive, non-empty, special substrings of s, and swapping them. Two strings are consecutive if the last character of the first string is exactly one index before the first character of the second string.
-
-
Return the lexicographically largest resulting string possible after applying the mentioned operations on the string.
-
-
-
Example 1:
-
-
-Input: s = "11011000"
-Output: "11100100"
-Explanation: The strings "10" [occuring at s[1]] and "1100" [at s[3]] are swapped.
-This is the lexicographically largest string possible after some number of swaps.
-
-
-
Example 2:
-
-
-Input: s = "10"
-Output: "10"
-
-
-
-
Constraints:
-
-
-
1 <= s.length <= 50
-
s[i] is either '0' or '1'.
-
s is a special binary string.
-
-
-### Related Topics
- [[Recursion](../../tag/recursion/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Similar Questions
- 1. [Valid Parenthesis String](../valid-parenthesis-string) (Medium)
-
-### Hints
-
-Hint 1
-Draw a line from (x, y) to (x+1, y+1) if we see a "1", else to (x+1, y-1).
-A special substring is just a line that starts and ends at the same y-coordinate, and that is the lowest y-coordinate reached.
-Call a mountain a special substring with no special prefixes - ie. only at the beginning and end is the lowest y-coordinate reached.
-If F is the answer function, and S has mountain decomposition M1,M2,M3,...,Mk, then the answer is:
-reverse_sorted(F(M1), F(M2), ..., F(Mk)).
-However, you'll also need to deal with the case that S is a mountain, such as 11011000 -> 11100100.
-
diff --git a/problems/special-binary-string/special_binary_string.go b/problems/special-binary-string/special_binary_string.go
deleted file mode 100644
index 9d5c817d0..000000000
--- a/problems/special-binary-string/special_binary_string.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem761
diff --git a/problems/special-binary-string/special_binary_string_test.go b/problems/special-binary-string/special_binary_string_test.go
deleted file mode 100644
index 9d5c817d0..000000000
--- a/problems/special-binary-string/special_binary_string_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem761
diff --git a/problems/special-positions-in-a-binary-matrix/README.md b/problems/special-positions-in-a-binary-matrix/README.md
deleted file mode 100644
index 3f8fe5cdd..000000000
--- a/problems/special-positions-in-a-binary-matrix/README.md
+++ /dev/null
@@ -1,53 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../customer-who-visited-but-did-not-make-any-transactions "Customer Who Visited but Did Not Make Any Transactions")
-
-[Next >](../count-unhappy-friends "Count Unhappy Friends")
-
-## [1582. Special Positions in a Binary Matrix (Easy)](https://leetcode.com/problems/special-positions-in-a-binary-matrix "二进制矩阵中的特殊位置")
-
-
Given an m x n binary matrix mat, return the number of special positions in mat.
-
-
A position (i, j) is called special if mat[i][j] == 1 and all other elements in row i and column j are 0 (rows and columns are 0-indexed).
-
-
-
Example 1:
-
-
-Input: mat = [[1,0,0],[0,0,1],[1,0,0]]
-Output: 1
-Explanation: (1, 2) is a special position because mat[1][2] == 1 and all other elements in row 1 and column 2 are 0.
-
-
-
Example 2:
-
-
-Input: mat = [[1,0,0],[0,1,0],[0,0,1]]
-Output: 3
-Explanation: (0, 0), (1, 1) and (2, 2) are special positions.
-
-
-
-
Constraints:
-
-
-
m == mat.length
-
n == mat[i].length
-
1 <= m, n <= 100
-
mat[i][j] is either 0 or 1.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
-
-### Hints
-
-Hint 1
-Keep track of 1s in each row and in each column. Then while iterating over matrix, if the current position is 1 and current row as well as current column contains exactly one occurrence of 1.
-
diff --git a/problems/spiral-matrix-ii/README.md b/problems/spiral-matrix-ii/README.md
deleted file mode 100644
index a9f9ed6c2..000000000
--- a/problems/spiral-matrix-ii/README.md
+++ /dev/null
@@ -1,44 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../length-of-last-word "Length of Last Word")
-
-[Next >](../permutation-sequence "Permutation Sequence")
-
-## [59. Spiral Matrix II (Medium)](https://leetcode.com/problems/spiral-matrix-ii "螺旋矩阵 II")
-
-
Given a positive integer n, generate an n x nmatrix filled with elements from 1 to n2 in spiral order.
-
-
-
Example 1:
-
-
-Input: n = 3
-Output: [[1,2,3],[8,9,4],[7,6,5]]
-
You start at the cell (rStart, cStart) of an rows x cols grid facing east. The northwest corner is at the first row and column in the grid, and the southeast corner is at the last row and column.
-
-
You will walk in a clockwise spiral shape to visit every position in this grid. Whenever you move outside the grid's boundary, we continue our walk outside the grid (but may return to the grid boundary later.). Eventually, we reach all rows * cols spaces of the grid.
-
-
Return an array of coordinates representing the positions of the grid in the order you visited them.
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
- [[Simulation](../../tag/simulation/README.md)]
-
-### Similar Questions
- 1. [Spiral Matrix II](../spiral-matrix-ii) (Medium)
- 1. [Spiral Matrix III](../spiral-matrix-iii) (Medium)
-
-### Hints
-
-Hint 1
-Well for some problems, the best way really is to come up with some algorithms for simulation. Basically, you need to simulate what the problem asks us to do.
-
-
-
-Hint 2
-We go boundary by boundary and move inwards. That is the essential operation. First row, last column, last row, first column and then we move inwards by 1 and then repeat. That's all, that is all the simulation that we need.
-
-
-
-Hint 3
-Think about when you want to switch the progress on one of the indexes. If you progress on
i
out of
[i, j]
, you'd be shifting in the same column. Similarly, by changing values for
j
, you'd be shifting in the same row.
-Also, keep track of the end of a boundary so that you can move inwards and then keep repeating. It's always best to run the simulation on edge cases like a single column or a single row to see if anything breaks or not.
-
diff --git a/problems/spiral-matrix/spiral_matrix.go b/problems/spiral-matrix/spiral_matrix.go
deleted file mode 100644
index 501b6c4d3..000000000
--- a/problems/spiral-matrix/spiral_matrix.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem54
diff --git a/problems/spiral-matrix/spiral_matrix_test.go b/problems/spiral-matrix/spiral_matrix_test.go
deleted file mode 100644
index 501b6c4d3..000000000
--- a/problems/spiral-matrix/spiral_matrix_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem54
diff --git a/problems/split-a-string-in-balanced-strings/README.md b/problems/split-a-string-in-balanced-strings/README.md
deleted file mode 100644
index e2cb832da..000000000
--- a/problems/split-a-string-in-balanced-strings/README.md
+++ /dev/null
@@ -1,76 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../count-vowels-permutation "Count Vowels Permutation")
-
-[Next >](../queens-that-can-attack-the-king "Queens That Can Attack the King")
-
-## [1221. Split a String in Balanced Strings (Easy)](https://leetcode.com/problems/split-a-string-in-balanced-strings "分割平衡字符串")
-
-
Balanced strings are those that have an equal quantity of 'L' and 'R' characters.
-
-
Given a balanced string s, split it in the maximum amount of balanced strings.
-
-
Return the maximum amount of split balanced strings.
-
-
-
Example 1:
-
-
-Input: s = "RLRRLLRLRL"
-Output: 4
-Explanation: s can be split into "RL", "RRLL", "RL", "RL", each substring contains same number of 'L' and 'R'.
-
-
-
Example 2:
-
-
-Input: s = "RLLLLRRRLR"
-Output: 3
-Explanation: s can be split into "RL", "LLLRRR", "LR", each substring contains same number of 'L' and 'R'.
-
-
-
Example 3:
-
-
-Input: s = "LLLLRRRR"
-Output: 1
-Explanation: s can be split into "LLLLRRRR".
-
-
-
Example 4:
-
-
-Input: s = "RLRRRLLRLL"
-Output: 2
-Explanation: s can be split into "RL", "RRRLLRLL", since each substring contains an equal number of 'L' and 'R'
-
-
-
-
Constraints:
-
-
-
1 <= s.length <= 1000
-
s[i] is either 'L' or 'R'.
-
s is a balanced string.
-
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[String](../../tag/string/README.md)]
- [[Counting](../../tag/counting/README.md)]
-
-### Hints
-
-Hint 1
-Loop from left to right maintaining a balance variable when it gets an L increase it by one otherwise decrease it by one.
-
-
-
-Hint 2
-Whenever the balance variable reaches zero then we increase the answer by one.
-
diff --git a/problems/split-a-string-in-balanced-strings/split_a_string_in_balanced_strings.go b/problems/split-a-string-in-balanced-strings/split_a_string_in_balanced_strings.go
deleted file mode 100644
index 6ab2766b8..000000000
--- a/problems/split-a-string-in-balanced-strings/split_a_string_in_balanced_strings.go
+++ /dev/null
@@ -1,16 +0,0 @@
-package problem1221
-
-func balancedStringSplit(s string) int {
- ans, flag := 0, 0
- for _, b := range s {
- if b == 'L' {
- flag--
- } else {
- flag++
- }
- if flag == 0 {
- ans++
- }
- }
- return ans
-}
diff --git a/problems/split-a-string-in-balanced-strings/split_a_string_in_balanced_strings_test.go b/problems/split-a-string-in-balanced-strings/split_a_string_in_balanced_strings_test.go
deleted file mode 100644
index 7094dc22e..000000000
--- a/problems/split-a-string-in-balanced-strings/split_a_string_in_balanced_strings_test.go
+++ /dev/null
@@ -1,31 +0,0 @@
-package problem1221
-
-import "testing"
-
-type testType struct {
- in string
- want int
-}
-
-func TestBalancedStringSplit(t *testing.T) {
- tests := [...]testType{
- {
- in: "RLRRLLRLRL",
- want: 4,
- },
- {
- in: "RLLLLRRRLR",
- want: 3,
- },
- {
- in: "LLLLRRRR",
- want: 1,
- },
- }
- for _, tt := range tests {
- got := balancedStringSplit(tt.in)
- if got != tt.want {
- t.Fatalf("in: %v, got: %v, want: %v", tt.in, got, tt.want)
- }
- }
-}
diff --git a/problems/split-a-string-into-the-max-number-of-unique-substrings/README.md b/problems/split-a-string-into-the-max-number-of-unique-substrings/README.md
deleted file mode 100644
index 1bdc20e26..000000000
--- a/problems/split-a-string-into-the-max-number-of-unique-substrings/README.md
+++ /dev/null
@@ -1,71 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../rearrange-spaces-between-words "Rearrange Spaces Between Words")
-
-[Next >](../maximum-non-negative-product-in-a-matrix "Maximum Non Negative Product in a Matrix")
-
-## [1593. Split a String Into the Max Number of Unique Substrings (Medium)](https://leetcode.com/problems/split-a-string-into-the-max-number-of-unique-substrings "拆分字符串使唯一子字符串的数目最大")
-
-
Given a string s, return the maximum number of unique substrings that the given string can be split into.
-
-
You can split string s into any list of non-empty substrings, where the concatenation of the substrings forms the original string. However, you must split the substrings such that all of them are unique.
-
-
A substring is a contiguous sequence of characters within a string.
-
-
-
Example 1:
-
-
-Input: s = "ababccc"
-Output: 5
-Explanation: One way to split maximally is ['a', 'b', 'ab', 'c', 'cc']. Splitting like ['a', 'b', 'a', 'b', 'c', 'cc'] is not valid as you have 'a' and 'b' multiple times.
-
-
-
Example 2:
-
-
-Input: s = "aba"
-Output: 2
-Explanation: One way to split maximally is ['a', 'ba'].
-
-
-
Example 3:
-
-
-Input: s = "aa"
-Output: 1
-Explanation: It is impossible to split the string any further.
-
-
-
-
Constraints:
-
-
-
-
1 <= s.length <= 16
-
-
-
s contains only lower case English letters.
-
-
-
-### Related Topics
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
- [[Backtracking](../../tag/backtracking/README.md)]
-
-### Hints
-
-Hint 1
-Use a set to keep track of which substrings have been used already
-
-
-
-Hint 2
-Try each possible substring at every position and backtrack if a complete split is not possible
-
diff --git a/problems/split-array-into-consecutive-subsequences/README.md b/problems/split-array-into-consecutive-subsequences/README.md
deleted file mode 100644
index 26dc3b3e0..000000000
--- a/problems/split-array-into-consecutive-subsequences/README.md
+++ /dev/null
@@ -1,72 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../find-k-closest-elements "Find K Closest Elements")
-
-[Next >](../remove-9 "Remove 9")
-
-## [659. Split Array into Consecutive Subsequences (Medium)](https://leetcode.com/problems/split-array-into-consecutive-subsequences "分割数组为连续子序列")
-
-
You are given an integer array nums that is sorted in non-decreasing order.
-
-
Determine if it is possible to split nums into one or more subsequences such that both of the following conditions are true:
-
-
-
Each subsequence is a consecutive increasing sequence (i.e. each integer is exactly one more than the previous integer).
-
All subsequences have a length of 3 or more.
-
-
-
Return true if you can split nums according to the above conditions, or false otherwise.
-
-
A subsequence of an array is a new array that is formed from the original array by deleting some (can be none) of the elements without disturbing the relative positions of the remaining elements. (i.e., [1,3,5] is a subsequence of [1,2,3,4,5] while [1,3,2] is not).
-
-
-
Example 1:
-
-
-Input: nums = [1,2,3,3,4,5]
-Output: true
-Explanation: nums can be split into the following subsequences:
-[1,2,3,3,4,5] --> 1, 2, 3
-[1,2,3,3,4,5] --> 3, 4, 5
-
-
-
Example 2:
-
-
-Input: nums = [1,2,3,3,4,4,5,5]
-Output: true
-Explanation: nums can be split into the following subsequences:
-[1,2,3,3,4,4,5,5] --> 1, 2, 3, 4, 5
-[1,2,3,3,4,4,5,5] --> 3, 4, 5
-
-
-
Example 3:
-
-
-Input: nums = [1,2,3,4,4,5]
-Output: false
-Explanation: It is impossible to split nums into consecutive increasing subsequences of length 3 or more.
-
Given an array nums which consists of non-negative integers and an integer m, you can split the array into m non-empty continuous subarrays.
-
-
Write an algorithm to minimize the largest sum among these m subarrays.
-
-
-
Example 1:
-
-
-Input: nums = [7,2,5,10,8], m = 2
-Output: 18
-Explanation:
-There are four ways to split nums into two subarrays.
-The best way is to split it into [7,2,5] and [10,8],
-where the largest sum among the two subarrays is only 18.
-
You should move each element of nums into one of the two arrays A and B such that A and B are non-empty, and average(A) == average(B).
-
-
Return true if it is possible to achieve that and false otherwise.
-
-
Note that for an array arr, average(arr) is the sum of all the elements of arr over the length of arr.
-
-
-
Example 1:
-
-
-Input: nums = [1,2,3,4,5,6,7,8]
-Output: true
-Explanation: We can split the array into [1,4,5,8] and [2,3,6,7], and both of them have an average of 4.5.
-
Given a Binary Search Tree (BST) with root node root, and a target value V, split the tree into two subtrees where one subtree has nodes that are all smaller or equal to the target value, while the other subtree has all nodes that are greater than the target value. It's not necessarily the case that the tree contains a node with value V.
-
-
Additionally, most of the structure of the original tree should remain. Formally, for any child C with parent P in the original tree, if they are both in the same subtree after the split, then node C should still have the parent P.
-
-
You should output the root TreeNode of both subtrees after splitting, in any order.
-
-
Example 1:
-
-
-Input: root = [4,2,6,1,3,5,7], V = 2
-Output: [[2,1],[4,3,6,null,null,5,7]]
-Explanation:
-Note that root, output[0], and output[1] are TreeNode objects, not arrays.
-
-The given tree [4,2,6,1,3,5,7] is represented by the following diagram:
-
- 4
- / \
- 2 6
- / \ / \
- 1 3 5 7
-
-while the diagrams for the outputs are:
-
- 4
- / \
- 3 6 and 2
- / \ /
- 5 7 1
-
-
-
Note:
-
-
-
The size of the BST will not exceed 50.
-
The BST is always valid and each node's value is different.
-
-
-### Related Topics
- [[Tree](../../tag/tree/README.md)]
- [[Binary Search Tree](../../tag/binary-search-tree/README.md)]
- [[Recursion](../../tag/recursion/README.md)]
- [[Binary Tree](../../tag/binary-tree/README.md)]
-
-### Similar Questions
- 1. [Delete Node in a BST](../delete-node-in-a-bst) (Medium)
-
-### Hints
-
-Hint 1
-Use recursion. If root.val <= V, you split root.right into two halves, then join it's left half back on root.right.
-
diff --git a/problems/split-bst/split_bst.go b/problems/split-bst/split_bst.go
deleted file mode 100644
index 1f648eaef..000000000
--- a/problems/split-bst/split_bst.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem776
diff --git a/problems/split-bst/split_bst_test.go b/problems/split-bst/split_bst_test.go
deleted file mode 100644
index 1f648eaef..000000000
--- a/problems/split-bst/split_bst_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem776
diff --git a/problems/split-concatenated-strings/README.md b/problems/split-concatenated-strings/README.md
deleted file mode 100644
index ebca547de..000000000
--- a/problems/split-concatenated-strings/README.md
+++ /dev/null
@@ -1,44 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../brick-wall "Brick Wall")
-
-[Next >](../next-greater-element-iii "Next Greater Element III")
-
-## [555. Split Concatenated Strings (Medium)](https://leetcode.com/problems/split-concatenated-strings "分割连接字符串")
-
-
Given a list of strings, you could concatenate these strings together into a loop, where for each string you could choose to reverse it or not. Among all the possible loops, you need to find the lexicographically biggest string after cutting the loop, which will make the looped string into a regular one.
-
-
Specifically, to find the lexicographically biggest string, you need to experience two phases:
-
-
Concatenate all the strings into a loop, where you can reverse some strings or not and connect them in the same order as given.
-
Cut and make one breakpoint in any place of the loop, which will make the looped string into a regular one starting from the character at the cutpoint.
-
-
-
-
And your job is to find the lexicographically biggest one among all the possible regular strings.
-
-
-
Example:
-
-Input: "abc", "xyz"
-Output: "zyxcba"
-Explanation: You can get the looped string "-abcxyz-", "-abczyx-", "-cbaxyz-", "-cbazyx-", where '-' represents the looped status. The answer string came from the fourth looped one, where you could cut from the middle character 'a' and get "zyxcba".
-
-
-
-
Note:
-
-
The input strings will only contain lowercase letters.
-
The total length of all the strings will not over 1,000.
Given the head of a singly linked list and an integer k, split the linked list into k consecutive linked list parts.
-
-
The length of each part should be as equal as possible: no two parts should have a size differing by more than one. This may lead to some parts being null.
-
-
The parts should be in the order of occurrence in the input list, and parts occurring earlier should always have a size greater than or equal to parts occurring later.
-
-
Return an array of the k parts.
-
-
-
Example 1:
-
-
-Input: head = [1,2,3], k = 5
-Output: [[1],[2],[3],[],[]]
-Explanation:
-The first element output[0] has output[0].val = 1, output[0].next = null.
-The last element output[4] is null, but its string representation as a ListNode is [].
-
-
-
Example 2:
-
-
-Input: head = [1,2,3,4,5,6,7,8,9,10], k = 3
-Output: [[1,2,3,4],[5,6,7],[8,9,10]]
-Explanation:
-The input has been split into consecutive parts with size difference at most 1, and earlier parts are a larger size than the later parts.
-
-
-
-
Constraints:
-
-
-
The number of nodes in the list is in the range [0, 1000].
-
0 <= Node.val <= 1000
-
1 <= k <= 50
-
-
-### Related Topics
- [[Linked List](../../tag/linked-list/README.md)]
-
-### Similar Questions
- 1. [Rotate List](../rotate-list) (Medium)
- 1. [Odd Even Linked List](../odd-even-linked-list) (Medium)
-
-### Hints
-
-Hint 1
-If there are N nodes in the list, and k parts, then every part has N/k elements, except the first N%k parts have an extra one.
-
diff --git a/problems/split-linked-list-in-parts/split_linked_list_in_parts.go b/problems/split-linked-list-in-parts/split_linked_list_in_parts.go
deleted file mode 100644
index 34ab94c88..000000000
--- a/problems/split-linked-list-in-parts/split_linked_list_in_parts.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem725
diff --git a/problems/split-linked-list-in-parts/split_linked_list_in_parts_test.go b/problems/split-linked-list-in-parts/split_linked_list_in_parts_test.go
deleted file mode 100644
index 34ab94c88..000000000
--- a/problems/split-linked-list-in-parts/split_linked_list_in_parts_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem725
diff --git a/problems/split-two-strings-to-make-palindrome/README.md b/problems/split-two-strings-to-make-palindrome/README.md
deleted file mode 100644
index b8a9ef7b2..000000000
--- a/problems/split-two-strings-to-make-palindrome/README.md
+++ /dev/null
@@ -1,75 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximal-network-rank "Maximal Network Rank")
-
-[Next >](../count-subtrees-with-max-distance-between-cities "Count Subtrees With Max Distance Between Cities")
-
-## [1616. Split Two Strings to Make Palindrome (Medium)](https://leetcode.com/problems/split-two-strings-to-make-palindrome "分割两个字符串得到回文串")
-
-
You are given two strings a and b of the same length. Choose an index and split both strings at the same index, splitting a into two strings: aprefix and asuffix where a = aprefix + asuffix, and splitting b into two strings: bprefix and bsuffix where b = bprefix + bsuffix. Check if aprefix + bsuffix or bprefix + asuffix forms a palindrome.
-
-
When you split a string s into sprefix and ssuffix, either ssuffix or sprefix is allowed to be empty. For example, if s = "abc", then "" + "abc", "a" + "bc", "ab" + "c" , and "abc" + "" are valid splits.
-
-
Return true if it is possible to form a palindrome string, otherwise return false.
-
-
Notice that x + y denotes the concatenation of strings x and y.
-
-
-
Example 1:
-
-
-Input: a = "x", b = "y"
-Output: true
-Explaination: If either a or b are palindromes the answer is true since you can split in the following way:
-aprefix = "", asuffix = "x"
-bprefix = "", bsuffix = "y"
-Then, aprefix + bsuffix = "" + "y" = "y", which is a palindrome.
-
-
-
Example 2:
-
-
-Input: a = "xbdef", b = "xecab"
-Output: false
-
-
-
Example 3:
-
-
-Input: a = "ulacfd", b = "jizalu"
-Output: true
-Explaination: Split them at index 3:
-aprefix = "ula", asuffix = "cfd"
-bprefix = "jiz", bsuffix = "alu"
-Then, aprefix + bsuffix = "ula" + "alu" = "ulaalu", which is a palindrome.
-
-
-
-
Constraints:
-
-
-
1 <= a.length, b.length <= 105
-
a.length == b.length
-
a and b consist of lowercase English letters
-
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[Two Pointers](../../tag/two-pointers/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Hints
-
-Hint 1
-Try finding the largest prefix form a that matches a suffix in b
-
-
-
-Hint 2
-Try string matching
-
diff --git a/problems/splitting-a-string-into-descending-consecutive-values/README.md b/problems/splitting-a-string-into-descending-consecutive-values/README.md
deleted file mode 100644
index 97aca561b..000000000
--- a/problems/splitting-a-string-into-descending-consecutive-values/README.md
+++ /dev/null
@@ -1,74 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-distance-to-the-target-element "Minimum Distance to the Target Element")
-
-[Next >](../minimum-adjacent-swaps-to-reach-the-kth-smallest-number "Minimum Adjacent Swaps to Reach the Kth Smallest Number")
-
-## [1849. Splitting a String Into Descending Consecutive Values (Medium)](https://leetcode.com/problems/splitting-a-string-into-descending-consecutive-values "将字符串拆分为递减的连续值")
-
-
You are given a string s that consists of only digits.
-
-
Check if we can split s into two or more non-empty substrings such that the numerical values of the substrings are in descending order and the difference between numerical values of every two adjacentsubstrings is equal to 1.
-
-
-
For example, the string s = "0090089" can be split into ["0090", "089"] with numerical values [90,89]. The values are in descending order and adjacent values differ by 1, so this way is valid.
-
Another example, the string s = "001" can be split into ["0", "01"], ["00", "1"], or ["0", "0", "1"]. However all the ways are invalid because they have numerical values [0,1], [0,1], and [0,0,1] respectively, all of which are not in descending order.
-
-
-
Return trueif it is possible to splits as described above, or false otherwise.
-
-
A substring is a contiguous sequence of characters in a string.
-
-
-
Example 1:
-
-
-Input: s = "1234"
-Output: false
-Explanation: There is no valid way to split s.
-
-
-
Example 2:
-
-
-Input: s = "050043"
-Output: true
-Explanation: s can be split into ["05", "004", "3"] with numerical values [5,4,3].
-The values are in descending order with adjacent values differing by 1.
-
-
-
Example 3:
-
-
-Input: s = "9080701"
-Output: false
-Explanation: There is no valid way to split s.
-
-
-
-
Constraints:
-
-
-
1 <= s.length <= 20
-
s only consists of digits.
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
- [[Backtracking](../../tag/backtracking/README.md)]
-
-### Hints
-
-Hint 1
-One solution is to try all possible splits using backtrack
-
-
-
-Hint 2
-Look out for trailing zeros in string
-
diff --git a/problems/sqrtx/README.md b/problems/sqrtx/README.md
deleted file mode 100644
index 6fb4dff4a..000000000
--- a/problems/sqrtx/README.md
+++ /dev/null
@@ -1,59 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../text-justification "Text Justification")
-
-[Next >](../climbing-stairs "Climbing Stairs")
-
-## [69. Sqrt(x) (Easy)](https://leetcode.com/problems/sqrtx "x 的平方根")
-
-
Given a non-negative integer x, compute and return the square root ofx.
-
-
Since the return type is an integer, the decimal digits are truncated, and only the integer part of the result is returned.
-
-
Note: You are not allowed to use any built-in exponent function or operator, such as pow(x, 0.5) or x ** 0.5.
-
-
-
Example 1:
-
-
-Input: x = 4
-Output: 2
-
-
-
Example 2:
-
-
-Input: x = 8
-Output: 2
-Explanation: The square root of 8 is 2.82842..., and since the decimal part is truncated, 2 is returned.
-Follow up: Squaring each element and sorting the new array is very trivial, could you find an O(n) solution using a different approach?
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Two Pointers](../../tag/two-pointers/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Similar Questions
- 1. [Merge Sorted Array](../merge-sorted-array) (Easy)
- 1. [Sort Transformed Array](../sort-transformed-array) (Medium)
diff --git a/problems/squares-of-a-sorted-array/squares_of_a_sorted_array.go b/problems/squares-of-a-sorted-array/squares_of_a_sorted_array.go
deleted file mode 100644
index 31d94d962..000000000
--- a/problems/squares-of-a-sorted-array/squares_of_a_sorted_array.go
+++ /dev/null
@@ -1,12 +0,0 @@
-package problem977
-
-import "sort"
-
-func sortedSquares(A []int) []int {
- ans := make([]int, len(A))
- for i, v := range A {
- ans[i] = v * v
- }
- sort.Ints(ans)
- return ans
-}
diff --git a/problems/squares-of-a-sorted-array/squares_of_a_sorted_array_test.go b/problems/squares-of-a-sorted-array/squares_of_a_sorted_array_test.go
deleted file mode 100644
index bdfe20889..000000000
--- a/problems/squares-of-a-sorted-array/squares_of_a_sorted_array_test.go
+++ /dev/null
@@ -1,30 +0,0 @@
-package problem977
-
-import (
- "reflect"
- "testing"
-)
-
-type testType struct {
- in []int
- want []int
-}
-
-func TestSortedSquares(t *testing.T) {
- tests := [...]testType{
- {
- in: []int{-4, -1, 0, 3, 10},
- want: []int{0, 1, 9, 16, 100},
- },
- {
- in: []int{-7, -3, 2, 3, 11},
- want: []int{4, 9, 9, 49, 121},
- },
- }
- for _, tt := range tests {
- got := sortedSquares(tt.in)
- if !reflect.DeepEqual(got, tt.want) {
- t.Fatalf("in: %v, got: %v, want: %v", tt.in, got, tt.want)
- }
- }
-}
diff --git a/problems/squirrel-simulation/README.md b/problems/squirrel-simulation/README.md
deleted file mode 100644
index dcb935bcb..000000000
--- a/problems/squirrel-simulation/README.md
+++ /dev/null
@@ -1,66 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../subtree-of-another-tree "Subtree of Another Tree")
-
-[Next >](../winning-candidate "Winning Candidate")
-
-## [573. Squirrel Simulation (Medium)](https://leetcode.com/problems/squirrel-simulation "松鼠模拟")
-
-There's a tree, a squirrel, and several nuts. Positions are represented by the cells in a 2D grid. Your goal is to find the minimal distance for the squirrel to collect all the nuts and put them under the tree one by one. The squirrel can only take at most one nut at one time and can move in four directions - up, down, left and right, to the adjacent cell. The distance is represented by the number of moves.
-
The squirrel can take at most one nut at one time.
-
The given positions of nuts have no order.
-
Height and width are positive integers. 3 <= height * width <= 10,000.
-
The given positions contain at least one nut, only one tree and one squirrel.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Math](../../tag/math/README.md)]
-
-### Hints
-
-Hint 1
-Will Brute force solution works here? What will be its complexity?
-
-
-
-Hint 2
-Brute force definitely won't work here. Think of some simple solution. Take some example and make some observations.
-
-
-
-Hint 3
-Will order of nuts traversed by squirrel is important or only first nut traversed by squirrel is important?
-
-
-
-Hint 4
-Are there some paths which squirrel have to cover in any case? If yes, what are they?
-
-
-
-Hint 5
-Did you notice only first nut traversed by squirrel matters? Obviously squirrel will choose first nut which will result in minimum distance.
-
diff --git a/problems/squirrel-simulation/squirrel_simulation.go b/problems/squirrel-simulation/squirrel_simulation.go
deleted file mode 100644
index 349983d57..000000000
--- a/problems/squirrel-simulation/squirrel_simulation.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem573
diff --git a/problems/squirrel-simulation/squirrel_simulation_test.go b/problems/squirrel-simulation/squirrel_simulation_test.go
deleted file mode 100644
index 349983d57..000000000
--- a/problems/squirrel-simulation/squirrel_simulation_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem573
diff --git a/problems/stamping-the-grid/README.md b/problems/stamping-the-grid/README.md
deleted file mode 100644
index e11e22239..000000000
--- a/problems/stamping-the-grid/README.md
+++ /dev/null
@@ -1,78 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../longest-palindrome-by-concatenating-two-letter-words "Longest Palindrome by Concatenating Two Letter Words")
-
-[Next >](../check-if-every-row-and-column-contains-all-numbers "Check if Every Row and Column Contains All Numbers")
-
-## [2132. Stamping the Grid (Hard)](https://leetcode.com/problems/stamping-the-grid "用邮票贴满网格图")
-
-
You are given an m x n binary matrix grid where each cell is either 0 (empty) or 1 (occupied).
-
-
You are then given stamps of size stampHeight x stampWidth. We want to fit the stamps such that they follow the given restrictions and requirements:
-
-
-
Cover all the empty cells.
-
Do not cover any of the occupied cells.
-
We can put as many stamps as we want.
-
Stamps can overlap with each other.
-
Stamps are not allowed to be rotated.
-
Stamps must stay completely inside the grid.
-
-
-
Return trueif it is possible to fit the stamps while following the given restrictions and requirements. Otherwise, returnfalse.
-
-
-
Example 1:
-
-
-Input: grid = [[1,0,0,0],[1,0,0,0],[1,0,0,0],[1,0,0,0],[1,0,0,0]], stampHeight = 4, stampWidth = 3
-Output: true
-Explanation: We have two overlapping stamps (labeled 1 and 2 in the image) that are able to cover all the empty cells.
-
-
-
Example 2:
-
-
-Input: grid = [[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]], stampHeight = 2, stampWidth = 2
-Output: false
-Explanation: There is no way to fit the stamps onto all the empty cells without the stamps going outside the grid.
-
-
-
-
Constraints:
-
-
-
m == grid.length
-
n == grid[r].length
-
1 <= m, n <= 105
-
1 <= m * n <= 2 * 105
-
grid[r][c] is either 0 or 1.
-
1 <= stampHeight, stampWidth <= 105
-
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
- [[Prefix Sum](../../tag/prefix-sum/README.md)]
-
-### Hints
-
-Hint 1
-We can check if every empty cell is a part of a consecutive row of empty cells that has a width of at least stampWidth as well as a consecutive column of empty cells that has a height of at least stampHeight.
-
-
-
-Hint 2
-We can prove that this condition is sufficient and necessary to fit the stamps while following the given restrictions and requirements.
-
-
-
-Hint 3
-For each row, find every consecutive row of empty cells, and mark all the cells where the consecutive row is at least stampWidth wide. Do the same for the columns with stampHeight. Then, you can check if every cell is marked twice.
-
diff --git a/problems/stamping-the-sequence/README.md b/problems/stamping-the-sequence/README.md
deleted file mode 100644
index 9b995d25d..000000000
--- a/problems/stamping-the-sequence/README.md
+++ /dev/null
@@ -1,67 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../knight-dialer "Knight Dialer")
-
-[Next >](../reorder-data-in-log-files "Reorder Data in Log Files")
-
-## [936. Stamping The Sequence (Hard)](https://leetcode.com/problems/stamping-the-sequence "戳印序列")
-
-
You are given two strings stamp and target. Initially, there is a string s of length target.length with all s[i] == '?'.
-
-
In one turn, you can place stamp over s and replace every letter in the s with the corresponding letter from stamp.
-
-
-
For example, if stamp = "abc" and target = "abcba", then s is "?????" initially. In one turn you can:
-
-
place stamp at index 0 of s to obtain "abc??",
-
place stamp at index 1 of s to obtain "?abc?", or
-
place stamp at index 2 of s to obtain "??abc".
-
- Note that stamp must be fully contained in the boundaries of s in order to stamp (i.e., you cannot place stamp at index 3 of s).
-
-
-
We want to convert s to target using at most10 * target.length turns.
-
-
Return an array of the index of the left-most letter being stamped at each turn. If we cannot obtain target from s within 10 * target.length turns, return an empty array.
-
-
-
Example 1:
-
-
-Input: stamp = "abc", target = "ababc"
-Output: [0,2]
-Explanation: Initially s = "?????".
-- Place stamp at index 0 to get "abc??".
-- Place stamp at index 2 to get "ababc".
-[1,0,2] would also be accepted as an answer, as well as some other answers.
-
-
-
Example 2:
-
-
-Input: stamp = "abca", target = "aabcaca"
-Output: [3,0,1]
-Explanation: Initially s = "???????".
-- Place stamp at index 3 to get "???abca".
-- Place stamp at index 0 to get "abcabca".
-- Place stamp at index 1 to get "aabcaca".
-
-
-
-
Constraints:
-
-
-
1 <= stamp.length <= target.length <= 1000
-
stamp and target consist of lowercase English letters.
You are given a large sample of integers in the range [0, 255]. Since the sample is so large, it is represented by an array count where count[k] is the number of times that k appears in the sample.
-
-
Calculate the following statistics:
-
-
-
minimum: The minimum element in the sample.
-
maximum: The maximum element in the sample.
-
mean: The average of the sample, calculated as the total sum of all elements divided by the total number of elements.
-
median:
-
-
If the sample has an odd number of elements, then the median is the middle element once the sample is sorted.
-
If the sample has an even number of elements, then the median is the average of the two middle elements once the sample is sorted.
-
-
-
mode: The number that appears the most in the sample. It is guaranteed to be unique.
-
-
-
Return the statistics of the sample as an array of floating-point numbers [minimum, maximum, mean, median, mode]. Answers within 10-5 of the actual answer will be accepted.
-
-
-
Example 1:
-
-
-Input: count = [0,1,3,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
-Output: [1.00000,3.00000,2.37500,2.50000,3.00000]
-Explanation: The sample represented by count is [1,2,2,2,3,3,3,3].
-The minimum and maximum are 1 and 3 respectively.
-The mean is (1+2+2+2+3+3+3+3) / 8 = 19 / 8 = 2.375.
-Since the size of the sample is even, the median is the average of the two middle elements 2 and 3, which is 2.5.
-The mode is 3 as it appears the most in the sample.
-
-
-
Example 2:
-
-
-Input: count = [0,4,3,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
-Output: [1.00000,4.00000,2.18182,2.00000,1.00000]
-Explanation: The sample represented by count is [1,1,1,1,2,2,2,3,3,4,4].
-The minimum and maximum are 1 and 4 respectively.
-The mean is (1+1+1+1+2+2+2+3+3+4+4) / 11 = 24 / 11 = 2.18181818... (for display purposes, the output shows the rounded number 2.18182).
-Since the size of the sample is odd, the median is the middle element 2.
-The mode is 1 as it appears the most in the sample.
-
-
-
-
Constraints:
-
-
-
count.length == 256
-
0 <= count[i] <= 109
-
1 <= sum(count) <= 109
-
The mode of the sample that count represents is unique.
-
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
- [[Two Pointers](../../tag/two-pointers/README.md)]
- [[Probability and Statistics](../../tag/probability-and-statistics/README.md)]
-
-### Hints
-
-Hint 1
-The hard part is the median. Write a helper function which finds the k-th element from the sample.
-
diff --git a/problems/statistics-from-a-large-sample/statistics_from_a_large_sample.go b/problems/statistics-from-a-large-sample/statistics_from_a_large_sample.go
deleted file mode 100644
index c93b75726..000000000
--- a/problems/statistics-from-a-large-sample/statistics_from_a_large_sample.go
+++ /dev/null
@@ -1,86 +0,0 @@
-package problem1093
-
-import "sort"
-
-func sampleStats(count []int) []float64 {
- return []float64{
- minimum(count),
- maximum(count),
- mean(count),
- median(count),
- mode(count),
- }
-}
-
-// minimum:最小值
-func minimum(count []int) float64 {
- i := 0
- for ; i < len(count); i++ {
- if count[i] != 0 {
- break
- }
- }
- return float64(i)
-}
-
-// maximum:最大值
-func maximum(count []int) float64 {
- i := len(count) - 1
- for ; i >= 0; i-- {
- if count[i] != 0 {
- break
- }
- }
- return float64(i)
-}
-
-// mean :平均数
-func mean(count []int) float64 {
- sum, c := 0, 0
- for i := 0; i < len(count); i++ {
- if count[i] == 0 {
- continue
- }
- sum += i * count[i]
- c += count[i]
- }
- return float64(sum) / float64(c)
-}
-
-// median :中位数,排序后,位于正中间的数。
-func median(count []int) float64 {
- k := make([]int, 0, 256)
- c := make([]int, 0, 256)
- sum := 0
- for i := 0; i < len(count); i++ {
- if count[i] == 0 {
- continue
- }
- sum += count[i]
- k = append(k, i)
- c = append(c, sum)
- }
- if sum%2 == 1 {
- h := sum/2 + 1
- i := sort.SearchInts(c, h)
- return float64(k[i])
- }
- h := sum / 2
- i := sort.SearchInts(c, h)
- j := sort.SearchInts(c, h+1)
- return float64(k[i]+k[j]) / 2
-}
-
-// mode :出现次数最多的数
-func mode(count []int) float64 {
- k, c := -1, -1
- for i := 0; i < len(count); i++ {
- if count[i] == 0 {
- continue
- }
- if c < count[i] {
- k, c = i, count[i]
- }
- }
- return float64(k)
-}
diff --git a/problems/step-by-step-directions-from-a-binary-tree-node-to-another/README.md b/problems/step-by-step-directions-from-a-binary-tree-node-to-another/README.md
deleted file mode 100644
index ad7f54d10..000000000
--- a/problems/step-by-step-directions-from-a-binary-tree-node-to-another/README.md
+++ /dev/null
@@ -1,75 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../delete-the-middle-node-of-a-linked-list "Delete the Middle Node of a Linked List")
-
-[Next >](../valid-arrangement-of-pairs "Valid Arrangement of Pairs")
-
-## [2096. Step-By-Step Directions From a Binary Tree Node to Another (Medium)](https://leetcode.com/problems/step-by-step-directions-from-a-binary-tree-node-to-another "从二叉树一个节点到另一个节点每一步的方向")
-
-
You are given the root of a binary tree with n nodes. Each node is uniquely assigned a value from 1 to n. You are also given an integer startValue representing the value of the start node s, and a different integer destValue representing the value of the destination node t.
-
-
Find the shortest path starting from node s and ending at node t. Generate step-by-step directions of such path as a string consisting of only the uppercase letters 'L', 'R', and 'U'. Each letter indicates a specific direction:
-
-
-
'L' means to go from a node to its left child node.
-
'R' means to go from a node to its right child node.
-
'U' means to go from a node to its parent node.
-
-
-
Return the step-by-step directions of the shortest path from node s to nodet.
-
-### Related Topics
- [[Tree](../../tag/tree/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[String](../../tag/string/README.md)]
- [[Binary Tree](../../tag/binary-tree/README.md)]
-
-### Hints
-
-Hint 1
-The shortest path between any two nodes in a tree must pass through their Lowest Common Ancestor (LCA). The path will travel upwards from node s to the LCA and then downwards from the LCA to node t.
-
-
-
-Hint 2
-Find the path strings from root → s, and root → t. Can you use these two strings to prepare the final answer?
-
-
-
-Hint 3
-Remove the longest common prefix of the two path strings to get the path LCA → s, and LCA → t. Each step in the path of LCA → s should be reversed as 'U'.
-
diff --git a/problems/stepping-numbers/README.md b/problems/stepping-numbers/README.md
deleted file mode 100644
index 015aa8167..000000000
--- a/problems/stepping-numbers/README.md
+++ /dev/null
@@ -1,48 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../two-sum-bsts "Two Sum BSTs")
-
-[Next >](../valid-palindrome-iii "Valid Palindrome III")
-
-## [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.
-
-
Given two integers low and high, find and return a sorted list of all the Stepping Numbers in the range [low, high] inclusive.
-
-
-
Example 1:
-
Input: low = 0, high = 21
-Output: [0,1,2,3,4,5,6,7,8,9,10,12,21]
-
-
-
Constraints:
-
-
-
0 <= low <= high <= 2 * 10^9
-
-
-### Related Topics
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Backtracking](../../tag/backtracking/README.md)]
-
-### Hints
-
-Hint 1
-Try to generate the numbers using recursion.
-
-
-
-Hint 2
-In one step in the recursion, add a valid digit to the right of the current number.
-
-
-
-Hint 3
-Save the number if it's in the range between low and high.
-
diff --git a/problems/stickers-to-spell-word/README.md b/problems/stickers-to-spell-word/README.md
deleted file mode 100644
index 344c35177..000000000
--- a/problems/stickers-to-spell-word/README.md
+++ /dev/null
@@ -1,73 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../employee-importance "Employee Importance")
-
-[Next >](../top-k-frequent-words "Top K Frequent Words")
-
-## [691. Stickers to Spell Word (Hard)](https://leetcode.com/problems/stickers-to-spell-word "贴纸拼词")
-
-
We are given n different types of stickers. Each sticker has a lowercase English word on it.
-
-
You would like to spell out the given string target by cutting individual letters from your collection of stickers and rearranging them. You can use each sticker more than once if you want, and you have infinite quantities of each sticker.
-
-
Return the minimum number of stickers that you need to spell out target. If the task is impossible, return -1.
-
-
Note: In all test cases, all words were chosen randomly from the 1000 most common US English words, and target was chosen as a concatenation of two random words.
-
-
-
Example 1:
-
-
-Input: stickers = ["with","example","science"], target = "thehat"
-Output: 3
-Explanation:
-We can use 2 "with" stickers, and 1 "example" sticker.
-After cutting and rearrange the letters of those stickers, we can form the target "thehat".
-Also, this is the minimum number of stickers necessary to form the target string.
-
-
-
Example 2:
-
-
-Input: stickers = ["notice","possible"], target = "basicbasic"
-Output: -1
-Explanation:
-We cannot form the target "basicbasic" from cutting letters from the given stickers.
-
-
-
-
Constraints:
-
-
-
n == stickers.length
-
1 <= n <= 50
-
1 <= stickers[i].length <= 10
-
1 <= target <= 15
-
stickers[i] and target consist of lowercase English letters.
-
-
-### Related Topics
- [[Bit Manipulation](../../tag/bit-manipulation/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Backtracking](../../tag/backtracking/README.md)]
- [[Bitmask](../../tag/bitmask/README.md)]
-
-### Similar Questions
- 1. [Ransom Note](../ransom-note) (Easy)
-
-### Hints
-
-Hint 1
-We want to perform an exhaustive search, but we need to speed it up based on the input data being random.
-
-For all stickers, we can ignore any letters that are not in the target word.
-
-When our candidate answer won't be smaller than an answer we have already found, we can stop searching this path.
-
-When a sticker dominates another, we shouldn't include the dominated sticker in our sticker collection. [Here, we say a sticker `A` dominates `B` if `A.count(letter) >= B.count(letter)` for all letters.]
-
diff --git a/problems/stickers-to-spell-word/stickers_to_spell_word.go b/problems/stickers-to-spell-word/stickers_to_spell_word.go
deleted file mode 100644
index fa30e1e2c..000000000
--- a/problems/stickers-to-spell-word/stickers_to_spell_word.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem691
diff --git a/problems/stickers-to-spell-word/stickers_to_spell_word_test.go b/problems/stickers-to-spell-word/stickers_to_spell_word_test.go
deleted file mode 100644
index fa30e1e2c..000000000
--- a/problems/stickers-to-spell-word/stickers_to_spell_word_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem691
diff --git a/problems/stock-price-fluctuation/README.md b/problems/stock-price-fluctuation/README.md
deleted file mode 100644
index 993eb2005..000000000
--- a/problems/stock-price-fluctuation/README.md
+++ /dev/null
@@ -1,85 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-operations-to-make-a-uni-value-grid "Minimum Operations to Make a Uni-Value Grid")
-
-[Next >](../partition-array-into-two-arrays-to-minimize-sum-difference "Partition Array Into Two Arrays to Minimize Sum Difference")
-
-## [2034. Stock Price Fluctuation (Medium)](https://leetcode.com/problems/stock-price-fluctuation "股票价格波动")
-
-
You are given a stream of records about a particular stock. Each record contains a timestamp and the corresponding price of the stock at that timestamp.
-
-
Unfortunately due to the volatile nature of the stock market, the records do not come in order. Even worse, some records may be incorrect. Another record with the same timestamp may appear later in the stream correcting the price of the previous wrong record.
-
-
Design an algorithm that:
-
-
-
Updates the price of the stock at a particular timestamp, correcting the price from any previous records at the timestamp.
-
Finds the latest price of the stock based on the current records. The latest price is the price at the latest timestamp recorded.
-
Finds the maximum price the stock has been based on the current records.
-
Finds the minimum price the stock has been based on the current records.
-
-
-
Implement the StockPrice class:
-
-
-
StockPrice() Initializes the object with no price records.
-
void update(int timestamp, int price) Updates the price of the stock at the given timestamp.
-
int current() Returns the latest price of the stock.
-
int maximum() Returns the maximum price of the stock.
-
int minimum() Returns the minimum price of the stock.
-
-
-
-
Example 1:
-
-
-Input
-["StockPrice", "update", "update", "current", "maximum", "update", "maximum", "update", "minimum"]
-[[], [1, 10], [2, 5], [], [], [1, 3], [], [4, 2], []]
-Output
-[null, null, null, 5, 10, null, 5, null, 2]
-
-Explanation
-StockPrice stockPrice = new StockPrice();
-stockPrice.update(1, 10); // Timestamps are [1] with corresponding prices [10].
-stockPrice.update(2, 5); // Timestamps are [1,2] with corresponding prices [10,5].
-stockPrice.current(); // return 5, the latest timestamp is 2 with the price being 5.
-stockPrice.maximum(); // return 10, the maximum price is 10 at timestamp 1.
-stockPrice.update(1, 3); // The previous timestamp 1 had the wrong price, so it is updated to 3.
- // Timestamps are [1,2] with corresponding prices [3,5].
-stockPrice.maximum(); // return 5, the maximum price is 5 after the correction.
-stockPrice.update(4, 2); // Timestamps are [1,2,4] with corresponding prices [3,5,2].
-stockPrice.minimum(); // return 2, the minimum price is 2 at timestamp 4.
-
-
-
-
Constraints:
-
-
-
1 <= timestamp, price <= 109
-
At most 105 calls will be made in total to update, current, maximum, and minimum.
-
current, maximum, and minimum will be called only afterupdate has been called at least once.
-
-
-### Related Topics
- [[Design](../../tag/design/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Data Stream](../../tag/data-stream/README.md)]
- [[Ordered Set](../../tag/ordered-set/README.md)]
- [[Heap (Priority Queue)](../../tag/heap-priority-queue/README.md)]
-
-### Hints
-
-Hint 1
-How would you solve the problem for offline queries (all queries given at once)?
-
-
-
-Hint 2
-Think about which data structure can help insert and delete the most optimal way.
-
diff --git a/problems/stone-game-ii/README.md b/problems/stone-game-ii/README.md
deleted file mode 100644
index 7a40acc4c..000000000
--- a/problems/stone-game-ii/README.md
+++ /dev/null
@@ -1,58 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../largest-1-bordered-square "Largest 1-Bordered Square")
-
-[Next >](../user-activity-for-the-past-30-days-i "User Activity for the Past 30 Days I")
-
-## [1140. Stone Game II (Medium)](https://leetcode.com/problems/stone-game-ii "石子游戏 II")
-
-
Alice and Bob continue their games with piles of stones. There are a number of piles arranged in a row, and each pile has a positive integer number of stones piles[i]. The objective of the game is to end with the most stones.
-
-
Alice and Bob take turns, with Alice starting first. Initially, M = 1.
-
-
On each player's turn, that player can take all the stones in the firstX remaining piles, where 1 <= X <= 2M. Then, we set M = max(M, X).
-
-
The game continues until all the stones have been taken.
-
-
Assuming Alice and Bob play optimally, return the maximum number of stones Alice can get.
-
-
-
Example 1:
-
-
-Input: piles = [2,7,9,4,4]
-Output: 10
-Explanation: If Alice takes one pile at the beginning, Bob takes two piles, then Alice takes 2 piles again. Alice can get 2 + 4 + 4 = 10 piles in total. If Alice takes two piles at the beginning, then Bob can take all three piles left. In this case, Alice get 2 + 7 = 9 piles in total. So we return 10 since it's larger.
-
-
-
Example 2:
-
-
-Input: piles = [1,2,3,4,5,100]
-Output: 104
-
-
-
-
Constraints:
-
-
-
1 <= piles.length <= 100
-
1 <= piles[i] <= 104
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Math](../../tag/math/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Game Theory](../../tag/game-theory/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/stone-game-iii/README.md b/problems/stone-game-iii/README.md
deleted file mode 100644
index cb4cc8145..000000000
--- a/problems/stone-game-iii/README.md
+++ /dev/null
@@ -1,77 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../longest-happy-string "Longest Happy String")
-
-[Next >](../top-travellers "Top Travellers")
-
-## [1406. Stone Game III (Hard)](https://leetcode.com/problems/stone-game-iii "石子游戏 III")
-
-
Alice and Bob continue their games with piles of stones. There are several stones arranged in a row, and each stone has an associated value which is an integer given in the array stoneValue.
-
-
Alice and Bob take turns, with Alice starting first. On each player's turn, that player can take 1, 2, or 3 stones from the first remaining stones in the row.
-
-
The score of each player is the sum of the values of the stones taken. The score of each player is 0 initially.
-
-
The objective of the game is to end with the highest score, and the winner is the player with the highest score and there could be a tie. The game continues until all the stones have been taken.
-
-
Assume Alice and Bob play optimally.
-
-
Return "Alice" if Alice will win, "Bob" if Bob will win, or "Tie" if they will end the game with the same score.
-
-
-
Example 1:
-
-
-Input: values = [1,2,3,7]
-Output: "Bob"
-Explanation: Alice will always lose. Her best move will be to take three piles and the score become 6. Now the score of Bob is 7 and Bob wins.
-
-
-
Example 2:
-
-
-Input: values = [1,2,3,-9]
-Output: "Alice"
-Explanation: Alice must choose all the three piles at the first move to win and leave Bob with negative score.
-If Alice chooses one pile her score will be 1 and the next move Bob's score becomes 5. In the next move, Alice will take the pile with value = -9 and lose.
-If Alice chooses two piles her score will be 3 and the next move Bob's score becomes 3. In the next move, Alice will take the pile with value = -9 and also lose.
-Remember that both play optimally so here Alice will choose the scenario that makes her win.
-
-
-
Example 3:
-
-
-Input: values = [1,2,3,6]
-Output: "Tie"
-Explanation: Alice cannot win this game. She can end the game in a draw if she decided to choose all the first three piles, otherwise she will lose.
-
-
-
-
Constraints:
-
-
-
1 <= stoneValue.length <= 5 * 104
-
-1000 <= stoneValue[i] <= 1000
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Math](../../tag/math/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Game Theory](../../tag/game-theory/README.md)]
-
-### Hints
-
-Hint 1
-The game can be mapped to minmax game. Alice tries to maximize the total score and Bob tries to minimize it.
-
-
-
-Hint 2
-Use dynamic programming to simulate the game. If the total score was 0 the game is "Tie", and if it has positive value then "Alice" wins, otherwise "Bob" wins.
-
diff --git a/problems/stone-game-iv/README.md b/problems/stone-game-iv/README.md
deleted file mode 100644
index e353d2524..000000000
--- a/problems/stone-game-iv/README.md
+++ /dev/null
@@ -1,69 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-difference-between-largest-and-smallest-value-in-three-moves "Minimum Difference Between Largest and Smallest Value in Three Moves")
-
-[Next >](../customer-order-frequency "Customer Order Frequency")
-
-## [1510. Stone Game IV (Hard)](https://leetcode.com/problems/stone-game-iv "石子游戏 IV")
-
-
Alice and Bob take turns playing a game, with Alice starting first.
-
-
Initially, there are n stones in a pile. On each player's turn, that player makes a move consisting of removing any non-zero square number of stones in the pile.
-
-
Also, if a player cannot make a move, he/she loses the game.
-
-
Given a positive integer n, return true if and only if Alice wins the game otherwise return false, assuming both players play optimally.
-
-
-
Example 1:
-
-
-Input: n = 1
-Output: true
-Explanation: Alice can remove 1 stone winning the game because Bob doesn't have any moves.
-
-
Example 2:
-
-
-Input: n = 2
-Output: false
-Explanation: Alice can only remove 1 stone, after that Bob removes the last one winning the game (2 -> 1 -> 0).
-
-
-
Example 3:
-
-
-Input: n = 4
-Output: true
-Explanation: n is already a perfect square, Alice can win with one move, removing 4 stones (4 -> 0).
-
-
-
-
Constraints:
-
-
-
1 <= n <= 105
-
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Game Theory](../../tag/game-theory/README.md)]
-
-### Similar Questions
- 1. [Stone Game V](../stone-game-v) (Hard)
- 1. [Stone Game VI](../stone-game-vi) (Medium)
- 1. [Stone Game VII](../stone-game-vii) (Medium)
- 1. [Stone Game VIII](../stone-game-viii) (Hard)
- 1. [Stone Game IX](../stone-game-ix) (Medium)
-
-### Hints
-
-Hint 1
-Use dynamic programming to keep track of winning and losing states. Given some number of stones, Alice can win if she can force Bob onto a losing state.
-
diff --git a/problems/stone-game-ix/README.md b/problems/stone-game-ix/README.md
deleted file mode 100644
index d3a199649..000000000
--- a/problems/stone-game-ix/README.md
+++ /dev/null
@@ -1,79 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../find-missing-observations "Find Missing Observations")
-
-[Next >](../smallest-k-length-subsequence-with-occurrences-of-a-letter "Smallest K-Length Subsequence With Occurrences of a Letter")
-
-## [2029. Stone Game IX (Medium)](https://leetcode.com/problems/stone-game-ix "石子游戏 IX")
-
-
Alice and Bob continue their games with stones. There is a row of n stones, and each stone has an associated value. You are given an integer array stones, where stones[i] is the value of the ith stone.
-
-
Alice and Bob take turns, with Alice starting first. On each turn, the player may remove any stone from stones. The player who removes a stone loses if the sum of the values of all removed stones is divisible by 3. Bob will win automatically if there are no remaining stones (even if it is Alice's turn).
-
-
Assuming both players play optimally, return trueif Alice wins andfalseif Bob wins.
-
-
-
Example 1:
-
-
-Input: stones = [2,1]
-Output: true
-Explanation: The game will be played as follows:
-- Turn 1: Alice can remove either stone.
-- Turn 2: Bob removes the remaining stone.
-The sum of the removed stones is 1 + 2 = 3 and is divisible by 3. Therefore, Bob loses and Alice wins the game.
-
-
-
Example 2:
-
-
-Input: stones = [2]
-Output: false
-Explanation: Alice will remove the only stone, and the sum of the values on the removed stones is 2.
-Since all the stones are removed and the sum of values is not divisible by 3, Bob wins the game.
-
-
-
Example 3:
-
-
-Input: stones = [5,1,2,4,3]
-Output: false
-Explanation: Bob will always win. One possible way for Bob to win is shown below:
-- Turn 1: Alice can remove the second stone with value 1. Sum of removed stones = 1.
-- Turn 2: Bob removes the fifth stone with value 3. Sum of removed stones = 1 + 3 = 4.
-- Turn 3: Alices removes the fourth stone with value 4. Sum of removed stones = 1 + 3 + 4 = 8.
-- Turn 4: Bob removes the third stone with value 2. Sum of removed stones = 1 + 3 + 4 + 2 = 10.
-- Turn 5: Alice removes the first stone with value 5. Sum of removed stones = 1 + 3 + 4 + 2 + 5 = 15.
-Alice loses the game because the sum of the removed stones (15) is divisible by 3. Bob wins the game.
-
-
-
-
Constraints:
-
-
-
1 <= stones.length <= 105
-
1 <= stones[i] <= 104
-
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Math](../../tag/math/README.md)]
- [[Counting](../../tag/counting/README.md)]
- [[Game Theory](../../tag/game-theory/README.md)]
-
-### Hints
-
-Hint 1
-There are limited outcomes given the current sum and the stones remaining.
-
-
-
-Hint 2
-Can we greedily simulate starting with taking a stone with remainder 1 or 2 divided by 3?
-
diff --git a/problems/stone-game-v/README.md b/problems/stone-game-v/README.md
deleted file mode 100644
index 79aa9c07c..000000000
--- a/problems/stone-game-v/README.md
+++ /dev/null
@@ -1,70 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../find-latest-group-of-size-m "Find Latest Group of Size M")
-
-[Next >](../put-boxes-into-the-warehouse-i "Put Boxes Into the Warehouse I")
-
-## [1563. Stone Game V (Hard)](https://leetcode.com/problems/stone-game-v "石子游戏 V")
-
-
There are several stones arranged in a row, and each stone has an associated value which is an integer given in the array stoneValue.
-
-
In each round of the game, Alice divides the row into two non-empty rows (i.e. left row and right row), then Bob calculates the value of each row which is the sum of the values of all the stones in this row. Bob throws away the row which has the maximum value, and Alice's score increases by the value of the remaining row. If the value of the two rows are equal, Bob lets Alice decide which row will be thrown away. The next round starts with the remaining row.
-
-
The game ends when there is only one stone remaining. Alice's is initially zero.
-
-
Return the maximum score that Alice can obtain.
-
-
-
Example 1:
-
-
-Input: stoneValue = [6,2,3,4,5,5]
-Output: 18
-Explanation: In the first round, Alice divides the row to [6,2,3], [4,5,5]. The left row has the value 11 and the right row has value 14. Bob throws away the right row and Alice's score is now 11.
-In the second round Alice divides the row to [6], [2,3]. This time Bob throws away the left row and Alice's score becomes 16 (11 + 5).
-The last round Alice has only one choice to divide the row which is [2], [3]. Bob throws away the right row and Alice's score is now 18 (16 + 2). The game ends because only one stone is remaining in the row.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Math](../../tag/math/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Game Theory](../../tag/game-theory/README.md)]
-
-### Hints
-
-Hint 1
-We need to try all possible divisions for the current row to get the max score.
-
-
-
-Hint 2
-As calculating all possible divisions will lead us to calculate some sub-problems more than once, we need to think of dynamic programming.
-
diff --git a/problems/stone-game-vi/README.md b/problems/stone-game-vi/README.md
deleted file mode 100644
index 5d868a7e1..000000000
--- a/problems/stone-game-vi/README.md
+++ /dev/null
@@ -1,89 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../sum-of-absolute-differences-in-a-sorted-array "Sum of Absolute Differences in a Sorted Array")
-
-[Next >](../delivering-boxes-from-storage-to-ports "Delivering Boxes from Storage to Ports")
-
-## [1686. Stone Game VI (Medium)](https://leetcode.com/problems/stone-game-vi "石子游戏 VI")
-
-
Alice and Bob take turns playing a game, with Alice starting first.
-
-
There are n stones in a pile. On each player's turn, they can remove a stone from the pile and receive points based on the stone's value. Alice and Bob may value the stones differently.
-
-
You are given two integer arrays of length n, aliceValues and bobValues. Each aliceValues[i] and bobValues[i] represents how Alice and Bob, respectively, value the ith stone.
-
-
The winner is the person with the most points after all the stones are chosen. If both players have the same amount of points, the game results in a draw. Both players will play optimally. Both players know the other's values.
-
-
Determine the result of the game, and:
-
-
-
If Alice wins, return 1.
-
If Bob wins, return -1.
-
If the game results in a draw, return 0.
-
-
-
-
Example 1:
-
-
-Input: aliceValues = [1,3], bobValues = [2,1]
-Output: 1
-Explanation:
-If Alice takes stone 1 (0-indexed) first, Alice will receive 3 points.
-Bob can only choose stone 0, and will only receive 2 points.
-Alice wins.
-
-
-
Example 2:
-
-
-Input: aliceValues = [1,2], bobValues = [3,1]
-Output: 0
-Explanation:
-If Alice takes stone 0, and Bob takes stone 1, they will both have 1 point.
-Draw.
-
-
-
Example 3:
-
-
-Input: aliceValues = [2,4,3], bobValues = [1,6,7]
-Output: -1
-Explanation:
-Regardless of how Alice plays, Bob will be able to have more points than Alice.
-For example, if Alice takes stone 1, Bob can take stone 2, and Alice takes stone 0, Alice will have 6 points to Bob's 7.
-Bob wins.
-
-
-
-
Constraints:
-
-
-
n == aliceValues.length == bobValues.length
-
1 <= n <= 105
-
1 <= aliceValues[i], bobValues[i] <= 100
-
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Math](../../tag/math/README.md)]
- [[Game Theory](../../tag/game-theory/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
- [[Heap (Priority Queue)](../../tag/heap-priority-queue/README.md)]
-
-### Hints
-
-Hint 1
-When one takes the stone, they not only get the points, but they take them away from the other player too.
-
-
-
-Hint 2
-Greedily choose the stone with the maximum aliceValues[i] + bobValues[i].
-
diff --git a/problems/stone-game-vii/README.md b/problems/stone-game-vii/README.md
deleted file mode 100644
index 5d1b5878e..000000000
--- a/problems/stone-game-vii/README.md
+++ /dev/null
@@ -1,67 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../partitioning-into-minimum-number-of-deci-binary-numbers "Partitioning Into Minimum Number Of Deci-Binary Numbers")
-
-[Next >](../maximum-height-by-stacking-cuboids "Maximum Height by Stacking Cuboids ")
-
-## [1690. Stone Game VII (Medium)](https://leetcode.com/problems/stone-game-vii "石子游戏 VII")
-
-
Alice and Bob take turns playing a game, with Alice starting first.
-
-
There are n stones arranged in a row. On each player's turn, they can remove either the leftmost stone or the rightmost stone from the row and receive points equal to the sum of the remaining stones' values in the row. The winner is the one with the higher score when there are no stones left to remove.
-
-
Bob found that he will always lose this game (poor Bob, he always loses), so he decided to minimize the score's difference. Alice's goal is to maximize the difference in the score.
-
-
Given an array of integers stones where stones[i] represents the value of the ith stone from the left, return the difference in Alice and Bob's score if they both play optimally.
-
-
-
Example 1:
-
-
-Input: stones = [5,3,1,4,2]
-Output: 6
-Explanation:
-- Alice removes 2 and gets 5 + 3 + 1 + 4 = 13 points. Alice = 13, Bob = 0, stones = [5,3,1,4].
-- Bob removes 5 and gets 3 + 1 + 4 = 8 points. Alice = 13, Bob = 8, stones = [3,1,4].
-- Alice removes 3 and gets 1 + 4 = 5 points. Alice = 18, Bob = 8, stones = [1,4].
-- Bob removes 1 and gets 4 points. Alice = 18, Bob = 12, stones = [4].
-- Alice removes 4 and gets 0 points. Alice = 18, Bob = 12, stones = [].
-The score difference is 18 - 12 = 6.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Math](../../tag/math/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Game Theory](../../tag/game-theory/README.md)]
-
-### Hints
-
-Hint 1
-The constraints are small enough for an N^2 solution.
-
-
-
-Hint 2
-Try using dynamic programming.
-
diff --git a/problems/stone-game-viii/README.md b/problems/stone-game-viii/README.md
deleted file mode 100644
index 5fa74e2c5..000000000
--- a/problems/stone-game-viii/README.md
+++ /dev/null
@@ -1,91 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../jump-game-vii "Jump Game VII")
-
-[Next >](../calculate-special-bonus "Calculate Special Bonus")
-
-## [1872. Stone Game VIII (Hard)](https://leetcode.com/problems/stone-game-viii "石子游戏 VIII")
-
-
Alice and Bob take turns playing a game, with Alice starting first.
-
-
There are n stones arranged in a row. On each player's turn, while the number of stones is more than one, they will do the following:
-
-
-
Choose an integer x > 1, and remove the leftmost x stones from the row.
-
Add the sum of the removed stones' values to the player's score.
-
Place a new stone, whose value is equal to that sum, on the left side of the row.
-
-
-
The game stops when onlyone stone is left in the row.
-
-
The score difference between Alice and Bob is (Alice's score - Bob's score). Alice's goal is to maximize the score difference, and Bob's goal is the minimize the score difference.
-
-
Given an integer array stones of length n where stones[i] represents the value of the ith stone from the left, return the score difference between Alice and Bob if they both play optimally.
-
-
-
Example 1:
-
-
-Input: stones = [-1,2,-3,4,-5]
-Output: 5
-Explanation:
-- Alice removes the first 4 stones, adds (-1) + 2 + (-3) + 4 = 2 to her score, and places a stone of
- value 2 on the left. stones = [2,-5].
-- Bob removes the first 2 stones, adds 2 + (-5) = -3 to his score, and places a stone of value -3 on
- the left. stones = [-3].
-The difference between their scores is 2 - (-3) = 5.
-
-
-
Example 2:
-
-
-Input: stones = [7,-6,5,10,5,-2,-6]
-Output: 13
-Explanation:
-- Alice removes all stones, adds 7 + (-6) + 5 + 10 + 5 + (-2) + (-6) = 13 to her score, and places a
- stone of value 13 on the left. stones = [13].
-The difference between their scores is 13 - 0 = 13.
-
-
-
Example 3:
-
-
-Input: stones = [-10,-12]
-Output: -22
-Explanation:
-- Alice can only make one move, which is to remove both stones. She adds (-10) + (-12) = -22 to her
- score and places a stone of value -22 on the left. stones = [-22].
-The difference between their scores is (-22) - 0 = -22.
-
-
-
-
Constraints:
-
-
-
n == stones.length
-
2 <= n <= 105
-
-104 <= stones[i] <= 104
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Math](../../tag/math/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Game Theory](../../tag/game-theory/README.md)]
- [[Prefix Sum](../../tag/prefix-sum/README.md)]
-
-### Hints
-
-Hint 1
-Let's note that the only thing that matters is how many stones were removed so we can maintain dp[numberOfRemovedStones]
-
-
-
-Hint 2
-dp[x] = max(sum of all elements up to y - dp[y]) for all y > x
-
diff --git a/problems/stone-game/README.md b/problems/stone-game/README.md
deleted file mode 100644
index 111b11a47..000000000
--- a/problems/stone-game/README.md
+++ /dev/null
@@ -1,57 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../middle-of-the-linked-list "Middle of the Linked List")
-
-[Next >](../nth-magical-number "Nth Magical Number")
-
-## [877. Stone Game (Medium)](https://leetcode.com/problems/stone-game "石子游戏")
-
-
Alice and Bob play a game with piles of stones. There are an even number of piles arranged in a row, and each pile has a positive integer number of stones piles[i].
-
-
The objective of the game is to end with the most stones. The total number of stones across all the piles is odd, so there are no ties.
-
-
Alice and Bob take turns, with Alice starting first. Each turn, a player takes the entire pile of stones either from the beginning or from the end of the row. This continues until there are no more piles left, at which point the person with the most stones wins.
-
-
Assuming Alice and Bob play optimally, return true if Alice wins the game, or false if Bob wins.
-
-
-
Example 1:
-
-
-Input: piles = [5,3,4,5]
-Output: true
-Explanation:
-Alice starts first, and can only take the first 5 or the last 5.
-Say she takes the first 5, so that the row becomes [3, 4, 5].
-If Bob takes 3, then the board is [4, 5], and Alice takes 5 to win with 10 points.
-If Bob takes the last 5, then the board is [3, 4], and Alice takes 4 to win with 9 points.
-This demonstrated that taking the first 5 was a winning move for Alice, so we return true.
-
There is a strange printer with the following two special requirements:
-
-
-
On each turn, the printer will print a solid rectangular pattern of a single color on the grid. This will cover up the existing colors in the rectangle.
-
Once the printer has used a color for the above operation, the same color cannot be used again.
-
-
-
You are given a m x n matrix targetGrid, where targetGrid[row][col] is the color in the position (row, col) of the grid.
-
-
Return true if it is possible to print the matrix targetGrid, otherwise, return false.
-Input: targetGrid = [[1,2,1],[2,1,2],[1,2,1]]
-Output: false
-Explanation: It is impossible to form targetGrid because it is not allowed to print the same color in different turns.
-
-
-
-
Constraints:
-
-
-
m == targetGrid.length
-
n == targetGrid[i].length
-
1 <= m, n <= 60
-
1 <= targetGrid[row][col] <= 60
-
-
-### Related Topics
- [[Graph](../../tag/graph/README.md)]
- [[Topological Sort](../../tag/topological-sort/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
-
-### Hints
-
-Hint 1
-Try thinking in reverse. Given the grid, how can you tell if a colour was painted last?
-
diff --git a/problems/strange-printer/README.md b/problems/strange-printer/README.md
deleted file mode 100644
index c94739d6a..000000000
--- a/problems/strange-printer/README.md
+++ /dev/null
@@ -1,53 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../equal-tree-partition "Equal Tree Partition")
-
-[Next >](../non-decreasing-array "Non-decreasing Array")
-
-## [664. Strange Printer (Hard)](https://leetcode.com/problems/strange-printer "奇怪的打印机")
-
-
There is a strange printer with the following two special properties:
-
-
-
The printer can only print a sequence of the same character each time.
-
At each turn, the printer can print new characters starting from and ending at any place and will cover the original existing characters.
-
-
-
Given a string s, return the minimum number of turns the printer needed to print it.
-
-
-
Example 1:
-
-
-Input: s = "aaabbb"
-Output: 2
-Explanation: Print "aaa" first and then print "bbb".
-
-
-
Example 2:
-
-
-Input: s = "aba"
-Output: 2
-Explanation: Print "aaa" first and then print "b" from the second place of the string, which will cover the existing character 'a'.
-
Design an algorithm that accepts a stream of characters and checks if a suffix of these characters is a string of a given array of strings words.
-
-
For example, if words = ["abc", "xyz"] and the stream added the four characters (one by one) 'a', 'x', 'y', and 'z', your algorithm should detect that the suffix "xyz" of the characters "axyz" matches "xyz" from words.
-
-
Implement the StreamChecker class:
-
-
-
StreamChecker(String[] words) Initializes the object with the strings array words.
-
boolean query(char letter) Accepts a new character from the stream and returns true if any non-empty suffix from the stream forms a word that is in words.
-
-
-
-
Example 1:
-
-
-Input
-["StreamChecker", "query", "query", "query", "query", "query", "query", "query", "query", "query", "query", "query", "query"]
-[[["cd", "f", "kl"]], ["a"], ["b"], ["c"], ["d"], ["e"], ["f"], ["g"], ["h"], ["i"], ["j"], ["k"], ["l"]]
-Output
-[null, false, false, false, true, false, true, false, false, false, false, false, true]
-
-Explanation
-StreamChecker streamChecker = new StreamChecker(["cd", "f", "kl"]);
-streamChecker.query("a"); // return False
-streamChecker.query("b"); // return False
-streamChecker.query("c"); // return False
-streamChecker.query("d"); // return True, because 'cd' is in the wordlist
-streamChecker.query("e"); // return False
-streamChecker.query("f"); // return True, because 'f' is in the wordlist
-streamChecker.query("g"); // return False
-streamChecker.query("h"); // return False
-streamChecker.query("i"); // return False
-streamChecker.query("j"); // return False
-streamChecker.query("k"); // return False
-streamChecker.query("l"); // return True, because 'kl' is in the wordlist
-
-
-
-
Constraints:
-
-
-
1 <= words.length <= 2000
-
1 <= words[i].length <= 2000
-
words[i] consists of lowercase English letters.
-
letter is a lowercase English letter.
-
At most 4 * 104 calls will be made to query.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[String](../../tag/string/README.md)]
- [[Design](../../tag/design/README.md)]
- [[Trie](../../tag/trie/README.md)]
- [[Data Stream](../../tag/data-stream/README.md)]
-
-### Hints
-
-Hint 1
-Put the words into a trie, and manage a set of pointers within that trie.
-
diff --git a/problems/stream-of-characters/stream_of_characters.go b/problems/stream-of-characters/stream_of_characters.go
deleted file mode 100644
index 3206e00cb..000000000
--- a/problems/stream-of-characters/stream_of_characters.go
+++ /dev/null
@@ -1,63 +0,0 @@
-package problem1032
-
-// StreamChecker check letters
-type StreamChecker struct {
- trie *trie
- stream []int8
-}
-
-// Constructor returns StreamChecker
-func Constructor(words []string) StreamChecker {
- m := 0
- t := &trie{}
- for _, w := range words {
- m = max(m, len(w))
- t.insert(w)
- }
- return StreamChecker{
- trie: t,
- stream: make([]int8, 0, 1024),
- }
-}
-
-// Query returns true if letter in words
-func (sc *StreamChecker) Query(letter byte) bool {
- sc.stream = append(sc.stream, int8(letter-'a'))
- n, t := len(sc.stream), sc.trie
- for i := n - 1; i >= 0; i-- {
- index := sc.stream[i]
- if t.next[index] == nil {
- return false
- }
- t = t.next[index]
- if t.isWord {
- return true
- }
- }
- return false
-}
-
-type trie struct {
- next [26]*trie
- isWord bool
-}
-
-func (t *trie) insert(word string) {
- n := len(word)
- // reversely insert
- for i := n - 1; i >= 0; i-- {
- index := int(word[i] - 'a')
- if t.next[index] == nil {
- t.next[index] = &trie{}
- }
- t = t.next[index]
- }
- t.isWord = true
-}
-
-func max(a, b int) int {
- if a > b {
- return a
- }
- return b
-}
diff --git a/problems/string-compression-ii/README.md b/problems/string-compression-ii/README.md
deleted file mode 100644
index 5fb6dc2db..000000000
--- a/problems/string-compression-ii/README.md
+++ /dev/null
@@ -1,73 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../number-of-good-leaf-nodes-pairs "Number of Good Leaf Nodes Pairs")
-
-[Next >](../the-most-recent-three-orders "The Most Recent Three Orders")
-
-## [1531. String Compression II (Hard)](https://leetcode.com/problems/string-compression-ii "压缩字符串 II")
-
-
Run-length encoding is a string compression method that works by replacing consecutive identical characters (repeated 2 or more times) with the concatenation of the character and the number marking the count of the characters (length of the run). For example, to compress the string "aabccc" we replace "aa" by "a2" and replace "ccc" by "c3". Thus the compressed string becomes "a2bc3".
-
-
Notice that in this problem, we are not adding '1' after single characters.
-
-
Given a string s and an integer k. You need to delete at mostk characters from s such that the run-length encoded version of s has minimum length.
-
-
Find the minimum length of the run-length encoded version of s after deleting at most k characters.
-
-
-
Example 1:
-
-
-Input: s = "aaabcccd", k = 2
-Output: 4
-Explanation: Compressing s without deleting anything will give us "a3bc3d" of length 6. Deleting any of the characters 'a' or 'c' would at most decrease the length of the compressed string to 5, for instance delete 2 'a' then we will have s = "abcccd" which compressed is abc3d. Therefore, the optimal way is to delete 'b' and 'd', then the compressed version of s will be "a3c3" of length 4.
-
-
Example 2:
-
-
-Input: s = "aabbaa", k = 2
-Output: 2
-Explanation: If we delete both 'b' characters, the resulting compressed string would be "a4" of length 2.
-
-
-
Example 3:
-
-
-Input: s = "aaaaaaaaaaa", k = 0
-Output: 3
-Explanation: Since k is zero, we cannot delete anything. The compressed string is "a11" of length 3.
-
-
-
-
Constraints:
-
-
-
1 <= s.length <= 100
-
0 <= k <= s.length
-
s contains only lowercase English letters.
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Hints
-
-Hint 1
-Use dynamic programming.
-
-
-
-Hint 2
-The state of the DP can be the current index and the remaining characters to delete.
-
-
-
-Hint 3
-Having a prefix sum for each character can help you determine for a certain character c in some specific range, how many characters you need to delete to merge all occurrences of c in that range.
-
diff --git a/problems/string-compression/README.md b/problems/string-compression/README.md
deleted file mode 100644
index 5c788f044..000000000
--- a/problems/string-compression/README.md
+++ /dev/null
@@ -1,80 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../find-all-duplicates-in-an-array "Find All Duplicates in an Array")
-
-[Next >](../sequence-reconstruction "Sequence Reconstruction")
-
-## [443. String Compression (Medium)](https://leetcode.com/problems/string-compression "压缩字符串")
-
-
Given an array of characters chars, compress it using the following algorithm:
-
-
Begin with an empty string s. For each group of consecutive repeating characters in chars:
-
-
-
If the group's length is 1, append the character to s.
-
Otherwise, append the character followed by the group's length.
-
-
-
The compressed string sshould not be returned separately, but instead, be stored in the input character array chars. Note that group lengths that are 10 or longer will be split into multiple characters in chars.
-
-
After you are done modifying the input array, return the new length of the array.
-You must write an algorithm that uses only constant extra space.
-
-
Example 1:
-
-
-Input: chars = ["a","a","b","b","c","c","c"]
-Output: Return 6, and the first 6 characters of the input array should be: ["a","2","b","2","c","3"]
-Explanation: The groups are "aa", "bb", and "ccc". This compresses to "a2b2c3".
-
-
-
Example 2:
-
-
-Input: chars = ["a"]
-Output: Return 1, and the first character of the input array should be: ["a"]
-Explanation: The only group is "a", which remains uncompressed since it's a single character.
-
-
-
Example 3:
-
-
-Input: chars = ["a","b","b","b","b","b","b","b","b","b","b","b","b"]
-Output: Return 4, and the first 4 characters of the input array should be: ["a","b","1","2"].
-Explanation: The groups are "a" and "bbbbbbbbbbbb". This compresses to "ab12".
-
-
Example 4:
-
-
-Input: chars = ["a","a","a","b","b","a","a"]
-Output: Return 6, and the first 6 characters of the input array should be: ["a","3","b","2","a","2"].
-Explanation: The groups are "aaa", "bb", and "aa". This compresses to "a3b2a2". Note that each group is independent even if two groups have the same character.
-
-
-
-
Constraints:
-
-
-
1 <= chars.length <= 2000
-
chars[i] is a lowercase English letter, uppercase English letter, digit, or symbol.
-
-
-### Related Topics
- [[Two Pointers](../../tag/two-pointers/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Similar Questions
- 1. [Count and Say](../count-and-say) (Medium)
- 1. [Encode and Decode Strings](../encode-and-decode-strings) (Medium)
- 1. [Design Compressed String Iterator](../design-compressed-string-iterator) (Easy)
-
-### Hints
-
-Hint 1
-How do you know if you are at the end of a consecutive group of characters?
-
diff --git a/problems/string-compression/string_compression.go b/problems/string-compression/string_compression.go
deleted file mode 100644
index cc8bfc0eb..000000000
--- a/problems/string-compression/string_compression.go
+++ /dev/null
@@ -1,21 +0,0 @@
-package problem443
-
-import "strconv"
-
-func compress(chars []byte) int {
- ans, anchor, l := 0, 0, len(chars)
- for i, c := range chars {
- if i == l-1 || c != chars[i+1] {
- chars[ans] = chars[anchor]
- ans++
- if i > anchor {
- for _, n := range strconv.Itoa(i - anchor + 1) {
- chars[ans] = byte(n)
- ans++
- }
- }
- anchor = i + 1
- }
- }
- return ans
-}
diff --git a/problems/string-compression/string_compression_test.go b/problems/string-compression/string_compression_test.go
deleted file mode 100644
index c813ef387..000000000
--- a/problems/string-compression/string_compression_test.go
+++ /dev/null
@@ -1,38 +0,0 @@
-package problem443
-
-import (
- "reflect"
- "testing"
-)
-
-type testType struct {
- in []byte
- want []byte
-}
-
-func TestCompress(t *testing.T) {
- tests := [...]testType{
- {
- in: []byte{'a', 'a', 'b', 'b', 'c', 'c', 'c'},
- want: []byte{'a', '2', 'b', '2', 'c', '3'},
- },
- {
- in: []byte{'a'},
- want: []byte{'a'},
- },
- {
- in: []byte{'a', 'a'},
- want: []byte{'a', '2'},
- },
- {
- in: []byte{'a', 'b', 'b', 'b', 'b', 'b', 'b', 'b', 'b', 'b', 'b', 'b', 'b'},
- want: []byte{'a', 'b', '1', '2'},
- },
- }
- for _, tt := range tests {
- l := compress(tt.in)
- if !reflect.DeepEqual(tt.in[:l], tt.want) {
- t.Fatalf("in: %v, got: %v, want: %v", tt.in, l, tt.want)
- }
- }
-}
diff --git a/problems/string-matching-in-an-array/README.md b/problems/string-matching-in-an-array/README.md
deleted file mode 100644
index 0465ce113..000000000
--- a/problems/string-matching-in-an-array/README.md
+++ /dev/null
@@ -1,61 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../top-travellers "Top Travellers")
-
-[Next >](../queries-on-a-permutation-with-key "Queries on a Permutation With Key")
-
-## [1408. String Matching in an Array (Easy)](https://leetcode.com/problems/string-matching-in-an-array "数组中的字符串匹配")
-
-
Given an array of string words. Return all strings in words which is substring of another word in any order.
-
-
String words[i] is substring of words[j], if can be obtained removing some characters to left and/or right side of words[j].
-
-
-
Example 1:
-
-
-Input: words = ["mass","as","hero","superhero"]
-Output: ["as","hero"]
-Explanation: "as" is substring of "mass" and "hero" is substring of "superhero".
-["hero","as"] is also a valid answer.
-
-
-
Example 2:
-
-
-Input: words = ["leetcode","et","code"]
-Output: ["et","code"]
-Explanation: "et", "code" are substring of "leetcode".
-
-
-
Example 3:
-
-
-Input: words = ["blue","green","bu"]
-Output: []
-
-
-
-
Constraints:
-
-
-
1 <= words.length <= 100
-
1 <= words[i].length <= 30
-
words[i] contains only lowercase English letters.
-
It's guaranteed that words[i] will be unique.
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
- [[String Matching](../../tag/string-matching/README.md)]
-
-### Hints
-
-Hint 1
-Bruteforce to find if one string is substring of another or use KMP algorithm.
-
diff --git a/problems/string-matching-in-an-array/string_matching_in_an_array.go b/problems/string-matching-in-an-array/string_matching_in_an_array.go
deleted file mode 100644
index c39f42ee7..000000000
--- a/problems/string-matching-in-an-array/string_matching_in_an_array.go
+++ /dev/null
@@ -1,16 +0,0 @@
-package problem1408
-
-import "strings"
-
-func stringMatching(words []string) []string {
- var ans []string
- for _, word := range words {
- for _, val := range words {
- if val != word && strings.Contains(val, word) {
- ans = append(ans, word)
- break
- }
- }
- }
- return ans
-}
diff --git a/problems/string-matching-in-an-array/string_matching_in_an_array_test.go b/problems/string-matching-in-an-array/string_matching_in_an_array_test.go
deleted file mode 100644
index 00659ab4a..000000000
--- a/problems/string-matching-in-an-array/string_matching_in_an_array_test.go
+++ /dev/null
@@ -1,34 +0,0 @@
-package problem1408
-
-import (
- "reflect"
- "testing"
-)
-
-type testType struct {
- in []string
- want []string
-}
-
-func TestStringMatching(t *testing.T) {
- tests := [...]testType{
- {
- in: []string{"mass", "as", "hero", "superhero"},
- want: []string{"as", "hero"},
- },
- {
- in: []string{"leetcode", "et", "code"},
- want: []string{"et", "code"},
- },
- {
- in: []string{"blue", "green", "bu"},
- want: nil,
- },
- }
- for _, tt := range tests {
- got := stringMatching(tt.in)
- if !reflect.DeepEqual(got, tt.want) {
- t.Fatalf("in: %v, got: %v, want: %v", tt.in, got, tt.want)
- }
- }
-}
diff --git a/problems/string-to-integer-atoi/README.md b/problems/string-to-integer-atoi/README.md
deleted file mode 100644
index fc45cb209..000000000
--- a/problems/string-to-integer-atoi/README.md
+++ /dev/null
@@ -1,97 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../reverse-integer "Reverse Integer")
-
-[Next >](../palindrome-number "Palindrome Number")
-
-## [8. String to Integer (atoi) (Medium)](https://leetcode.com/problems/string-to-integer-atoi "字符串转换整数 (atoi)")
-
-
Implement the myAtoi(string s) function, which converts a string to a 32-bit signed integer (similar to C/C++'s atoi function).
-
-
The algorithm for myAtoi(string s) is as follows:
-
-
-
Read in and ignore any leading whitespace.
-
Check if the next character (if not already at the end of the string) is '-' or '+'. Read this character in if it is either. This determines if the final result is negative or positive respectively. Assume the result is positive if neither is present.
-
Read in next the characters until the next non-digit character or the end of the input is reached. The rest of the string is ignored.
-
Convert these digits into an integer (i.e. "123" -> 123, "0032" -> 32). If no digits were read, then the integer is 0. Change the sign as necessary (from step 2).
-
If the integer is out of the 32-bit signed integer range [-231, 231 - 1], then clamp the integer so that it remains in the range. Specifically, integers less than -231 should be clamped to -231, and integers greater than 231 - 1 should be clamped to 231 - 1.
-
Return the integer as the final result.
-
-
-
Note:
-
-
-
Only the space character ' ' is considered a whitespace character.
-
Do not ignore any characters other than the leading whitespace or the rest of the string after the digits.
-
-
-
-
Example 1:
-
-
-Input: s = "42"
-Output: 42
-Explanation: The underlined characters are what is read in, the caret is the current reader position.
-Step 1: "42" (no characters read because there is no leading whitespace)
- ^
-Step 2: "42" (no characters read because there is neither a '-' nor '+')
- ^
-Step 3: "42" ("42" is read in)
- ^
-The parsed integer is 42.
-Since 42 is in the range [-231, 231 - 1], the final result is 42.
-
-
-
Example 2:
-
-
-Input: s = " -42"
-Output: -42
-Explanation:
-Step 1: "-42" (leading whitespace is read and ignored)
- ^
-Step 2: " -42" ('-' is read, so the result should be negative)
- ^
-Step 3: " -42" ("42" is read in)
- ^
-The parsed integer is -42.
-Since -42 is in the range [-231, 231 - 1], the final result is -42.
-
-
-
Example 3:
-
-
-Input: s = "4193 with words"
-Output: 4193
-Explanation:
-Step 1: "4193 with words" (no characters read because there is no leading whitespace)
- ^
-Step 2: "4193 with words" (no characters read because there is neither a '-' nor '+')
- ^
-Step 3: "4193 with words" ("4193" is read in; reading stops because the next character is a non-digit)
- ^
-The parsed integer is 4193.
-Since 4193 is in the range [-231, 231 - 1], the final result is 4193.
-
-
-
-
Constraints:
-
-
-
0 <= s.length <= 200
-
s consists of English letters (lower-case and upper-case), digits (0-9), ' ', '+', '-', and '.'.
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
-
-### Similar Questions
- 1. [Reverse Integer](../reverse-integer) (Medium)
- 1. [Valid Number](../valid-number) (Hard)
- 1. [Check if Numbers Are Ascending in a Sentence](../check-if-numbers-are-ascending-in-a-sentence) (Easy)
diff --git a/problems/string-to-integer-atoi/string_to_integer_atoi.go b/problems/string-to-integer-atoi/string_to_integer_atoi.go
deleted file mode 100644
index 11c397dfb..000000000
--- a/problems/string-to-integer-atoi/string_to_integer_atoi.go
+++ /dev/null
@@ -1,30 +0,0 @@
-package problem8
-
-import (
- "math"
- "strconv"
- "strings"
- "unicode"
-)
-
-func myAtoi(str string) int {
- str = strings.TrimSpace(str)
- prefix := ""
- if strings.HasPrefix(str, "-") || strings.HasPrefix(str, "+") {
- prefix = str[0:1]
- str = str[1:]
- }
- i := strings.IndexFunc(str, func(r rune) bool {
- return !unicode.IsDigit(r)
- })
- if i > -1 {
- str = str[0:i]
- }
- r, _ := strconv.Atoi(prefix + str)
- if r < math.MinInt32 {
- r = math.MinInt32
- } else if r > math.MaxInt32 {
- r = math.MaxInt32
- }
- return r
-}
diff --git a/problems/string-to-integer-atoi/string_to_integer_atoi_test.go b/problems/string-to-integer-atoi/string_to_integer_atoi_test.go
deleted file mode 100644
index 3e37dbd11..000000000
--- a/problems/string-to-integer-atoi/string_to_integer_atoi_test.go
+++ /dev/null
@@ -1,30 +0,0 @@
-package problem8
-
-import (
- "math"
- "testing"
-)
-
-func TestMyAtoi(t *testing.T) {
- tests := map[string]int{
- " ": 0,
- "42": 42,
- "+123": 123,
- "+123 +": 123,
- "++123": 0,
- " -42 ": -42,
- " -123-": -123,
- "--321": 0,
- "4193 with words": 4193,
- "words and 987": 0,
- "-91283472332": math.MinInt32,
- "9876543210": math.MaxInt32,
- }
-
- for in, want := range tests {
- got := myAtoi(in)
- if got != want {
- t.Fatalf("in: %v, got: %v, want: %v", in, got, want)
- }
- }
-}
diff --git a/problems/string-transforms-into-another-string/README.md b/problems/string-transforms-into-another-string/README.md
deleted file mode 100644
index 4e1724a91..000000000
--- a/problems/string-transforms-into-another-string/README.md
+++ /dev/null
@@ -1,80 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../analyze-user-website-visit-pattern "Analyze User Website Visit Pattern")
-
-[Next >](../day-of-the-year "Day of the Year")
-
-## [1153. String Transforms Into Another String (Hard)](https://leetcode.com/problems/string-transforms-into-another-string "字符串转化")
-
-
Given two strings str1 and str2 of the same length, determine whether you can transform str1 into str2 by doing zero or moreconversions.
-
-
In one conversion you can convert all occurrences of one character in str1 to any other lowercase English character.
-
-
Return true if and only if you can transform str1 into str2.
-
-
-
-
Example 1:
-
-
-Input: str1 = "aabcc", str2 = "ccdee"
-Output: true
-Explanation: Convert 'c' to 'e' then 'b' to 'd' then 'a' to 'c'. Note that the order of conversions matter.
-
-
-
Example 2:
-
-
-Input: str1 = "leetcode", str2 = "codeleet"
-Output: false
-Explanation: There is no way to transform str1 to str2.
-
-
-
-
-
Note:
-
-
-
1 <= str1.length == str2.length <= 10^4
-
Both str1 and str2 contain only lowercase English letters.
-
-
-### Related Topics
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Hints
-
-Hint 1
-Model the problem as a graph problem. Add an edge from one character to another if you need to convert between them.
-
-
-
-Hint 2
-What if one character needs to be converted into more than one character?
-
-
-
-Hint 3
-There would be no solution. Thus, every node can have at most one outgoing edge.
-
-
-
-Hint 4
-How to process a linked list?
-
-
-
-Hint 5
-How to process a cycle?
-
-
-
-Hint 6
-What if there is a character with no outgoing edge? You can use it to break all cycles!
-
diff --git a/problems/string-without-aaa-or-bbb/README.md b/problems/string-without-aaa-or-bbb/README.md
deleted file mode 100644
index 1c7037275..000000000
--- a/problems/string-without-aaa-or-bbb/README.md
+++ /dev/null
@@ -1,48 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-cost-for-tickets "Minimum Cost For Tickets")
-
-[Next >](../sum-of-even-numbers-after-queries "Sum of Even Numbers After Queries")
-
-## [984. String Without AAA or BBB (Medium)](https://leetcode.com/problems/string-without-aaa-or-bbb "不含 AAA 或 BBB 的字符串")
-
-
Given two integers a and b, return any string s such that:
-
-
-
s has length a + b and contains exactly a'a' letters, and exactly b'b' letters,
-
The substring 'aaa' does not occur in s, and
-
The substring 'bbb' does not occur in s.
-
-
-
-
Example 1:
-
-
-Input: a = 1, b = 2
-Output: "abb"
-Explanation: "abb", "bab" and "bba" are all correct answers.
-
-
-
Example 2:
-
-
-Input: a = 4, b = 1
-Output: "aabaa"
-
-
-
-
Constraints:
-
-
-
0 <= a, b <= 100
-
It is guaranteed such an s exists for the given a and b.
-
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[String](../../tag/string/README.md)]
diff --git a/problems/string-without-aaa-or-bbb/string_without_aaa_or_bbb.go b/problems/string-without-aaa-or-bbb/string_without_aaa_or_bbb.go
deleted file mode 100644
index 67e34b083..000000000
--- a/problems/string-without-aaa-or-bbb/string_without_aaa_or_bbb.go
+++ /dev/null
@@ -1,15 +0,0 @@
-package problem984
-
-func strWithout3a3b(A int, B int) string {
- str, ac, bc := "", 0, 0
- for A > 0 || B > 0 {
- if A > B && ac < 2 || bc == 2 {
- str += "a"
- A, ac, bc = A-1, ac+1, 0
- } else {
- str += "b"
- B, ac, bc = B-1, 0, bc+1
- }
- }
- return str
-}
diff --git a/problems/string-without-aaa-or-bbb/string_without_aaa_or_bbb_test.go b/problems/string-without-aaa-or-bbb/string_without_aaa_or_bbb_test.go
deleted file mode 100644
index ad4625d85..000000000
--- a/problems/string-without-aaa-or-bbb/string_without_aaa_or_bbb_test.go
+++ /dev/null
@@ -1,40 +0,0 @@
-package problem984
-
-import "testing"
-
-type testType struct {
- a int
- b int
- want string
-}
-
-func TestStrWithout3a3b(t *testing.T) {
- tests := [...]testType{
- {
- a: 6,
- b: 2,
- want: "aabaabaa",
- },
- {
- a: 2,
- b: 6,
- want: "bbabbabb",
- },
- {
- a: 1,
- b: 2,
- want: "bba",
- },
- {
- a: 4,
- b: 1,
- want: "aabaa",
- },
- }
- for _, tt := range tests {
- got := strWithout3a3b(tt.a, tt.b)
- if got != tt.want {
- t.Fatalf("in: %v %v, got: %v, want: %v", tt.a, tt.b, got, tt.want)
- }
- }
-}
diff --git a/problems/strings-differ-by-one-character/README.md b/problems/strings-differ-by-one-character/README.md
deleted file mode 100644
index 497638a14..000000000
--- a/problems/strings-differ-by-one-character/README.md
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-number-of-days-to-eat-n-oranges "Minimum Number of Days to Eat N Oranges")
-
-[Next >](../bank-account-summary "Bank Account Summary")
-
-## [1554. Strings Differ by One Character (Medium)](https://leetcode.com/problems/strings-differ-by-one-character "只有一个不同字符的字符串")
-
-
-
-### Related Topics
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
- [[Hash Function](../../tag/hash-function/README.md)]
- [[Rolling Hash](../../tag/rolling-hash/README.md)]
-
-### Hints
-
-Hint 1
-BruteForce, check all pairs and verify if they differ in one character. O(n^2 * m) where n is the number of words and m is the length of each string.
-
-
-
-Hint 2
-O(m^2 * n), Use hashset, to insert all possible combinations adding a character "*". For example: If dict[i] = "abc", insert ("*bc", "a*c" and "ab*").
-
diff --git a/problems/strobogrammatic-number-ii/README.md b/problems/strobogrammatic-number-ii/README.md
deleted file mode 100644
index b6bd42690..000000000
--- a/problems/strobogrammatic-number-ii/README.md
+++ /dev/null
@@ -1,39 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../strobogrammatic-number "Strobogrammatic Number")
-
-[Next >](../strobogrammatic-number-iii "Strobogrammatic Number III")
-
-## [247. Strobogrammatic Number II (Medium)](https://leetcode.com/problems/strobogrammatic-number-ii "中心对称数 II")
-
-
A strobogrammatic number is a number that looks the same when rotated 180 degrees (looked at upside down).
-
-
Find all strobogrammatic numbers that are of length = n.
-
-
Example:
-
-
-Input: n = 2
-Output:["11","69","88","96"]
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[String](../../tag/string/README.md)]
- [[Recursion](../../tag/recursion/README.md)]
-
-### Similar Questions
- 1. [Strobogrammatic Number](../strobogrammatic-number) (Easy)
- 1. [Strobogrammatic Number III](../strobogrammatic-number-iii) (Hard)
- 1. [Sum of k-Mirror Numbers](../sum-of-k-mirror-numbers) (Hard)
-
-### Hints
-
-Hint 1
-Try to use recursion and notice that it should recurse with n - 2 instead of n - 1.
-
diff --git a/problems/strobogrammatic-number-ii/strobogrammatic_number_ii.go b/problems/strobogrammatic-number-ii/strobogrammatic_number_ii.go
deleted file mode 100644
index 26ac73433..000000000
--- a/problems/strobogrammatic-number-ii/strobogrammatic_number_ii.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem247
diff --git a/problems/strobogrammatic-number-ii/strobogrammatic_number_ii_test.go b/problems/strobogrammatic-number-ii/strobogrammatic_number_ii_test.go
deleted file mode 100644
index 26ac73433..000000000
--- a/problems/strobogrammatic-number-ii/strobogrammatic_number_ii_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem247
diff --git a/problems/strobogrammatic-number-iii/README.md b/problems/strobogrammatic-number-iii/README.md
deleted file mode 100644
index 6ba33e54b..000000000
--- a/problems/strobogrammatic-number-iii/README.md
+++ /dev/null
@@ -1,35 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../strobogrammatic-number-ii "Strobogrammatic Number II")
-
-[Next >](../group-shifted-strings "Group Shifted Strings")
-
-## [248. Strobogrammatic Number III (Hard)](https://leetcode.com/problems/strobogrammatic-number-iii "中心对称数 III")
-
-
A strobogrammatic number is a number that looks the same when rotated 180 degrees (looked at upside down).
-
-
Write a function to count the total strobogrammatic numbers that exist in the range of low <= num <= high.
-
-
Example:
-
-
-Input: low = "50", high = "100"
-Output: 3
-Explanation: 69, 88, and 96 are three strobogrammatic numbers.
-
-
Note:
-Because the range might be a large number, the low and high numbers are represented as string.
You are given a string s representing an attendance record for a student where each character signifies whether the student was absent, late, or present on that day. The record only contains the following three characters:
-
-
-
'A': Absent.
-
'L': Late.
-
'P': Present.
-
-
-
The student is eligible for an attendance award if they meet both of the following criteria:
-
-
-
The student was absent ('A') for strictly fewer than 2 days total.
-
The student was never late ('L') for 3 or more consecutive days.
-
-
-
Return true if the student is eligible for an attendance award, or false otherwise.
-
-
-
Example 1:
-
-
-Input: s = "PPALLP"
-Output: true
-Explanation: The student has fewer than 2 absences and was never late 3 or more consecutive days.
-
-
-
Example 2:
-
-
-Input: s = "PPALLL"
-Output: false
-Explanation: The student was late 3 consecutive days in the last 3 days, so is not eligible for the award.
-
An attendance record for a student can be represented as a string where each character signifies whether the student was absent, late, or present on that day. The record only contains the following three characters:
-
-
-
'A': Absent.
-
'L': Late.
-
'P': Present.
-
-
-
Any student is eligible for an attendance award if they meet both of the following criteria:
-
-
-
The student was absent ('A') for strictly fewer than 2 days total.
-
The student was never late ('L') for 3 or more consecutive days.
-
-
-
Given an integer n, return the number of possible attendance records of lengthn that make a student eligible for an attendance award. The answer may be very large, so return it modulo109 + 7.
-
-
-
Example 1:
-
-
-Input: n = 2
-Output: 8
-Explanation: There are 8 records with length 2 that are eligible for an award:
-"PP", "AP", "PA", "LP", "PL", "AL", "LA", "LL"
-Only "AA" is not eligible because there are 2 absences (there need to be fewer than 2).
-
-
-
Example 2:
-
-
-Input: n = 1
-Output: 3
-
-
-
Example 3:
-
-
-Input: n = 10101
-Output: 183236316
-
-
-
-
Constraints:
-
-
-
1 <= n <= 105
-
-
-### Related Topics
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Similar Questions
- 1. [Student Attendance Record I](../student-attendance-record-i) (Easy)
diff --git a/problems/student-attendance-record-ii/student_attendance_record_ii.go b/problems/student-attendance-record-ii/student_attendance_record_ii.go
deleted file mode 100644
index d11f8ac56..000000000
--- a/problems/student-attendance-record-ii/student_attendance_record_ii.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem552
diff --git a/problems/student-attendance-record-ii/student_attendance_record_ii_test.go b/problems/student-attendance-record-ii/student_attendance_record_ii_test.go
deleted file mode 100644
index d11f8ac56..000000000
--- a/problems/student-attendance-record-ii/student_attendance_record_ii_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem552
diff --git a/problems/students-and-examinations/README.md b/problems/students-and-examinations/README.md
deleted file mode 100644
index e9b327fe4..000000000
--- a/problems/students-and-examinations/README.md
+++ /dev/null
@@ -1,114 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../traffic-light-controlled-intersection "Traffic Light Controlled Intersection")
-
-[Next >](../subtract-the-product-and-sum-of-digits-of-an-integer "Subtract the Product and Sum of Digits of an Integer")
-
-## [1280. Students and Examinations (Easy)](https://leetcode.com/problems/students-and-examinations "学生们参加各科测试的次数")
-
-
Table: Students
-
-+---------------+---------+
-| Column Name | Type |
-+---------------+---------+
-| student_id | int |
-| student_name | varchar |
-+---------------+---------+
-student_id is the primary key for this table.
-Each row of this table contains the ID and the name of one student in the school.
-
-
-
Table: Subjects
-
-+--------------+---------+
-| Column Name | Type |
-+--------------+---------+
-| subject_name | varchar |
-+--------------+---------+
-subject_name is the primary key for this table.
-Each row of this table contains a name of one subject in the school.
-
-
-
Table: Examinations
-
-+--------------+---------+
-| Column Name | Type |
-+--------------+---------+
-| student_id | int |
-| subject_name | varchar |
-+--------------+---------+
-There is no primary key for this table. It may contain duplicates.
-Each student from Students table takes every course from Subjects table.
-Each row of this table indicates that a student with ID student_id attended the exam of subject_name.
-
-
-Write an SQL query to find the number of times each student attended each exam.
-
-Order the result table by student_id and subject_name.
-
-The query result format is in the following example:
-
-Students table:
-+------------+--------------+
-| student_id | student_name |
-+------------+--------------+
-| 1 | Alice |
-| 2 | Bob |
-| 13 | John |
-| 6 | Alex |
-+------------+--------------+
-Subjects table:
-+--------------+
-| subject_name |
-+--------------+
-| Math |
-| Physics |
-| Programming |
-+--------------+
-Examinations table:
-+------------+--------------+
-| student_id | subject_name |
-+------------+--------------+
-| 1 | Math |
-| 1 | Physics |
-| 1 | Programming |
-| 2 | Programming |
-| 1 | Physics |
-| 1 | Math |
-| 13 | Math |
-| 13 | Programming |
-| 13 | Physics |
-| 2 | Math |
-| 1 | Math |
-+------------+--------------+
-Result table:
-+------------+--------------+--------------+----------------+
-| student_id | student_name | subject_name | attended_exams |
-+------------+--------------+--------------+----------------+
-| 1 | Alice | Math | 3 |
-| 1 | Alice | Physics | 2 |
-| 1 | Alice | Programming | 1 |
-| 2 | Bob | Math | 1 |
-| 2 | Bob | Physics | 0 |
-| 2 | Bob | Programming | 1 |
-| 6 | Alex | Math | 0 |
-| 6 | Alex | Physics | 0 |
-| 6 | Alex | Programming | 0 |
-| 13 | John | Math | 1 |
-| 13 | John | Physics | 1 |
-| 13 | John | Programming | 1 |
-+------------+--------------+--------------+----------------+
-The result table should contain all students and all subjects.
-Alice attended Math exam 3 times, Physics exam 2 times and Programming exam 1 time.
-Bob attended Math exam 1 time, Programming exam 1 time and didn't attend the Physics exam.
-Alex didn't attend any exam.
-John attended Math exam 1 time, Physics exam 1 time and Programming exam 1 time.
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/students-and-examinations/mysql_schemas.sql b/problems/students-and-examinations/mysql_schemas.sql
deleted file mode 100644
index 4664a44c1..000000000
--- a/problems/students-and-examinations/mysql_schemas.sql
+++ /dev/null
@@ -1,24 +0,0 @@
-Create table If Not Exists Students (student_id int, student_name varchar(20));
-Create table If Not Exists Subjects (subject_name varchar(20));
-Create table If Not Exists Examinations (student_id int, subject_name varchar(20));
-Truncate table Students;
-insert into Students (student_id, student_name) values ('1', 'Alice');
-insert into Students (student_id, student_name) values ('2', 'Bob');
-insert into Students (student_id, student_name) values ('13', 'John');
-insert into Students (student_id, student_name) values ('6', 'Alex');
-Truncate table Subjects;
-insert into Subjects (subject_name) values ('Math');
-insert into Subjects (subject_name) values ('Physics');
-insert into Subjects (subject_name) values ('Programming');
-Truncate table Examinations;
-insert into Examinations (student_id, subject_name) values ('1', 'Math');
-insert into Examinations (student_id, subject_name) values ('1', 'Physics');
-insert into Examinations (student_id, subject_name) values ('1', 'Programming');
-insert into Examinations (student_id, subject_name) values ('2', 'Programming');
-insert into Examinations (student_id, subject_name) values ('1', 'Physics');
-insert into Examinations (student_id, subject_name) values ('1', 'Math');
-insert into Examinations (student_id, subject_name) values ('13', 'Math');
-insert into Examinations (student_id, subject_name) values ('13', 'Programming');
-insert into Examinations (student_id, subject_name) values ('13', 'Physics');
-insert into Examinations (student_id, subject_name) values ('2', 'Math');
-insert into Examinations (student_id, subject_name) values ('1', 'Math');
diff --git a/problems/students-report-by-geography/README.md b/problems/students-report-by-geography/README.md
deleted file mode 100644
index 1d661e8f6..000000000
--- a/problems/students-report-by-geography/README.md
+++ /dev/null
@@ -1,47 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../merge-two-binary-trees "Merge Two Binary Trees")
-
-[Next >](../biggest-single-number "Biggest Single Number")
-
-## [618. Students Report By Geography (Hard)](https://leetcode.com/problems/students-report-by-geography "学生地理信息报告")
-
-A U.S graduate school has students from Asia, Europe and America. The students' location information are stored in table student as below.
-
-
-
-| name | continent |
-|--------|-----------|
-| Jack | America |
-| Pascal | Europe |
-| Xi | Asia |
-| Jane | America |
-
-
-
- Pivot the continent column in this table so that each name is sorted alphabetically and displayed underneath its corresponding continent. The output headers should be America, Asia and Europe respectively. It is guaranteed that the student number from America is no less than either Asia or Europe.
-
-
-For the sample input, the output is:
-
-
-
-
-| America | Asia | Europe |
-|---------|------|--------|
-| Jack | Xi | Pascal |
-| Jane | | |
-
-
-
-Follow-up: If it is unknown which continent has the most students, can you write a query to generate the student report?
-
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/students-report-by-geography/mysql_schemas.sql b/problems/students-report-by-geography/mysql_schemas.sql
deleted file mode 100644
index 271a37487..000000000
--- a/problems/students-report-by-geography/mysql_schemas.sql
+++ /dev/null
@@ -1,6 +0,0 @@
-Create table If Not Exists Student (name varchar(50), continent varchar(7));
-Truncate table Student;
-insert into Student (name, continent) values ('Jane', 'America');
-insert into Student (name, continent) values ('Pascal', 'Europe');
-insert into Student (name, continent) values ('Xi', 'Asia');
-insert into Student (name, continent) values ('Jack', 'America');
diff --git a/problems/students-report-by-geography/students_report_by_geography.sql b/problems/students-report-by-geography/students_report_by_geography.sql
deleted file mode 100644
index 1c99109b1..000000000
--- a/problems/students-report-by-geography/students_report_by_geography.sql
+++ /dev/null
@@ -1,29 +0,0 @@
-# Write your MySQL query statement below
-
-SELECT
- America, Asia, Europe
-FROM
- (SELECT @as:=0, @am:=0, @eu:=0) t,
- (SELECT
- @as:=@as + 1 AS asid, name AS Asia
- FROM
- student
- WHERE
- continent = 'Asia'
- ORDER BY Asia) AS t1
- RIGHT JOIN
- (SELECT
- @am:=@am + 1 AS amid, name AS America
- FROM
- student
- WHERE
- continent = 'America'
- ORDER BY America) AS t2 ON asid = amid
- LEFT JOIN
- (SELECT
- @eu:=@eu + 1 AS euid, name AS Europe
- FROM
- student
- WHERE
- continent = 'Europe'
- ORDER BY Europe) AS t3 ON amid = euid;
diff --git a/problems/students-with-invalid-departments/README.md b/problems/students-with-invalid-departments/README.md
deleted file mode 100644
index ea308e0fa..000000000
--- a/problems/students-with-invalid-departments/README.md
+++ /dev/null
@@ -1,84 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-students-taking-exam "Maximum Students Taking Exam")
-
-[Next >](../count-negative-numbers-in-a-sorted-matrix "Count Negative Numbers in a Sorted Matrix")
-
-## [1350. Students With Invalid Departments (Easy)](https://leetcode.com/problems/students-with-invalid-departments "院系无效的学生")
-
-
Table: Departments
-
-+---------------+---------+
-| Column Name | Type |
-+---------------+---------+
-| id | int |
-| name | varchar |
-+---------------+---------+
-id is the primary key of this table.
-The table has information about the id of each department of a university.
-
-
-
Table: Students
-
-+---------------+---------+
-| Column Name | Type |
-+---------------+---------+
-| id | int |
-| name | varchar |
-| department_id | int |
-+---------------+---------+
-id is the primary key of this table.
-The table has information about the id of each student at a university and the id of the department he/she studies at.
-
-
-Write an SQL query to find the id and the name of all students who are enrolled in departments that no longer exists.
-
-Return the result table in any order.
-
-The query result format is in the following example:
-
-Departments table:
-+------+--------------------------+
-| id | name |
-+------+--------------------------+
-| 1 | Electrical Engineering |
-| 7 | Computer Engineering |
-| 13 | Bussiness Administration |
-+------+--------------------------+
-
-Students table:
-+------+----------+---------------+
-| id | name | department_id |
-+------+----------+---------------+
-| 23 | Alice | 1 |
-| 1 | Bob | 7 |
-| 5 | Jennifer | 13 |
-| 2 | John | 14 |
-| 4 | Jasmine | 77 |
-| 3 | Steve | 74 |
-| 6 | Luis | 1 |
-| 8 | Jonathan | 7 |
-| 7 | Daiana | 33 |
-| 11 | Madelynn | 1 |
-+------+----------+---------------+
-
-Result table:
-+------+----------+
-| id | name |
-+------+----------+
-| 2 | John |
-| 7 | Daiana |
-| 4 | Jasmine |
-| 3 | Steve |
-+------+----------+
-
-John, Daiana, Steve and Jasmine are enrolled in departments 14, 33, 74 and 77 respectively. department 14, 33, 74 and 77 doesn't exist in the Departments table.
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/students-with-invalid-departments/mysql_schemas.sql b/problems/students-with-invalid-departments/mysql_schemas.sql
deleted file mode 100644
index 3f3e4af12..000000000
--- a/problems/students-with-invalid-departments/mysql_schemas.sql
+++ /dev/null
@@ -1,17 +0,0 @@
-Create table If Not Exists Departments (id int, name varchar(30));
-Create table If Not Exists Students (id int, name varchar(30), department_id int);
-Truncate table Departments;
-insert into Departments (id, name) values ('1', 'Electrical Engineering');
-insert into Departments (id, name) values ('7', 'Computer Engineering');
-insert into Departments (id, name) values ('13', 'Bussiness Administration');
-Truncate table Students;
-insert into Students (id, name, department_id) values ('23', 'Alice', '1');
-insert into Students (id, name, department_id) values ('1', 'Bob', '7');
-insert into Students (id, name, department_id) values ('5', 'Jennifer', '13');
-insert into Students (id, name, department_id) values ('2', 'John', '14');
-insert into Students (id, name, department_id) values ('4', 'Jasmine', '77');
-insert into Students (id, name, department_id) values ('3', 'Steve', '74');
-insert into Students (id, name, department_id) values ('6', 'Luis', '1');
-insert into Students (id, name, department_id) values ('8', 'Jonathan', '7');
-insert into Students (id, name, department_id) values ('7', 'Daiana', '33');
-insert into Students (id, name, department_id) values ('11', 'Madelynn', '1');
diff --git a/problems/subarray-product-less-than-k/README.md b/problems/subarray-product-less-than-k/README.md
deleted file mode 100644
index 3597aca60..000000000
--- a/problems/subarray-product-less-than-k/README.md
+++ /dev/null
@@ -1,57 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-ascii-delete-sum-for-two-strings "Minimum ASCII Delete Sum for Two Strings")
-
-[Next >](../best-time-to-buy-and-sell-stock-with-transaction-fee "Best Time to Buy and Sell Stock with Transaction Fee")
-
-## [713. Subarray Product Less Than K (Medium)](https://leetcode.com/problems/subarray-product-less-than-k "乘积小于K的子数组")
-
-
Given an array of integers nums and an integer k, return the number of contiguous subarrays where the product of all the elements in the subarray is strictly less than k.
-
-
-
Example 1:
-
-
-Input: nums = [10,5,2,6], k = 100
-Output: 8
-Explanation: The 8 subarrays that have product less than 100 are:
-[10], [5], [2], [6], [10, 5], [5, 2], [2, 6], [5, 2, 6]
-Note that [10, 5, 2] is not included as the product of 100 is not strictly less than k.
-
-
-
Example 2:
-
-
-Input: nums = [1,2,3], k = 0
-Output: 0
-
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 3 * 104
-
1 <= nums[i] <= 1000
-
0 <= k <= 106
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Sliding Window](../../tag/sliding-window/README.md)]
-
-### Similar Questions
- 1. [Maximum Product Subarray](../maximum-product-subarray) (Medium)
- 1. [Maximum Size Subarray Sum Equals k](../maximum-size-subarray-sum-equals-k) (Medium)
- 1. [Subarray Sum Equals K](../subarray-sum-equals-k) (Medium)
- 1. [Two Sum Less Than K](../two-sum-less-than-k) (Easy)
-
-### Hints
-
-Hint 1
-For each j, let opt(j) be the smallest i so that nums[i] * nums[i+1] * ... * nums[j] is less than k. opt is an increasing function.
-
diff --git a/problems/subarray-product-less-than-k/subarray_product_less_than_k.go b/problems/subarray-product-less-than-k/subarray_product_less_than_k.go
deleted file mode 100644
index f7b836b8a..000000000
--- a/problems/subarray-product-less-than-k/subarray_product_less_than_k.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem713
diff --git a/problems/subarray-product-less-than-k/subarray_product_less_than_k_test.go b/problems/subarray-product-less-than-k/subarray_product_less_than_k_test.go
deleted file mode 100644
index f7b836b8a..000000000
--- a/problems/subarray-product-less-than-k/subarray_product_less_than_k_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem713
diff --git a/problems/subarray-sum-equals-k/README.md b/problems/subarray-sum-equals-k/README.md
deleted file mode 100644
index c2756c8bc..000000000
--- a/problems/subarray-sum-equals-k/README.md
+++ /dev/null
@@ -1,67 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-depth-of-n-ary-tree "Maximum Depth of N-ary Tree")
-
-[Next >](../array-partition-i "Array Partition I")
-
-## [560. Subarray Sum Equals K (Medium)](https://leetcode.com/problems/subarray-sum-equals-k "和为 K 的子数组")
-
-
Given an array of integers nums and an integer k, return the total number of continuous subarrays whose sum equals to k.
-
-
-
Example 1:
-
Input: nums = [1,1,1], k = 2
-Output: 2
-
Example 2:
-
Input: nums = [1,2,3], k = 3
-Output: 2
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 2 * 104
-
-1000 <= nums[i] <= 1000
-
-107 <= k <= 107
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Prefix Sum](../../tag/prefix-sum/README.md)]
-
-### Similar Questions
- 1. [Two Sum](../two-sum) (Easy)
- 1. [Continuous Subarray Sum](../continuous-subarray-sum) (Medium)
- 1. [Subarray Product Less Than K](../subarray-product-less-than-k) (Medium)
- 1. [Find Pivot Index](../find-pivot-index) (Easy)
- 1. [Subarray Sums Divisible by K](../subarray-sums-divisible-by-k) (Medium)
- 1. [Minimum Operations to Reduce X to Zero](../minimum-operations-to-reduce-x-to-zero) (Medium)
-
-### Hints
-
-Hint 1
-Will Brute force work here? Try to optimize it.
-
-
-
-Hint 2
-Can we optimize it by using some extra space?
-
-
-
-Hint 3
-What about storing sum frequencies in a hash table? Will it be useful?
-
-
-
-Hint 4
-sum(i,j)=sum(0,j)-sum(0,i), where sum(i,j) represents the sum of all the elements from index i to j-1.
-
-Can we use this property to optimize it.
-
diff --git a/problems/subarray-sum-equals-k/subarray_sum_equals_k.go b/problems/subarray-sum-equals-k/subarray_sum_equals_k.go
deleted file mode 100644
index 214094230..000000000
--- a/problems/subarray-sum-equals-k/subarray_sum_equals_k.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem560
diff --git a/problems/subarray-sum-equals-k/subarray_sum_equals_k_test.go b/problems/subarray-sum-equals-k/subarray_sum_equals_k_test.go
deleted file mode 100644
index 214094230..000000000
--- a/problems/subarray-sum-equals-k/subarray_sum_equals_k_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem560
diff --git a/problems/subarray-sums-divisible-by-k/README.md b/problems/subarray-sums-divisible-by-k/README.md
deleted file mode 100644
index 15e7339d0..000000000
--- a/problems/subarray-sums-divisible-by-k/README.md
+++ /dev/null
@@ -1,50 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../k-closest-points-to-origin "K Closest Points to Origin")
-
-[Next >](../odd-even-jump "Odd Even Jump")
-
-## [974. Subarray Sums Divisible by K (Medium)](https://leetcode.com/problems/subarray-sums-divisible-by-k "和可被 K 整除的子数组")
-
-
Given an integer array nums and an integer k, return the number of non-empty subarrays that have a sum divisible by k.
-
-
A subarray is a contiguous part of an array.
-
-
-
Example 1:
-
-
-Input: nums = [4,5,0,-2,-3,1], k = 5
-Output: 7
-Explanation: There are 7 subarrays with a sum divisible by k = 5:
-[4, 5, 0, -2, -3, 1], [5], [5, 0], [5, 0, -2, -3], [0], [0, -2, -3], [-2, -3]
-
Given an integer array nums and an integer k, return the number of good subarrays of nums.
-
-
A good array is an array where the number of different integers in that array is exactly k.
-
-
-
For example, [1,2,3,1,2] has 3 different integers: 1, 2, and 3.
-
-
-
A subarray is a contiguous part of an array.
-
-
-
Example 1:
-
-
-Input: nums = [1,2,1,2,3], k = 2
-Output: 7
-Explanation: Subarrays formed with exactly 2 different integers: [1,2], [2,1], [1,2], [2,3], [1,2,1], [2,1,2], [1,2,1,2]
-
-
-
Example 2:
-
-
-Input: nums = [1,2,1,3,4], k = 3
-Output: 3
-Explanation: Subarrays formed with exactly 3 different integers: [1,2,1,3], [2,1,3], [1,3,4].
-
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 2 * 104
-
1 <= nums[i], k <= nums.length
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Counting](../../tag/counting/README.md)]
- [[Sliding Window](../../tag/sliding-window/README.md)]
-
-### Similar Questions
- 1. [Longest Substring Without Repeating Characters](../longest-substring-without-repeating-characters) (Medium)
- 1. [Longest Substring with At Most Two Distinct Characters](../longest-substring-with-at-most-two-distinct-characters) (Medium)
- 1. [Longest Substring with At Most K Distinct Characters](../longest-substring-with-at-most-k-distinct-characters) (Medium)
diff --git a/problems/subarrays-with-k-different-integers/subarrays_with_k_different_integers.go b/problems/subarrays-with-k-different-integers/subarrays_with_k_different_integers.go
deleted file mode 100644
index b69ae9876..000000000
--- a/problems/subarrays-with-k-different-integers/subarrays_with_k_different_integers.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem992
diff --git a/problems/subdomain-visit-count/README.md b/problems/subdomain-visit-count/README.md
deleted file mode 100644
index 700b534f3..000000000
--- a/problems/subdomain-visit-count/README.md
+++ /dev/null
@@ -1,57 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../chalkboard-xor-game "Chalkboard XOR Game")
-
-[Next >](../largest-triangle-area "Largest Triangle Area")
-
-## [811. Subdomain Visit Count (Medium)](https://leetcode.com/problems/subdomain-visit-count "子域名访问计数")
-
-
A website domain "discuss.leetcode.com" consists of various subdomains. At the top level, we have "com", at the next level, we have "leetcode.com" and at the lowest level, "discuss.leetcode.com". When we visit a domain like "discuss.leetcode.com", we will also visit the parent domains "leetcode.com" and "com" implicitly.
-
-
A count-paired domain is a domain that has one of the two formats "rep d1.d2.d3" or "rep d1.d2" where rep is the number of visits to the domain and d1.d2.d3 is the domain itself.
-
-
-
For example, "9001 discuss.leetcode.com" is a count-paired domain that indicates that discuss.leetcode.com was visited 9001 times.
-
-
-
Given an array of count-paired domainscpdomains, return an array of the count-paired domains of each subdomain in the input. You may return the answer in any order.
-
-
-
Example 1:
-
-
-Input: cpdomains = ["9001 discuss.leetcode.com"]
-Output: ["9001 leetcode.com","9001 discuss.leetcode.com","9001 com"]
-Explanation: We only have one website domain: "discuss.leetcode.com".
-As discussed above, the subdomain "leetcode.com" and "com" will also be visited. So they will all be visited 9001 times.
-
-
-
Example 2:
-
-
-Input: cpdomains = ["900 google.mail.com", "50 yahoo.com", "1 intel.mail.com", "5 wiki.org"]
-Output: ["901 mail.com","50 yahoo.com","900 google.mail.com","5 wiki.org","5 org","1 intel.mail.com","951 com"]
-Explanation: We will visit "google.mail.com" 900 times, "yahoo.com" 50 times, "intel.mail.com" once and "wiki.org" 5 times.
-For the subdomains, we will visit "mail.com" 900 + 1 = 901 times, "com" 900 + 50 + 1 = 951 times, and "org" 5 times.
-
-
-
-
Constraints:
-
-
-
1 <= cpdomain.length <= 100
-
1 <= cpdomain[i].length <= 100
-
cpdomain[i] follows either the "repi d1i.d2i.d3i" format or the "repi d1i.d2i" format.
-
repi is an integer in the range [1, 104].
-
d1i, d2i, and d3i consist of lowercase English letters.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
diff --git a/problems/subdomain-visit-count/subdomain_visit_count.go b/problems/subdomain-visit-count/subdomain_visit_count.go
deleted file mode 100644
index 5c89a4d55..000000000
--- a/problems/subdomain-visit-count/subdomain_visit_count.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem811
diff --git a/problems/subdomain-visit-count/subdomain_visit_count_test.go b/problems/subdomain-visit-count/subdomain_visit_count_test.go
deleted file mode 100644
index 5c89a4d55..000000000
--- a/problems/subdomain-visit-count/subdomain_visit_count_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem811
diff --git a/problems/subrectangle-queries/README.md b/problems/subrectangle-queries/README.md
deleted file mode 100644
index 2f116e489..000000000
--- a/problems/subrectangle-queries/README.md
+++ /dev/null
@@ -1,105 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../final-prices-with-a-special-discount-in-a-shop "Final Prices With a Special Discount in a Shop")
-
-[Next >](../find-two-non-overlapping-sub-arrays-each-with-target-sum "Find Two Non-overlapping Sub-arrays Each With Target Sum")
-
-## [1476. Subrectangle Queries (Medium)](https://leetcode.com/problems/subrectangle-queries "子矩形查询")
-
-
Implement the class SubrectangleQueries which receives a rows x cols rectangle as a matrix of integers in the constructor and supports two methods:
-
-
1. updateSubrectangle(int row1, int col1, int row2, int col2, int newValue)
-
-
-
Updates all values with newValue in the subrectangle whose upper left coordinate is (row1,col1) and bottom right coordinate is (row2,col2).
-
-
-
2. getValue(int row, int col)
-
-
-
Returns the current value of the coordinate (row,col) from the rectangle.
There will be at most 500 operations considering both methods: updateSubrectangle and getValue.
-
1 <= rows, cols <= 100
-
rows == rectangle.length
-
cols == rectangle[i].length
-
0 <= row1 <= row2 < rows
-
0 <= col1 <= col2 < cols
-
1 <= newValue, rectangle[i][j] <= 10^9
-
0 <= row < rows
-
0 <= col < cols
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Design](../../tag/design/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
-
-### Hints
-
-Hint 1
-Use brute force to update a rectangle and, response to the queries in O(1).
-
diff --git a/problems/subsequence-of-size-k-with-the-largest-even-sum/README.md b/problems/subsequence-of-size-k-with-the-largest-even-sum/README.md
deleted file mode 100644
index b37446fc3..000000000
--- a/problems/subsequence-of-size-k-with-the-largest-even-sum/README.md
+++ /dev/null
@@ -1,35 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../valid-arrangement-of-pairs "Valid Arrangement of Pairs")
-
-[Next >](../find-subsequence-of-length-k-with-the-largest-sum "Find Subsequence of Length K With the Largest Sum")
-
-## [2098. Subsequence of Size K With the Largest Even Sum (Medium)](https://leetcode.com/problems/subsequence-of-size-k-with-the-largest-even-sum "")
-
-
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Hints
-
-Hint 1
-Is the sum of two even numbers even or odd? How about two odd numbers? One odd number and one even number?
-
-
-
-Hint 2
-If there is an even number of odd numbers, the sum will be even and vice versa.
-
-
-
-Hint 3
-Create an integer array to store all the even numbers in nums and another array to store all the odd numbers in nums. Sort both arrays.
-
diff --git a/problems/subsets-ii/README.md b/problems/subsets-ii/README.md
deleted file mode 100644
index 1f182abfd..000000000
--- a/problems/subsets-ii/README.md
+++ /dev/null
@@ -1,40 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../gray-code "Gray Code")
-
-[Next >](../decode-ways "Decode Ways")
-
-## [90. Subsets II (Medium)](https://leetcode.com/problems/subsets-ii "子集 II")
-
-
Given an integer array nums that may contain duplicates, return all possible subsets (the power set).
-
-
The solution set must not contain duplicate subsets. Return the solution in any order.
You are given a string s and an array of strings words of the same length. Return all starting indices of substring(s) in s that is a concatenation of each word in wordsexactly once, in any order, and without any intervening characters.
-
-
You can return the answer in any order.
-
-
-
Example 1:
-
-
-Input: s = "barfoothefoobarman", words = ["foo","bar"]
-Output: [0,9]
-Explanation: Substrings starting at index 0 and 9 are "barfoo" and "foobar" respectively.
-The output order does not matter, returning [9,0] is fine too.
-
-
-
Example 2:
-
-
-Input: s = "wordgoodgoodgoodbestword", words = ["word","good","best","word"]
-Output: []
-
-
-
Example 3:
-
-
-Input: s = "barfoofoobarthefoobarman", words = ["bar","foo","the"]
-Output: [6,9,12]
-
-
-
-
Constraints:
-
-
-
1 <= s.length <= 104
-
s consists of lower-case English letters.
-
1 <= words.length <= 5000
-
1 <= words[i].length <= 30
-
words[i] consists of lower-case English letters.
-
-
-### Related Topics
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
- [[Sliding Window](../../tag/sliding-window/README.md)]
-
-### Similar Questions
- 1. [Minimum Window Substring](../minimum-window-substring) (Hard)
diff --git a/problems/substring-with-concatenation-of-all-words/substring_with_concatenation_of_all_words.go b/problems/substring-with-concatenation-of-all-words/substring_with_concatenation_of_all_words.go
deleted file mode 100644
index 459e51bfa..000000000
--- a/problems/substring-with-concatenation-of-all-words/substring_with_concatenation_of_all_words.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem30
diff --git a/problems/substring-with-concatenation-of-all-words/substring_with_concatenation_of_all_words_test.go b/problems/substring-with-concatenation-of-all-words/substring_with_concatenation_of_all_words_test.go
deleted file mode 100644
index 459e51bfa..000000000
--- a/problems/substring-with-concatenation-of-all-words/substring_with_concatenation_of_all_words_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem30
diff --git a/problems/substrings-of-size-three-with-distinct-characters/README.md b/problems/substrings-of-size-three-with-distinct-characters/README.md
deleted file mode 100644
index eedd2515f..000000000
--- a/problems/substrings-of-size-three-with-distinct-characters/README.md
+++ /dev/null
@@ -1,59 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../group-employees-of-the-same-salary "Group Employees of the Same Salary")
-
-[Next >](../minimize-maximum-pair-sum-in-array "Minimize Maximum Pair Sum in Array")
-
-## [1876. Substrings of Size Three with Distinct Characters (Easy)](https://leetcode.com/problems/substrings-of-size-three-with-distinct-characters "长度为三且各字符不同的子字符串")
-
-
A string is good if there are no repeated characters.
-
-
Given a string s, return the number of good substrings of length three in s.
-
-
Note that if there are multiple occurrences of the same substring, every occurrence should be counted.
-
-
A substring is a contiguous sequence of characters in a string.
-
-
-
Example 1:
-
-
-Input: s = "xyzzaz"
-Output: 1
-Explanation: There are 4 substrings of size 3: "xyz", "yzz", "zza", and "zaz".
-The only good substring of length 3 is "xyz".
-
-
-
Example 2:
-
-
-Input: s = "aababcabc"
-Output: 4
-Explanation: There are 7 substrings of size 3: "aab", "aba", "bab", "abc", "bca", "cab", and "abc".
-The good substrings are "abc", "bca", "cab", and "abc".
-
-
-
-
Constraints:
-
-
-
1 <= s.length <= 100
-
s consists of lowercase English letters.
-
-
-### Related Topics
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
- [[Counting](../../tag/counting/README.md)]
- [[Sliding Window](../../tag/sliding-window/README.md)]
-
-### Hints
-
-Hint 1
-Try using a set to find out the number of distinct characters in a substring.
-
diff --git a/problems/substrings-that-begin-and-end-with-the-same-letter/README.md b/problems/substrings-that-begin-and-end-with-the-same-letter/README.md
deleted file mode 100644
index 0bd2bd07a..000000000
--- a/problems/substrings-that-begin-and-end-with-the-same-letter/README.md
+++ /dev/null
@@ -1,47 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../the-number-of-rich-customers "The Number of Rich Customers")
-
-[Next >](../drop-type-1-orders-for-customers-with-type-0-orders "Drop Type 1 Orders for Customers With Type 0 Orders")
-
-## [2083. Substrings That Begin and End With the Same Letter (Medium)](https://leetcode.com/problems/substrings-that-begin-and-end-with-the-same-letter "求以相同字母开头和结尾的子串总数")
-
-
-
-### Related Topics
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Math](../../tag/math/README.md)]
- [[String](../../tag/string/README.md)]
- [[Counting](../../tag/counting/README.md)]
- [[Prefix Sum](../../tag/prefix-sum/README.md)]
-
-### Hints
-
-Hint 1
-In the string "abacad", the letter "a" appears 3 times. How many substrings begin with the first "a" and end with any "a"?
-
-
-
-Hint 2
-There are 3 substrings ("a", "aba", and "abaca"). How many substrings begin with the second "a" and end with any "a"? How about the third?
-
-
-
-Hint 3
-2 substrings begin with the second "a" ("a", and "aca") and 1 substring begins with the third "a" ("a").
-
-
-
-Hint 4
-There is a total of 3 + 2 + 1 = 6 substrings that begin and end with "a".
-
-
-
-Hint 5
-If a character appears i times in the string, there are i * (i + 1) / 2 substrings that begin and end with that character.
-
diff --git a/problems/subtract-the-product-and-sum-of-digits-of-an-integer/README.md b/problems/subtract-the-product-and-sum-of-digits-of-an-integer/README.md
deleted file mode 100644
index bff43a94f..000000000
--- a/problems/subtract-the-product-and-sum-of-digits-of-an-integer/README.md
+++ /dev/null
@@ -1,62 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../students-and-examinations "Students and Examinations")
-
-[Next >](../group-the-people-given-the-group-size-they-belong-to "Group the People Given the Group Size They Belong To")
-
-## [1281. Subtract the Product and Sum of Digits of an Integer (Easy)](https://leetcode.com/problems/subtract-the-product-and-sum-of-digits-of-an-integer "整数的各位积和之差")
-
-Given an integer number n, return the difference between the product of its digits and the sum of its digits.
-
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
-
-### Hints
-
-Hint 1
-How to compute all digits of the number ?
-
-
-
-Hint 2
-Use modulus operator (%) to compute the last digit.
-
-
-
-Hint 3
-Generalise modulus operator idea to compute all digits.
-
diff --git a/problems/subtree-of-another-tree/README.md b/problems/subtree-of-another-tree/README.md
deleted file mode 100644
index 654f1ec17..000000000
--- a/problems/subtree-of-another-tree/README.md
+++ /dev/null
@@ -1,74 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../find-median-given-frequency-of-numbers "Find Median Given Frequency of Numbers")
-
-[Next >](../squirrel-simulation "Squirrel Simulation")
-
-## [572. Subtree of Another Tree (Easy)](https://leetcode.com/problems/subtree-of-another-tree "另一棵树的子树")
-
-
Given the roots of two binary trees root and subRoot, return true if there is a subtree of root with the same structure and node values of subRoot and false otherwise.
-
-
A subtree of a binary tree tree is a tree that consists of a node in tree and all of this node's descendants. The tree tree could also be considered as a subtree of itself.
The number of nodes in the root tree is in the range [1, 2000].
-
The number of nodes in the subRoot tree is in the range [1, 1000].
-
-104 <= root.val <= 104
-
-104 <= subRoot.val <= 104
-
-
-### Related Topics
- [[Tree](../../tag/tree/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Binary Tree](../../tag/binary-tree/README.md)]
- [[String Matching](../../tag/string-matching/README.md)]
- [[Hash Function](../../tag/hash-function/README.md)]
-
-### Similar Questions
- 1. [Count Univalue Subtrees](../count-univalue-subtrees) (Medium)
- 1. [Most Frequent Subtree Sum](../most-frequent-subtree-sum) (Medium)
-
-### Hints
-
-Hint 1
-Which approach is better here- recursive or iterative?
-
-
-
-Hint 2
-If recursive approach is better, can you write recursive function with its parameters?
-
-
-
-Hint 3
-Two trees s and t are said to be identical if their root values are same and their left and right subtrees are identical. Can you write this in form of recursive formulae?
-
-
-
-Hint 4
-Recursive formulae can be:
-isIdentical(s,t)= s.val==t.val AND isIdentical(s.left,t.left) AND isIdentical(s.right,t.right)
-
diff --git a/problems/subtree-of-another-tree/subtree_of_another_tree.go b/problems/subtree-of-another-tree/subtree_of_another_tree.go
deleted file mode 100644
index f2db60217..000000000
--- a/problems/subtree-of-another-tree/subtree_of_another_tree.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem572
diff --git a/problems/subtree-of-another-tree/subtree_of_another_tree_test.go b/problems/subtree-of-another-tree/subtree_of_another_tree_test.go
deleted file mode 100644
index f2db60217..000000000
--- a/problems/subtree-of-another-tree/subtree_of_another_tree_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem572
diff --git a/problems/subtree-removal-game-with-fibonacci-tree/README.md b/problems/subtree-removal-game-with-fibonacci-tree/README.md
deleted file mode 100644
index 094bb4c14..000000000
--- a/problems/subtree-removal-game-with-fibonacci-tree/README.md
+++ /dev/null
@@ -1,30 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../the-number-of-seniors-and-juniors-to-join-the-company "The Number of Seniors and Juniors to Join the Company")
-
-[Next >](../count-number-of-pairs-with-absolute-difference-k "Count Number of Pairs With Absolute Difference K")
-
-## [2005. Subtree Removal Game with Fibonacci Tree (Hard)](https://leetcode.com/problems/subtree-removal-game-with-fibonacci-tree "斐波那契树的移除子树游戏")
-
-
-
-### Hints
-
-Hint 1
-How can game theory help us solve this problem?
-
-
-
-Hint 2
-Think about the Sprague–Grundy theorem and the Colon Principle
-
-
-
-Hint 3
-The Grundy value of a node is the nim sum of the Grundy values of its children.
-
diff --git a/problems/sudoku-solver/README.md b/problems/sudoku-solver/README.md
deleted file mode 100644
index df556e33c..000000000
--- a/problems/sudoku-solver/README.md
+++ /dev/null
@@ -1,54 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../valid-sudoku "Valid Sudoku")
-
-[Next >](../count-and-say "Count and Say")
-
-## [37. Sudoku Solver (Hard)](https://leetcode.com/problems/sudoku-solver "解数独")
-
-
Write a program to solve a Sudoku puzzle by filling the empty cells.
-
-
A sudoku solution must satisfy all of the following rules:
-
-
-
Each of the digits 1-9 must occur exactly once in each row.
-
Each of the digits 1-9 must occur exactly once in each column.
-
Each of the digits 1-9 must occur exactly once in each of the 9 3x3 sub-boxes of the grid.
-
-
-
The '.' character indicates empty cells.
-
-
-
Example 1:
-
-
-Input: board = [["5","3",".",".","7",".",".",".","."],["6",".",".","1","9","5",".",".","."],[".","9","8",".",".",".",".","6","."],["8",".",".",".","6",".",".",".","3"],["4",".",".","8",".","3",".",".","1"],["7",".",".",".","2",".",".",".","6"],[".","6",".",".",".",".","2","8","."],[".",".",".","4","1","9",".",".","5"],[".",".",".",".","8",".",".","7","9"]]
-Output: [["5","3","4","6","7","8","9","1","2"],["6","7","2","1","9","5","3","4","8"],["1","9","8","3","4","2","5","6","7"],["8","5","9","7","6","1","4","2","3"],["4","2","6","8","5","3","7","9","1"],["7","1","3","9","2","4","8","5","6"],["9","6","1","5","3","7","2","8","4"],["2","8","7","4","1","9","6","3","5"],["3","4","5","2","8","6","1","7","9"]]
-Explanation: The input board is shown above and the only valid solution is shown below:
-
-
-
-
-
-
Constraints:
-
-
-
board.length == 9
-
board[i].length == 9
-
board[i][j] is a digit or '.'.
-
It is guaranteed that the input board has only one solution.
Alice and Bob take turns playing a game, with Alice starting first.
-
-
You are given a string num of even length consisting of digits and '?' characters. On each turn, a player will do the following if there is still at least one '?' in num:
-
-
-
Choose an index i where num[i] == '?'.
-
Replace num[i] with any digit between '0' and '9'.
-
-
-
The game ends when there are no more '?' characters in num.
-
-
For Bob to win, the sum of the digits in the first half of num must be equal to the sum of the digits in the second half. For Alice to win, the sums must not be equal.
-
-
-
For example, if the game ended with num = "243801", then Bob wins because 2+4+3 = 8+0+1. If the game ended with num = "243803", then Alice wins because 2+4+3 != 8+0+3.
-
-
-
Assuming Alice and Bob play optimally, return trueif Alice will win and falseif Bob will win.
-
-
-
Example 1:
-
-
-Input: num = "5023"
-Output: false
-Explanation: There are no moves to be made.
-The sum of the first half is equal to the sum of the second half: 5 + 0 = 2 + 3.
-
-
-
Example 2:
-
-
-Input: num = "25??"
-Output: true
-Explanation: Alice can replace one of the '?'s with '9' and it will be impossible for Bob to make the sums equal.
-
-
-
Example 3:
-
-
-Input: num = "?3295???"
-Output: false
-Explanation: It can be proven that Bob will always win. One possible outcome is:
-- Alice replaces the first '?' with '9'. num = "93295???".
-- Bob replaces one of the '?' in the right half with '9'. num = "932959??".
-- Alice replaces one of the '?' in the right half with '2'. num = "9329592?".
-- Bob replaces the last '?' in the right half with '7'. num = "93295927".
-Bob wins because 9 + 3 + 2 + 9 = 5 + 9 + 2 + 7.
-
-
-
-
Constraints:
-
-
-
2 <= num.length <= 105
-
num.length is even.
-
num consists of only digits and '?'.
-
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[Math](../../tag/math/README.md)]
- [[Game Theory](../../tag/game-theory/README.md)]
-
-### Hints
-
-Hint 1
-Bob can always make the total sum of both sides equal in mod 9.
-
-
-
-Hint 2
-Why does the difference between the number of question marks on the left and right side matter?
-
diff --git a/problems/sum-of-absolute-differences-in-a-sorted-array/README.md b/problems/sum-of-absolute-differences-in-a-sorted-array/README.md
deleted file mode 100644
index 8d6a3c30c..000000000
--- a/problems/sum-of-absolute-differences-in-a-sorted-array/README.md
+++ /dev/null
@@ -1,66 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../count-the-number-of-consistent-strings "Count the Number of Consistent Strings")
-
-[Next >](../stone-game-vi "Stone Game VI")
-
-## [1685. Sum of Absolute Differences in a Sorted Array (Medium)](https://leetcode.com/problems/sum-of-absolute-differences-in-a-sorted-array "有序数组中差绝对值之和")
-
-
You are given an integer array nums sorted in non-decreasing order.
-
-
Build and return an integer array result with the same length as nums such that result[i] is equal to the summation of absolute differences between nums[i] and all the other elements in the array.
-
-
In other words, result[i] is equal to sum(|nums[i]-nums[j]|) where 0 <= j < nums.length and j != i (0-indexed).
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Math](../../tag/math/README.md)]
- [[Prefix Sum](../../tag/prefix-sum/README.md)]
-
-### Hints
-
-Hint 1
-Absolute difference is the same as max(a, b) - min(a, b). How can you use this fact with the fact that the array is sorted?
-
-
-
-Hint 2
-For nums[i], the answer is (nums[i] - nums[0]) + (nums[i] - nums[1]) + ... + (nums[i] - nums[i-1]) + (nums[i+1] - nums[i]) + (nums[i+2] - nums[i]) + ... + (nums[n-1] - nums[i]).
-
-
-
-Hint 3
-It can be simplified to (nums[i] * i - (nums[0] + nums[1] + ... + nums[i-1])) + ((nums[i+1] + nums[i+2] + ... + nums[n-1]) - nums[i] * (n-i-1)). One can build prefix and suffix sums to compute this quickly.
-
diff --git a/problems/sum-of-all-odd-length-subarrays/README.md b/problems/sum-of-all-odd-length-subarrays/README.md
deleted file mode 100644
index 89cc61509..000000000
--- a/problems/sum-of-all-odd-length-subarrays/README.md
+++ /dev/null
@@ -1,69 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../bank-account-summary-ii "Bank Account Summary II")
-
-[Next >](../maximum-sum-obtained-of-any-permutation "Maximum Sum Obtained of Any Permutation")
-
-## [1588. Sum of All Odd Length Subarrays (Easy)](https://leetcode.com/problems/sum-of-all-odd-length-subarrays "所有奇数长度子数组的和")
-
-
Given an array of positive integers arr, calculate the sum of all possible odd-length subarrays.
-
-
A subarray is a contiguous subsequence of the array.
-
-
Return the sum of all odd-length subarrays of arr.
-
-
-
Example 1:
-
-
-Input: arr = [1,4,2,5,3]
-Output: 58
-Explanation: The odd-length subarrays of arr and their sums are:
-[1] = 1
-[4] = 4
-[2] = 2
-[5] = 5
-[3] = 3
-[1,4,2] = 7
-[4,2,5] = 11
-[2,5,3] = 10
-[1,4,2,5,3] = 15
-If we add all these together we get 1 + 4 + 2 + 5 + 3 + 7 + 11 + 10 + 15 = 58
-
-
Example 2:
-
-
-Input: arr = [1,2]
-Output: 3
-Explanation: There are only 2 subarrays of odd length, [1] and [2]. Their sum is 3.
-
-
Example 3:
-
-
-Input: arr = [10,11,12]
-Output: 66
-
-
-
-
Constraints:
-
-
-
1 <= arr.length <= 100
-
1 <= arr[i] <= 1000
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Math](../../tag/math/README.md)]
- [[Prefix Sum](../../tag/prefix-sum/README.md)]
-
-### Hints
-
-Hint 1
-You can brute force – try every (i,j) pair, and if the length is odd, go through and add the sum to the answer.
-
diff --git a/problems/sum-of-all-subset-xor-totals/README.md b/problems/sum-of-all-subset-xor-totals/README.md
deleted file mode 100644
index 1fa7a407f..000000000
--- a/problems/sum-of-all-subset-xor-totals/README.md
+++ /dev/null
@@ -1,89 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../sum-of-floored-pairs "Sum of Floored Pairs")
-
-[Next >](../minimum-number-of-swaps-to-make-the-binary-string-alternating "Minimum Number of Swaps to Make the Binary String Alternating")
-
-## [1863. Sum of All Subset XOR Totals (Easy)](https://leetcode.com/problems/sum-of-all-subset-xor-totals "找出所有子集的异或总和再求和")
-
-
The XOR total of an array is defined as the bitwise XOR of all its elements, or 0 if the array is empty.
-
-
-
For example, the XOR total of the array [2,5,6] is 2 XOR 5 XOR 6 = 1.
-
-
-
Given an array nums, return the sum of all XOR totals for every subset of nums.
-
-
Note: Subsets with the same elements should be counted multiple times.
-
-
An array a is a subset of an array b if a can be obtained from b by deleting some (possibly zero) elements of b.
-
-
-
Example 1:
-
-
-Input: nums = [1,3]
-Output: 6
-Explanation: The 4 subsets of [1,3] are:
-- The empty subset has an XOR total of 0.
-- [1] has an XOR total of 1.
-- [3] has an XOR total of 3.
-- [1,3] has an XOR total of 1 XOR 3 = 2.
-0 + 1 + 3 + 2 = 6
-
-
-
Example 2:
-
-
-Input: nums = [5,1,6]
-Output: 28
-Explanation: The 8 subsets of [5,1,6] are:
-- The empty subset has an XOR total of 0.
-- [5] has an XOR total of 5.
-- [1] has an XOR total of 1.
-- [6] has an XOR total of 6.
-- [5,1] has an XOR total of 5 XOR 1 = 4.
-- [5,6] has an XOR total of 5 XOR 6 = 3.
-- [1,6] has an XOR total of 1 XOR 6 = 7.
-- [5,1,6] has an XOR total of 5 XOR 1 XOR 6 = 2.
-0 + 5 + 1 + 6 + 4 + 3 + 7 + 2 = 28
-
-
-
Example 3:
-
-
-Input: nums = [3,4,5,6,7,8]
-Output: 480
-Explanation: The sum of all XOR totals for every subset is 480.
-
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 12
-
1 <= nums[i] <= 20
-
-
-### Related Topics
- [[Bit Manipulation](../../tag/bit-manipulation/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Math](../../tag/math/README.md)]
- [[Backtracking](../../tag/backtracking/README.md)]
- [[Combinatorics](../../tag/combinatorics/README.md)]
-
-### Hints
-
-Hint 1
-Is there a way to iterate through all the subsets of the array?
-
-
-
-Hint 2
-Can we use recursion to efficiently iterate through all the subsets?
-
diff --git a/problems/sum-of-beauty-in-the-array/README.md b/problems/sum-of-beauty-in-the-array/README.md
deleted file mode 100644
index f6a1c02c1..000000000
--- a/problems/sum-of-beauty-in-the-array/README.md
+++ /dev/null
@@ -1,78 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../final-value-of-variable-after-performing-operations "Final Value of Variable After Performing Operations")
-
-[Next >](../detect-squares "Detect Squares")
-
-## [2012. Sum of Beauty in the Array (Medium)](https://leetcode.com/problems/sum-of-beauty-in-the-array "数组美丽值求和")
-
-
You are given a 0-indexed integer array nums. For each index i (1 <= i <= nums.length - 2) the beauty of nums[i] equals:
-
-
-
2, if nums[j] < nums[i] < nums[k], for all0 <= j < i and for alli < k <= nums.length - 1.
-
1, if nums[i - 1] < nums[i] < nums[i + 1], and the previous condition is not satisfied.
-
0, if none of the previous conditions holds.
-
-
-
Return the sum of beauty of all nums[i] where 1 <= i <= nums.length - 2.
-
-
-
Example 1:
-
-
-Input: nums = [1,2,3]
-Output: 2
-Explanation: For each index i in the range 1 <= i <= 1:
-- The beauty of nums[1] equals 2.
-
-
-
Example 2:
-
-
-Input: nums = [2,4,6,4]
-Output: 1
-Explanation: For each index i in the range 1 <= i <= 2:
-- The beauty of nums[1] equals 1.
-- The beauty of nums[2] equals 0.
-
-
-
Example 3:
-
-
-Input: nums = [3,2,1]
-Output: 0
-Explanation: For each index i in the range 1 <= i <= 1:
-- The beauty of nums[1] equals 0.
-
-
-
-
Constraints:
-
-
-
3 <= nums.length <= 105
-
1 <= nums[i] <= 105
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
-
-### Hints
-
-Hint 1
-Use suffix/prefix arrays.
-
-
-
-Hint 2
-prefix[i] records the maximum value in range (0, i - 1) inclusive.
-
-
-
-Hint 3
-suffix[i] records the minimum value in range (i + 1, n - 1) inclusive.
-
diff --git a/problems/sum-of-beauty-of-all-substrings/README.md b/problems/sum-of-beauty-of-all-substrings/README.md
deleted file mode 100644
index 8e5cea5de..000000000
--- a/problems/sum-of-beauty-of-all-substrings/README.md
+++ /dev/null
@@ -1,59 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../check-if-number-is-a-sum-of-powers-of-three "Check if Number is a Sum of Powers of Three")
-
-[Next >](../count-pairs-of-nodes "Count Pairs Of Nodes")
-
-## [1781. Sum of Beauty of All Substrings (Medium)](https://leetcode.com/problems/sum-of-beauty-of-all-substrings "所有子字符串美丽值之和")
-
-
The beauty of a string is the difference in frequencies between the most frequent and least frequent characters.
-
-
-
For example, the beauty of "abaacc" is 3 - 1 = 2.
-
-
-
Given a string s, return the sum of beauty of all of its substrings.
-
-
-
Example 1:
-
-
-Input: s = "aabcb"
-Output: 5
-Explanation: The substrings with non-zero beauty are ["aab","aabc","aabcb","abcb","bcb"], each with beauty equal to 1.
-
-
Example 2:
-
-
-Input: s = "aabcbaa"
-Output: 17
-
-
-
-
Constraints:
-
-
-
1 <= s.length <=500
-
s consists of only lowercase English letters.
-
-
-### Related Topics
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
- [[Counting](../../tag/counting/README.md)]
-
-### Hints
-
-Hint 1
-Maintain a prefix sum for the frequencies of characters.
-
-
-
-Hint 2
-You can iterate over all substring then iterate over the alphabet and find which character appears most and which appears least using the prefix sum array
-
diff --git a/problems/sum-of-digits-in-base-k/README.md b/problems/sum-of-digits-in-base-k/README.md
deleted file mode 100644
index 8ae9cb78f..000000000
--- a/problems/sum-of-digits-in-base-k/README.md
+++ /dev/null
@@ -1,55 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../remove-duplicates-from-an-unsorted-linked-list "Remove Duplicates From an Unsorted Linked List")
-
-[Next >](../frequency-of-the-most-frequent-element "Frequency of the Most Frequent Element")
-
-## [1837. Sum of Digits in Base K (Easy)](https://leetcode.com/problems/sum-of-digits-in-base-k "K 进制表示下的各位数字总和")
-
-
Given an integer n (in base 10) and a base k, return the sum of the digits of nafter converting n from base 10 to base k.
-
-
After converting, each digit should be interpreted as a base 10 number, and the sum should be returned in base 10.
-
-
-
Example 1:
-
-
-Input: n = 34, k = 6
-Output: 9
-Explanation: 34 (base 10) expressed in base 6 is 54. 5 + 4 = 9.
-
-
-
Example 2:
-
-
-Input: n = 10, k = 10
-Output: 1
-Explanation: n is already in base 10. 1 + 0 = 1.
-
-
-
-
Constraints:
-
-
-
1 <= n <= 100
-
2 <= k <= 10
-
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
-
-### Hints
-
-Hint 1
-Convert the given number into base k.
-
-
-
-Hint 2
-Use mod-10 to find what each digit is after the conversion and sum the digits.
-
diff --git a/problems/sum-of-digits-in-the-minimum-number/README.md b/problems/sum-of-digits-in-the-minimum-number/README.md
deleted file mode 100644
index c0eb6700d..000000000
--- a/problems/sum-of-digits-in-the-minimum-number/README.md
+++ /dev/null
@@ -1,73 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../sales-analysis-iii "Sales Analysis III")
-
-[Next >](../high-five "High Five")
-
-## [1085. Sum of Digits in the Minimum Number (Easy)](https://leetcode.com/problems/sum-of-digits-in-the-minimum-number "最小元素各数位之和")
-
-
Given an array A of positive integers, let S be the sum of the digits of the minimal element of A.
-
-
Return 0 if S is odd, otherwise return 1.
-
-
-
-
Example 1:
-
-
-Input: [34,23,1,24,75,33,54,8]
-Output: 0
-Explanation:
-The minimal element is 1, and the sum of those digits is S = 1 which is odd, so the answer is 0.
-
-
-
Example 2:
-
-
-Input: [99,77,33,66,55]
-Output: 1
-Explanation:
-The minimal element is 33, and the sum of those digits is S = 3 + 3 = 6 which is even, so the answer is 1.
-
-
-
-
-
Note:
-
-
-
1 <= A.length <= 100
-
1 <= A[i].length <= 100
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Math](../../tag/math/README.md)]
-
-### Similar Questions
- 1. [Add Digits](../add-digits) (Easy)
-
-### Hints
-
-Hint 1
-How to find the minimum number in an array?
-
-
-
-Hint 2
-Loop over the array and compare each one of the numbers.
-
-
-
-Hint 3
-How to find the sum of digits?
-
-
-
-Hint 4
-Divide the number consecutively and get their remainder modulus 10. Sum those remainders and return the answer as the problem asks.
-
diff --git a/problems/sum-of-digits-of-string-after-convert/README.md b/problems/sum-of-digits-of-string-after-convert/README.md
deleted file mode 100644
index a8fba598f..000000000
--- a/problems/sum-of-digits-of-string-after-convert/README.md
+++ /dev/null
@@ -1,81 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../number-of-visible-people-in-a-queue "Number of Visible People in a Queue")
-
-[Next >](../largest-number-after-mutating-substring "Largest Number After Mutating Substring")
-
-## [1945. Sum of Digits of String After Convert (Easy)](https://leetcode.com/problems/sum-of-digits-of-string-after-convert "字符串转化后的各位数字之和")
-
-
You are given a string s consisting of lowercase English letters, and an integer k.
-
-
First, converts into an integer by replacing each letter with its position in the alphabet (i.e., replace 'a' with 1, 'b' with 2, ..., 'z' with 26). Then, transform the integer by replacing it with the sum of its digits. Repeat the transform operation k times in total.
-
-
For example, if s = "zbax" and k = 2, then the resulting integer would be 8 by the following operations:
Return the resulting integer after performing the operations described above.
-
-
-
Example 1:
-
-
-Input: s = "iiii", k = 1
-Output: 36
-Explanation: The operations are as follows:
-- Convert: "iiii" ➝ "(9)(9)(9)(9)" ➝ "9999" ➝ 9999
-- Transform #1: 9999 ➝ 9 + 9 + 9 + 9 ➝ 36
-Thus the resulting integer is 36.
-
-
-
Example 2:
-
-
-Input: s = "leetcode", k = 2
-Output: 6
-Explanation: The operations are as follows:
-- Convert: "leetcode" ➝ "(12)(5)(5)(20)(3)(15)(4)(5)" ➝ "12552031545" ➝ 12552031545
-- Transform #1: 12552031545 ➝ 1 + 2 + 5 + 5 + 2 + 0 + 3 + 1 + 5 + 4 + 5 ➝ 33
-- Transform #2: 33 ➝ 3 + 3 ➝ 6
-Thus the resulting integer is 6.
-
-
-
Example 3:
-
-
-Input: s = "zbax", k = 2
-Output: 8
-
-
-
-
Constraints:
-
-
-
1 <= s.length <= 100
-
1 <= k <= 10
-
s consists of lowercase English letters.
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
- [[Simulation](../../tag/simulation/README.md)]
-
-### Hints
-
-Hint 1
-First, let's note that after the first transform the value will be at most 100 * 9 which is not much
-
-
-
-Hint 2
-After The first transform, we can just do the rest of the transforms by brute force
-
diff --git a/problems/sum-of-distances-in-tree/README.md b/problems/sum-of-distances-in-tree/README.md
deleted file mode 100644
index 470093066..000000000
--- a/problems/sum-of-distances-in-tree/README.md
+++ /dev/null
@@ -1,65 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../find-and-replace-in-string "Find And Replace in String")
-
-[Next >](../image-overlap "Image Overlap")
-
-## [834. Sum of Distances in Tree (Hard)](https://leetcode.com/problems/sum-of-distances-in-tree "树中距离之和")
-
-
There is an undirected connected tree with n nodes labeled from 0 to n - 1 and n - 1 edges.
-
-
You are given the integer n and the array edges where edges[i] = [ai, bi] indicates that there is an edge between nodes ai and bi in the tree.
-
-
Return an array answer of length n where answer[i] is the sum of the distances between the ith node in the tree and all other nodes.
-
-
-
Example 1:
-
-
-Input: n = 6, edges = [[0,1],[0,2],[2,3],[2,4],[2,5]]
-Output: [8,12,6,10,10,10]
-Explanation: The tree is shown above.
-We can see that dist(0,1) + dist(0,2) + dist(0,3) + dist(0,4) + dist(0,5)
-equals 1 + 1 + 2 + 2 + 2 = 8.
-Hence, answer[0] = 8, and so on.
-
-
-
Example 2:
-
-
-Input: n = 1, edges = []
-Output: [0]
-
-
-
Example 3:
-
-
-Input: n = 2, edges = [[1,0]]
-Output: [1,1]
-
-
-
-
Constraints:
-
-
-
1 <= n <= 3 * 104
-
edges.length == n - 1
-
edges[i].length == 2
-
0 <= ai, bi < n
-
ai != bi
-
The given input represents a valid tree.
-
-
-### Related Topics
- [[Tree](../../tag/tree/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Graph](../../tag/graph/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Similar Questions
- 1. [Distribute Coins in Binary Tree](../distribute-coins-in-binary-tree) (Medium)
diff --git a/problems/sum-of-distances-in-tree/sum_of_distances_in_tree.go b/problems/sum-of-distances-in-tree/sum_of_distances_in_tree.go
deleted file mode 100644
index 156f05210..000000000
--- a/problems/sum-of-distances-in-tree/sum_of_distances_in_tree.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem834
diff --git a/problems/sum-of-distances-in-tree/sum_of_distances_in_tree_test.go b/problems/sum-of-distances-in-tree/sum_of_distances_in_tree_test.go
deleted file mode 100644
index 156f05210..000000000
--- a/problems/sum-of-distances-in-tree/sum_of_distances_in_tree_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem834
diff --git a/problems/sum-of-even-numbers-after-queries/README.md b/problems/sum-of-even-numbers-after-queries/README.md
deleted file mode 100644
index 392687112..000000000
--- a/problems/sum-of-even-numbers-after-queries/README.md
+++ /dev/null
@@ -1,53 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../string-without-aaa-or-bbb "String Without AAA or BBB")
-
-[Next >](../interval-list-intersections "Interval List Intersections")
-
-## [985. Sum of Even Numbers After Queries (Medium)](https://leetcode.com/problems/sum-of-even-numbers-after-queries "查询后的偶数和")
-
-
You are given an integer array nums and an array queries where queries[i] = [vali, indexi].
-
-
For each query i, first, apply nums[indexi] = nums[indexi] + vali, then print the sum of the even values of nums.
-
-
Return an integer array answer where answer[i] is the answer to the ith query.
-
-
-
Example 1:
-
-
-Input: nums = [1,2,3,4], queries = [[1,0],[-3,1],[-4,0],[2,3]]
-Output: [8,6,2,4]
-Explanation: At the beginning, the array is [1,2,3,4].
-After adding 1 to nums[0], the array is [2,2,3,4], and the sum of even values is 2 + 2 + 4 = 8.
-After adding -3 to nums[1], the array is [2,-1,3,4], and the sum of even values is 2 + 4 = 6.
-After adding -4 to nums[0], the array is [-2,-1,3,4], and the sum of even values is -2 + 4 = 2.
-After adding 2 to nums[3], the array is [-2,-1,3,6], and the sum of even values is -2 + 6 = 4.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Simulation](../../tag/simulation/README.md)]
diff --git a/problems/sum-of-even-numbers-after-queries/sum_of_even_numbers_after_queries.go b/problems/sum-of-even-numbers-after-queries/sum_of_even_numbers_after_queries.go
deleted file mode 100644
index 87dff26b9..000000000
--- a/problems/sum-of-even-numbers-after-queries/sum_of_even_numbers_after_queries.go
+++ /dev/null
@@ -1,22 +0,0 @@
-package problem985
-
-func sumEvenAfterQueries(A []int, queries [][]int) []int {
- sum, ans := 0, make([]int, 0)
- for _, v := range A {
- if v%2 == 0 {
- sum += v
- }
- }
- for _, q := range queries {
- v, i := q[0], q[1]
- if A[i]%2 == 0 {
- sum -= A[i]
- }
- A[i] += v
- if A[i]%2 == 0 {
- sum += A[i]
- }
- ans = append(ans, sum)
- }
- return ans
-}
diff --git a/problems/sum-of-even-numbers-after-queries/sum_of_even_numbers_after_queries_test.go b/problems/sum-of-even-numbers-after-queries/sum_of_even_numbers_after_queries_test.go
deleted file mode 100644
index a6c1791ad..000000000
--- a/problems/sum-of-even-numbers-after-queries/sum_of_even_numbers_after_queries_test.go
+++ /dev/null
@@ -1,28 +0,0 @@
-package problem985
-
-import (
- "reflect"
- "testing"
-)
-
-type testType struct {
- in []int
- queries [][]int
- want []int
-}
-
-func TestSumEvenAfterQueries(t *testing.T) {
- tests := [...]testType{
- {
- in: []int{1, 2, 3, 4},
- queries: [][]int{{1, 0}, {-3, 1}, {-4, 0}, {2, 3}},
- want: []int{8, 6, 2, 4},
- },
- }
- for _, tt := range tests {
- got := sumEvenAfterQueries(tt.in, tt.queries)
- if !reflect.DeepEqual(got, tt.want) {
- t.Fatalf("in: %v, got: %v, want: %v", tt.in, got, tt.want)
- }
- }
-}
diff --git a/problems/sum-of-floored-pairs/README.md b/problems/sum-of-floored-pairs/README.md
deleted file mode 100644
index 10d72bc34..000000000
--- a/problems/sum-of-floored-pairs/README.md
+++ /dev/null
@@ -1,63 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../rotating-the-box "Rotating the Box")
-
-[Next >](../sum-of-all-subset-xor-totals "Sum of All Subset XOR Totals")
-
-## [1862. Sum of Floored Pairs (Hard)](https://leetcode.com/problems/sum-of-floored-pairs "向下取整数对和")
-
-
Given an integer array nums, return the sum of floor(nums[i] / nums[j]) for all pairs of indices 0 <= i, j < nums.length in the array. Since the answer may be too large, return it modulo109 + 7.
-
-
The floor() function returns the integer part of the division.
-
-
-
Example 1:
-
-
-Input: nums = [2,5,9]
-Output: 10
-Explanation:
-floor(2 / 5) = floor(2 / 9) = floor(5 / 9) = 0
-floor(2 / 2) = floor(5 / 5) = floor(9 / 9) = 1
-floor(5 / 2) = 2
-floor(9 / 2) = 4
-floor(9 / 5) = 1
-We calculate the floor of the division for every pair of indices in the array then sum them up.
-
-
-
Example 2:
-
-
-Input: nums = [7,7,7,7,7,7,7]
-Output: 49
-
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 105
-
1 <= nums[i] <= 105
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Math](../../tag/math/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
- [[Prefix Sum](../../tag/prefix-sum/README.md)]
-
-### Hints
-
-Hint 1
-Find the frequency (number of occurrences) of all elements in the array.
-
-
-
-Hint 2
-For each element, iterate through its multiples and multiply frequencies to find the answer.
-
diff --git a/problems/sum-of-k-mirror-numbers/README.md b/problems/sum-of-k-mirror-numbers/README.md
deleted file mode 100644
index 3d18182e4..000000000
--- a/problems/sum-of-k-mirror-numbers/README.md
+++ /dev/null
@@ -1,93 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../range-frequency-queries "Range Frequency Queries")
-
-[Next >](../the-number-of-rich-customers "The Number of Rich Customers")
-
-## [2081. Sum of k-Mirror Numbers (Hard)](https://leetcode.com/problems/sum-of-k-mirror-numbers "k 镜像数字的和")
-
-
A k-mirror number is a positive integer without leading zeros that reads the same both forward and backward in base-10 as well as in base-k.
-
-
-
For example, 9 is a 2-mirror number. The representation of 9 in base-10 and base-2 are 9 and 1001 respectively, which read the same both forward and backward.
-
On the contrary, 4 is not a 2-mirror number. The representation of 4 in base-2 is 100, which does not read the same both forward and backward.
-
-
-
Given the base k and the number n, return the sum of thensmallest k-mirror numbers.
-
-
-
Example 1:
-
-
-Input: k = 2, n = 5
-Output: 25
-Explanation:
-The 5 smallest 2-mirror numbers and their representations in base-2 are listed as follows:
- base-10 base-2
- 1 1
- 3 11
- 5 101
- 7 111
- 9 1001
-Their sum = 1 + 3 + 5 + 7 + 9 = 25.
-
-
-
Example 2:
-
-
-Input: k = 3, n = 7
-Output: 499
-Explanation:
-The 7 smallest 3-mirror numbers are and their representations in base-3 are listed as follows:
- base-10 base-3
- 1 1
- 2 2
- 4 11
- 8 22
- 121 11111
- 151 12121
- 212 21212
-Their sum = 1 + 2 + 4 + 8 + 121 + 151 + 212 = 499.
-
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
- [[Enumeration](../../tag/enumeration/README.md)]
-
-### Hints
-
-Hint 1
-Since we need to reduce search space, instead of checking if every number is a palindrome in base-10, can we try to "generate" the palindromic numbers?
-
-
-
-Hint 2
-If you are provided with a d digit number, how can you generate a palindrome with 2*d or 2*d - 1 digit?
-
-
-
-Hint 3
-Try brute-forcing and checking if the palindrome you generated is a "k-Mirror" number.
-
diff --git a/problems/sum-of-left-leaves/README.md b/problems/sum-of-left-leaves/README.md
deleted file mode 100644
index 232f68a07..000000000
--- a/problems/sum-of-left-leaves/README.md
+++ /dev/null
@@ -1,44 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../frog-jump "Frog Jump")
-
-[Next >](../convert-a-number-to-hexadecimal "Convert a Number to Hexadecimal")
-
-## [404. Sum of Left Leaves (Easy)](https://leetcode.com/problems/sum-of-left-leaves "左叶子之和")
-
-
Given the root of a binary tree, return the sum of all left leaves.
-
-
-
Example 1:
-
-
-Input: root = [3,9,20,null,null,15,7]
-Output: 24
-Explanation: There are two left leaves in the binary tree, with values 9 and 15 respectively.
-
-
-
Example 2:
-
-
-Input: root = [1]
-Output: 0
-
-
-
-
Constraints:
-
-
-
The number of nodes in the tree is in the range [1, 1000].
-
-1000 <= Node.val <= 1000
-
-
-### Related Topics
- [[Tree](../../tag/tree/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Binary Tree](../../tag/binary-tree/README.md)]
diff --git a/problems/sum-of-left-leaves/sum_of_left_leaves.go b/problems/sum-of-left-leaves/sum_of_left_leaves.go
deleted file mode 100644
index 331c9439c..000000000
--- a/problems/sum-of-left-leaves/sum_of_left_leaves.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem404
diff --git a/problems/sum-of-left-leaves/sum_of_left_leaves_test.go b/problems/sum-of-left-leaves/sum_of_left_leaves_test.go
deleted file mode 100644
index 331c9439c..000000000
--- a/problems/sum-of-left-leaves/sum_of_left_leaves_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem404
diff --git a/problems/sum-of-mutated-array-closest-to-target/README.md b/problems/sum-of-mutated-array-closest-to-target/README.md
deleted file mode 100644
index 490eaebb2..000000000
--- a/problems/sum-of-mutated-array-closest-to-target/README.md
+++ /dev/null
@@ -1,70 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../replace-elements-with-greatest-element-on-right-side "Replace Elements with Greatest Element on Right Side")
-
-[Next >](../number-of-paths-with-max-score "Number of Paths with Max Score")
-
-## [1300. Sum of Mutated Array Closest to Target (Medium)](https://leetcode.com/problems/sum-of-mutated-array-closest-to-target "转变数组后最接近目标值的数组和")
-
-
Given an integer array arr and a target value target, return the integer value such that when we change all the integers larger than value in the given array to be equal to value, the sum of the array gets as close as possible (in absolute difference) to target.
-
-
In case of a tie, return the minimum such integer.
-
-
Notice that the answer is not neccesarilly a number from arr.
-
-
-
Example 1:
-
-
-Input: arr = [4,9,3], target = 10
-Output: 3
-Explanation: When using 3 arr converts to [3, 3, 3] which sums 9 and that's the optimal answer.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Hints
-
-Hint 1
-If you draw a graph with the value on one axis and the absolute difference between the target and the array sum, what will you get?
-
-
-
-Hint 2
-That graph is uni-modal.
-
-
-
-Hint 3
-Use ternary search on that graph to find the best value.
-
diff --git a/problems/sum-of-nodes-with-even-valued-grandparent/README.md b/problems/sum-of-nodes-with-even-valued-grandparent/README.md
deleted file mode 100644
index fdcf237f6..000000000
--- a/problems/sum-of-nodes-with-even-valued-grandparent/README.md
+++ /dev/null
@@ -1,57 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../matrix-block-sum "Matrix Block Sum")
-
-[Next >](../distinct-echo-substrings "Distinct Echo Substrings")
-
-## [1315. Sum of Nodes with Even-Valued Grandparent (Medium)](https://leetcode.com/problems/sum-of-nodes-with-even-valued-grandparent "祖父节点值为偶数的节点和")
-
-
Given the root of a binary tree, return the sum of values of nodes with an even-valued grandparent. If there are no nodes with an even-valued grandparent, return 0.
-
-
A grandparent of a node is the parent of its parent if it exists.
-
-
-
Example 1:
-
-
-Input: root = [6,7,8,2,7,1,3,9,null,1,4,null,null,null,5]
-Output: 18
-Explanation: The red nodes are the nodes with even-value grandparent while the blue nodes are the even-value grandparents.
-
-
-
Example 2:
-
-
-Input: root = [1]
-Output: 0
-
-
-
-
Constraints:
-
-
-
The number of nodes in the tree is in the range [1, 104].
-
1 <= Node.val <= 100
-
-
-### Related Topics
- [[Tree](../../tag/tree/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Binary Tree](../../tag/binary-tree/README.md)]
-
-### Hints
-
-Hint 1
-Traverse the tree keeping the parent and the grandparent.
-
-
-
-Hint 2
-If the grandparent of the current node is even-valued, add the value of this node to the answer.
-
diff --git a/problems/sum-of-root-to-leaf-binary-numbers/README.md b/problems/sum-of-root-to-leaf-binary-numbers/README.md
deleted file mode 100644
index b74243c58..000000000
--- a/problems/sum-of-root-to-leaf-binary-numbers/README.md
+++ /dev/null
@@ -1,67 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../remove-outermost-parentheses "Remove Outermost Parentheses")
-
-[Next >](../camelcase-matching "Camelcase Matching")
-
-## [1022. Sum of Root To Leaf Binary Numbers (Easy)](https://leetcode.com/problems/sum-of-root-to-leaf-binary-numbers "从根到叶的二进制数之和")
-
-
You are given the root of a binary tree where each node has a value 0 or 1. Each root-to-leaf path represents a binary number starting with the most significant bit. For example, if the path is 0 -> 1 -> 1 -> 0 -> 1, then this could represent 01101 in binary, which is 13.
-
-
For all leaves in the tree, consider the numbers represented by the path from the root to that leaf.
-
-
Return the sum of these numbers. The answer is guaranteed to fit in a 32-bits integer.
Given an array of integers arr, find the sum of min(b), where b ranges over every (contiguous) subarray of arr. Since the answer may be large, return the answer modulo109 + 7.
You are given an integer array nums. The range of a subarray of nums is the difference between the largest and smallest element in the subarray.
-
-
Return the sum of all subarray ranges of nums.
-
-
A subarray is a contiguous non-empty sequence of elements within an array.
-
-
-
Example 1:
-
-
-Input: nums = [1,2,3]
-Output: 4
-Explanation: The 6 subarrays of nums are the following:
-[1], range = largest - smallest = 1 - 1 = 0
-[2], range = 2 - 2 = 0
-[3], range = 3 - 3 = 0
-[1,2], range = 2 - 1 = 1
-[2,3], range = 3 - 2 = 1
-[1,2,3], range = 3 - 1 = 2
-So the sum of all ranges is 0 + 0 + 0 + 1 + 1 + 2 = 4.
-
-
Example 2:
-
-
-Input: nums = [1,3,3]
-Output: 4
-Explanation: The 6 subarrays of nums are the following:
-[1], range = largest - smallest = 1 - 1 = 0
-[3], range = 3 - 3 = 0
-[3], range = 3 - 3 = 0
-[1,3], range = 3 - 1 = 2
-[3,3], range = 3 - 3 = 0
-[1,3,3], range = 3 - 1 = 2
-So the sum of all ranges is 0 + 0 + 0 + 2 + 0 + 2 = 4.
-
-
-
Example 3:
-
-
-Input: nums = [4,-2,-3,4,1]
-Output: 59
-Explanation: The sum of all subarray ranges of nums is 59.
-
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 1000
-
-109 <= nums[i] <= 109
-
-
-
-
Follow-up: Could you find a solution with O(n) time complexity?
-
-### Related Topics
- [[Stack](../../tag/stack/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Monotonic Stack](../../tag/monotonic-stack/README.md)]
-
-### Hints
-
-Hint 1
-Can you get the max/min of a certain subarray by using the max/min of a smaller subarray within it?
-
-
-
-Hint 2
-Notice that the max of the subarray from index i to j is equal to max of (max of the subarray from index i to j-1) and nums[j].
-
diff --git a/problems/sum-of-subsequence-widths/README.md b/problems/sum-of-subsequence-widths/README.md
deleted file mode 100644
index 237896b1c..000000000
--- a/problems/sum-of-subsequence-widths/README.md
+++ /dev/null
@@ -1,49 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../find-and-replace-pattern "Find and Replace Pattern")
-
-[Next >](../surface-area-of-3d-shapes "Surface Area of 3D Shapes")
-
-## [891. Sum of Subsequence Widths (Hard)](https://leetcode.com/problems/sum-of-subsequence-widths "子序列宽度之和")
-
-
The width of a sequence is the difference between the maximum and minimum elements in the sequence.
-
-
Given an array of integers nums, return the sum of the widths of all the non-empty subsequences of nums. Since the answer may be very large, return it modulo109 + 7.
-
-
A subsequence is a sequence that can be derived from an array by deleting some or no elements without changing the order of the remaining elements. For example, [3,6,2,7] is a subsequence of the array [0,3,1,6,2,2,7].
-
-
-
Example 1:
-
-
-Input: nums = [2,1,3]
-Output: 6
-Explanation: The subsequences are [1], [2], [3], [2,1], [2,3], [1,3], [2,1,3].
-The corresponding widths are 0, 0, 0, 1, 1, 2, 2.
-The sum of these widths is 6.
-
Return the smallest sorted list of ranges that cover all the numbers in the array exactly. That is, each element of nums is covered by exactly one of the ranges, and there is no integer x such that x is in one of the ranges but not in nums.
You are given k identical eggs and you have access to a building with n floors labeled from 1 to n.
-
-
You know that there exists a floor f where 0 <= f <= n such that any egg dropped at a floor higher than f will break, and any egg dropped at or below floor f will not break.
-
-
Each move, you may take an unbroken egg and drop it from any floor x (where 1 <= x <= n). If the egg breaks, you can no longer use it. However, if the egg does not break, you may reuse it in future moves.
-
-
Return the minimum number of moves that you need to determine with certainty what the value of f is.
-
-
-
Example 1:
-
-
-Input: k = 1, n = 2
-Output: 2
-Explanation:
-Drop the egg from floor 1. If it breaks, we know that f = 0.
-Otherwise, drop the egg from floor 2. If it breaks, we know that f = 1.
-If it does not break, then we know f = 2.
-Hence, we need at minimum 2 moves to determine with certainty what the value of f is.
-
Let's say a positive integer is a super-palindrome if it is a palindrome, and it is also the square of a palindrome.
-
-
Given two positive integers left and right represented as strings, return the number of super-palindromes integers in the inclusive range[left, right].
-
-
-
Example 1:
-
-
-Input: left = "4", right = "1000"
-Output: 4
-Explanation: 4, 9, 121, and 484 are superpalindromes.
-Note that 676 is not a superpalindrome: 26 * 26 = 676, but 26 is not a palindrome.
-
-
-
Example 2:
-
-
-Input: left = "1", right = "2"
-Output: 1
-
-
-
-
Constraints:
-
-
-
1 <= left.length, right.length <= 18
-
left and right consist of only digits.
-
left and right cannot have leading zeros.
-
left and right represent integers in the range [1, 1018 - 1].
A super ugly number is a positive integer whose prime factors are in the array primes.
-
-
Given an integer n and an array of integers primes, return thenthsuper ugly number.
-
-
The nthsuper ugly number is guaranteed to fit in a 32-bit signed integer.
-
-
-
Example 1:
-
-
-Input: n = 12, primes = [2,7,13,19]
-Output: 32
-Explanation: [1,2,4,7,8,13,14,16,19,26,28,32] is the sequence of the first 12 super ugly numbers given primes = [2,7,13,19].
-
-
-
Example 2:
-
-
-Input: n = 1, primes = [2,3,5]
-Output: 1
-Explanation: 1 has no prime factors, therefore all of its prime factors are in the array primes = [2,3,5].
-
-
-
-
Constraints:
-
-
-
1 <= n <= 106
-
1 <= primes.length <= 100
-
2 <= primes[i] <= 1000
-
primes[i] is guaranteed to be a prime number.
-
All the values of primes are unique and sorted in ascending order.
You have n super washing machines on a line. Initially, each washing machine has some dresses or is empty.
-
-
For each move, you could choose any m (1 <= m <= n) washing machines, and pass one dress of each washing machine to one of its adjacent washing machines at the same time.
-
-
Given an integer array machines representing the number of dresses in each washing machine from left to right on the line, return the minimum number of moves to make all the washing machines have the same number of dresses. If it is not possible to do it, return -1.
You are given an n x ngrid where you have placed some 1 x 1 x 1 cubes. Each value v = grid[i][j] represents a tower of v cubes placed on top of cell (i, j).
-
-
After placing these cubes, you have decided to glue any directly adjacent cubes to each other, forming several irregular 3D shapes.
-
-
Return the total surface area of the resulting shapes.
-
-
Note: The bottom face of each shape counts toward its surface area.
Given an m x n matrix board containing 'X' and 'O', capture all regions that are 4-directionally surrounded by'X'.
-
-
A region is captured by flipping all 'O's into 'X's in that surrounded region.
-
-
-
Example 1:
-
-
-Input: board = [["X","X","X","X"],["X","O","O","X"],["X","X","O","X"],["X","O","X","X"]]
-Output: [["X","X","X","X"],["X","X","X","X"],["X","X","X","X"],["X","O","X","X"]]
-Explanation: Surrounded regions should not be on the border, which means that any 'O' on the border of the board are not flipped to 'X'. Any 'O' that is not on the border and it is not connected to an 'O' on the border will be flipped to 'X'. Two cells are connected if they are adjacent cells connected horizontally or vertically.
-
In a string composed of 'L', 'R', and 'X' characters, like "RXXLRXRXL", a move consists of either replacing one occurrence of "XL" with "LX", or replacing one occurrence of "RX" with "XR". Given the starting string start and the ending string end, return True if and only if there exists a sequence of moves to transform one string to the other.
-
-
-
Example 1:
-
-
-Input: start = "RXXLRXRXL", end = "XRLXXRRLX"
-Output: true
-Explanation: We can transform start to end following these steps:
-RXXLRXRXL ->
-XRXLRXRXL ->
-XRLXRXRXL ->
-XRLXXRRXL ->
-XRLXXRRLX
-
-
-
Example 2:
-
-
-Input: start = "X", end = "L"
-Output: false
-
-
-
-
Constraints:
-
-
-
1 <= start.length <= 104
-
start.length == end.length
-
Both start and end will only consist of characters in 'L', 'R', and 'X'.
-
-
-### Related Topics
- [[Two Pointers](../../tag/two-pointers/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Hints
-
-Hint 1
-Think of the L and R's as people on a horizontal line, where X is a space. The people can't cross each other, and also you can't go from XRX to RXX.
-
diff --git a/problems/swap-adjacent-in-lr-string/swap_adjacent_in_lr_string.go b/problems/swap-adjacent-in-lr-string/swap_adjacent_in_lr_string.go
deleted file mode 100644
index c28119601..000000000
--- a/problems/swap-adjacent-in-lr-string/swap_adjacent_in_lr_string.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem777
diff --git a/problems/swap-adjacent-in-lr-string/swap_adjacent_in_lr_string_test.go b/problems/swap-adjacent-in-lr-string/swap_adjacent_in_lr_string_test.go
deleted file mode 100644
index c28119601..000000000
--- a/problems/swap-adjacent-in-lr-string/swap_adjacent_in_lr_string_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem777
diff --git a/problems/swap-for-longest-repeated-character-substring/README.md b/problems/swap-for-longest-repeated-character-substring/README.md
deleted file mode 100644
index d4f009b32..000000000
--- a/problems/swap-for-longest-repeated-character-substring/README.md
+++ /dev/null
@@ -1,60 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../number-of-dice-rolls-with-target-sum "Number of Dice Rolls With Target Sum")
-
-[Next >](../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 "单字符重复子串的最大长度")
-
-
You are given a string text. You can swap two of the characters in the text.
-
-
Return the length of the longest substring with repeated characters.
-
-
-
Example 1:
-
-
-Input: text = "ababa"
-Output: 3
-Explanation: We can swap the first 'b' with the last 'a', or the last 'b' with the first 'a'. Then, the longest repeated character substring is "aaa" with length 3.
-
-
-
Example 2:
-
-
-Input: text = "aaabaaa"
-Output: 6
-Explanation: Swap 'b' with the last 'a' (or the first 'a'), and we get longest repeated character substring "aaaaaa" with length 6.
-
-
-
Example 3:
-
-
-Input: text = "aaaaa"
-Output: 5
-Explanation: No need to swap, longest repeated character substring is "aaaaa" with length is 5.
-
-
-
-
Constraints:
-
-
-
1 <= text.length <= 2 * 104
-
text consist of lowercase English characters only.
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
- [[Sliding Window](../../tag/sliding-window/README.md)]
-
-### Hints
-
-Hint 1
-There are two cases: a block of characters, or two blocks of characters between one different character.
- By keeping a run-length encoded version of the string, we can easily check these cases.
-
diff --git a/problems/swap-nodes-in-pairs/README.md b/problems/swap-nodes-in-pairs/README.md
deleted file mode 100644
index 25b2d137f..000000000
--- a/problems/swap-nodes-in-pairs/README.md
+++ /dev/null
@@ -1,52 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../merge-k-sorted-lists "Merge k Sorted Lists")
-
-[Next >](../reverse-nodes-in-k-group "Reverse Nodes in k-Group")
-
-## [24. Swap Nodes in Pairs (Medium)](https://leetcode.com/problems/swap-nodes-in-pairs "两两交换链表中的节点")
-
-
Given a linked list, swap every two adjacent nodes and return its head. You must solve the problem without modifying the values in the list's nodes (i.e., only nodes themselves may be changed.)
-
-
-
Example 1:
-
-
-Input: head = [1,2,3,4]
-Output: [2,1,4,3]
-
-
-
Example 2:
-
-
-Input: head = []
-Output: []
-
-
-
Example 3:
-
-
-Input: head = [1]
-Output: [1]
-
-
-
-
Constraints:
-
-
-
The number of nodes in the list is in the range [0, 100].
-+-------------+----------+
-| Column Name | Type |
-+-------------+----------+
-| id | int |
-| name | varchar |
-| sex | ENUM |
-| salary | int |
-+-------------+----------+
-id is the primary key for this table.
-The sex column is ENUM value of type ('m', 'f').
-The table contains information about an employee.
-
-
-
-
-
Write an SQL query to swap all 'f' and 'm' values (i.e., change all 'f' values to 'm' and vice versa) with a single update statement and no intermediate temporary tables.
-
-
Note that you must write a single update statement, do not write any select statement for this problem.
-
-
The query result format is in the following example.
-
-
-
Example 1:
-
-
-Input:
-Salary table:
-+----+------+-----+--------+
-| id | name | sex | salary |
-+----+------+-----+--------+
-| 1 | A | m | 2500 |
-| 2 | B | f | 1500 |
-| 3 | C | m | 5500 |
-| 4 | D | f | 500 |
-+----+------+-----+--------+
-Output:
-+----+------+-----+--------+
-| id | name | sex | salary |
-+----+------+-----+--------+
-| 1 | A | f | 2500 |
-| 2 | B | m | 1500 |
-| 3 | C | f | 5500 |
-| 4 | D | m | 500 |
-+----+------+-----+--------+
-Explanation:
-(1, A) and (3, C) were changed from 'm' to 'f'.
-(2, B) and (4, D) were changed from 'f' to 'm'.
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/swap-salary/mysql_schemas.sql b/problems/swap-salary/mysql_schemas.sql
deleted file mode 100644
index dd8dccfe3..000000000
--- a/problems/swap-salary/mysql_schemas.sql
+++ /dev/null
@@ -1,6 +0,0 @@
-Create table If Not Exists Salary (id int, name varchar(100), sex char(1), salary int);
-Truncate table salary;
-insert into salary (id, name, sex, salary) values ('1', 'A', 'm', '2500');
-insert into salary (id, name, sex, salary) values ('2', 'B', 'f', '1500');
-insert into salary (id, name, sex, salary) values ('3', 'C', 'm', '5500');
-insert into salary (id, name, sex, salary) values ('4', 'D', 'f', '500');
diff --git a/problems/swap-salary/swap_salary.sql b/problems/swap-salary/swap_salary.sql
deleted file mode 100644
index 3225d0023..000000000
--- a/problems/swap-salary/swap_salary.sql
+++ /dev/null
@@ -1,12 +0,0 @@
-# Write your MySQL query statement below
-
-# Method 1
-UPDATE salary
-SET sex = IF(sex = 'm', 'f', 'm');
-
-# Method 2
-UPDATE salary
-SET sex = CASE sex
- WHEN 'm'
- THEN 'f'
- ELSE 'm' END;
diff --git a/problems/swapping-nodes-in-a-linked-list/README.md b/problems/swapping-nodes-in-a-linked-list/README.md
deleted file mode 100644
index 230f24024..000000000
--- a/problems/swapping-nodes-in-a-linked-list/README.md
+++ /dev/null
@@ -1,60 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../decode-xored-array "Decode XORed Array")
-
-[Next >](../minimize-hamming-distance-after-swap-operations "Minimize Hamming Distance After Swap Operations")
-
-## [1721. Swapping Nodes in a Linked List (Medium)](https://leetcode.com/problems/swapping-nodes-in-a-linked-list "交换链表中的节点")
-
-
You are given the head of a linked list, and an integer k.
-
-
Return the head of the linked list after swapping the values of the kthnode from the beginning and the kthnode from the end (the list is 1-indexed).
-
-
-
Example 1:
-
-
-Input: head = [1,2,3,4,5], k = 2
-Output: [1,4,3,2,5]
-
-
-
Example 2:
-
-
-Input: head = [7,9,6,6,7,8,3,0,9,5], k = 5
-Output: [7,9,6,6,8,7,3,0,9,5]
-
-
-
-
Constraints:
-
-
-
The number of nodes in the list is n.
-
1 <= k <= n <= 105
-
0 <= Node.val <= 100
-
-
-### Related Topics
- [[Linked List](../../tag/linked-list/README.md)]
- [[Two Pointers](../../tag/two-pointers/README.md)]
-
-### Similar Questions
- 1. [Remove Nth Node From End of List](../remove-nth-node-from-end-of-list) (Medium)
- 1. [Swap Nodes in Pairs](../swap-nodes-in-pairs) (Medium)
- 1. [Reverse Nodes in k-Group](../reverse-nodes-in-k-group) (Hard)
-
-### Hints
-
-Hint 1
-We can transform the linked list to an array this should ease things up
-
-
-
-Hint 2
-After transforming the linked list to an array it becomes as easy as swapping two integers in an array then rebuilding the linked list
-
diff --git a/problems/swim-in-rising-water/README.md b/problems/swim-in-rising-water/README.md
deleted file mode 100644
index b70685f53..000000000
--- a/problems/swim-in-rising-water/README.md
+++ /dev/null
@@ -1,69 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../swap-adjacent-in-lr-string "Swap Adjacent in LR String")
-
-[Next >](../k-th-symbol-in-grammar "K-th Symbol in Grammar")
-
-## [778. Swim in Rising Water (Hard)](https://leetcode.com/problems/swim-in-rising-water "水位上升的泳池中游泳")
-
-
You are given an n x n integer matrix grid where each value grid[i][j] represents the elevation at that point (i, j).
-
-
The rain starts to fall. At time t, the depth of the water everywhere is t. You can swim from a square to another 4-directionally adjacent square if and only if the elevation of both squares individually are at most t. You can swim infinite distances in zero time. Of course, you must stay within the boundaries of the grid during your swim.
-
-
Return the least time until you can reach the bottom right square (n - 1, n - 1) if you start at the top left square (0, 0).
-
-
-
Example 1:
-
-
-Input: grid = [[0,2],[1,3]]
-Output: 3
-Explanation:
-At time 0, you are in grid location (0, 0).
-You cannot go anywhere else because 4-directionally adjacent neighbors have a higher elevation than t = 0.
-You cannot reach point (1, 1) until time 3.
-When the depth of water is 3, we can swim anywhere inside the grid.
-
-
-
Example 2:
-
-
-Input: grid = [[0,1,2,3,4],[24,23,22,21,5],[12,13,14,15,16],[11,17,18,19,20],[10,9,8,7,6]]
-Output: 16
-Explanation: The final route is shown.
-We need to wait until time 16 so that (0, 0) and (4, 4) are connected.
-
-
-
-
Constraints:
-
-
-
n == grid.length
-
n == grid[i].length
-
1 <= n <= 50
-
0 <= grid[i][j] < n2
-
Each value grid[i][j] is unique.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Union Find](../../tag/union-find/README.md)]
- [[Heap (Priority Queue)](../../tag/heap-priority-queue/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
-
-### Similar Questions
- 1. [Path With Minimum Effort](../path-with-minimum-effort) (Medium)
-
-### Hints
-
-Hint 1
-Use either Dijkstra's, or binary search for the best time T for which you can reach the end if you only step on squares at most T.
-
diff --git a/problems/swim-in-rising-water/swim_in_rising_water.go b/problems/swim-in-rising-water/swim_in_rising_water.go
deleted file mode 100644
index 5cc5d6429..000000000
--- a/problems/swim-in-rising-water/swim_in_rising_water.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem778
diff --git a/problems/swim-in-rising-water/swim_in_rising_water_test.go b/problems/swim-in-rising-water/swim_in_rising_water_test.go
deleted file mode 100644
index 5cc5d6429..000000000
--- a/problems/swim-in-rising-water/swim_in_rising_water_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem778
diff --git a/problems/symmetric-tree/README.md b/problems/symmetric-tree/README.md
deleted file mode 100644
index d5627165a..000000000
--- a/problems/symmetric-tree/README.md
+++ /dev/null
@@ -1,46 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../same-tree "Same Tree")
-
-[Next >](../binary-tree-level-order-traversal "Binary Tree Level Order Traversal")
-
-## [101. Symmetric Tree (Easy)](https://leetcode.com/problems/symmetric-tree "对称二叉树")
-
-
Given the root of a binary tree, check whether it is a mirror of itself (i.e., symmetric around its center).
The number of nodes in the tree is in the range [1, 1000].
-
-100 <= Node.val <= 100
-
-
-
-Follow up: Could you solve it both recursively and iteratively?
-
-### Related Topics
- [[Tree](../../tag/tree/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Binary Tree](../../tag/binary-tree/README.md)]
diff --git a/problems/symmetric-tree/symmetric_tree.go b/problems/symmetric-tree/symmetric_tree.go
deleted file mode 100644
index 1b4995c61..000000000
--- a/problems/symmetric-tree/symmetric_tree.go
+++ /dev/null
@@ -1,27 +0,0 @@
-package problem101
-
-import "github.com/awesee/leetcode/internal/kit"
-
-// TreeNode - Definition for a binary tree node.
-type TreeNode = kit.TreeNode
-
-/**
- * Definition for a binary tree node.
- * type TreeNode struct {
- * Val int
- * Left *TreeNode
- * Right *TreeNode
- * }
- */
-func isSymmetric(root *TreeNode) bool {
- return isMirror(root, root)
-}
-
-func isMirror(t1, t2 *TreeNode) bool {
- if t1 == nil && t2 == nil {
- return true
- } else if t1 == nil || t2 == nil {
- return false
- }
- return t1.Val == t2.Val && isMirror(t1.Left, t2.Right) && isMirror(t1.Right, t2.Left)
-}
diff --git a/problems/symmetric-tree/symmetric_tree_test.go b/problems/symmetric-tree/symmetric_tree_test.go
deleted file mode 100644
index f84c9d137..000000000
--- a/problems/symmetric-tree/symmetric_tree_test.go
+++ /dev/null
@@ -1,31 +0,0 @@
-package problem101
-
-import (
- "testing"
-
- "github.com/awesee/leetcode/internal/kit"
-)
-
-type testType struct {
- in []int
- want bool
-}
-
-func TestIsSymmetric(t *testing.T) {
- tests := [...]testType{
- {
- in: []int{1, 2, 2, 3, 4, 4, 3},
- want: true,
- },
- {
- in: []int{1, 2, 2, kit.NULL, 3, kit.NULL, 3},
- want: false,
- },
- }
- for _, tt := range tests {
- got := isSymmetric(kit.SliceInt2TreeNode(tt.in))
- if got != tt.want {
- t.Fatalf("in: %v, got: %v, want: %v", tt.in, got, tt.want)
- }
- }
-}
diff --git a/problems/synonymous-sentences/README.md b/problems/synonymous-sentences/README.md
deleted file mode 100644
index 011fc9ffe..000000000
--- a/problems/synonymous-sentences/README.md
+++ /dev/null
@@ -1,63 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../smallest-common-region "Smallest Common Region")
-
-[Next >](../handshakes-that-dont-cross "Handshakes That Don't Cross")
-
-## [1258. Synonymous Sentences (Medium)](https://leetcode.com/problems/synonymous-sentences "近义词句子")
-
-Given a list of pairs of equivalent words synonyms and a sentence text, Return all possible synonymous sentences sorted lexicographically.
-
-
Example 1:
-
-
-Input:
-synonyms = [["happy","joy"],["sad","sorrow"],["joy","cheerful"]],
-text = "I am happy today but was sad yesterday"
-Output:
-["I am cheerful today but was sad yesterday",
-"I am cheerful today but was sorrow yesterday",
-"I am happy today but was sad yesterday",
-"I am happy today but was sorrow yesterday",
-"I am joy today but was sad yesterday",
-"I am joy today but was sorrow yesterday"]
-
-
-
-
Constraints:
-
-
-
0 <= synonyms.length <= 10
-
synonyms[i].length == 2
-
synonyms[0] != synonyms[1]
-
All words consist of at most 10 English letters only.
-
text is a single space separated sentence of at most 10 words.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
- [[Backtracking](../../tag/backtracking/README.md)]
- [[Union Find](../../tag/union-find/README.md)]
-
-### Hints
-
-Hint 1
-Find all synonymous groups of words.
-
-
-
-Hint 2
-Use union-find data structure.
-
-
-
-Hint 3
-By backtracking, generate all possible statements.
-
diff --git a/problems/tag-validator/README.md b/problems/tag-validator/README.md
deleted file mode 100644
index f210a6fe3..000000000
--- a/problems/tag-validator/README.md
+++ /dev/null
@@ -1,87 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../n-ary-tree-postorder-traversal "N-ary Tree Postorder Traversal")
-
-[Next >](../fraction-addition-and-subtraction "Fraction Addition and Subtraction")
-
-## [591. Tag Validator (Hard)](https://leetcode.com/problems/tag-validator "标签验证器")
-
-
Given a string representing a code snippet, implement a tag validator to parse the code and return whether it is valid.
-
-
A code snippet is valid if all the following rules hold:
-
-
-
The code must be wrapped in a valid closed tag. Otherwise, the code is invalid.
-
A closed tag (not necessarily valid) has exactly the following format : <TAG_NAME>TAG_CONTENT</TAG_NAME>. Among them, <TAG_NAME> is the start tag, and </TAG_NAME> is the end tag. The TAG_NAME in start and end tags should be the same. A closed tag is valid if and only if the TAG_NAME and TAG_CONTENT are valid.
-
A validTAG_NAME only contain upper-case letters, and has length in range [1,9]. Otherwise, the TAG_NAME is invalid.
-
A validTAG_CONTENT may contain other valid closed tags, cdata and any characters (see note1) EXCEPT unmatched <, unmatched start and end tag, and unmatched or closed tags with invalid TAG_NAME. Otherwise, the TAG_CONTENT is invalid.
-
A start tag is unmatched if no end tag exists with the same TAG_NAME, and vice versa. However, you also need to consider the issue of unbalanced when tags are nested.
-
A < is unmatched if you cannot find a subsequent >. And when you find a < or </, all the subsequent characters until the next > should be parsed as TAG_NAME (not necessarily valid).
-
The cdata has the following format : <![CDATA[CDATA_CONTENT]]>. The range of CDATA_CONTENT is defined as the characters between <![CDATA[ and the first subsequent]]>.
-
CDATA_CONTENT may contain any characters. The function of cdata is to forbid the validator to parse CDATA_CONTENT, so even it has some characters that can be parsed as tag (no matter valid or invalid), you should treat it as regular characters.
-
-
-
-
Example 1:
-
-
-Input: code = "<DIV>This is the first line <![CDATA[<div>]]></DIV>"
-Output: true
-Explanation:
-The code is wrapped in a closed tag : <DIV> and </DIV>.
-The TAG_NAME is valid, the TAG_CONTENT consists of some characters and cdata.
-Although CDATA_CONTENT has an unmatched start tag with invalid TAG_NAME, it should be considered as plain text, not parsed as a tag.
-So TAG_CONTENT is valid, and then the code is valid. Thus return true.
-
-
-
Example 2:
-
-
-Input: code = "<DIV>>> ![cdata[]] <![CDATA[<div>]>]]>]]>>]</DIV>"
-Output: true
-Explanation:
-We first separate the code into : start_tag|tag_content|end_tag.
-start_tag -> "<DIV>"
-end_tag -> "</DIV>"
-tag_content could also be separated into : text1|cdata|text2.
-text1 -> ">> ![cdata[]] "
-cdata -> "<![CDATA[<div>]>]]>", where the CDATA_CONTENT is "<div>]>"
-text2 -> "]]>>]"
-The reason why start_tag is NOT "<DIV>>>" is because of the rule 6.
-The reason why cdata is NOT "<![CDATA[<div>]>]]>]]>" is because of the rule 7.
-
-
-
Example 3:
-
-
-Input: code = "<A> <B> </A> </B>"
-Output: false
-Explanation: Unbalanced. If "<A>" is closed, then "<B>" must be unmatched, and vice versa.
-
-
-
Example 4:
-
-
-Input: code = "<DIV> div tag is not closed <DIV>"
-Output: false
-
-
-
-
Constraints:
-
-
-
1 <= code.length <= 500
-
code consists of English letters, digits, '<', '>', '/', '!', '[', ']', '.', and ' '.
-
-
-### Related Topics
- [[Stack](../../tag/stack/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Similar Questions
- 1. [Add Bold Tag in String](../add-bold-tag-in-string) (Medium)
diff --git a/problems/tag-validator/tag_validator.go b/problems/tag-validator/tag_validator.go
deleted file mode 100644
index 62b06cd23..000000000
--- a/problems/tag-validator/tag_validator.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem591
diff --git a/problems/tag-validator/tag_validator_test.go b/problems/tag-validator/tag_validator_test.go
deleted file mode 100644
index 62b06cd23..000000000
--- a/problems/tag-validator/tag_validator_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem591
diff --git a/problems/tallest-billboard/README.md b/problems/tallest-billboard/README.md
deleted file mode 100644
index 3d3e7c94a..000000000
--- a/problems/tallest-billboard/README.md
+++ /dev/null
@@ -1,56 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../delete-columns-to-make-sorted-ii "Delete Columns to Make Sorted II")
-
-[Next >](../prison-cells-after-n-days "Prison Cells After N Days")
-
-## [956. Tallest Billboard (Hard)](https://leetcode.com/problems/tallest-billboard "最高的广告牌")
-
-
You are installing a billboard and want it to have the largest height. The billboard will have two steel supports, one on each side. Each steel support must be an equal height.
-
-
You are given a collection of rods that can be welded together. For example, if you have rods of lengths 1, 2, and 3, you can weld them together to make a support of length 6.
-
-
Return the largest possible height of your billboard installation. If you cannot support the billboard, return 0.
-
-
-
Example 1:
-
-
-Input: rods = [1,2,3,6]
-Output: 6
-Explanation: We have two disjoint subsets {1,2,3} and {6}, which have the same sum = 6.
-
-
-
Example 2:
-
-
-Input: rods = [1,2,3,4,5,6]
-Output: 10
-Explanation: We have two disjoint subsets {2,3,5} and {4,6}, which have the same sum = 10.
-
-
-
Example 3:
-
-
-Input: rods = [1,2]
-Output: 0
-Explanation: The billboard cannot be supported, so we return 0.
-
You are given an integer array nums and an integer target.
-
-
You want to build an expression out of nums by adding one of the symbols '+' and '-' before each integer in nums and then concatenate all the integers.
-
-
-
For example, if nums = [2, 1], you can add a '+' before 2 and a '-' before 1 and concatenate them to build the expression "+2-1".
-
-
-
Return the number of different expressions that you can build, which evaluates to target.
-
-
-
Example 1:
-
-
-Input: nums = [1,1,1,1,1], target = 3
-Output: 5
-Explanation: There are 5 ways to assign symbols to make the sum of nums be target 3.
--1 + 1 + 1 + 1 + 1 = 3
-+1 - 1 + 1 + 1 + 1 = 3
-+1 + 1 - 1 + 1 + 1 = 3
-+1 + 1 + 1 - 1 + 1 = 3
-+1 + 1 + 1 + 1 - 1 = 3
-
Given a characters array tasks, representing the tasks a CPU needs to do, where each letter represents a different task. Tasks could be done in any order. Each task is done in one unit of time. For each unit of time, the CPU could complete either one task or just be idle.
-
-
However, there is a non-negative integer n that represents the cooldown period between two same tasks (the same letter in the array), that is that there must be at least n units of time between any two same tasks.
-
-
Return the least number of units of times that the CPU will take to finish all the given tasks.
-
-
-
Example 1:
-
-
-Input: tasks = ["A","A","A","B","B","B"], n = 2
-Output: 8
-Explanation:
-A -> B -> idle -> A -> B -> idle -> A -> B
-There is at least 2 units of time between any two same tasks.
-
-
-
Example 2:
-
-
-Input: tasks = ["A","A","A","B","B","B"], n = 0
-Output: 6
-Explanation: On this case any permutation of size 6 would work since n = 0.
-["A","A","A","B","B","B"]
-["A","B","A","B","A","B"]
-["B","B","B","A","A","A"]
-...
-And so on.
-
-
-
Example 3:
-
-
-Input: tasks = ["A","A","A","A","A","A","B","C","D","E","F","G"], n = 2
-Output: 16
-Explanation:
-One possible solution is
-A -> B -> C -> A -> D -> E -> A -> F -> G -> A -> idle -> idle -> A -> idle -> idle -> A
-
-
-
-
Constraints:
-
-
-
1 <= task.length <= 104
-
tasks[i] is upper-case English letter.
-
The integer n is in the range [0, 100].
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Greedy](../../tag/greedy/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
- [[Heap (Priority Queue)](../../tag/heap-priority-queue/README.md)]
- [[Counting](../../tag/counting/README.md)]
-
-### Similar Questions
- 1. [Rearrange String k Distance Apart](../rearrange-string-k-distance-apart) (Hard)
- 1. [Reorganize String](../reorganize-string) (Medium)
- 1. [Maximum Number of Weeks for Which You Can Work](../maximum-number-of-weeks-for-which-you-can-work) (Medium)
diff --git a/problems/task-scheduler/task_scheduler.go b/problems/task-scheduler/task_scheduler.go
deleted file mode 100644
index e66f99980..000000000
--- a/problems/task-scheduler/task_scheduler.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem621
diff --git a/problems/task-scheduler/task_scheduler_test.go b/problems/task-scheduler/task_scheduler_test.go
deleted file mode 100644
index e66f99980..000000000
--- a/problems/task-scheduler/task_scheduler_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem621
diff --git a/problems/team-scores-in-football-tournament/README.md b/problems/team-scores-in-football-tournament/README.md
deleted file mode 100644
index ea77aa03e..000000000
--- a/problems/team-scores-in-football-tournament/README.md
+++ /dev/null
@@ -1,93 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../queries-quality-and-percentage "Queries Quality and Percentage")
-
-[Next >](../intersection-of-three-sorted-arrays "Intersection of Three Sorted Arrays")
-
-## [1212. Team Scores in Football Tournament (Medium)](https://leetcode.com/problems/team-scores-in-football-tournament "查询球队积分")
-
-
Table: Teams
-
-
-+---------------+----------+
-| Column Name | Type |
-+---------------+----------+
-| team_id | int |
-| team_name | varchar |
-+---------------+----------+
-team_id is the primary key of this table.
-Each row of this table represents a single football team.
-
-
-
Table: Matches
-
-
-+---------------+---------+
-| Column Name | Type |
-+---------------+---------+
-| match_id | int |
-| host_team | int |
-| guest_team | int |
-| host_goals | int |
-| guest_goals | int |
-+---------------+---------+
-match_id is the primary key of this table.
-Each row is a record of a finished match between two different teams.
-Teams host_team and guest_team are represented by their IDs in the teams table (team_id) and they scored host_goals and guest_goals goals respectively.
-
-
-
-You would like to compute the scores of all teams after all matches. Points are awarded as follows:
-
-
-
A team receives three points if they win a match (Score strictly more goals than the opponent team).
-
A team receives one point if they draw a match (Same number of goals as the opponent team).
-
A team receives no points if they lose a match (Score less goals than the opponent team).
-
-
-
Write an SQL query that selects the team_id, team_name and num_points of each team in the tournament after all described matches. Result table should be ordered by num_points (decreasing order). In case of a tie, order the records by team_id (increasing order).
-
-
The query result format is in the following example:
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/team-scores-in-football-tournament/mysql_schemas.sql b/problems/team-scores-in-football-tournament/mysql_schemas.sql
deleted file mode 100644
index a09fa129d..000000000
--- a/problems/team-scores-in-football-tournament/mysql_schemas.sql
+++ /dev/null
@@ -1,14 +0,0 @@
-Create table If Not Exists Teams (team_id int, team_name varchar(30));
-Create table If Not Exists Matches (match_id int, host_team int, guest_team int, host_goals int, guest_goals int);
-Truncate table Teams;
-insert into Teams (team_id, team_name) values ('10', 'Leetcode FC');
-insert into Teams (team_id, team_name) values ('20', 'NewYork FC');
-insert into Teams (team_id, team_name) values ('30', 'Atlanta FC');
-insert into Teams (team_id, team_name) values ('40', 'Chicago FC');
-insert into Teams (team_id, team_name) values ('50', 'Toronto FC');
-Truncate table Matches;
-insert into Matches (match_id, host_team, guest_team, host_goals, guest_goals) values ('1', '10', '20', '3', '0');
-insert into Matches (match_id, host_team, guest_team, host_goals, guest_goals) values ('2', '30', '10', '2', '2');
-insert into Matches (match_id, host_team, guest_team, host_goals, guest_goals) values ('3', '10', '50', '5', '1');
-insert into Matches (match_id, host_team, guest_team, host_goals, guest_goals) values ('4', '20', '30', '1', '0');
-insert into Matches (match_id, host_team, guest_team, host_goals, guest_goals) values ('5', '50', '30', '1', '0');
diff --git a/problems/teemo-attacking/README.md b/problems/teemo-attacking/README.md
deleted file mode 100644
index 2698808e4..000000000
--- a/problems/teemo-attacking/README.md
+++ /dev/null
@@ -1,58 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../target-sum "Target Sum")
-
-[Next >](../next-greater-element-i "Next Greater Element I")
-
-## [495. Teemo Attacking (Easy)](https://leetcode.com/problems/teemo-attacking "提莫攻击")
-
-
Our hero Teemo is attacking an enemy Ashe with poison attacks! When Teemo attacks Ashe, Ashe gets poisoned for a exactly duration seconds. More formally, an attack at second t will mean Ashe is poisoned during the inclusive time interval [t, t + duration - 1]. If Teemo attacks again before the poison effect ends, the timer for it is reset, and the poison effect will end duration seconds after the new attack.
-
-
You are given a non-decreasing integer array timeSeries, where timeSeries[i] denotes that Teemo attacks Ashe at second timeSeries[i], and an integer duration.
-
-
Return the total number of seconds that Ashe is poisoned.
-
-
-
Example 1:
-
-
-Input: timeSeries = [1,4], duration = 2
-Output: 4
-Explanation: Teemo's attacks on Ashe go as follows:
-- At second 1, Teemo attacks, and Ashe is poisoned for seconds 1 and 2.
-- At second 4, Teemo attacks, and Ashe is poisoned for seconds 4 and 5.
-Ashe is poisoned for seconds 1, 2, 4, and 5, which is 4 seconds in total.
-
-
-
Example 2:
-
-
-Input: timeSeries = [1,2], duration = 2
-Output: 3
-Explanation: Teemo's attacks on Ashe go as follows:
-- At second 1, Teemo attacks, and Ashe is poisoned for seconds 1 and 2.
-- At second 2 however, Teemo attacks again and resets the poison timer. Ashe is poisoned for seconds 2 and 3.
-Ashe is poisoned for seconds 1, 2, and 3, which is 3 seconds in total.
Your script should output the tenth line, which is:
-
-
-Line 10
-
-
-
Note:
-1. If the file contains less than 10 lines, what should you output?
-2. There's at least three different solutions. Try to explore all possibilities.
-
-### Related Topics
- [[Shell](../../tag/shell/README.md)]
diff --git a/problems/tenth-line/file.txt b/problems/tenth-line/file.txt
deleted file mode 100644
index 00935f183..000000000
--- a/problems/tenth-line/file.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-Line 1
-Line 2
-Line 3
-Line 4
-Line 5
-Line 6
-Line 7
-Line 8
-Line 9
-Line 10
diff --git a/problems/tenth-line/tenth_line.bash b/problems/tenth-line/tenth_line.bash
deleted file mode 100755
index b8ddf9abb..000000000
--- a/problems/tenth-line/tenth_line.bash
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/usr/bin/env bash
-
-# Read from the file file.txt and output the tenth line to stdout.
-
-sed -n '10p' file.txt
diff --git a/problems/ternary-expression-parser/README.md b/problems/ternary-expression-parser/README.md
deleted file mode 100644
index 9ada653a3..000000000
--- a/problems/ternary-expression-parser/README.md
+++ /dev/null
@@ -1,75 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../find-all-anagrams-in-a-string "Find All Anagrams in a String")
-
-[Next >](../k-th-smallest-in-lexicographical-order "K-th Smallest in Lexicographical Order")
-
-## [439. Ternary Expression Parser (Medium)](https://leetcode.com/problems/ternary-expression-parser "三元表达式解析器")
-
-
Given a string representing arbitrarily nested ternary expressions, calculate the result of the expression. You can always assume that the given expression is valid and only consists of digits 0-9, ?, :, T and F (T and F represent True and False respectively).
-
-
Note:
-
-
The length of the given string is ≤ 10000.
-
Each number will contain only one digit.
-
The conditional expressions group right-to-left (as usual in most languages).
-
The condition will always be either T or F. That is, the condition will never be a digit.
-
The result of the expression will always evaluate to either a digit 0-9, T or F.
-
-
-
-
-Example 1:
-
-Input: "T?2:3"
-
-Output: "2"
-
-Explanation: If true, then result is 2; otherwise result is 3.
-
-
-
-
-Example 2:
-
-Input: "F?1:T?4:5"
-
-Output: "4"
-
-Explanation: The conditional expressions group right-to-left. Using parenthesis, it is read/evaluated as:
-
- "(F ? 1 : (T ? 4 : 5))" "(F ? 1 : (T ? 4 : 5))"
- -> "(F ? 1 : 4)" or -> "(T ? 4 : 5)"
- -> "4" -> "4"
-
-
-
-
-Example 3:
-
-Input: "T?T?F:5:3"
-
-Output: "F"
-
-Explanation: The conditional expressions group right-to-left. Using parenthesis, it is read/evaluated as:
-
- "(T ? (T ? F : 5) : 3)" "(T ? (T ? F : 5) : 3)"
- -> "(T ? F : 3)" or -> "(T ? F : 5)"
- -> "F" -> "F"
-
Given an array of strings words and a width maxWidth, format the text such that each line has exactly maxWidth characters and is fully (left and right) justified.
-
-
You should pack your words in a greedy approach; that is, pack as many words as you can in each line. Pad extra spaces ' ' when necessary so that each line has exactly maxWidth characters.
-
-
Extra spaces between words should be distributed as evenly as possible. If the number of spaces on a line does not divide evenly between words, the empty slots on the left will be assigned more spaces than the slots on the right.
-
-
For the last line of text, it should be left-justified and no extra space is inserted between words.
-
-
Note:
-
-
-
A word is defined as a character sequence consisting of non-space characters only.
-
Each word's length is guaranteed to be greater than 0 and not exceed maxWidth.
-
The input array words contains at least one word.
-
-
-
-
Example 1:
-
-
-Input: words = ["This", "is", "an", "example", "of", "text", "justification."], maxWidth = 16
-Output:
-[
- "This is an",
- "example of text",
- "justification. "
-]
-
-
Example 2:
-
-
-Input: words = ["What","must","be","acknowledgment","shall","be"], maxWidth = 16
-Output:
-[
- "What must be",
- "acknowledgment ",
- "shall be "
-]
-Explanation: Note that the last line is "shall be " instead of "shall be", because the last line must be left-justified instead of fully-justified.
-Note that the second line is also left-justified becase it contains only one word.
-
-
Example 3:
-
-
-Input: words = ["Science","is","what","we","understand","well","enough","to","explain","to","a","computer.","Art","is","everything","else","we","do"], maxWidth = 20
-Output:
-[
- "Science is what we",
- "understand well",
- "enough to explain to",
- "a computer. Art is",
- "everything else we",
- "do "
-]
-
-
-
Constraints:
-
-
-
1 <= words.length <= 300
-
1 <= words[i].length <= 20
-
words[i] consists of only English letters and symbols.
-
1 <= maxWidth <= 100
-
words[i].length <= maxWidth
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
- [[Simulation](../../tag/simulation/README.md)]
diff --git a/problems/text-justification/text_justification.go b/problems/text-justification/text_justification.go
deleted file mode 100644
index bb720d604..000000000
--- a/problems/text-justification/text_justification.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem68
diff --git a/problems/text-justification/text_justification_test.go b/problems/text-justification/text_justification_test.go
deleted file mode 100644
index bb720d604..000000000
--- a/problems/text-justification/text_justification_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem68
diff --git a/problems/the-airport-with-the-most-traffic/README.md b/problems/the-airport-with-the-most-traffic/README.md
deleted file mode 100644
index 00c570b75..000000000
--- a/problems/the-airport-with-the-most-traffic/README.md
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-operations-to-make-the-array-k-increasing "Minimum Operations to Make the Array K-Increasing")
-
-[Next >](../elements-in-array-after-removing-and-replacing-elements "Elements in Array After Removing and Replacing Elements")
-
-## [2112. The Airport With the Most Traffic (Medium)](https://leetcode.com/problems/the-airport-with-the-most-traffic "")
-
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/the-airport-with-the-most-traffic/mysql_schemas.sql b/problems/the-airport-with-the-most-traffic/mysql_schemas.sql
deleted file mode 100644
index 2c4c276f3..000000000
--- a/problems/the-airport-with-the-most-traffic/mysql_schemas.sql
+++ /dev/null
@@ -1,5 +0,0 @@
-Create table If Not Exists Flights (departure_airport int, arrival_airport int, flights_count int);
-Truncate table Flights;
-insert into Flights (departure_airport, arrival_airport, flights_count) values ('1', '2', '4');
-insert into Flights (departure_airport, arrival_airport, flights_count) values ('2', '1', '5');
-insert into Flights (departure_airport, arrival_airport, flights_count) values ('2', '4', '5');
diff --git a/problems/the-category-of-each-member-in-the-store/README.md b/problems/the-category-of-each-member-in-the-store/README.md
deleted file mode 100644
index 2f2569f3c..000000000
--- a/problems/the-category-of-each-member-in-the-store/README.md
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../parallel-courses-iii "Parallel Courses III")
-
-[Next >](../minimum-cost-to-separate-sentence-into-rows "Minimum Cost to Separate Sentence Into Rows")
-
-## [2051. The Category of Each Member in the Store (Medium)](https://leetcode.com/problems/the-category-of-each-member-in-the-store "")
-
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/the-category-of-each-member-in-the-store/mysql_schemas.sql b/problems/the-category-of-each-member-in-the-store/mysql_schemas.sql
deleted file mode 100644
index e5664f6fc..000000000
--- a/problems/the-category-of-each-member-in-the-store/mysql_schemas.sql
+++ /dev/null
@@ -1,21 +0,0 @@
-Create table If Not Exists Members (member_id int, name varchar(30));
-Create table If Not Exists Visits (visit_id int, member_id int, visit_date date);
-Create table If Not Exists Purchases (visit_id int, charged_amount int);
-Truncate table Members;
-insert into Members (member_id, name) values ('9', 'Alice');
-insert into Members (member_id, name) values ('11', 'Bob');
-insert into Members (member_id, name) values ('3', 'Winston');
-insert into Members (member_id, name) values ('8', 'Hercy');
-insert into Members (member_id, name) values ('1', 'Narihan');
-Truncate table Visits;
-insert into Visits (visit_id, member_id, visit_date) values ('22', '11', '2021-10-28');
-insert into Visits (visit_id, member_id, visit_date) values ('16', '11', '2021-01-12');
-insert into Visits (visit_id, member_id, visit_date) values ('18', '9', '2021-12-10');
-insert into Visits (visit_id, member_id, visit_date) values ('19', '3', '2021-10-19');
-insert into Visits (visit_id, member_id, visit_date) values ('12', '11', '2021-03-01');
-insert into Visits (visit_id, member_id, visit_date) values ('17', '8', '2021-05-07');
-insert into Visits (visit_id, member_id, visit_date) values ('21', '9', '2021-05-12');
-Truncate table Purchases;
-insert into Purchases (visit_id, charged_amount) values ('12', '2000');
-insert into Purchases (visit_id, charged_amount) values ('18', '9000');
-insert into Purchases (visit_id, charged_amount) values ('17', '7000');
diff --git a/problems/the-dining-philosophers/README.md b/problems/the-dining-philosophers/README.md
deleted file mode 100644
index 8199b4c4e..000000000
--- a/problems/the-dining-philosophers/README.md
+++ /dev/null
@@ -1,62 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../report-contiguous-dates "Report Contiguous Dates")
-
-[Next >](../airplane-seat-assignment-probability "Airplane Seat Assignment Probability")
-
-## [1226. The Dining Philosophers (Medium)](https://leetcode.com/problems/the-dining-philosophers "哲学家进餐")
-
-
Five silent philosophers sit at a round table with bowls of spaghetti. Forks are placed between each pair of adjacent philosophers.
-
-
Each philosopher must alternately think and eat. However, a philosopher can only eat spaghetti when they have both left and right forks. Each fork can be held by only one philosopher and so a philosopher can use the fork only if it is not being used by another philosopher. After an individual philosopher finishes eating, they need to put down both forks so that the forks become available to others. A philosopher can take the fork on their right or the one on their left as they become available, but cannot start eating before getting both forks.
-
-
Eating is not limited by the remaining amounts of spaghetti or stomach space; an infinite supply and an infinite demand are assumed.
-
-
Design a discipline of behaviour (a concurrent algorithm) such that no philosopher will starve; i.e., each can forever continue to alternate between eating and thinking, assuming that no philosopher can know when others may want to eat or think.
-
-
-
-
The problem statement and the image above are taken from wikipedia.org
-
-
-
-
The philosophers' ids are numbered from 0 to 4 in a clockwise order. Implement the function void wantsToEat(philosopher, pickLeftFork, pickRightFork, eat, putLeftFork, putRightFork) where:
-
-
-
philosopher is the id of the philosopher who wants to eat.
-
pickLeftFork and pickRightFork are functions you can call to pick the corresponding forks of that philosopher.
-
eat is a function you can call to let the philosopher eat once he has picked both forks.
-
putLeftFork and putRightFork are functions you can call to put down the corresponding forks of that philosopher.
-
The philosophers are assumed to be thinking as long as they are not asking to eat (the function is not being called with their number).
-
-
-
Five threads, each representing a philosopher, will simultaneously use one object of your class to simulate the process. The function may be called for the same philosopher more than once, even before the last call ends.
-
-
-
Example 1:
-
-
-Input: n = 1
-Output: [[4,2,1],[4,1,1],[0,1,1],[2,2,1],[2,1,1],[2,0,3],[2,1,2],[2,2,2],[4,0,3],[4,1,2],[0,2,1],[4,2,2],[3,2,1],[3,1,1],[0,0,3],[0,1,2],[0,2,2],[1,2,1],[1,1,1],[3,0,3],[3,1,2],[3,2,2],[1,0,3],[1,1,2],[1,2,2]]
-Explanation:
-n is the number of times each philosopher will call the function.
-The output array describes the calls you made to the functions controlling the forks and the eat function, its format is:
-output[i] = [a, b, c] (three integers)
-- a is the id of a philosopher.
-- b specifies the fork: {1 : left, 2 : right}.
-- c specifies the operation: {1 : pick, 2 : put, 3 : eat}.
-
-
-
Constraints:
-
-
-
1 <= n <= 60
-
-
-### Related Topics
- [[Concurrency](../../tag/concurrency/README.md)]
diff --git a/problems/the-earliest-and-latest-rounds-where-players-compete/README.md b/problems/the-earliest-and-latest-rounds-where-players-compete/README.md
deleted file mode 100644
index 21a5d1e92..000000000
--- a/problems/the-earliest-and-latest-rounds-where-players-compete/README.md
+++ /dev/null
@@ -1,82 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../merge-triplets-to-form-target-triplet "Merge Triplets to Form Target Triplet")
-
-[Next >](../find-a-peak-element-ii "Find a Peak Element II")
-
-## [1900. The Earliest and Latest Rounds Where Players Compete (Hard)](https://leetcode.com/problems/the-earliest-and-latest-rounds-where-players-compete "最佳运动员的比拼回合")
-
-
There is a tournament where n players are participating. The players are standing in a single row and are numbered from 1 to n based on their initial standing position (player 1 is the first player in the row, player 2 is the second player in the row, etc.).
-
-
The tournament consists of multiple rounds (starting from round number 1). In each round, the ith player from the front of the row competes against the ith player from the end of the row, and the winner advances to the next round. When the number of players is odd for the current round, the player in the middle automatically advances to the next round.
-
-
-
For example, if the row consists of players 1, 2, 4, 6, 7
-
-
Player 1 competes against player 7.
-
Player 2 competes against player 6.
-
Player 4 automatically advances to the next round.
-
-
-
-
-
After each round is over, the winners are lined back up in the row based on the original ordering assigned to them initially (ascending order).
-
-
The players numbered firstPlayer and secondPlayer are the best in the tournament. They can win against any other player before they compete against each other. If any two other players compete against each other, either of them might win, and thus you may choose the outcome of this round.
-
-
Given the integers n, firstPlayer, and secondPlayer, return an integer array containing two values, the earliest possible round number and the latest possible round number in which these two players will compete against each other, respectively.
-
-
-
Example 1:
-
-
-Input: n = 11, firstPlayer = 2, secondPlayer = 4
-Output: [3,4]
-Explanation:
-One possible scenario which leads to the earliest round number:
-First round: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11
-Second round: 2, 3, 4, 5, 6, 11
-Third round: 2, 3, 4
-One possible scenario which leads to the latest round number:
-First round: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11
-Second round: 1, 2, 3, 4, 5, 6
-Third round: 1, 2, 4
-Fourth round: 2, 4
-
-
-
Example 2:
-
-
-Input: n = 5, firstPlayer = 1, secondPlayer = 5
-Output: [1,1]
-Explanation: The players numbered 1 and 5 compete in the first round.
-There is no way to make them compete in any other round.
-
-
-
-
Constraints:
-
-
-
2 <= n <= 28
-
1 <= firstPlayer < secondPlayer <= n
-
-
-### Related Topics
- [[Memoization](../../tag/memoization/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Hints
-
-Hint 1
-Brute force using bitmasks and simulate the rounds.
-
-
-
-Hint 2
-Calculate each state one time and save its solution.
-
diff --git a/problems/the-earliest-moment-when-everyone-become-friends/README.md b/problems/the-earliest-moment-when-everyone-become-friends/README.md
deleted file mode 100644
index 97e5581bb..000000000
--- a/problems/the-earliest-moment-when-everyone-become-friends/README.md
+++ /dev/null
@@ -1,80 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../find-k-length-substrings-with-no-repeated-characters "Find K-Length Substrings With No Repeated Characters")
-
-[Next >](../path-with-maximum-minimum-value "Path With Maximum Minimum Value")
-
-## [1101. The Earliest Moment When Everyone Become Friends (Medium)](https://leetcode.com/problems/the-earliest-moment-when-everyone-become-friends "彼此熟识的最早时间")
-
-
In a social group, there are N people, with unique integer ids from 0 to N-1.
-
-
We have a list of logs, where each logs[i] = [timestamp, id_A, id_B] contains a non-negative integer timestamp, and the ids of two different people.
-
-
Each log represents the time in which two different people became friends. Friendship is symmetric: if A is friends with B, then B is friends with A.
-
-
Let's say that person A is acquainted with person B if A is friends with B, or A is a friend of someone acquainted with B.
-
-
Return the earliest time for which every person became acquainted with every other person. Return -1 if there is no such earliest time.
-
-
-
-
Example 1:
-
-
-Input: logs = [[20190101,0,1],[20190104,3,4],[20190107,2,3],[20190211,1,5],[20190224,2,4],[20190301,0,3],[20190312,1,2],[20190322,4,5]], N = 6
-Output: 20190301
-Explanation:
-The first event occurs at timestamp = 20190101 and after 0 and 1 become friends we have the following friendship groups [0,1], [2], [3], [4], [5].
-The second event occurs at timestamp = 20190104 and after 3 and 4 become friends we have the following friendship groups [0,1], [2], [3,4], [5].
-The third event occurs at timestamp = 20190107 and after 2 and 3 become friends we have the following friendship groups [0,1], [2,3,4], [5].
-The fourth event occurs at timestamp = 20190211 and after 1 and 5 become friends we have the following friendship groups [0,1,5], [2,3,4].
-The fifth event occurs at timestamp = 20190224 and as 2 and 4 are already friend anything happens.
-The sixth event occurs at timestamp = 20190301 and after 0 and 3 become friends we have that all become friends.
-
-
-
-
-
Note:
-
-
-
1 <= N <= 100
-
1 <= logs.length <= 10^4
-
0 <= logs[i][0] <= 10^9
-
0 <= logs[i][1], logs[i][2] <= N - 1
-
It's guaranteed that all timestamps in logs[i][0] are different.
-
Logs are not necessarily ordered by some criteria.
-
logs[i][1] != logs[i][2]
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Union Find](../../tag/union-find/README.md)]
-
-### Similar Questions
- 1. [Number of Provinces](../number-of-provinces) (Medium)
-
-### Hints
-
-Hint 1
-Sort the log items by their timestamp.
-
-
-
-Hint 2
-How can we model this problem as a graph problem?
-
-
-
-Hint 3
-Let's use a union-find data structure. At the beginning we have a graph with N nodes but no edges.
-
-
-
-Hint 4
-Then we loop through the events and if unite each node until the number of connected components reach to 1. Notice that each time two different connected components are united the number of connected components decreases by 1.
-
diff --git a/problems/the-k-strongest-values-in-an-array/README.md b/problems/the-k-strongest-values-in-an-array/README.md
deleted file mode 100644
index d063932a0..000000000
--- a/problems/the-k-strongest-values-in-an-array/README.md
+++ /dev/null
@@ -1,78 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../shuffle-the-array "Shuffle the Array")
-
-[Next >](../design-browser-history "Design Browser History")
-
-## [1471. The k Strongest Values in an Array (Medium)](https://leetcode.com/problems/the-k-strongest-values-in-an-array "数组中的 k 个最强值")
-
-
Given an array of integers arr and an integer k.
-
-
A value arr[i] is said to be stronger than a value arr[j] if |arr[i] - m| > |arr[j] - m| where m is the median of the array.
-If |arr[i] - m| == |arr[j] - m|, then arr[i] is said to be stronger than arr[j] if arr[i] > arr[j].
-
-
Return a list of the strongest k values in the array. return the answer in any arbitrary order.
-
-
Median is the middle value in an ordered integer list. More formally, if the length of the list is n, the median is the element in position ((n - 1) / 2) in the sorted list (0-indexed).
-
-
-
For arr = [6, -3, 7, 2, 11], n = 5 and the median is obtained by sorting the array arr = [-3, 2, 6, 7, 11] and the median is arr[m] where m = ((5 - 1) / 2) = 2. The median is 6.
-
For arr = [-7, 22, 17, 3], n = 4 and the median is obtained by sorting the array arr = [-7, 3, 17, 22] and the median is arr[m] where m = ((4 - 1) / 2) = 1. The median is 3.
-
-
-
-
Example 1:
-
-
-Input: arr = [1,2,3,4,5], k = 2
-Output: [5,1]
-Explanation: Median is 3, the elements of the array sorted by the strongest are [5,1,4,2,3]. The strongest 2 elements are [5, 1]. [1, 5] is also accepted answer.
-Please note that although |5 - 3| == |1 - 3| but 5 is stronger than 1 because 5 > 1.
-
-
-
Example 2:
-
-
-Input: arr = [1,1,3,5,5], k = 2
-Output: [5,5]
-Explanation: Median is 3, the elements of the array sorted by the strongest are [5,5,1,1,3]. The strongest 2 elements are [5, 5].
-
-
-
Example 3:
-
-
-Input: arr = [6,7,11,7,6,8], k = 5
-Output: [11,8,6,6,7]
-Explanation: Median is 7, the elements of the array sorted by the strongest are [11,8,6,6,7,7].
-Any permutation of [11,8,6,6,7] is accepted.
-
-
-
-
Constraints:
-
-
-
1 <= arr.length <= 105
-
-105 <= arr[i] <= 105
-
1 <= k <= arr.length
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Two Pointers](../../tag/two-pointers/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Hints
-
-Hint 1
-Calculate the median of the array as defined in the statement.
-
-
-
-Hint 2
-Use custom sort function to sort values (Strongest first), then slice the first k.
-
diff --git a/problems/the-k-th-lexicographical-string-of-all-happy-strings-of-length-n/README.md b/problems/the-k-th-lexicographical-string-of-all-happy-strings-of-length-n/README.md
deleted file mode 100644
index 099a3b76a..000000000
--- a/problems/the-k-th-lexicographical-string-of-all-happy-strings-of-length-n/README.md
+++ /dev/null
@@ -1,89 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../find-the-minimum-number-of-fibonacci-numbers-whose-sum-is-k "Find the Minimum Number of Fibonacci Numbers Whose Sum Is K")
-
-[Next >](../restore-the-array "Restore The Array")
-
-## [1415. The k-th Lexicographical String of All Happy Strings of Length n (Medium)](https://leetcode.com/problems/the-k-th-lexicographical-string-of-all-happy-strings-of-length-n "长度为 n 的开心字符串中字典序第 k 小的字符串")
-
-
A happy string is a string that:
-
-
-
consists only of letters of the set ['a', 'b', 'c'].
-
s[i] != s[i + 1] for all values of i from 1 to s.length - 1 (string is 1-indexed).
-
-
-
For example, strings "abc", "ac", "b" and "abcbabcbcb" are all happy strings and strings "aa", "baa" and "ababbc" are not happy strings.
-
-
Given two integers n and k, consider a list of all happy strings of length n sorted in lexicographical order.
-
-
Return the kth string of this list or return an empty string if there are less than k happy strings of length n.
-
-
-
Example 1:
-
-
-Input: n = 1, k = 3
-Output: "c"
-Explanation: The list ["a", "b", "c"] contains all happy strings of length 1. The third string is "c".
-
-
-
Example 2:
-
-
-Input: n = 1, k = 4
-Output: ""
-Explanation: There are only 3 happy strings of length 1.
-
-
-
Example 3:
-
-
-Input: n = 3, k = 9
-Output: "cab"
-Explanation: There are 12 different happy string of length 3 ["aba", "abc", "aca", "acb", "bab", "bac", "bca", "bcb", "cab", "cac", "cba", "cbc"]. You will find the 9th string = "cab"
-
-
-
Example 4:
-
-
-Input: n = 2, k = 7
-Output: ""
-
-
-
Example 5:
-
-
-Input: n = 10, k = 100
-Output: "abacbabacb"
-
-
-
-
Constraints:
-
-
-
1 <= n <= 10
-
1 <= k <= 100
-
-
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
- [[Backtracking](../../tag/backtracking/README.md)]
-
-### Hints
-
-Hint 1
-Generate recursively all the happy strings of length n.
-
-
-
-Hint 2
-Sort them in lexicographical order and return the kth string if it exists.
-
diff --git a/problems/the-k-weakest-rows-in-a-matrix/README.md b/problems/the-k-weakest-rows-in-a-matrix/README.md
deleted file mode 100644
index 7c502a569..000000000
--- a/problems/the-k-weakest-rows-in-a-matrix/README.md
+++ /dev/null
@@ -1,88 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../number-of-transactions-per-visit "Number of Transactions per Visit")
-
-[Next >](../reduce-array-size-to-the-half "Reduce Array Size to The Half")
-
-## [1337. The K Weakest Rows in a Matrix (Easy)](https://leetcode.com/problems/the-k-weakest-rows-in-a-matrix "矩阵中战斗力最弱的 K 行")
-
-
You are given an m x n binary matrix mat of 1's (representing soldiers) and 0's (representing civilians). The soldiers are positioned in front of the civilians. That is, all the 1's will appear to the left of all the 0's in each row.
-
-
A row i is weaker than a row j if one of the following is true:
-
-
-
The number of soldiers in row i is less than the number of soldiers in row j.
-
Both rows have the same number of soldiers and i < j.
-
-
-
Return the indices of the kweakest rows in the matrix ordered from weakest to strongest.
-
-
-
Example 1:
-
-
-Input: mat =
-[[1,1,0,0,0],
- [1,1,1,1,0],
- [1,0,0,0,0],
- [1,1,0,0,0],
- [1,1,1,1,1]],
-k = 3
-Output: [2,0,3]
-Explanation:
-The number of soldiers in each row is:
-- Row 0: 2
-- Row 1: 4
-- Row 2: 1
-- Row 3: 2
-- Row 4: 5
-The rows ordered from weakest to strongest are [2,0,3,1,4].
-
-
-
Example 2:
-
-
-Input: mat =
-[[1,0,0,0],
- [1,1,1,1],
- [1,0,0,0],
- [1,0,0,0]],
-k = 2
-Output: [0,2]
-Explanation:
-The number of soldiers in each row is:
-- Row 0: 1
-- Row 1: 4
-- Row 2: 1
-- Row 3: 1
-The rows ordered from weakest to strongest are [0,2,3,1].
-
-
-
-
Constraints:
-
-
-
m == mat.length
-
n == mat[i].length
-
2 <= n, m <= 100
-
1 <= k <= m
-
matrix[i][j] is either 0 or 1.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
- [[Heap (Priority Queue)](../../tag/heap-priority-queue/README.md)]
-
-### Hints
-
-Hint 1
-Sort the matrix row indexes by the number of soldiers and then row indexes.
-
diff --git a/problems/the-kth-factor-of-n/README.md b/problems/the-kth-factor-of-n/README.md
deleted file mode 100644
index ce9c4a33b..000000000
--- a/problems/the-kth-factor-of-n/README.md
+++ /dev/null
@@ -1,62 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../average-salary-excluding-the-minimum-and-maximum-salary "Average Salary Excluding the Minimum and Maximum Salary")
-
-[Next >](../longest-subarray-of-1s-after-deleting-one-element "Longest Subarray of 1's After Deleting One Element")
-
-## [1492. The kth Factor of n (Medium)](https://leetcode.com/problems/the-kth-factor-of-n "n 的第 k 个因子")
-
-
You are given two positive integers n and k. A factor of an integer n is defined as an integer i where n % i == 0.
-
-
Consider a list of all factors of n sorted in ascending order, return the kth factor in this list or return -1 if n has less than k factors.
-
-
-
Example 1:
-
-
-Input: n = 12, k = 3
-Output: 3
-Explanation: Factors list is [1, 2, 3, 4, 6, 12], the 3rd factor is 3.
-
-
-
Example 2:
-
-
-Input: n = 7, k = 2
-Output: 7
-Explanation: Factors list is [1, 7], the 2nd factor is 7.
-
-
-
Example 3:
-
-
-Input: n = 4, k = 4
-Output: -1
-Explanation: Factors list is [1, 2, 4], there is only 3 factors. We should return -1.
-
-
-
-
Constraints:
-
-
-
1 <= k <= n <= 1000
-
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
-
-### Hints
-
-Hint 1
-The factors of n will be always in the range [1, n].
-
-
-
-Hint 2
-Keep a list of all factors sorted. Loop i from 1 to n and add i if n % i == 0. Return the kth factor if it exist in this list.
-
diff --git a/problems/the-latest-login-in-2020/README.md b/problems/the-latest-login-in-2020/README.md
deleted file mode 100644
index 09cab9b9a..000000000
--- a/problems/the-latest-login-in-2020/README.md
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-space-wasted-from-packaging "Minimum Space Wasted From Packaging")
-
-[Next >](../cutting-ribbons "Cutting Ribbons")
-
-## [1890. The Latest Login in 2020 (Easy)](https://leetcode.com/problems/the-latest-login-in-2020 "2020年最后一次登录")
-
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/the-latest-login-in-2020/mysql_schemas.sql b/problems/the-latest-login-in-2020/mysql_schemas.sql
deleted file mode 100644
index feda94477..000000000
--- a/problems/the-latest-login-in-2020/mysql_schemas.sql
+++ /dev/null
@@ -1,11 +0,0 @@
-Create table If Not Exists Logins (user_id int, time_stamp datetime);
-Truncate table Logins;
-insert into Logins (user_id, time_stamp) values ('6', '2020-06-30 15:06:07');
-insert into Logins (user_id, time_stamp) values ('6', '2021-04-21 14:06:06');
-insert into Logins (user_id, time_stamp) values ('6', '2019-03-07 00:18:15');
-insert into Logins (user_id, time_stamp) values ('8', '2020-02-01 05:10:53');
-insert into Logins (user_id, time_stamp) values ('8', '2020-12-30 00:46:50');
-insert into Logins (user_id, time_stamp) values ('2', '2020-01-16 02:49:50');
-insert into Logins (user_id, time_stamp) values ('2', '2019-08-25 07:59:08');
-insert into Logins (user_id, time_stamp) values ('14', '2019-07-14 09:00:00');
-insert into Logins (user_id, time_stamp) values ('14', '2021-01-06 11:59:59');
diff --git a/problems/the-maze-ii/README.md b/problems/the-maze-ii/README.md
deleted file mode 100644
index d9bc886f6..000000000
--- a/problems/the-maze-ii/README.md
+++ /dev/null
@@ -1,81 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../base-7 "Base 7")
-
-[Next >](../relative-ranks "Relative Ranks")
-
-## [505. The Maze II (Medium)](https://leetcode.com/problems/the-maze-ii "迷宫 II")
-
-
There is a ball in a maze with empty spaces and walls. The ball can go through empty spaces by rolling up, down, left or right, but it won't stop rolling until hitting a wall. When the ball stops, it could choose the next direction.
-
-
Given the ball's start position, the destination and the maze, find the shortest distance for the ball to stop at the destination. The distance is defined by the number of empty spaces traveled by the ball from the start position (excluded) to the destination (included). If the ball cannot stop at the destination, return -1.
-
-
The maze is represented by a binary 2D array. 1 means the wall and 0 means the empty space. You may assume that the borders of the maze are all walls. The start and destination coordinates are represented by row and column indexes.
-
-
-
-
Example 1:
-
-
Input 1: a maze represented by a 2D array
-
-0 0 1 0 0
-0 0 0 0 0
-0 0 0 1 0
-1 1 0 1 1
-0 0 0 0 0
-
-Input 2: start coordinate (rowStart, colStart) = (0, 4)
-Input 3: destination coordinate (rowDest, colDest) = (4, 4)
-
-Output: 12
-
-Explanation: One shortest way is : left -> down -> left -> down -> right -> down -> right.
- The total distance is 1 + 1 + 3 + 1 + 2 + 2 + 2 = 12.
-
-
-
-
Example 2:
-
-
Input 1: a maze represented by a 2D array
-
-0 0 1 0 0
-0 0 0 0 0
-0 0 0 1 0
-1 1 0 1 1
-0 0 0 0 0
-
-Input 2: start coordinate (rowStart, colStart) = (0, 4)
-Input 3: destination coordinate (rowDest, colDest) = (3, 2)
-
-Output: -1
-
-Explanation: There is no way for the ball to stop at the destination.
-
-
-
-
-
-
Note:
-
-
-
There is only one ball and one destination in the maze.
-
Both the ball and the destination exist on an empty space, and they will not be at the same position initially.
-
The given maze does not contain border (like the red rectangle in the example pictures), but you could assume the border of the maze are all walls.
-
The maze contains at least 2 empty spaces, and both the width and height of the maze won't exceed 100.
There is a ball in a maze with empty spaces and walls. The ball can go through empty spaces by rolling up (u), down (d), left (l) or right (r), but it won't stop rolling until hitting a wall. When the ball stops, it could choose the next direction. There is also a hole in this maze. The ball will drop into the hole if it rolls on to the hole.
-
-
Given the ball position, the hole position and the maze, find out how the ball could drop into the hole by moving the shortest distance. The distance is defined by the number of empty spaces traveled by the ball from the start position (excluded) to the hole (included). Output the moving directions by using 'u', 'd', 'l' and 'r'. Since there could be several different shortest ways, you should output the lexicographically smallest way. If the ball cannot reach the hole, output "impossible".
-
-
The maze is represented by a binary 2D array. 1 means the wall and 0 means the empty space. You may assume that the borders of the maze are all walls. The ball and the hole coordinates are represented by row and column indexes.
-
-
-
-
Example 1:
-
-
-Input 1: a maze represented by a 2D array
-
-0 0 0 0 0
-1 1 0 0 1
-0 0 0 0 0
-0 1 0 0 1
-0 1 0 0 0
-
-Input 2: ball coordinate (rowBall, colBall) = (4, 3)
-Input 3: hole coordinate (rowHole, colHole) = (0, 1)
-
-Output: "lul"
-
-Explanation: There are two shortest ways for the ball to drop into the hole.
-The first way is left -> up -> left, represented by "lul".
-The second way is up -> left, represented by 'ul'.
-Both ways have shortest distance 6, but the first way is lexicographically smaller because 'l' < 'u'. So the output is "lul".
-
-
There is a ball in a maze with empty spaces and walls. The ball can go through empty spaces by rolling up, down, left or right, but it won't stop rolling until hitting a wall. When the ball stops, it could choose the next direction.
-
-
Given the ball's start position, the destination and the maze, determine whether the ball could stop at the destination.
-
-
The maze is represented by a binary 2D array. 1 means the wall and 0 means the empty space. You may assume that the borders of the maze are all walls. The start and destination coordinates are represented by row and column indexes.
-
-
-
-
Example 1:
-
-
Input 1: a maze represented by a 2D array
-
-0 0 1 0 0
-0 0 0 0 0
-0 0 0 1 0
-1 1 0 1 1
-0 0 0 0 0
-
-Input 2: start coordinate (rowStart, colStart) = (0, 4)
-Input 3: destination coordinate (rowDest, colDest) = (4, 4)
-
-Output: true
-
-Explanation: One possible way is : left -> down -> left -> down -> right -> down -> right.
-
-
-
-
Example 2:
-
-
Input 1: a maze represented by a 2D array
-
-0 0 1 0 0
-0 0 0 0 0
-0 0 0 1 0
-1 1 0 1 1
-0 0 0 0 0
-
-Input 2: start coordinate (rowStart, colStart) = (0, 4)
-Input 3: destination coordinate (rowDest, colDest) = (3, 2)
-
-Output: false
-
-Explanation: There is no way for the ball to stop at the destination.
-
-
-
-
-
-
Note:
-
-
-
There is only one ball and one destination in the maze.
-
Both the ball and the destination exist on an empty space, and they will not be at the same position initially.
-
The given maze does not contain border (like the red rectangle in the example pictures), but you could assume the border of the maze are all walls.
-
The maze contains at least 2 empty spaces, and both the width and height of the maze won't exceed 100.
-
-
-### Related Topics
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Graph](../../tag/graph/README.md)]
-
-### Similar Questions
- 1. [The Maze III](../the-maze-iii) (Hard)
- 1. [The Maze II](../the-maze-ii) (Medium)
diff --git a/problems/the-maze/the_maze.go b/problems/the-maze/the_maze.go
deleted file mode 100644
index dafead1d6..000000000
--- a/problems/the-maze/the_maze.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem490
diff --git a/problems/the-maze/the_maze_test.go b/problems/the-maze/the_maze_test.go
deleted file mode 100644
index dafead1d6..000000000
--- a/problems/the-maze/the_maze_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem490
diff --git a/problems/the-most-frequently-ordered-products-for-each-customer/README.md b/problems/the-most-frequently-ordered-products-for-each-customer/README.md
deleted file mode 100644
index e820d61c9..000000000
--- a/problems/the-most-frequently-ordered-products-for-each-customer/README.md
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-cost-to-connect-two-groups-of-points "Minimum Cost to Connect Two Groups of Points")
-
-[Next >](../build-binary-expression-tree-from-infix-expression "Build Binary Expression Tree From Infix Expression")
-
-## [1596. The Most Frequently Ordered Products for Each Customer (Medium)](https://leetcode.com/problems/the-most-frequently-ordered-products-for-each-customer "每位顾客最经常订购的商品")
-
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
-
-### Similar Questions
- 1. [The Most Recent Orders for Each Product](../the-most-recent-orders-for-each-product) (Medium)
diff --git a/problems/the-most-frequently-ordered-products-for-each-customer/mysql_schemas.sql b/problems/the-most-frequently-ordered-products-for-each-customer/mysql_schemas.sql
deleted file mode 100644
index 7294b609b..000000000
--- a/problems/the-most-frequently-ordered-products-for-each-customer/mysql_schemas.sql
+++ /dev/null
@@ -1,25 +0,0 @@
-Create table If Not Exists Customers (customer_id int, name varchar(10));
-Create table If Not Exists Orders (order_id int, order_date date, customer_id int, product_id int);
-Create table If Not Exists Products (product_id int, product_name varchar(20), price int);
-Truncate table Customers;
-insert into Customers (customer_id, name) values ('1', 'Alice');
-insert into Customers (customer_id, name) values ('2', 'Bob');
-insert into Customers (customer_id, name) values ('3', 'Tom');
-insert into Customers (customer_id, name) values ('4', 'Jerry');
-insert into Customers (customer_id, name) values ('5', 'John');
-Truncate table Orders;
-insert into Orders (order_id, order_date, customer_id, product_id) values ('1', '2020-07-31', '1', '1');
-insert into Orders (order_id, order_date, customer_id, product_id) values ('2', '2020-7-30', '2', '2');
-insert into Orders (order_id, order_date, customer_id, product_id) values ('3', '2020-08-29', '3', '3');
-insert into Orders (order_id, order_date, customer_id, product_id) values ('4', '2020-07-29', '4', '1');
-insert into Orders (order_id, order_date, customer_id, product_id) values ('5', '2020-06-10', '1', '2');
-insert into Orders (order_id, order_date, customer_id, product_id) values ('6', '2020-08-01', '2', '1');
-insert into Orders (order_id, order_date, customer_id, product_id) values ('7', '2020-08-01', '3', '3');
-insert into Orders (order_id, order_date, customer_id, product_id) values ('8', '2020-08-03', '1', '2');
-insert into Orders (order_id, order_date, customer_id, product_id) values ('9', '2020-08-07', '2', '3');
-insert into Orders (order_id, order_date, customer_id, product_id) values ('10', '2020-07-15', '1', '2');
-Truncate table Products;
-insert into Products (product_id, product_name, price) values ('1', 'keyboard', '120');
-insert into Products (product_id, product_name, price) values ('2', 'mouse', '80');
-insert into Products (product_id, product_name, price) values ('3', 'screen', '600');
-insert into Products (product_id, product_name, price) values ('4', 'hard disk', '450');
diff --git a/problems/the-most-recent-orders-for-each-product/README.md b/problems/the-most-recent-orders-for-each-product/README.md
deleted file mode 100644
index 9eb2bee4d..000000000
--- a/problems/the-most-recent-orders-for-each-product/README.md
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../the-most-similar-path-in-a-graph "The Most Similar Path in a Graph")
-
-[Next >](../three-consecutive-odds "Three Consecutive Odds")
-
-## [1549. The Most Recent Orders for Each Product (Medium)](https://leetcode.com/problems/the-most-recent-orders-for-each-product "每件商品的最新订单")
-
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
-
-### Similar Questions
- 1. [The Most Recent Three Orders](../the-most-recent-three-orders) (Medium)
- 1. [The Most Frequently Ordered Products for Each Customer](../the-most-frequently-ordered-products-for-each-customer) (Medium)
diff --git a/problems/the-most-recent-orders-for-each-product/mysql_schemas.sql b/problems/the-most-recent-orders-for-each-product/mysql_schemas.sql
deleted file mode 100644
index 7da4f47bc..000000000
--- a/problems/the-most-recent-orders-for-each-product/mysql_schemas.sql
+++ /dev/null
@@ -1,25 +0,0 @@
-Create table If Not Exists Customers (customer_id int, name varchar(10));
-Create table If Not Exists Orders (order_id int, order_date date, customer_id int, product_id int);
-Create table If Not Exists Products (product_id int, product_name varchar(20), price int);
-Truncate table Customers;
-insert into Customers (customer_id, name) values ('1', 'Winston');
-insert into Customers (customer_id, name) values ('2', 'Jonathan');
-insert into Customers (customer_id, name) values ('3', 'Annabelle');
-insert into Customers (customer_id, name) values ('4', 'Marwan');
-insert into Customers (customer_id, name) values ('5', 'Khaled');
-Truncate table Orders;
-insert into Orders (order_id, order_date, customer_id, product_id) values ('1', '2020-07-31', '1', '1');
-insert into Orders (order_id, order_date, customer_id, product_id) values ('2', '2020-7-30', '2', '2');
-insert into Orders (order_id, order_date, customer_id, product_id) values ('3', '2020-08-29', '3', '3');
-insert into Orders (order_id, order_date, customer_id, product_id) values ('4', '2020-07-29', '4', '1');
-insert into Orders (order_id, order_date, customer_id, product_id) values ('5', '2020-06-10', '1', '2');
-insert into Orders (order_id, order_date, customer_id, product_id) values ('6', '2020-08-01', '2', '1');
-insert into Orders (order_id, order_date, customer_id, product_id) values ('7', '2020-08-01', '3', '1');
-insert into Orders (order_id, order_date, customer_id, product_id) values ('8', '2020-08-03', '1', '2');
-insert into Orders (order_id, order_date, customer_id, product_id) values ('9', '2020-08-07', '2', '3');
-insert into Orders (order_id, order_date, customer_id, product_id) values ('10', '2020-07-15', '1', '2');
-Truncate table Products;
-insert into Products (product_id, product_name, price) values ('1', 'keyboard', '120');
-insert into Products (product_id, product_name, price) values ('2', 'mouse', '80');
-insert into Products (product_id, product_name, price) values ('3', 'screen', '600');
-insert into Products (product_id, product_name, price) values ('4', 'hard disk', '450');
diff --git a/problems/the-most-recent-three-orders/README.md b/problems/the-most-recent-three-orders/README.md
deleted file mode 100644
index 992bd55db..000000000
--- a/problems/the-most-recent-three-orders/README.md
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../string-compression-ii "String Compression II")
-
-[Next >](../find-the-index-of-the-large-integer "Find the Index of the Large Integer")
-
-## [1532. The Most Recent Three Orders (Medium)](https://leetcode.com/problems/the-most-recent-three-orders "最近的三笔订单")
-
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
-
-### Similar Questions
- 1. [The Most Recent Orders for Each Product](../the-most-recent-orders-for-each-product) (Medium)
diff --git a/problems/the-most-recent-three-orders/mysql_schemas.sql b/problems/the-most-recent-three-orders/mysql_schemas.sql
deleted file mode 100644
index 85541ef76..000000000
--- a/problems/the-most-recent-three-orders/mysql_schemas.sql
+++ /dev/null
@@ -1,19 +0,0 @@
-Create table If Not Exists Customers (customer_id int, name varchar(10));
-Create table If Not Exists Orders (order_id int, order_date date, customer_id int, cost int);
-Truncate table Customers;
-insert into Customers (customer_id, name) values ('1', 'Winston');
-insert into Customers (customer_id, name) values ('2', 'Jonathan');
-insert into Customers (customer_id, name) values ('3', 'Annabelle');
-insert into Customers (customer_id, name) values ('4', 'Marwan');
-insert into Customers (customer_id, name) values ('5', 'Khaled');
-Truncate table Orders;
-insert into Orders (order_id, order_date, customer_id, cost) values ('1', '2020-07-31', '1', '30');
-insert into Orders (order_id, order_date, customer_id, cost) values ('2', '2020-7-30', '2', '40');
-insert into Orders (order_id, order_date, customer_id, cost) values ('3', '2020-07-31', '3', '70');
-insert into Orders (order_id, order_date, customer_id, cost) values ('4', '2020-07-29', '4', '100');
-insert into Orders (order_id, order_date, customer_id, cost) values ('5', '2020-06-10', '1', '1010');
-insert into Orders (order_id, order_date, customer_id, cost) values ('6', '2020-08-01', '2', '102');
-insert into Orders (order_id, order_date, customer_id, cost) values ('7', '2020-08-01', '3', '111');
-insert into Orders (order_id, order_date, customer_id, cost) values ('8', '2020-08-03', '1', '99');
-insert into Orders (order_id, order_date, customer_id, cost) values ('9', '2020-08-07', '2', '32');
-insert into Orders (order_id, order_date, customer_id, cost) values ('10', '2020-07-15', '1', '2');
diff --git a/problems/the-most-similar-path-in-a-graph/README.md b/problems/the-most-similar-path-in-a-graph/README.md
deleted file mode 100644
index f1f57b715..000000000
--- a/problems/the-most-similar-path-in-a-graph/README.md
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-cost-to-cut-a-stick "Minimum Cost to Cut a Stick")
-
-[Next >](../the-most-recent-orders-for-each-product "The Most Recent Orders for Each Product")
-
-## [1548. The Most Similar Path in a Graph (Hard)](https://leetcode.com/problems/the-most-similar-path-in-a-graph "图中最相似的路径")
-
-
-
-### Related Topics
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Graph](../../tag/graph/README.md)]
-
-### Hints
-
-Hint 1
-Create an array dp where dp[i][j] is the min edit distance for the path starting at node i and compared to index j of the targetPath.
-
-
-
-Hint 2
-Traverse the dp array to obtain a valid answer.
-
diff --git a/problems/the-number-of-employees-which-report-to-each-employee/README.md b/problems/the-number-of-employees-which-report-to-each-employee/README.md
deleted file mode 100644
index 8251eb140..000000000
--- a/problems/the-number-of-employees-which-report-to-each-employee/README.md
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../shortest-path-to-get-food "Shortest Path to Get Food")
-
-[Next >](../find-the-highest-altitude "Find the Highest Altitude")
-
-## [1731. The Number of Employees Which Report to Each Employee (Easy)](https://leetcode.com/problems/the-number-of-employees-which-report-to-each-employee "每位经理的下属员工数量")
-
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/the-number-of-employees-which-report-to-each-employee/mysql_schemas.sql b/problems/the-number-of-employees-which-report-to-each-employee/mysql_schemas.sql
deleted file mode 100644
index a819253b1..000000000
--- a/problems/the-number-of-employees-which-report-to-each-employee/mysql_schemas.sql
+++ /dev/null
@@ -1,6 +0,0 @@
-Create table If Not Exists Employees(employee_id int, name varchar(20), reports_to int, age int);
-Truncate table Employees;
-insert into Employees (employee_id, name, reports_to, age) values ('9', 'Hercy', 'None', '43');
-insert into Employees (employee_id, name, reports_to, age) values ('6', 'Alice', '9', '41');
-insert into Employees (employee_id, name, reports_to, age) values ('4', 'Bob', '9', '36');
-insert into Employees (employee_id, name, reports_to, age) values ('2', 'Winston', 'None', '37');
diff --git a/problems/the-number-of-full-rounds-you-have-played/README.md b/problems/the-number-of-full-rounds-you-have-played/README.md
deleted file mode 100644
index 79d5b74f0..000000000
--- a/problems/the-number-of-full-rounds-you-have-played/README.md
+++ /dev/null
@@ -1,76 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../largest-odd-number-in-string "Largest Odd Number in String")
-
-[Next >](../count-sub-islands "Count Sub Islands")
-
-## [1904. The Number of Full Rounds You Have Played (Medium)](https://leetcode.com/problems/the-number-of-full-rounds-you-have-played "你完成的完整对局数")
-
-
You are participating in an online chess tournament. There is a chess round that starts every 15 minutes. The first round of the day starts at 00:00, and after every 15 minutes, a new round starts.
-
-
-
For example, the second round starts at 00:15, the fourth round starts at 00:45, and the seventh round starts at 01:30.
-
-
-
You are given two strings loginTime and logoutTime where:
-
-
-
loginTime is the time you will login to the game, and
-
logoutTime is the time you will logout from the game.
-
-
-
If logoutTime is earlier than loginTime, this means you have played from loginTime to midnight and from midnight to logoutTime.
-
-
Return the number of full chess rounds you have played in the tournament.
-
-
Note: All the given times follow the 24-hour clock. That means the first round of the day starts at 00:00 and the last round of the day starts at 23:45.
-
-
-
Example 1:
-
-
-Input: loginTime = "09:31", logoutTime = "10:14"
-Output: 1
-Explanation: You played one full round from 09:45 to 10:00.
-You did not play the full round from 09:30 to 09:45 because you logged in at 09:31 after it began.
-You did not play the full round from 10:00 to 10:15 because you logged out at 10:14 before it ended.
-
-
-
Example 2:
-
-
-Input: loginTime = "21:30", logoutTime = "03:00"
-Output: 22
-Explanation: You played 10 full rounds from 21:30 to 00:00 and 12 full rounds from 00:00 to 03:00.
-10 + 12 = 22.
-
-
-
-
Constraints:
-
-
-
loginTime and logoutTime are in the format hh:mm.
-
00 <= hh <= 23
-
00 <= mm <= 59
-
loginTime and logoutTime are not equal.
-
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Hints
-
-Hint 1
-Consider the day as 48 hours instead of 24.
-
-
-
-Hint 2
-For each round check if you were playing.
-
diff --git a/problems/the-number-of-good-subsets/README.md b/problems/the-number-of-good-subsets/README.md
deleted file mode 100644
index 14eac458b..000000000
--- a/problems/the-number-of-good-subsets/README.md
+++ /dev/null
@@ -1,81 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../operations-on-tree "Operations on Tree")
-
-[Next >](../count-special-quadruplets "Count Special Quadruplets")
-
-## [1994. The Number of Good Subsets (Hard)](https://leetcode.com/problems/the-number-of-good-subsets "好子集的数目")
-
-
You are given an integer array nums. We call a subset of numsgood if its product can be represented as a product of one or more distinct prime numbers.
-
-
-
For example, if nums = [1, 2, 3, 4]:
-
-
[2, 3], [1, 2, 3], and [1, 3] are good subsets with products 6 = 2*3, 6 = 2*3, and 3 = 3 respectively.
-
[1, 4] and [4] are not good subsets with products 4 = 2*2 and 4 = 2*2 respectively.
-
-
-
-
-
Return the number of different good subsets in numsmodulo109 + 7.
-
-
A subset of nums is any array that can be obtained by deleting some (possibly none or all) elements from nums. Two subsets are different if and only if the chosen indices to delete are different.
-
-
-
Example 1:
-
-
-Input: nums = [1,2,3,4]
-Output: 6
-Explanation: The good subsets are:
-- [1,2]: product is 2, which is the product of distinct prime 2.
-- [1,2,3]: product is 6, which is the product of distinct primes 2 and 3.
-- [1,3]: product is 3, which is the product of distinct prime 3.
-- [2]: product is 2, which is the product of distinct prime 2.
-- [2,3]: product is 6, which is the product of distinct primes 2 and 3.
-- [3]: product is 3, which is the product of distinct prime 3.
-
-
-
Example 2:
-
-
-Input: nums = [4,2,3,15]
-Output: 5
-Explanation: The good subsets are:
-- [2]: product is 2, which is the product of distinct prime 2.
-- [2,3]: product is 6, which is the product of distinct primes 2 and 3.
-- [2,15]: product is 30, which is the product of distinct primes 2, 3, and 5.
-- [3]: product is 3, which is the product of distinct prime 3.
-- [15]: product is 15, which is the product of distinct primes 3 and 5.
-
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 105
-
1 <= nums[i] <= 30
-
-
-### Related Topics
- [[Bit Manipulation](../../tag/bit-manipulation/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Math](../../tag/math/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Bitmask](../../tag/bitmask/README.md)]
-
-### Hints
-
-Hint 1
-Consider only the numbers which have a good prime factorization.
-
-
-
-Hint 2
-Use brute force to find all possible good subsets and then calculate its frequency in nums.
-
diff --git a/problems/the-number-of-passengers-in-each-bus-i/README.md b/problems/the-number-of-passengers-in-each-bus-i/README.md
deleted file mode 100644
index 42c598909..000000000
--- a/problems/the-number-of-passengers-in-each-bus-i/README.md
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-running-time-of-n-computers "Maximum Running Time of N Computers")
-
-[Next >](../choose-numbers-from-two-arrays-in-range "Choose Numbers From Two Arrays in Range")
-
-## [2142. The Number of Passengers in Each Bus I (Medium)](https://leetcode.com/problems/the-number-of-passengers-in-each-bus-i "")
-
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/the-number-of-passengers-in-each-bus-i/mysql_schemas.sql b/problems/the-number-of-passengers-in-each-bus-i/mysql_schemas.sql
deleted file mode 100644
index 0fc11eefe..000000000
--- a/problems/the-number-of-passengers-in-each-bus-i/mysql_schemas.sql
+++ /dev/null
@@ -1,11 +0,0 @@
-Create table If Not Exists Buses (bus_id int, arrival_time int);
-Create table If Not Exists Passengers (passenger_id int, arrival_time int);
-Truncate table Buses;
-insert into Buses (bus_id, arrival_time) values ('1', '2');
-insert into Buses (bus_id, arrival_time) values ('2', '4');
-insert into Buses (bus_id, arrival_time) values ('3', '7');
-Truncate table Passengers;
-insert into Passengers (passenger_id, arrival_time) values ('11', '1');
-insert into Passengers (passenger_id, arrival_time) values ('12', '5');
-insert into Passengers (passenger_id, arrival_time) values ('13', '6');
-insert into Passengers (passenger_id, arrival_time) values ('14', '7');
diff --git a/problems/the-number-of-passengers-in-each-bus-ii/README.md b/problems/the-number-of-passengers-in-each-bus-ii/README.md
deleted file mode 100644
index 55bbc3466..000000000
--- a/problems/the-number-of-passengers-in-each-bus-ii/README.md
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-number-of-lines-to-cover-points "Minimum Number of Lines to Cover Points")
-
-[Next >](../keep-multiplying-found-values-by-two "Keep Multiplying Found Values by Two")
-
-## [2153. The Number of Passengers in Each Bus II (Hard)](https://leetcode.com/problems/the-number-of-passengers-in-each-bus-ii "")
-
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/the-number-of-passengers-in-each-bus-ii/mysql_schemas.sql b/problems/the-number-of-passengers-in-each-bus-ii/mysql_schemas.sql
deleted file mode 100644
index 58e4a205c..000000000
--- a/problems/the-number-of-passengers-in-each-bus-ii/mysql_schemas.sql
+++ /dev/null
@@ -1,12 +0,0 @@
-Create table If Not Exists Buses (bus_id int, arrival_time int, capacity int);
-Create table If Not Exists Passengers (passenger_id int, arrival_time int);
-Truncate table Buses;
-insert into Buses (bus_id, arrival_time, capacity) values ('1', '2', '1');
-insert into Buses (bus_id, arrival_time, capacity) values ('2', '4', '10');
-insert into Buses (bus_id, arrival_time, capacity) values ('3', '7', '2');
-Truncate table Passengers;
-insert into Passengers (passenger_id, arrival_time) values ('11', '1');
-insert into Passengers (passenger_id, arrival_time) values ('12', '1');
-insert into Passengers (passenger_id, arrival_time) values ('13', '5');
-insert into Passengers (passenger_id, arrival_time) values ('14', '6');
-insert into Passengers (passenger_id, arrival_time) values ('15', '7');
diff --git a/problems/the-number-of-rich-customers/README.md b/problems/the-number-of-rich-customers/README.md
deleted file mode 100644
index 9cde4d167..000000000
--- a/problems/the-number-of-rich-customers/README.md
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../sum-of-k-mirror-numbers "Sum of k-Mirror Numbers")
-
-[Next >](../substrings-that-begin-and-end-with-the-same-letter "Substrings That Begin and End With the Same Letter")
-
-## [2082. The Number of Rich Customers (Easy)](https://leetcode.com/problems/the-number-of-rich-customers "富有客户的数量")
-
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/the-number-of-rich-customers/mysql_schemas.sql b/problems/the-number-of-rich-customers/mysql_schemas.sql
deleted file mode 100644
index 63d1df440..000000000
--- a/problems/the-number-of-rich-customers/mysql_schemas.sql
+++ /dev/null
@@ -1,7 +0,0 @@
-Create table If Not Exists Store (bill_id int, customer_id int, amount int);
-Truncate table Store;
-insert into Store (bill_id, customer_id, amount) values ('6', '1', '549');
-insert into Store (bill_id, customer_id, amount) values ('8', '1', '834');
-insert into Store (bill_id, customer_id, amount) values ('4', '2', '394');
-insert into Store (bill_id, customer_id, amount) values ('11', '3', '657');
-insert into Store (bill_id, customer_id, amount) values ('13', '3', '257');
diff --git a/problems/the-number-of-seniors-and-juniors-to-join-the-company-ii/README.md b/problems/the-number-of-seniors-and-juniors-to-join-the-company-ii/README.md
deleted file mode 100644
index 3ce1b5c42..000000000
--- a/problems/the-number-of-seniors-and-juniors-to-join-the-company-ii/README.md
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-number-of-operations-to-make-array-continuous "Minimum Number of Operations to Make Array Continuous")
-
-[Next >](../final-value-of-variable-after-performing-operations "Final Value of Variable After Performing Operations")
-
-## [2010. The Number of Seniors and Juniors to Join the Company II (Hard)](https://leetcode.com/problems/the-number-of-seniors-and-juniors-to-join-the-company-ii "")
-
-
diff --git a/problems/the-number-of-seniors-and-juniors-to-join-the-company-ii/mysql_schemas.sql b/problems/the-number-of-seniors-and-juniors-to-join-the-company-ii/mysql_schemas.sql
deleted file mode 100644
index 998e0268a..000000000
--- a/problems/the-number-of-seniors-and-juniors-to-join-the-company-ii/mysql_schemas.sql
+++ /dev/null
@@ -1,8 +0,0 @@
-Create table If Not Exists Candidates (employee_id int, experience ENUM('Senior', 'Junior'), salary int);
-Truncate table Candidates;
-insert into Candidates (employee_id, experience, salary) values ('1', 'Junior', '10000');
-insert into Candidates (employee_id, experience, salary) values ('9', 'Junior', '15000');
-insert into Candidates (employee_id, experience, salary) values ('2', 'Senior', '20000');
-insert into Candidates (employee_id, experience, salary) values ('11', 'Senior', '16000');
-insert into Candidates (employee_id, experience, salary) values ('13', 'Senior', '50000');
-insert into Candidates (employee_id, experience, salary) values ('4', 'Junior', '40000');
diff --git a/problems/the-number-of-seniors-and-juniors-to-join-the-company/README.md b/problems/the-number-of-seniors-and-juniors-to-join-the-company/README.md
deleted file mode 100644
index b6d5ea3a4..000000000
--- a/problems/the-number-of-seniors-and-juniors-to-join-the-company/README.md
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../smallest-missing-genetic-value-in-each-subtree "Smallest Missing Genetic Value in Each Subtree")
-
-[Next >](../subtree-removal-game-with-fibonacci-tree "Subtree Removal Game with Fibonacci Tree")
-
-## [2004. The Number of Seniors and Juniors to Join the Company (Hard)](https://leetcode.com/problems/the-number-of-seniors-and-juniors-to-join-the-company "")
-
-
diff --git a/problems/the-number-of-seniors-and-juniors-to-join-the-company/mysql_schemas.sql b/problems/the-number-of-seniors-and-juniors-to-join-the-company/mysql_schemas.sql
deleted file mode 100644
index a379f18ed..000000000
--- a/problems/the-number-of-seniors-and-juniors-to-join-the-company/mysql_schemas.sql
+++ /dev/null
@@ -1,8 +0,0 @@
-Create table If Not Exists Candidates (employee_id int, experience ENUM('Senior', 'Junior'), salary int);
-Truncate table Candidates;
-insert into Candidates (employee_id, experience, salary) values ('1', 'Junior', '10000');
-insert into Candidates (employee_id, experience, salary) values ('9', 'Junior', '10000');
-insert into Candidates (employee_id, experience, salary) values ('2', 'Senior', '20000');
-insert into Candidates (employee_id, experience, salary) values ('11', 'Senior', '20000');
-insert into Candidates (employee_id, experience, salary) values ('13', 'Senior', '50000');
-insert into Candidates (employee_id, experience, salary) values ('4', 'Junior', '40000');
diff --git a/problems/the-number-of-the-smallest-unoccupied-chair/README.md b/problems/the-number-of-the-smallest-unoccupied-chair/README.md
deleted file mode 100644
index c5e38453c..000000000
--- a/problems/the-number-of-the-smallest-unoccupied-chair/README.md
+++ /dev/null
@@ -1,82 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../check-if-all-characters-have-equal-number-of-occurrences "Check if All Characters Have Equal Number of Occurrences")
-
-[Next >](../describe-the-painting "Describe the Painting")
-
-## [1942. The Number of the Smallest Unoccupied Chair (Medium)](https://leetcode.com/problems/the-number-of-the-smallest-unoccupied-chair "最小未被占据椅子的编号")
-
-
There is a party where n friends numbered from 0 to n - 1 are attending. There is an infinite number of chairs in this party that are numbered from 0 to infinity. When a friend arrives at the party, they sit on the unoccupied chair with the smallest number.
-
-
-
For example, if chairs 0, 1, and 5 are occupied when a friend comes, they will sit on chair number 2.
-
-
-
When a friend leaves the party, their chair becomes unoccupied at the moment they leave. If another friend arrives at that same moment, they can sit in that chair.
-
-
You are given a 0-indexed 2D integer array times where times[i] = [arrivali, leavingi], indicating the arrival and leaving times of the ith friend respectively, and an integer targetFriend. All arrival times are distinct.
-
-
Return the chair number that the friend numbered targetFriend will sit on.
-
-
-
Example 1:
-
-
-Input: times = [[1,4],[2,3],[4,6]], targetFriend = 1
-Output: 1
-Explanation:
-- Friend 0 arrives at time 1 and sits on chair 0.
-- Friend 1 arrives at time 2 and sits on chair 1.
-- Friend 1 leaves at time 3 and chair 1 becomes empty.
-- Friend 0 leaves at time 4 and chair 0 becomes empty.
-- Friend 2 arrives at time 4 and sits on chair 0.
-Since friend 1 sat on chair 1, we return 1.
-
-
-
Example 2:
-
-
-Input: times = [[3,10],[1,5],[2,6]], targetFriend = 0
-Output: 2
-Explanation:
-- Friend 1 arrives at time 1 and sits on chair 0.
-- Friend 2 arrives at time 2 and sits on chair 1.
-- Friend 0 arrives at time 3 and sits on chair 2.
-- Friend 1 leaves at time 5 and chair 0 becomes empty.
-- Friend 2 leaves at time 6 and chair 1 becomes empty.
-- Friend 0 leaves at time 10 and chair 2 becomes empty.
-Since friend 0 sat on chair 2, we return 2.
-
-
-
-
Constraints:
-
-
-
n == times.length
-
2 <= n <= 104
-
times[i].length == 2
-
1 <= arrivali < leavingi <= 105
-
0 <= targetFriend <= n - 1
-
Each arrivali time is distinct.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Ordered Set](../../tag/ordered-set/README.md)]
- [[Heap (Priority Queue)](../../tag/heap-priority-queue/README.md)]
-
-### Hints
-
-Hint 1
-Sort times by arrival time.
-
-
-
-Hint 2
-for each arrival_i find the smallest unoccupied chair and mark it as occupied until leaving_i.
-
diff --git a/problems/the-number-of-weak-characters-in-the-game/README.md b/problems/the-number-of-weak-characters-in-the-game/README.md
deleted file mode 100644
index 86f87d699..000000000
--- a/problems/the-number-of-weak-characters-in-the-game/README.md
+++ /dev/null
@@ -1,70 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../count-special-quadruplets "Count Special Quadruplets")
-
-[Next >](../first-day-where-you-have-been-in-all-the-rooms "First Day Where You Have Been in All the Rooms")
-
-## [1996. The Number of Weak Characters in the Game (Medium)](https://leetcode.com/problems/the-number-of-weak-characters-in-the-game "游戏中弱角色的数量")
-
-
You are playing a game that contains multiple characters, and each of the characters has two main properties: attack and defense. You are given a 2D integer array properties where properties[i] = [attacki, defensei] represents the properties of the ith character in the game.
-
-
A character is said to be weak if any other character has both attack and defense levels strictly greater than this character's attack and defense levels. More formally, a character i is said to be weak if there exists another character j where attackj > attacki and defensej > defensei.
-
-
Return the number of weak characters.
-
-
-
Example 1:
-
-
-Input: properties = [[5,5],[6,3],[3,6]]
-Output: 0
-Explanation: No character has strictly greater attack and defense than the other.
-
-
-
Example 2:
-
-
-Input: properties = [[2,2],[3,3]]
-Output: 1
-Explanation: The first character is weak because the second character has a strictly greater attack and defense.
-
-
-
Example 3:
-
-
-Input: properties = [[1,5],[10,4],[4,3]]
-Output: 1
-Explanation: The third character is weak because the second character has a strictly greater attack and defense.
-
-
-
-
Constraints:
-
-
-
2 <= properties.length <= 105
-
properties[i].length == 2
-
1 <= attacki, defensei <= 105
-
-
-### Related Topics
- [[Stack](../../tag/stack/README.md)]
- [[Greedy](../../tag/greedy/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
- [[Monotonic Stack](../../tag/monotonic-stack/README.md)]
-
-### Hints
-
-Hint 1
-Sort the array on the basis of the attack values and group characters with the same attack together. How can you use these groups?
-
-
-
-Hint 2
-Characters in one group will always have a lesser attack value than the characters of the next group. Hence, we will only need to check if there is a higher defense value present in the next groups.
-
diff --git a/problems/the-score-of-students-solving-math-expression/README.md b/problems/the-score-of-students-solving-math-expression/README.md
deleted file mode 100644
index d6b8d68bc..000000000
--- a/problems/the-score-of-students-solving-math-expression/README.md
+++ /dev/null
@@ -1,99 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../check-if-word-can-be-placed-in-crossword "Check if Word Can Be Placed In Crossword")
-
-[Next >](../number-of-accounts-that-did-not-stream "Number of Accounts That Did Not Stream")
-
-## [2019. The Score of Students Solving Math Expression (Hard)](https://leetcode.com/problems/the-score-of-students-solving-math-expression "解出数学表达式的学生分数")
-
-
You are given a string s that contains digits 0-9, addition symbols '+', and multiplication symbols '*'only, representing a valid math expression of single digit numbers (e.g., 3+5*2). This expression was given to n elementary school students. The students were instructed to get the answer of the expression by following this order of operations:
-
-
-
Compute multiplication, reading from left to right; Then,
-
Compute addition, reading from left to right.
-
-
-
You are given an integer array answers of length n, which are the submitted answers of the students in no particular order. You are asked to grade the answers, by following these rules:
-
-
-
If an answer equals the correct answer of the expression, this student will be rewarded 5 points;
-
Otherwise, if the answer could be interpreted as if the student applied the operators in the wrong order but had correct arithmetic, this student will be rewarded 2 points;
-
Otherwise, this student will be rewarded 0 points.
-
-
-
Return the sum of the points of the students.
-
-
-
Example 1:
-
-
-Input: s = "7+3*1*2", answers = [20,13,42]
-Output: 7
-Explanation: As illustrated above, the correct answer of the expression is 13, therefore one student is rewarded 5 points: [20,13,42]
-A student might have applied the operators in this wrong order: ((7+3)*1)*2 = 20. Therefore one student is rewarded 2 points: [20,13,42]
-The points for the students are: [2,5,0]. The sum of the points is 2+5+0=7.
-
-
-
Example 2:
-
-
-Input: s = "3+5*2", answers = [13,0,10,13,13,16,16]
-Output: 19
-Explanation: The correct answer of the expression is 13, therefore three students are rewarded 5 points each: [13,0,10,13,13,16,16]
-A student might have applied the operators in this wrong order: ((3+5)*2 = 16. Therefore two students are rewarded 2 points: [13,0,10,13,13,16,16]
-The points for the students are: [5,0,0,5,5,2,2]. The sum of the points is 5+0+0+5+5+2+2=19.
-
-
-
Example 3:
-
-
-Input: s = "6+0*1", answers = [12,9,6,4,8,6]
-Output: 10
-Explanation: The correct answer of the expression is 6.
-If a student had incorrectly done (6+0)*1, the answer would also be 6.
-By the rules of grading, the students will still be rewarded 5 points (as they got the correct answer), not 2 points.
-The points for the students are: [0,0,5,0,0,5]. The sum of the points is 10.
-
-
-
-
Constraints:
-
-
-
3 <= s.length <= 31
-
s represents a valid expression that contains only digits 0-9, '+', and '*' only.
-
All the integer operands in the expression are in the inclusive range [0, 9].
-
1 <= The count of all operators ('+' and '*') in the math expression <= 15
-
Test data are generated such that the correct answer of the expression is in the range of [0, 1000].
-
n == answers.length
-
1 <= n <= 104
-
0 <= answers[i] <= 1000
-
-
-### Related Topics
- [[Stack](../../tag/stack/README.md)]
- [[Memoization](../../tag/memoization/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Math](../../tag/math/README.md)]
- [[String](../../tag/string/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Hints
-
-Hint 1
-The number of operators in the equation is less. Could you find the right answer then generate all possible answers using different orders of operations?
-
-
-
-Hint 2
-Divide the equation into blocks separated by the operators, and use memoization on the results of blocks for optimization.
-
-
-
-Hint 3
-Use set and the max limit of the answer for further optimization.
-
diff --git a/problems/the-skyline-problem/README.md b/problems/the-skyline-problem/README.md
deleted file mode 100644
index 769f51184..000000000
--- a/problems/the-skyline-problem/README.md
+++ /dev/null
@@ -1,68 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../contains-duplicate "Contains Duplicate")
-
-[Next >](../contains-duplicate-ii "Contains Duplicate II")
-
-## [218. The Skyline Problem (Hard)](https://leetcode.com/problems/the-skyline-problem "天际线问题")
-
-
A city's skyline is the outer contour of the silhouette formed by all the buildings in that city when viewed from a distance. Given the locations and heights of all the buildings, return the skyline formed by these buildings collectively.
-
-
The geometric information of each building is given in the array buildings where buildings[i] = [lefti, righti, heighti]:
-
-
-
lefti is the x coordinate of the left edge of the ith building.
-
righti is the x coordinate of the right edge of the ith building.
-
heighti is the height of the ith building.
-
-
-
You may assume all buildings are perfect rectangles grounded on an absolutely flat surface at height 0.
-
-
The skyline should be represented as a list of "key points" sorted by their x-coordinate in the form [[x1,y1],[x2,y2],...]. Each key point is the left endpoint of some horizontal segment in the skyline except the last point in the list, which always has a y-coordinate 0 and is used to mark the skyline's termination where the rightmost building ends. Any ground between the leftmost and rightmost buildings should be part of the skyline's contour.
-
-
Note: There must be no consecutive horizontal lines of equal height in the output skyline. For instance, [...,[2 3],[4 5],[7 5],[11 5],[12 7],...] is not acceptable; the three lines of height 5 should be merged into one in the final output as such: [...,[2 3],[4 5],[12 7],...]
-
-
-
Example 1:
-
-
-Input: buildings = [[2,9,10],[3,7,15],[5,12,12],[15,20,10],[19,24,8]]
-Output: [[2,10],[3,15],[7,12],[12,0],[15,10],[20,8],[24,0]]
-Explanation:
-Figure A shows the buildings of the input.
-Figure B shows the skyline formed by those buildings. The red points in figure B represent the key points in the output list.
-
buildings is sorted by lefti in non-decreasing order.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Divide and Conquer](../../tag/divide-and-conquer/README.md)]
- [[Binary Indexed Tree](../../tag/binary-indexed-tree/README.md)]
- [[Segment Tree](../../tag/segment-tree/README.md)]
- [[Line Sweep](../../tag/line-sweep/README.md)]
- [[Heap (Priority Queue)](../../tag/heap-priority-queue/README.md)]
- [[Ordered Set](../../tag/ordered-set/README.md)]
-
-### Similar Questions
- 1. [Falling Squares](../falling-squares) (Hard)
diff --git a/problems/the-skyline-problem/the_skyline_problem.go b/problems/the-skyline-problem/the_skyline_problem.go
deleted file mode 100644
index 45fcd259f..000000000
--- a/problems/the-skyline-problem/the_skyline_problem.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem218
diff --git a/problems/the-skyline-problem/the_skyline_problem_test.go b/problems/the-skyline-problem/the_skyline_problem_test.go
deleted file mode 100644
index 45fcd259f..000000000
--- a/problems/the-skyline-problem/the_skyline_problem_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem218
diff --git a/problems/the-time-when-the-network-becomes-idle/README.md b/problems/the-time-when-the-network-becomes-idle/README.md
deleted file mode 100644
index e3b5677b0..000000000
--- a/problems/the-time-when-the-network-becomes-idle/README.md
+++ /dev/null
@@ -1,105 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../remove-colored-pieces-if-both-neighbors-are-the-same-color "Remove Colored Pieces if Both Neighbors are the Same Color")
-
-[Next >](../kth-smallest-product-of-two-sorted-arrays "Kth Smallest Product of Two Sorted Arrays")
-
-## [2039. The Time When the Network Becomes Idle (Medium)](https://leetcode.com/problems/the-time-when-the-network-becomes-idle "网络空闲的时刻")
-
-
There is a network of n servers, labeled from 0 to n - 1. You are given a 2D integer array edges, where edges[i] = [ui, vi] indicates there is a message channel between servers ui and vi, and they can pass any number of messages to each other directly in one second. You are also given a 0-indexed integer array patience of length n.
-
-
All servers are connected, i.e., a message can be passed from one server to any other server(s) directly or indirectly through the message channels.
-
-
The server labeled 0 is the master server. The rest are data servers. Each data server needs to send its message to the master server for processing and wait for a reply. Messages move between servers optimally, so every message takes the least amount of time to arrive at the master server. The master server will process all newly arrived messages instantly and send a reply to the originating server via the reversed path the message had gone through.
-
-
At the beginning of second 0, each data server sends its message to be processed. Starting from second 1, at the beginning of every second, each data server will check if it has received a reply to the message it sent (including any newly arrived replies) from the master server:
-
-
-
If it has not, it will resend the message periodically. The data server i will resend the message every patience[i] second(s), i.e., the data server i will resend the message if patience[i] second(s) have elapsed since the last time the message was sent from this server.
-
Otherwise, no more resending will occur from this server.
-
-
-
The network becomes idle when there are no messages passing between servers or arriving at servers.
-
-
Return the earliest second starting from which the network becomes idle.
-
-
-
Example 1:
-
-
-Input: edges = [[0,1],[1,2]], patience = [0,2,1]
-Output: 8
-Explanation:
-At (the beginning of) second 0,
-- Data server 1 sends its message (denoted 1A) to the master server.
-- Data server 2 sends its message (denoted 2A) to the master server.
-
-At second 1,
-- Message 1A arrives at the master server. Master server processes message 1A instantly and sends a reply 1A back.
-- Server 1 has not received any reply. 1 second (1 < patience[1] = 2) elapsed since this server has sent the message, therefore it does not resend the message.
-- Server 2 has not received any reply. 1 second (1 == patience[2] = 1) elapsed since this server has sent the message, therefore it resends the message (denoted 2B).
-
-At second 2,
-- The reply 1A arrives at server 1. No more resending will occur from server 1.
-- Message 2A arrives at the master server. Master server processes message 2A instantly and sends a reply 2A back.
-- Server 2 resends the message (denoted 2C).
-...
-At second 4,
-- The reply 2A arrives at server 2. No more resending will occur from server 2.
-...
-At second 7, reply 2D arrives at server 2.
-
-Starting from the beginning of the second 8, there are no messages passing between servers or arriving at servers.
-This is the time when the network becomes idle.
-
-
-
Example 2:
-
-
-Input: edges = [[0,1],[0,2],[1,2]], patience = [0,10,10]
-Output: 3
-Explanation: Data servers 1 and 2 receive a reply back at the beginning of second 2.
-From the beginning of the second 3, the network becomes idle.
-
-
-
-
Constraints:
-
-
-
n == patience.length
-
2 <= n <= 105
-
patience[0] == 0
-
1 <= patience[i] <= 105 for 1 <= i < n
-
1 <= edges.length <= min(105, n * (n - 1) / 2)
-
edges[i].length == 2
-
0 <= ui, vi < n
-
ui != vi
-
There are no duplicate edges.
-
Each server can directly or indirectly reach another server.
-
-
-### Related Topics
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Graph](../../tag/graph/README.md)]
- [[Array](../../tag/array/README.md)]
-
-### Hints
-
-Hint 1
-What method can you use to find the shortest time taken for a message from a data server to reach the master server? How can you use this value and the server's patience value to determine the time at which the server sends its last message?
-
-
-
-Hint 2
-What is the time when the last message sent from a server gets back to the server?
-
-
-
-Hint 3
-For each data server, by the time the server receives the first returned messages, how many messages has the server sent?
-
diff --git a/problems/the-winner-university/README.md b/problems/the-winner-university/README.md
deleted file mode 100644
index 569867b73..000000000
--- a/problems/the-winner-university/README.md
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-number-of-tasks-you-can-assign "Maximum Number of Tasks You Can Assign")
-
-[Next >](../time-needed-to-buy-tickets "Time Needed to Buy Tickets")
-
-## [2072. The Winner University (Easy)](https://leetcode.com/problems/the-winner-university "赢得比赛的大学")
-
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/the-winner-university/mysql_schemas.sql b/problems/the-winner-university/mysql_schemas.sql
deleted file mode 100644
index a1aefcc9b..000000000
--- a/problems/the-winner-university/mysql_schemas.sql
+++ /dev/null
@@ -1,8 +0,0 @@
-Create table If Not Exists NewYork (student_id int, score int);
-Create table If Not Exists California (student_id int, score int);
-Truncate table NewYork;
-insert into NewYork (student_id, score) values ('1', '90');
-insert into NewYork (student_id, score) values ('2', '87');
-Truncate table California;
-insert into California (student_id, score) values ('2', '89');
-insert into California (student_id, score) values ('3', '88');
diff --git a/problems/third-maximum-number/README.md b/problems/third-maximum-number/README.md
deleted file mode 100644
index d7b315550..000000000
--- a/problems/third-maximum-number/README.md
+++ /dev/null
@@ -1,66 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../arithmetic-slices "Arithmetic Slices")
-
-[Next >](../add-strings "Add Strings")
-
-## [414. Third Maximum Number (Easy)](https://leetcode.com/problems/third-maximum-number "第三大的数")
-
-
Given an integer array nums, return the third distinct maximum number in this array. If the third maximum does not exist, return the maximum number.
-
-
-
Example 1:
-
-
-Input: nums = [3,2,1]
-Output: 1
-Explanation:
-The first distinct maximum is 3.
-The second distinct maximum is 2.
-The third distinct maximum is 1.
-
-
-
Example 2:
-
-
-Input: nums = [1,2]
-Output: 2
-Explanation:
-The first distinct maximum is 2.
-The second distinct maximum is 1.
-The third distinct maximum does not exist, so the maximum (2) is returned instead.
-
-
-
Example 3:
-
-
-Input: nums = [2,2,3,1]
-Output: 1
-Explanation:
-The first distinct maximum is 3.
-The second distinct maximum is 2 (both 2's are counted together since they have the same value).
-The third distinct maximum is 1.
-
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 104
-
-231 <= nums[i] <= 231 - 1
-
-
-
-Follow up: Can you find an O(n) solution?
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Similar Questions
- 1. [Kth Largest Element in an Array](../kth-largest-element-in-an-array) (Medium)
diff --git a/problems/third-maximum-number/third_maximum_number.go b/problems/third-maximum-number/third_maximum_number.go
deleted file mode 100644
index dec9633c1..000000000
--- a/problems/third-maximum-number/third_maximum_number.go
+++ /dev/null
@@ -1,18 +0,0 @@
-package problem414
-
-func thirdMax(nums []int) int {
- max1, max2, max3 := 0, -1, -1
- for i, v := range nums {
- if v > nums[max1] {
- max1, max2, max3 = i, max1, max2
- } else if (max2 == -1 || v > nums[max2]) && v != nums[max1] {
- max2, max3 = i, max2
- } else if (max3 == -1 || v > nums[max3]) && v != nums[max1] && v != nums[max2] {
- max3 = i
- }
- }
- if max3 == -1 {
- return nums[max1]
- }
- return nums[max3]
-}
diff --git a/problems/third-maximum-number/third_maximum_number_test.go b/problems/third-maximum-number/third_maximum_number_test.go
deleted file mode 100644
index 86338922d..000000000
--- a/problems/third-maximum-number/third_maximum_number_test.go
+++ /dev/null
@@ -1,43 +0,0 @@
-package problem414
-
-import "testing"
-
-type testType struct {
- in []int
- want int
-}
-
-func TestThirdMax(t *testing.T) {
- tests := [...]testType{
- {
- in: []int{1, 2, 2, 5, 3, 5},
- want: 2,
- },
- {
- in: []int{1, 2, 2},
- want: 2,
- },
- {
- in: []int{1, 1, 2},
- want: 2,
- },
- {
- in: []int{3, 2, 1},
- want: 1,
- },
- {
- in: []int{1, 2},
- want: 2,
- },
- {
- in: []int{2, 2, 3, 1},
- want: 1,
- },
- }
- for _, tt := range tests {
- got := thirdMax(tt.in)
- if got != tt.want {
- t.Fatalf("in: %v, got: %v, want: %v", tt.in, got, tt.want)
- }
- }
-}
diff --git a/problems/thousand-separator/README.md b/problems/thousand-separator/README.md
deleted file mode 100644
index 87bf7dfd4..000000000
--- a/problems/thousand-separator/README.md
+++ /dev/null
@@ -1,45 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../bank-account-summary "Bank Account Summary")
-
-[Next >](../minimum-number-of-vertices-to-reach-all-nodes "Minimum Number of Vertices to Reach All Nodes")
-
-## [1556. Thousand Separator (Easy)](https://leetcode.com/problems/thousand-separator "千位分隔数")
-
-
Given an integer n, add a dot (".") as the thousands separator and return it in string format.
-
-
-
Example 1:
-
-
-Input: n = 987
-Output: "987"
-
-
-
Example 2:
-
-
-Input: n = 1234
-Output: "1.234"
-
-
-
-
Constraints:
-
-
-
0 <= n <= 231 - 1
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
-
-### Hints
-
-Hint 1
-Scan from the back of the integer and use dots to connect blocks with length 3 except the last block.
-
diff --git a/problems/three-consecutive-odds/README.md b/problems/three-consecutive-odds/README.md
deleted file mode 100644
index fae398752..000000000
--- a/problems/three-consecutive-odds/README.md
+++ /dev/null
@@ -1,47 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../the-most-recent-orders-for-each-product "The Most Recent Orders for Each Product")
-
-[Next >](../minimum-operations-to-make-array-equal "Minimum Operations to Make Array Equal")
-
-## [1550. Three Consecutive Odds (Easy)](https://leetcode.com/problems/three-consecutive-odds "存在连续三个奇数的数组")
-
-Given an integer array arr, return true if there are three consecutive odd numbers in the array. Otherwise, return false.
-
-
Example 1:
-
-
-Input: arr = [2,6,4,1]
-Output: false
-Explanation: There are no three consecutive odds.
-
-
-
Example 2:
-
-
-Input: arr = [1,2,34,3,4,5,7,23,12]
-Output: true
-Explanation: [5,7,23] are three consecutive odds.
-
-
-
-
Constraints:
-
-
-
1 <= arr.length <= 1000
-
1 <= arr[i] <= 1000
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
-
-### Hints
-
-Hint 1
-Check every three consecutive numbers in the array for parity.
-
diff --git a/problems/three-divisors/README.md b/problems/three-divisors/README.md
deleted file mode 100644
index cc81d110e..000000000
--- a/problems/three-divisors/README.md
+++ /dev/null
@@ -1,57 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../all-the-pairs-with-the-maximum-number-of-common-followers "All the Pairs With the Maximum Number of Common Followers")
-
-[Next >](../maximum-number-of-weeks-for-which-you-can-work "Maximum Number of Weeks for Which You Can Work")
-
-## [1952. Three Divisors (Easy)](https://leetcode.com/problems/three-divisors "三除数")
-
-
Given an integer n, return true if n has exactly three positive divisors. Otherwise, return false.
-
-
An integer m is a divisor of n if there exists an integer k such that n = k * m.
-
-
-
Example 1:
-
-
-Input: n = 2
-Output: false
-Explantion: 2 has only two divisors: 1 and 2.
-
-
-
Example 2:
-
-
-Input: n = 4
-Output: true
-Explantion: 4 has three divisors: 1, 2, and 4.
-
-
-
-
Constraints:
-
-
-
1 <= n <= 104
-
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
-
-### Similar Questions
- 1. [Find Greatest Common Divisor of Array](../find-greatest-common-divisor-of-array) (Easy)
-
-### Hints
-
-Hint 1
-You can count the number of divisors and just check that they are 3
-
-
-
-Hint 2
-Beware of the case of n equal 1 as some solutions might fail in it
-
diff --git a/problems/three-equal-parts/README.md b/problems/three-equal-parts/README.md
deleted file mode 100644
index 275dd7810..000000000
--- a/problems/three-equal-parts/README.md
+++ /dev/null
@@ -1,50 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../flip-string-to-monotone-increasing "Flip String to Monotone Increasing")
-
-[Next >](../minimize-malware-spread-ii "Minimize Malware Spread II")
-
-## [927. Three Equal Parts (Hard)](https://leetcode.com/problems/three-equal-parts "三等分")
-
-
You are given an array arr which consists of only zeros and ones, divide the array into three non-empty parts such that all of these parts represent the same binary value.
-
-
If it is possible, return any [i, j] with i + 1 < j, such that:
-
-
-
arr[0], arr[1], ..., arr[i] is the first part,
-
arr[i + 1], arr[i + 2], ..., arr[j - 1] is the second part, and
-
arr[j], arr[j + 1], ..., arr[arr.length - 1] is the third part.
-
All three parts have equal binary values.
-
-
-
If it is not possible, return [-1, -1].
-
-
Note that the entire part is used when considering what binary value it represents. For example, [1,1,0] represents 6 in decimal, not 3. Also, leading zeros are allowed, so [0,1,1] and [1,1] represent the same value.
A kingdom consists of a king, his children, his grandchildren, and so on. Every once in a while, someone in the family dies or a child is born.
-
-
The kingdom has a well-defined order of inheritance that consists of the king as the first member. Let's define the recursive function Successor(x, curOrder), which given a person x and the inheritance order so far, returns who should be the next person after x in the order of inheritance.
-
-
-Successor(x, curOrder):
- if x has no children or all of x's children are in curOrder:
- if x is the king return null
- else return Successor(x's parent, curOrder)
- else return x's oldest child who's not in curOrder
-
-
-
For example, assume we have a kingdom that consists of the king, his children Alice and Bob (Alice is older than Bob), and finally Alice's son Jack.
-
-
-
In the beginning, curOrder will be ["king"].
-
Calling Successor(king, curOrder) will return Alice, so we append to curOrder to get ["king", "Alice"].
-
Calling Successor(Alice, curOrder) will return Jack, so we append to curOrder to get ["king", "Alice", "Jack"].
-
Calling Successor(Jack, curOrder) will return Bob, so we append to curOrder to get ["king", "Alice", "Jack", "Bob"].
-
Calling Successor(Bob, curOrder) will return null. Thus the order of inheritance will be ["king", "Alice", "Jack", "Bob"].
-
-
-
Using the above function, we can always obtain a unique order of inheritance.
-
-
Implement the ThroneInheritance class:
-
-
-
ThroneInheritance(string kingName) Initializes an object of the ThroneInheritance class. The name of the king is given as part of the constructor.
-
void birth(string parentName, string childName) Indicates that parentName gave birth to childName.
-
void death(string name) Indicates the death of name. The death of the person doesn't affect the Successor function nor the current inheritance order. You can treat it as just marking the person as dead.
-
string[] getInheritanceOrder() Returns a list representing the current order of inheritance excluding dead people.
-
-
-
-
Example 1:
-
-
-Input
-["ThroneInheritance", "birth", "birth", "birth", "birth", "birth", "birth", "getInheritanceOrder", "death", "getInheritanceOrder"]
-[["king"], ["king", "andy"], ["king", "bob"], ["king", "catherine"], ["andy", "matthew"], ["bob", "alex"], ["bob", "asha"], [null], ["bob"], [null]]
-Output
-[null, null, null, null, null, null, null, ["king", "andy", "matthew", "bob", "alex", "asha", "catherine"], null, ["king", "andy", "matthew", "alex", "asha", "catherine"]]
-
-Explanation
-ThroneInheritance t= new ThroneInheritance("king"); // order: king
-t.birth("king", "andy"); // order: king > andy
-t.birth("king", "bob"); // order: king > andy > bob
-t.birth("king", "catherine"); // order: king > andy > bob > catherine
-t.birth("andy", "matthew"); // order: king > andy > matthew > bob > catherine
-t.birth("bob", "alex"); // order: king > andy > matthew > bob > alex > catherine
-t.birth("bob", "asha"); // order: king > andy > matthew > bob > alex > asha > catherine
-t.getInheritanceOrder(); // return ["king", "andy", "matthew", "bob", "alex", "asha", "catherine"]
-t.death("bob"); // order: king > andy > matthew > bob > alex > asha > catherine
-t.getInheritanceOrder(); // return ["king", "andy", "matthew", "alex", "asha", "catherine"]
-
kingName, parentName, childName, and name consist of lowercase English letters only.
-
All arguments childName and kingName are distinct.
-
All name arguments of death will be passed to either the constructor or as childName to birth first.
-
For each call to birth(parentName, childName), it is guaranteed that parentName is alive.
-
At most 105 calls will be made to birth and death.
-
At most 10 calls will be made to getInheritanceOrder.
-
-
-### Related Topics
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Tree](../../tag/tree/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Design](../../tag/design/README.md)]
-
-### Similar Questions
- 1. [Operations on Tree](../operations-on-tree) (Medium)
-
-### Hints
-
-Hint 1
-Create a tree structure of the family.
-
-
-
-Hint 2
-Without deaths, the order of inheritance is simply a pre-order traversal of the tree.
-
-
-
-Hint 3
-Mark the dead family members tree nodes and don't include them in the final order.
-
diff --git a/problems/tiling-a-rectangle-with-the-fewest-squares/README.md b/problems/tiling-a-rectangle-with-the-fewest-squares/README.md
deleted file mode 100644
index 1c2d357e2..000000000
--- a/problems/tiling-a-rectangle-with-the-fewest-squares/README.md
+++ /dev/null
@@ -1,71 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-length-of-a-concatenated-string-with-unique-characters "Maximum Length of a Concatenated String with Unique Characters")
-
-[Next >](../number-of-comments-per-post "Number of Comments per Post")
-
-## [1240. Tiling a Rectangle with the Fewest Squares (Hard)](https://leetcode.com/problems/tiling-a-rectangle-with-the-fewest-squares "铺瓷砖")
-
-
Given a rectangle of size n x m, return the minimum number of integer-sided squares that tile the rectangle.
-
-
-
Example 1:
-
-
-
-
-Input: n = 2, m = 3
-Output: 3
-Explanation:3 squares are necessary to cover the rectangle.
-2 (squares of 1x1)
-1 (square of 2x2)
-
-
Example 2:
-
-
-
-
-Input: n = 5, m = 8
-Output: 5
-
-
-
Example 3:
-
-
-
-
-Input: n = 11, m = 13
-Output: 6
-
-
-
-
Constraints:
-
-
-
1 <= n, m <= 13
-
-
-### Related Topics
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Backtracking](../../tag/backtracking/README.md)]
-
-### Hints
-
-Hint 1
-Can you use backtracking to solve this problem ?.
-
-
-
-Hint 2
-Suppose you've placed a bunch of squares. Where is the natural spot to place the next square ?.
-
-
-
-Hint 3
-The maximum number of squares to be placed will be ≤ max(n,m).
-
diff --git a/problems/time-based-key-value-store/README.md b/problems/time-based-key-value-store/README.md
deleted file mode 100644
index 559c1350b..000000000
--- a/problems/time-based-key-value-store/README.md
+++ /dev/null
@@ -1,59 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../unique-paths-iii "Unique Paths III")
-
-[Next >](../triples-with-bitwise-and-equal-to-zero "Triples with Bitwise AND Equal To Zero")
-
-## [981. Time Based Key-Value Store (Medium)](https://leetcode.com/problems/time-based-key-value-store "基于时间的键值存储")
-
-
Design a time-based key-value data structure that can store multiple values for the same key at different time stamps and retrieve the key's value at a certain timestamp.
-
-
Implement the TimeMap class:
-
-
-
TimeMap() Initializes the object of the data structure.
-
void set(String key, String value, int timestamp) Stores the key key with the value value at the given time timestamp.
-
String get(String key, int timestamp) Returns a value such that set was called previously, with timestamp_prev <= timestamp. If there are multiple such values, it returns the value associated with the largest timestamp_prev. If there are no values, it returns "".
-
-
-
-
Example 1:
-
-
-Input
-["TimeMap", "set", "get", "get", "set", "get", "get"]
-[[], ["foo", "bar", 1], ["foo", 1], ["foo", 3], ["foo", "bar2", 4], ["foo", 4], ["foo", 5]]
-Output
-[null, null, "bar", "bar", null, "bar2", "bar2"]
-
-Explanation
-TimeMap timeMap = new TimeMap();
-timeMap.set("foo", "bar", 1); // store the key "foo" and value "bar" along with timestamp = 1.
-timeMap.get("foo", 1); // return "bar"
-timeMap.get("foo", 3); // return "bar", since there is no value corresponding to foo at timestamp 3 and timestamp 2, then the only value is at timestamp 1 is "bar".
-timeMap.set("foo", "bar2", 4); // store the key "foo" and value "bar2" along with timestamp = 4.
-timeMap.get("foo", 4); // return "bar2"
-timeMap.get("foo", 5); // return "bar2"
-
-
-
-
Constraints:
-
-
-
1 <= key.length, value.length <= 100
-
key and value consist of lowercase English letters and digits.
-
1 <= timestamp <= 107
-
All the timestamps timestamp of set are strictly increasing.
-
At most 2 * 105 calls will be made to set and get.
There are n people in a line queuing to buy tickets, where the 0th person is at the front of the line and the (n - 1)th person is at the back of the line.
-
-
You are given a 0-indexed integer array tickets of length n where the number of tickets that the ith person would like to buy is tickets[i].
-
-
Each person takes exactly 1 second to buy a ticket. A person can only buy 1 ticket at a time and has to go back to the end of the line (which happens instantaneously) in order to buy more tickets. If a person does not have any tickets left to buy, the person will leave the line.
-
-
Return the time taken for the person at position k(0-indexed)to finish buying tickets.
-
-
-
Example 1:
-
-
-Input: tickets = [2,3,2], k = 2
-Output: 6
-Explanation:
-- In the first pass, everyone in the line buys a ticket and the line becomes [1, 2, 1].
-- In the second pass, everyone in the line buys a ticket and the line becomes [0, 1, 0].
-The person at position 2 has successfully bought 2 tickets and it took 3 + 3 = 6 seconds.
-
-
-
Example 2:
-
-
-Input: tickets = [5,1,1,1], k = 0
-Output: 8
-Explanation:
-- In the first pass, everyone in the line buys a ticket and the line becomes [4, 0, 0, 0].
-- In the next 4 passes, only the person in position 0 is buying tickets.
-The person at position 0 has successfully bought 5 tickets and it took 4 + 1 + 1 + 1 + 1 = 8 seconds.
-
-
-
-
Constraints:
-
-
-
n == tickets.length
-
1 <= n <= 100
-
1 <= tickets[i] <= 100
-
0 <= k < n
-
-
-### Related Topics
- [[Queue](../../tag/queue/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Simulation](../../tag/simulation/README.md)]
-
-### Hints
-
-Hint 1
-Loop through the line of people and decrement the number of tickets for each to buy one at a time as if simulating the line moving forward. Keep track of how many tickets have been sold up until person k has no more tickets to buy.
-
-
-
-Hint 2
-Remember that those who have no more tickets to buy will leave the line.
-
diff --git a/problems/time-needed-to-inform-all-employees/README.md b/problems/time-needed-to-inform-all-employees/README.md
deleted file mode 100644
index af158e624..000000000
--- a/problems/time-needed-to-inform-all-employees/README.md
+++ /dev/null
@@ -1,80 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../number-of-times-binary-string-is-prefix-aligned "Number of Times Binary String Is Prefix-Aligned")
-
-[Next >](../frog-position-after-t-seconds "Frog Position After T Seconds")
-
-## [1376. Time Needed to Inform All Employees (Medium)](https://leetcode.com/problems/time-needed-to-inform-all-employees "通知所有员工所需的时间")
-
-
A company has n employees with a unique ID for each employee from 0 to n - 1. The head of the company is the one with headID.
-
-
Each employee has one direct manager given in the manager array where manager[i] is the direct manager of the i-th employee, manager[headID] = -1. Also, it is guaranteed that the subordination relationships have a tree structure.
-
-
The head of the company wants to inform all the company employees of an urgent piece of news. He will inform his direct subordinates, and they will inform their subordinates, and so on until all employees know about the urgent news.
-
-
The i-th employee needs informTime[i] minutes to inform all of his direct subordinates (i.e., After informTime[i] minutes, all his direct subordinates can start spreading the news).
-
-
Return the number of minutes needed to inform all the employees about the urgent news.
-
-
-
Example 1:
-
-
-Input: n = 1, headID = 0, manager = [-1], informTime = [0]
-Output: 0
-Explanation: The head of the company is the only employee in the company.
-
-
-
Example 2:
-
-
-Input: n = 6, headID = 2, manager = [2,2,-1,2,2,2], informTime = [0,0,1,0,0,0]
-Output: 1
-Explanation: The head of the company with id = 2 is the direct manager of all the employees in the company and needs 1 minute to inform them all.
-The tree structure of the employees in the company is shown.
-
-
-
-
Constraints:
-
-
-
1 <= n <= 105
-
0 <= headID < n
-
manager.length == n
-
0 <= manager[i] < n
-
manager[headID] == -1
-
informTime.length == n
-
0 <= informTime[i] <= 1000
-
informTime[i] == 0 if employee i has no subordinates.
-
It is guaranteed that all the employees can be informed.
-
-
-### Related Topics
- [[Tree](../../tag/tree/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
-
-### Similar Questions
- 1. [Maximum Depth of Binary Tree](../maximum-depth-of-binary-tree) (Easy)
- 1. [Binary Tree Maximum Path Sum](../binary-tree-maximum-path-sum) (Hard)
-
-### Hints
-
-Hint 1
-The company can be represented as a tree, headID is always the root.
-
-
-
-Hint 2
-Store for each node the time needed to be informed of the news.
-
-
-
-Hint 3
-Answer is the max time a leaf node needs to be informed.
-
diff --git a/problems/to-lower-case/README.md b/problems/to-lower-case/README.md
deleted file mode 100644
index 5b2bc0157..000000000
--- a/problems/to-lower-case/README.md
+++ /dev/null
@@ -1,63 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../insert-into-a-sorted-circular-linked-list "Insert into a Sorted Circular Linked List")
-
-[Next >](../random-pick-with-blacklist "Random Pick with Blacklist")
-
-## [709. To Lower Case (Easy)](https://leetcode.com/problems/to-lower-case "转换成小写字母")
-
-
Given a string s, return the string after replacing every uppercase letter with the same lowercase letter.
-
-
-
Example 1:
-
-
-Input: s = "Hello"
-Output: "hello"
-
-
-
Example 2:
-
-
-Input: s = "here"
-Output: "here"
-
-
-
Example 3:
-
-
-Input: s = "LOVELY"
-Output: "lovely"
-
-
-
-
Constraints:
-
-
-
1 <= s.length <= 100
-
s consists of printable ASCII characters.
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
-
-### Hints
-
-Hint 1
-Most languages support lowercase conversion for a string data type. However, that is certainly not the purpose of the problem. Think about how the implementation of the lowercase function call can be done easily.
-
-
-
-Hint 2
-Think ASCII!
-
-
-
-Hint 3
-Think about the different capital letters and their ASCII codes and how that relates to their lowercase counterparts. Does there seem to be any pattern there? Any mathematical relationship that we can use?
-
diff --git a/problems/to-lower-case/to_lower_case.go b/problems/to-lower-case/to_lower_case.go
deleted file mode 100644
index 780016c2b..000000000
--- a/problems/to-lower-case/to_lower_case.go
+++ /dev/null
@@ -1,7 +0,0 @@
-package problem709
-
-import "strings"
-
-func toLowerCase(str string) string {
- return strings.ToLower(str)
-}
diff --git a/problems/to-lower-case/to_lower_case_test.go b/problems/to-lower-case/to_lower_case_test.go
deleted file mode 100644
index 6be8dcd93..000000000
--- a/problems/to-lower-case/to_lower_case_test.go
+++ /dev/null
@@ -1,19 +0,0 @@
-package problem709
-
-import "testing"
-
-func TestToLowerCase(t *testing.T) {
- tests := map[string]string{
- "Hello": "hello",
- "here": "here",
- "LOVELY": "lovely",
- "aweSee": "awesee",
- }
-
- for in, want := range tests {
- got := toLowerCase(in)
- if got != want {
- t.Fatalf("in: %v, got: %v, want: %v", in, got, want)
- }
- }
-}
diff --git a/problems/toeplitz-matrix/README.md b/problems/toeplitz-matrix/README.md
deleted file mode 100644
index c9dffec1b..000000000
--- a/problems/toeplitz-matrix/README.md
+++ /dev/null
@@ -1,68 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../couples-holding-hands "Couples Holding Hands")
-
-[Next >](../reorganize-string "Reorganize String")
-
-## [766. Toeplitz Matrix (Easy)](https://leetcode.com/problems/toeplitz-matrix "托普利茨矩阵")
-
-
Given an m x nmatrix, return true if the matrix is Toeplitz. Otherwise, return false.
-
-
A matrix is Toeplitz if every diagonal from top-left to bottom-right has the same elements.
-
-
-
Example 1:
-
-
-Input: matrix = [[1,2,3,4],[5,1,2,3],[9,5,1,2]]
-Output: true
-Explanation:
-In the above grid, the diagonals are:
-"[9]", "[5, 5]", "[1, 1, 1]", "[2, 2, 2]", "[3, 3]", "[4]".
-In each diagonal all elements are the same, so the answer is True.
-
-
-
Example 2:
-
-
-Input: matrix = [[1,2],[2,2]]
-Output: false
-Explanation:
-The diagonal "[1, 2]" has different elements.
-
-
-
-
Constraints:
-
-
-
m == matrix.length
-
n == matrix[i].length
-
1 <= m, n <= 20
-
0 <= matrix[i][j] <= 99
-
-
-
-
Follow up:
-
-
-
What if the matrix is stored on disk, and the memory is limited such that you can only load at most one row of the matrix into the memory at once?
-
What if the matrix is so large that you can only load up a partial row into the memory at once?
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
-
-### Similar Questions
- 1. [Valid Word Square](../valid-word-square) (Easy)
-
-### Hints
-
-Hint 1
-Check whether each value is equal to the value of it's top-left neighbor.
-
diff --git a/problems/toeplitz-matrix/toeplitz_matrix.go b/problems/toeplitz-matrix/toeplitz_matrix.go
deleted file mode 100644
index 2a4bec580..000000000
--- a/problems/toeplitz-matrix/toeplitz_matrix.go
+++ /dev/null
@@ -1,12 +0,0 @@
-package problem766
-
-func isToeplitzMatrix(matrix [][]int) bool {
- for i, row := range matrix[1:] {
- for j, v := range row[1:] {
- if v != matrix[i][j] {
- return false
- }
- }
- }
- return true
-}
diff --git a/problems/toeplitz-matrix/toeplitz_matrix_test.go b/problems/toeplitz-matrix/toeplitz_matrix_test.go
deleted file mode 100644
index df54e8b12..000000000
--- a/problems/toeplitz-matrix/toeplitz_matrix_test.go
+++ /dev/null
@@ -1,34 +0,0 @@
-package problem766
-
-import "testing"
-
-type testType struct {
- in [][]int
- want bool
-}
-
-func TestIsToeplitzMatrix(t *testing.T) {
- tests := [...]testType{
- {
- in: [][]int{
- {1, 2, 3, 4},
- {5, 1, 2, 3},
- {9, 5, 1, 2},
- },
- want: true,
- },
- {
- in: [][]int{
- {1, 2},
- {2, 2},
- },
- want: false,
- },
- }
- for _, tt := range tests {
- got := isToeplitzMatrix(tt.in)
- if got != tt.want {
- t.Fatalf("in: %v, got: %v, want: %v", tt.in, got, tt.want)
- }
- }
-}
diff --git a/problems/top-k-frequent-elements/README.md b/problems/top-k-frequent-elements/README.md
deleted file mode 100644
index ac17ea0c6..000000000
--- a/problems/top-k-frequent-elements/README.md
+++ /dev/null
@@ -1,52 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../moving-average-from-data-stream "Moving Average from Data Stream")
-
-[Next >](../design-tic-tac-toe "Design Tic-Tac-Toe")
-
-## [347. Top K Frequent Elements (Medium)](https://leetcode.com/problems/top-k-frequent-elements "前 K 个高频元素")
-
-
Given an integer array nums and an integer k, return thekmost frequent elements. You may return the answer in any order.
-
-
-
Example 1:
-
Input: nums = [1,1,1,2,2,3], k = 2
-Output: [1,2]
-
Example 2:
-
Input: nums = [1], k = 1
-Output: [1]
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 105
-
k is in the range [1, the number of unique elements in the array].
-
It is guaranteed that the answer is unique.
-
-
-
-
Follow up: Your algorithm's time complexity must be better than O(n log n), where n is the array's size.
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Divide and Conquer](../../tag/divide-and-conquer/README.md)]
- [[Bucket Sort](../../tag/bucket-sort/README.md)]
- [[Counting](../../tag/counting/README.md)]
- [[Quickselect](../../tag/quickselect/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
- [[Heap (Priority Queue)](../../tag/heap-priority-queue/README.md)]
-
-### Similar Questions
- 1. [Word Frequency](../word-frequency) (Medium)
- 1. [Kth Largest Element in an Array](../kth-largest-element-in-an-array) (Medium)
- 1. [Sort Characters By Frequency](../sort-characters-by-frequency) (Medium)
- 1. [Split Array into Consecutive Subsequences](../split-array-into-consecutive-subsequences) (Medium)
- 1. [Top K Frequent Words](../top-k-frequent-words) (Medium)
- 1. [K Closest Points to Origin](../k-closest-points-to-origin) (Medium)
diff --git a/problems/top-k-frequent-elements/top_k_frequent_elements.go b/problems/top-k-frequent-elements/top_k_frequent_elements.go
deleted file mode 100644
index 4f2b3a269..000000000
--- a/problems/top-k-frequent-elements/top_k_frequent_elements.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem347
diff --git a/problems/top-k-frequent-elements/top_k_frequent_elements_test.go b/problems/top-k-frequent-elements/top_k_frequent_elements_test.go
deleted file mode 100644
index 4f2b3a269..000000000
--- a/problems/top-k-frequent-elements/top_k_frequent_elements_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem347
diff --git a/problems/top-k-frequent-words/README.md b/problems/top-k-frequent-words/README.md
deleted file mode 100644
index 333a0533c..000000000
--- a/problems/top-k-frequent-words/README.md
+++ /dev/null
@@ -1,60 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../stickers-to-spell-word "Stickers to Spell Word")
-
-[Next >](../binary-number-with-alternating-bits "Binary Number with Alternating Bits")
-
-## [692. Top K Frequent Words (Medium)](https://leetcode.com/problems/top-k-frequent-words "前K个高频单词")
-
-
Given an array of strings words and an integer k, return the k most frequent strings.
-
-
Return the answer sorted by the frequency from highest to lowest. Sort the words with the same frequency by their lexicographical order.
-
-
-
Example 1:
-
-
-Input: words = ["i","love","leetcode","i","love","coding"], k = 2
-Output: ["i","love"]
-Explanation: "i" and "love" are the two most frequent words.
-Note that "i" comes before "love" due to a lower alphabetical order.
-
-
-
Example 2:
-
-
-Input: words = ["the","day","is","sunny","the","the","the","sunny","is","is"], k = 4
-Output: ["the","is","sunny","day"]
-Explanation: "the", "is", "sunny" and "day" are the four most frequent words, with the number of occurrence being 4, 3, 2 and 1 respectively.
-
-
-
-
Constraints:
-
-
-
1 <= words.length <= 500
-
1 <= words[i] <= 10
-
words[i] consists of lowercase English letters.
-
k is in the range [1, The number of unique words[i]]
-
-
-
-
Follow-up: Could you solve it in O(n log(k)) time and O(n) extra space?
-+---------------+---------+
-| Column Name | Type |
-+---------------+---------+
-| id | int |
-| name | varchar |
-+---------------+---------+
-id is the primary key for this table.
-name is the name of the user.
-
-
-
Table: Rides
-
-+---------------+---------+
-| Column Name | Type |
-+---------------+---------+
-| id | int |
-| user_id | int |
-| distance | int |
-+---------------+---------+
-id is the primary key for this table.
-city_id is the id of the city who bought the product "product_name".
-
-
-Write an SQL query to report the distance travelled by each user.
-
-Return the result table ordered by travelled_distance in descending order, if two or more users travelled the same distance, order them by their name in ascending order.
-
-The query result format is in the following example.
-
-Users table:
-+------+-----------+
-| id | name |
-+------+-----------+
-| 1 | Alice |
-| 2 | Bob |
-| 3 | Alex |
-| 4 | Donald |
-| 7 | Lee |
-| 13 | Jonathan |
-| 19 | Elvis |
-+------+-----------+
-
-Rides table:
-+------+----------+----------+
-| id | user_id | distance |
-+------+----------+----------+
-| 1 | 1 | 120 |
-| 2 | 2 | 317 |
-| 3 | 3 | 222 |
-| 4 | 7 | 100 |
-| 5 | 13 | 312 |
-| 6 | 19 | 50 |
-| 7 | 7 | 120 |
-| 8 | 19 | 400 |
-| 9 | 7 | 230 |
-+------+----------+----------+
-
-Result table:
-+----------+--------------------+
-| name | travelled_distance |
-+----------+--------------------+
-| Elvis | 450 |
-| Lee | 450 |
-| Bob | 317 |
-| Jonathan | 312 |
-| Alex | 222 |
-| Alice | 120 |
-| Donald | 0 |
-+----------+--------------------+
-Elvis and Lee travelled 450 miles, Elvis is the top traveller as his name is alphabetically smaller than Lee.
-Bob, Jonathan, Alex and Alice have only one ride and we just order them by the total distances of the ride.
-Donald didn't have any rides, the distance travelled by him is 0.
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/top-travellers/mysql_schemas.sql b/problems/top-travellers/mysql_schemas.sql
deleted file mode 100644
index 4d1dbe7da..000000000
--- a/problems/top-travellers/mysql_schemas.sql
+++ /dev/null
@@ -1,20 +0,0 @@
-Create Table If Not Exists Users (id int, name varchar(30));
-Create Table If Not Exists Rides (id int, user_id int, distance int);
-Truncate table Users;
-insert into Users (id, name) values ('1', 'Alice');
-insert into Users (id, name) values ('2', 'Bob');
-insert into Users (id, name) values ('3', 'Alex');
-insert into Users (id, name) values ('4', 'Donald');
-insert into Users (id, name) values ('7', 'Lee');
-insert into Users (id, name) values ('13', 'Jonathan');
-insert into Users (id, name) values ('19', 'Elvis');
-Truncate table Rides;
-insert into Rides (id, user_id, distance) values ('1', '1', '120');
-insert into Rides (id, user_id, distance) values ('2', '2', '317');
-insert into Rides (id, user_id, distance) values ('3', '3', '222');
-insert into Rides (id, user_id, distance) values ('4', '7', '100');
-insert into Rides (id, user_id, distance) values ('5', '13', '312');
-insert into Rides (id, user_id, distance) values ('6', '19', '50');
-insert into Rides (id, user_id, distance) values ('7', '7', '120');
-insert into Rides (id, user_id, distance) values ('8', '19', '400');
-insert into Rides (id, user_id, distance) values ('9', '7', '230');
diff --git a/problems/toss-strange-coins/README.md b/problems/toss-strange-coins/README.md
deleted file mode 100644
index 045ee166b..000000000
--- a/problems/toss-strange-coins/README.md
+++ /dev/null
@@ -1,60 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../meeting-scheduler "Meeting Scheduler")
-
-[Next >](../divide-chocolate "Divide Chocolate")
-
-## [1230. Toss Strange Coins (Medium)](https://leetcode.com/problems/toss-strange-coins "抛掷硬币")
-
-
You have some coins. The i-th coin has a probability prob[i] of facing heads when tossed.
-
-
Return the probability that the number of coins facing heads equals target if you toss every coin exactly once.
Answers will be accepted as correct if they are within 10^-5 of the correct answer.
-
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Probability and Statistics](../../tag/probability-and-statistics/README.md)]
-
-### Hints
-
-Hint 1
-What about solving the problem with DP?
-
-
-
-Hint 2
-Use DP with two states dp[pos][cnt], where pos represents the pos-th coin and cnt is the number of heads seen so far.
-
-
-
-Hint 3
-You can do the transitions with a little bit math.
-
-
-
-Hint 4
-For the base case, when pos == n return (cnt == target) to filter out the invalid scenarios.
-
diff --git a/problems/total-hamming-distance/README.md b/problems/total-hamming-distance/README.md
deleted file mode 100644
index 6ec41c314..000000000
--- a/problems/total-hamming-distance/README.md
+++ /dev/null
@@ -1,52 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../number-complement "Number Complement")
-
-[Next >](../generate-random-point-in-a-circle "Generate Random Point in a Circle")
-
-## [477. Total Hamming Distance (Medium)](https://leetcode.com/problems/total-hamming-distance "汉明距离总和")
-
-
The Hamming distance between two integers is the number of positions at which the corresponding bits are different.
-
-
Given an integer array nums, return the sum of Hamming distances between all the pairs of the integers innums.
-
-
-
Example 1:
-
-
-Input: nums = [4,14,2]
-Output: 6
-Explanation: In binary representation, the 4 is 0100, 14 is 1110, and 2 is 0010 (just
-showing the four bits relevant in this case).
-The answer will be:
-HammingDistance(4, 14) + HammingDistance(4, 2) + HammingDistance(14, 2) = 2 + 2 + 2 = 6.
-
-
-
Example 2:
-
-
-Input: nums = [4,14,4]
-Output: 4
-
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 104
-
0 <= nums[i] <= 109
-
The answer for the given input will fit in a 32-bit integer.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Math](../../tag/math/README.md)]
- [[Bit Manipulation](../../tag/bit-manipulation/README.md)]
-
-### Similar Questions
- 1. [Hamming Distance](../hamming-distance) (Easy)
diff --git a/problems/total-hamming-distance/total_hamming_distance.go b/problems/total-hamming-distance/total_hamming_distance.go
deleted file mode 100644
index d6463b474..000000000
--- a/problems/total-hamming-distance/total_hamming_distance.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem477
diff --git a/problems/total-hamming-distance/total_hamming_distance_test.go b/problems/total-hamming-distance/total_hamming_distance_test.go
deleted file mode 100644
index d6463b474..000000000
--- a/problems/total-hamming-distance/total_hamming_distance_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem477
diff --git a/problems/total-sales-amount-by-year/README.md b/problems/total-sales-amount-by-year/README.md
deleted file mode 100644
index f2a0dc254..000000000
--- a/problems/total-sales-amount-by-year/README.md
+++ /dev/null
@@ -1,83 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-performance-of-a-team "Maximum Performance of a Team")
-
-[Next >](../find-the-distance-value-between-two-arrays "Find the Distance Value Between Two Arrays")
-
-## [1384. Total Sales Amount by Year (Hard)](https://leetcode.com/problems/total-sales-amount-by-year "按年度列出销售总额")
-
-
Table: Product
-
-+---------------+---------+
-| Column Name | Type |
-+---------------+---------+
-| product_id | int |
-| product_name | varchar |
-+---------------+---------+
-product_id is the primary key for this table.
-product_name is the name of the product.
-
-
-
Table: Sales
-
-+---------------------+---------+
-| Column Name | Type |
-+---------------------+---------+
-| product_id | int |
-| period_start | varchar |
-| period_end | date |
-| average_daily_sales | int |
-+---------------------+---------+
-product_id is the primary key for this table.
-period_start and period_end indicates the start and end date for sales period, both dates are inclusive.
-The average_daily_sales column holds the average daily sales amount of the items for the period.
-
-
-Write an SQL query to report the Total sales amount of each item for each year, with corresponding product name, product_id, product_name and report_year.
-
-Dates of the sales years are between 2018 to 2020. Return the result table ordered by product_id and report_year.
-
-The query result format is in the following example:
-
-
-Product table:
-+------------+--------------+
-| product_id | product_name |
-+------------+--------------+
-| 1 | LC Phone |
-| 2 | LC T-Shirt |
-| 3 | LC Keychain |
-+------------+--------------+
-
-Sales table:
-+------------+--------------+-------------+---------------------+
-| product_id | period_start | period_end | average_daily_sales |
-+------------+--------------+-------------+---------------------+
-| 1 | 2019-01-25 | 2019-02-28 | 100 |
-| 2 | 2018-12-01 | 2020-01-01 | 10 |
-| 3 | 2019-12-01 | 2020-01-31 | 1 |
-+------------+--------------+-------------+---------------------+
-
-Result table:
-+------------+--------------+-------------+--------------+
-| product_id | product_name | report_year | total_amount |
-+------------+--------------+-------------+--------------+
-| 1 | LC Phone | 2019 | 3500 |
-| 2 | LC T-Shirt | 2018 | 310 |
-| 2 | LC T-Shirt | 2019 | 3650 |
-| 2 | LC T-Shirt | 2020 | 10 |
-| 3 | LC Keychain | 2019 | 31 |
-| 3 | LC Keychain | 2020 | 31 |
-+------------+--------------+-------------+--------------+
-LC Phone was sold for the period of 2019-01-25 to 2019-02-28, and there are 35 days for this period. Total amount 35*100 = 3500.
-LC T-shirt was sold for the period of 2018-12-01 to 2020-01-01, and there are 31, 365, 1 days for years 2018, 2019 and 2020 respectively.
-LC Keychain was sold for the period of 2019-12-01 to 2020-01-31, and there are 31, 31 days for years 2019 and 2020 respectively.
-
-+-------------+-------+
-| Column Name | Type |
-+-------------+-------+
-| player_id | int |
-| group_id | int |
-+-------------+-------+
-player_id is the primary key of this table.
-Each row of this table indicates the group of each player.
-
-
-
Table: Matches
-
-
-+---------------+---------+
-| Column Name | Type |
-+---------------+---------+
-| match_id | int |
-| first_player | int |
-| second_player | int |
-| first_score | int |
-| second_score | int |
-+---------------+---------+
-match_id is the primary key of this table.
-Each row is a record of a match, first_player and second_player contain the player_id of each match.
-first_score and second_score contain the number of points of the first_player and second_player respectively.
-You may assume that, in each match, players belongs to the same group.
-
-
-
-
-
The winner in each group is the player who scored the maximum total points within the group. In the case of a tie, the lowest player_id wins.
-
-
Write an SQL query to find the winner in each group.
-
-
The query result format is in the following example:
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/tournament-winners/mysql_schemas.sql b/problems/tournament-winners/mysql_schemas.sql
deleted file mode 100644
index ab978981b..000000000
--- a/problems/tournament-winners/mysql_schemas.sql
+++ /dev/null
@@ -1,19 +0,0 @@
-Create table If Not Exists Players (player_id int, group_id int);
-Create table If Not Exists Matches (match_id int, first_player int, second_player int, first_score int, second_score int)
-;
-Truncate table Players;
-insert into Players (player_id, group_id) values ('10', '2');
-insert into Players (player_id, group_id) values ('15', '1');
-insert into Players (player_id, group_id) values ('20', '3');
-insert into Players (player_id, group_id) values ('25', '1');
-insert into Players (player_id, group_id) values ('30', '1');
-insert into Players (player_id, group_id) values ('35', '2');
-insert into Players (player_id, group_id) values ('40', '3');
-insert into Players (player_id, group_id) values ('45', '1');
-insert into Players (player_id, group_id) values ('50', '2');
-Truncate table Matches;
-insert into Matches (match_id, first_player, second_player, first_score, second_score) values ('1', '15', '45', '3', '0');
-insert into Matches (match_id, first_player, second_player, first_score, second_score) values ('2', '30', '25', '1', '2');
-insert into Matches (match_id, first_player, second_player, first_score, second_score) values ('3', '30', '15', '2', '0');
-insert into Matches (match_id, first_player, second_player, first_score, second_score) values ('4', '40', '20', '5', '2');
-insert into Matches (match_id, first_player, second_player, first_score, second_score) values ('5', '35', '50', '1', '1');
diff --git a/problems/traffic-light-controlled-intersection/README.md b/problems/traffic-light-controlled-intersection/README.md
deleted file mode 100644
index 818d55bd4..000000000
--- a/problems/traffic-light-controlled-intersection/README.md
+++ /dev/null
@@ -1,76 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../palindrome-partitioning-iii "Palindrome Partitioning III")
-
-[Next >](../students-and-examinations "Students and Examinations")
-
-## [1279. Traffic Light Controlled Intersection (Easy)](https://leetcode.com/problems/traffic-light-controlled-intersection "红绿灯路口")
-
-There is an intersection of two roads. First road is road A where cars travel from North to South in direction 1 and from South to North in direction 2. Second road is road B where cars travel from West to East in direction 3 and from East to West in direction 4.
-
-There is a traffic light located on each road before the intersection. A traffic light can either be green or red.
-
-1. Green means cars can cross the intersection in both directions of the road.
-- Red means cars in both directions cannot cross the intersection and must wait until the light turns green.
-
-The traffic lights cannot be green on both roads at the same time. That means when the light is green on road A, it is red on road B and when the light is green on road B, it is red on road A.
-
-Initially, the traffic light is green on road A and red on road B. When the light is green on one road, all cars can cross the intersection in both directions until the light becomes green on the other road. No two cars traveling on different roads should cross at the same time.
-
-Design a deadlock-free traffic light controlled system at this intersection.
-
-Implement the function void carArrived(carId, roadId, direction, turnGreen, crossCar) where:
-
-- carId is the id of the car that arrived.
-- roadId is the id of the road that the car travels on.
-- direction is the direction of the car.
-- turnGreen is a function you can call to turn the traffic light to green on the current road.
-- crossCar is a function you can call to let the current car cross the intersection.
-
-Your answer is considered correct if it avoids cars deadlock in the intersection. Turning the light green on a road when it was already green is considered a wrong answer.
-
-
Example 1:
-
-Input: cars = [1,3,5,2,4], directions = [2,1,2,4,3], arrivalTimes = [10,20,30,40,50]
-Output: [
-"Car 1 Has Passed Road A In Direction 2", // Traffic light on road A is green, car 1 can cross the intersection.
-"Car 3 Has Passed Road A In Direction 1", // Car 3 crosses the intersection as the light is still green.
-"Car 5 Has Passed Road A In Direction 2", // Car 5 crosses the intersection as the light is still green.
-"Traffic Light On Road B Is Green", // Car 2 requests green light for road B.
-"Car 2 Has Passed Road B In Direction 4", // Car 2 crosses as the light is green on road B now.
-"Car 4 Has Passed Road B In Direction 3" // Car 4 crosses the intersection as the light is still green.
-]
-
-
-
Example 2:
-
-Input: cars = [1,2,3,4,5], directions = [2,4,3,3,1], arrivalTimes = [10,20,30,40,40]
-Output: [
-"Car 1 Has Passed Road A In Direction 2", // Traffic light on road A is green, car 1 can cross the intersection.
-"Traffic Light On Road B Is Green", // Car 2 requests green light for road B.
-"Car 2 Has Passed Road B In Direction 4", // Car 2 crosses as the light is green on road B now.
-"Car 3 Has Passed Road B In Direction 3", // Car 3 crosses as the light is green on road B now.
-"Traffic Light On Road A Is Green", // Car 5 requests green light for road A.
-"Car 5 Has Passed Road A In Direction 1", // Car 5 crosses as the light is green on road A now.
-"Traffic Light On Road B Is Green", // Car 4 requests green light for road B. Car 4 blocked until car 5 crosses and then traffic light is green on road B.
-"Car 4 Has Passed Road B In Direction 3" // Car 4 crosses as the light is green on road B now.
-]
-Explanation: This is a dead-lock free scenario. Note that the scenario when car 4 crosses before turning light into green on road A and allowing car 5 to pass is also correct and Accepted scenario.
-
-
-Constraints:
-
-- 1 <= cars.length <= 20
-- cars.length = directions.length
-- cars.length = arrivalTimes.length
-- All values of cars are unique
-- 1 <= directions[i] <= 4
-- arrivalTimes is non-decreasing
-
-### Related Topics
- [[Concurrency](../../tag/concurrency/README.md)]
diff --git a/problems/transform-to-chessboard/README.md b/problems/transform-to-chessboard/README.md
deleted file mode 100644
index 4230baade..000000000
--- a/problems/transform-to-chessboard/README.md
+++ /dev/null
@@ -1,61 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../rabbits-in-forest "Rabbits in Forest")
-
-[Next >](../minimum-distance-between-bst-nodes "Minimum Distance Between BST Nodes")
-
-## [782. Transform to Chessboard (Hard)](https://leetcode.com/problems/transform-to-chessboard "变为棋盘")
-
-
You are given an n x n binary grid board. In each move, you can swap any two rows with each other, or any two columns with each other.
-
-
Return the minimum number of moves to transform the board into a chessboard board. If the task is impossible, return -1.
-
-
A chessboard board is a board where no 0's and no 1's are 4-directionally adjacent.
-
-
-
Example 1:
-
-
-Input: board = [[0,1,1,0],[0,1,1,0],[1,0,0,1],[1,0,0,1]]
-Output: 2
-Explanation: One potential sequence of moves is shown.
-The first move swaps the first and second column.
-The second move swaps the second and third row.
-
-
-
Example 2:
-
-
-Input: board = [[0,1],[1,0]]
-Output: 0
-Explanation: Also note that the board with 0 in the top left corner, is also a valid chessboard.
-
-
-
Example 3:
-
-
-Input: board = [[1,0],[1,0]]
-Output: -1
-Explanation: No matter what sequence of moves you make, you cannot end with a valid chessboard.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
- [[Simulation](../../tag/simulation/README.md)]
-
-### Hints
-
-Hint 1
-We don't need any special algorithms to do this. You just need to know what the transpose of a matrix looks like. Rows become columns and vice versa!
-
diff --git a/problems/transpose-matrix/transpose_matrix.go b/problems/transpose-matrix/transpose_matrix.go
deleted file mode 100644
index cb6d21c27..000000000
--- a/problems/transpose-matrix/transpose_matrix.go
+++ /dev/null
@@ -1,15 +0,0 @@
-package problem867
-
-func transpose(A [][]int) [][]int {
- m, n := len(A[0]), len(A)
- B := make([][]int, m)
- for i := 0; i < m; i++ {
- B[i] = make([]int, n)
- }
- for i, row := range A {
- for j, v := range row {
- B[j][i] = v
- }
- }
- return B
-}
diff --git a/problems/transpose-matrix/transpose_matrix_test.go b/problems/transpose-matrix/transpose_matrix_test.go
deleted file mode 100644
index cd12659e8..000000000
--- a/problems/transpose-matrix/transpose_matrix_test.go
+++ /dev/null
@@ -1,45 +0,0 @@
-package problem867
-
-import (
- "reflect"
- "testing"
-)
-
-type testType struct {
- in [][]int
- want [][]int
-}
-
-func TestTranspose(t *testing.T) {
- tests := [...]testType{
- {
- in: [][]int{
- {1, 2, 3},
- {4, 5, 6},
- {7, 8, 9},
- },
- want: [][]int{
- {1, 4, 7},
- {2, 5, 8},
- {3, 6, 9},
- },
- },
- {
- in: [][]int{
- {1, 2, 3},
- {4, 5, 6},
- },
- want: [][]int{
- {1, 4},
- {2, 5},
- {3, 6},
- },
- },
- }
- for _, tt := range tests {
- got := transpose(tt.in)
- if !reflect.DeepEqual(got, tt.want) {
- t.Fatalf("in: %v, got: %v, want: %v", tt.in, got, tt.want)
- }
- }
-}
diff --git a/problems/trapping-rain-water-ii/README.md b/problems/trapping-rain-water-ii/README.md
deleted file mode 100644
index d7f037184..000000000
--- a/problems/trapping-rain-water-ii/README.md
+++ /dev/null
@@ -1,51 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../queue-reconstruction-by-height "Queue Reconstruction by Height")
-
-[Next >](../valid-word-abbreviation "Valid Word Abbreviation")
-
-## [407. Trapping Rain Water II (Hard)](https://leetcode.com/problems/trapping-rain-water-ii "接雨水 II")
-
-
Given an m x n integer matrix heightMap representing the height of each unit cell in a 2D elevation map, return the volume of water it can trap after raining.
-
-
-
Example 1:
-
-
-Input: heightMap = [[1,4,3,1,3,2],[3,2,1,3,2,4],[2,3,3,2,3,1]]
-Output: 4
-Explanation: After the rain, water is trapped between the blocks.
-We have two small ponds 1 and 3 units trapped.
-The total volume of water trapped is 4.
-
Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it can trap after raining.
-
-
-
Example 1:
-
-
-Input: height = [0,1,0,2,1,0,1,3,2,1,2,1]
-Output: 6
-Explanation: The above elevation map (black section) is represented by array [0,1,0,2,1,0,1,3,2,1,2,1]. In this case, 6 units of rain water (blue section) are being trapped.
-
Given an undirected tree, return its diameter: the number of edges in a longest path in that tree.
-
-
The tree is given as an array of edges where edges[i] = [u, v] is a bidirectional edge between nodes u and v. Each node has labels in the set {0, 1, ..., edges.length}.
-
-
-
Example 1:
-
-
-
-
-Input: edges = [[0,1],[0,2]]
-Output: 2
-Explanation:
-A longest path of the tree is the path 1 - 0 - 2.
-
-
-
Example 2:
-
-
-
-
-Input: edges = [[0,1],[1,2],[2,3],[1,4],[4,5]]
-Output: 4
-Explanation:
-A longest path of the tree is the path 3 - 2 - 1 - 4 - 5.
-
-
-
-
Constraints:
-
-
-
0 <= edges.length < 10^4
-
edges[i][0] != edges[i][1]
-
0 <= edges[i][j] <= edges.length
-
The given edges form an undirected tree.
-
-
-### Related Topics
- [[Tree](../../tag/tree/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
-
-### Similar Questions
- 1. [Count Subtrees With Max Distance Between Cities](../count-subtrees-with-max-distance-between-cities) (Hard)
-
-### Hints
-
-Hint 1
-Start at any node A and traverse the tree to find the furthest node from it, let's call it B.
-
-
-
-Hint 2
-Having found the furthest node B, traverse the tree from B to find the furthest node from it, lets call it C.
-
-
-
-Hint 3
-The distance between B and C is the tree diameter.
-
diff --git a/problems/tree-node/README.md b/problems/tree-node/README.md
deleted file mode 100644
index fb7de2645..000000000
--- a/problems/tree-node/README.md
+++ /dev/null
@@ -1,84 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../sales-person "Sales Person")
-
-[Next >](../find-duplicate-file-in-system "Find Duplicate File in System")
-
-## [608. Tree Node (Medium)](https://leetcode.com/problems/tree-node "树节点")
-
-
Given a table tree, id is identifier of the tree node and p_id is its parent node's id.
Node '1' is root node, because its parent node is NULL and it has child node '2' and '3'.
-
Node '2' is inner node, because it has parent node '1' and child node '4' and '5'.
-
Node '3', '4' and '5' is Leaf node, because they have parent node and they don't have child node.
-
-
And here is the image of the sample tree as below:
-
-
- 1
- / \
- 2 3
- / \
- 4 5
-
-
Note
-
If there is only one node on the tree, you only need to output its root attributes.
-
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
-
-### Hints
-
-Hint 1
-You can judge the node type by querying whether the node's id shows up in p_id column and whether the node's p_id is null.
-
diff --git a/problems/tree-node/mysql_schemas.sql b/problems/tree-node/mysql_schemas.sql
deleted file mode 100644
index 85a4aefaa..000000000
--- a/problems/tree-node/mysql_schemas.sql
+++ /dev/null
@@ -1,7 +0,0 @@
-Create table If Not Exists Tree (id int, p_id int);
-Truncate table Tree;
-insert into Tree (id, p_id) values ('1', 'None');
-insert into Tree (id, p_id) values ('2', '1');
-insert into Tree (id, p_id) values ('3', '1');
-insert into Tree (id, p_id) values ('4', '2');
-insert into Tree (id, p_id) values ('5', '2');
diff --git a/problems/tree-node/tree_node.sql b/problems/tree-node/tree_node.sql
deleted file mode 100644
index bae62cf19..000000000
--- a/problems/tree-node/tree_node.sql
+++ /dev/null
@@ -1 +0,0 @@
-# Write your MySQL query statement below
diff --git a/problems/tree-of-coprimes/README.md b/problems/tree-of-coprimes/README.md
deleted file mode 100644
index 14026bb81..000000000
--- a/problems/tree-of-coprimes/README.md
+++ /dev/null
@@ -1,78 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../map-of-highest-peak "Map of Highest Peak")
-
-[Next >](../find-the-subtasks-that-did-not-execute "Find the Subtasks That Did Not Execute")
-
-## [1766. Tree of Coprimes (Hard)](https://leetcode.com/problems/tree-of-coprimes "互质树")
-
-
There is a tree (i.e., a connected, undirected graph that has no cycles) consisting of n nodes numbered from 0 to n - 1 and exactly n - 1 edges. Each node has a value associated with it, and the root of the tree is node 0.
-
-
To represent this tree, you are given an integer array nums and a 2D array edges. Each nums[i] represents the ith node's value, and each edges[j] = [uj, vj] represents an edge between nodes uj and vj in the tree.
-
-
Two values x and y are coprime if gcd(x, y) == 1 where gcd(x, y) is the greatest common divisor of x and y.
-
-
An ancestor of a node i is any other node on the shortest path from node i to the root. A node is not considered an ancestor of itself.
-
-
Return an array ans of size n, where ans[i] is the closest ancestor to node i such that nums[i]and nums[ans[i]] are coprime, or -1 if there is no such ancestor.
-
-
-
Example 1:
-
-
-
-
-Input: nums = [2,3,3,2], edges = [[0,1],[1,2],[1,3]]
-Output: [-1,0,0,1]
-Explanation: In the above figure, each node's value is in parentheses.
-- Node 0 has no coprime ancestors.
-- Node 1 has only one ancestor, node 0. Their values are coprime (gcd(2,3) == 1).
-- Node 2 has two ancestors, nodes 1 and 0. Node 1's value is not coprime (gcd(3,3) == 3), but node 0's
- value is (gcd(2,3) == 1), so node 0 is the closest valid ancestor.
-- Node 3 has two ancestors, nodes 1 and 0. It is coprime with node 1 (gcd(3,2) == 1), so node 1 is its
- closest valid ancestor.
-
-
-### Related Topics
- [[Tree](../../tag/tree/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Math](../../tag/math/README.md)]
-
-### Hints
-
-Hint 1
-Note that for a node, it's not optimal to consider two nodes with the same value.
-
-
-
-Hint 2
-Note that the values are small enough for you to iterate over them instead of iterating over the parent nodes.
-
diff --git a/problems/triangle-judgement/README.md b/problems/triangle-judgement/README.md
deleted file mode 100644
index c2e4a3e2d..000000000
--- a/problems/triangle-judgement/README.md
+++ /dev/null
@@ -1,39 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../find-duplicate-file-in-system "Find Duplicate File in System")
-
-[Next >](../valid-triangle-number "Valid Triangle Number")
-
-## [610. Triangle Judgement (Easy)](https://leetcode.com/problems/triangle-judgement "判断三角形")
-
-A pupil Tim gets homework to identify whether three line segments could possibly form a triangle.
-
-However, this assignment is very heavy because there are hundreds of records to calculate.
-
-
-Could you help Tim by writing a query to judge whether these three sides can form a triangle, assuming table triangle holds the length of the three sides x, y and z.
-
-
-
-
-| x | y | z |
-|----|----|----|
-| 13 | 15 | 30 |
-| 10 | 20 | 15 |
-
-For the sample data above, your query should return the follow result:
-
-
-| x | y | z | triangle |
-|----|----|----|----------|
-| 13 | 15 | 30 | No |
-| 10 | 20 | 15 | Yes |
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/triangle-judgement/mysql_schemas.sql b/problems/triangle-judgement/mysql_schemas.sql
deleted file mode 100644
index 3f64d0d37..000000000
--- a/problems/triangle-judgement/mysql_schemas.sql
+++ /dev/null
@@ -1,4 +0,0 @@
-Create table If Not Exists Triangle (x int, y int, z int);
-Truncate table Triangle;
-insert into Triangle (x, y, z) values ('13', '15', '30');
-insert into Triangle (x, y, z) values ('10', '20', '15');
diff --git a/problems/triangle-judgement/triangle_judgement.sql b/problems/triangle-judgement/triangle_judgement.sql
deleted file mode 100644
index bae62cf19..000000000
--- a/problems/triangle-judgement/triangle_judgement.sql
+++ /dev/null
@@ -1 +0,0 @@
-# Write your MySQL query statement below
diff --git a/problems/triangle/README.md b/problems/triangle/README.md
deleted file mode 100644
index 645657618..000000000
--- a/problems/triangle/README.md
+++ /dev/null
@@ -1,54 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../pascals-triangle-ii "Pascal's Triangle II")
-
-[Next >](../best-time-to-buy-and-sell-stock "Best Time to Buy and Sell Stock")
-
-## [120. Triangle (Medium)](https://leetcode.com/problems/triangle "三角形最小路径和")
-
-
Given a triangle array, return the minimum path sum from top to bottom.
-
-
For each step, you may move to an adjacent number of the row below. More formally, if you are on index i on the current row, you may move to either index i or index i + 1 on the next row.
-
-
-
Example 1:
-
-
-Input: triangle = [[2],[3,4],[6,5,7],[4,1,8,3]]
-Output: 11
-Explanation: The triangle looks like:
- 2
- 3 4
- 6 5 7
-4 1 8 3
-The minimum path sum from top to bottom is 2 + 3 + 5 + 1 = 11 (underlined above).
-
-
-
Example 2:
-
-
-Input: triangle = [[-10]]
-Output: -10
-
-
-
-
Constraints:
-
-
-
1 <= triangle.length <= 200
-
triangle[0].length == 1
-
triangle[i].length == triangle[i - 1].length + 1
-
-104 <= triangle[i][j] <= 104
-
-
-
-Follow up: Could you do this using only O(n) extra space, where n is the total number of rows in the triangle?
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
diff --git a/problems/triangle/triangle.go b/problems/triangle/triangle.go
deleted file mode 100644
index b5bc0c64f..000000000
--- a/problems/triangle/triangle.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem120
diff --git a/problems/triangle/triangle_test.go b/problems/triangle/triangle_test.go
deleted file mode 100644
index b5bc0c64f..000000000
--- a/problems/triangle/triangle_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem120
diff --git a/problems/trim-a-binary-search-tree/README.md b/problems/trim-a-binary-search-tree/README.md
deleted file mode 100644
index 1062536dd..000000000
--- a/problems/trim-a-binary-search-tree/README.md
+++ /dev/null
@@ -1,69 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../kth-smallest-number-in-multiplication-table "Kth Smallest Number in Multiplication Table")
-
-[Next >](../maximum-swap "Maximum Swap")
-
-## [669. Trim a Binary Search Tree (Medium)](https://leetcode.com/problems/trim-a-binary-search-tree "修剪二叉搜索树")
-
-
Given the root of a binary search tree and the lowest and highest boundaries as low and high, trim the tree so that all its elements lies in [low, high]. Trimming the tree should not change the relative structure of the elements that will remain in the tree (i.e., any node's descendant should remain a descendant). It can be proven that there is a unique answer.
-
-
Return the root of the trimmed binary search tree. Note that the root may change depending on the given bounds.
-+-------------+----------+
-| Column Name | Type |
-+-------------+----------+
-| id | int |
-| client_id | int |
-| driver_id | int |
-| city_id | int |
-| status | enum |
-| request_at | date |
-+-------------+----------+
-id is the primary key for this table.
-The table holds all taxi trips. Each trip has a unique id, while client_id and driver_id are foreign keys to the users_id at the Users table.
-Status is an ENUM type of ('completed', 'cancelled_by_driver', 'cancelled_by_client').
-
-
-
-
-
Table: Users
-
-
-+-------------+----------+
-| Column Name | Type |
-+-------------+----------+
-| users_id | int |
-| banned | enum |
-| role | enum |
-+-------------+----------+
-users_id is the primary key for this table.
-The table holds all users. Each user has a unique users_id, and role is an ENUM type of ('client', 'driver', 'partner').
-banned is an ENUM type of ('Yes', 'No').
-
-
-
-
-
The cancellation rate is computed by dividing the number of canceled (by client or driver) requests with unbanned users by the total number of requests with unbanned users on that day.
-
-
Write a SQL query to find the cancellation rate of requests with unbanned users (both client and driver must not be banned) each day between "2013-10-01" and "2013-10-03". Round Cancellation Rate to two decimal points.
-
-
Return the result table in any order.
-
-
The query result format is in the following example.
-
-
-
Example 1:
-
-
-Input:
-Trips table:
-+----+-----------+-----------+---------+---------------------+------------+
-| id | client_id | driver_id | city_id | status | request_at |
-+----+-----------+-----------+---------+---------------------+------------+
-| 1 | 1 | 10 | 1 | completed | 2013-10-01 |
-| 2 | 2 | 11 | 1 | cancelled_by_driver | 2013-10-01 |
-| 3 | 3 | 12 | 6 | completed | 2013-10-01 |
-| 4 | 4 | 13 | 6 | cancelled_by_client | 2013-10-01 |
-| 5 | 1 | 10 | 1 | completed | 2013-10-02 |
-| 6 | 2 | 11 | 6 | completed | 2013-10-02 |
-| 7 | 3 | 12 | 6 | completed | 2013-10-02 |
-| 8 | 2 | 12 | 12 | completed | 2013-10-03 |
-| 9 | 3 | 10 | 12 | completed | 2013-10-03 |
-| 10 | 4 | 13 | 12 | cancelled_by_driver | 2013-10-03 |
-+----+-----------+-----------+---------+---------------------+------------+
-Users table:
-+----------+--------+--------+
-| users_id | banned | role |
-+----------+--------+--------+
-| 1 | No | client |
-| 2 | Yes | client |
-| 3 | No | client |
-| 4 | No | client |
-| 10 | No | driver |
-| 11 | No | driver |
-| 12 | No | driver |
-| 13 | No | driver |
-+----------+--------+--------+
-Output:
-+------------+-------------------+
-| Day | Cancellation Rate |
-+------------+-------------------+
-| 2013-10-01 | 0.33 |
-| 2013-10-02 | 0.00 |
-| 2013-10-03 | 0.50 |
-+------------+-------------------+
-Explanation:
-On 2013-10-01:
- - There were 4 requests in total, 2 of which were canceled.
- - However, the request with Id=2 was made by a banned client (User_Id=2), so it is ignored in the calculation.
- - Hence there are 3 unbanned requests in total, 1 of which was canceled.
- - The Cancellation Rate is (1 / 3) = 0.33
-On 2013-10-02:
- - There were 3 requests in total, 0 of which were canceled.
- - The request with Id=6 was made by a banned client, so it is ignored.
- - Hence there are 2 unbanned requests in total, 0 of which were canceled.
- - The Cancellation Rate is (0 / 2) = 0.00
-On 2013-10-03:
- - There were 3 requests in total, 1 of which was canceled.
- - The request with Id=8 was made by a banned client, so it is ignored.
- - Hence there are 2 unbanned request in total, 1 of which were canceled.
- - The Cancellation Rate is (1 / 2) = 0.50
-
A sentence is a list of words that are separated by a single space with no leading or trailing spaces. Each of the words consists of only uppercase and lowercase English letters (no punctuation).
-
-
-
For example, "Hello World", "HELLO", and "hello world hello world" are all sentences.
-
-
-
You are given a sentence s and an integer k. You want to truncates such that it contains only the firstk words. Return s after truncating it.
-
-
-
Example 1:
-
-
-Input: s = "Hello how are you Contestant", k = 4
-Output: "Hello how are you"
-Explanation:
-The words in s are ["Hello", "how" "are", "you", "Contestant"].
-The first 4 words are ["Hello", "how", "are", "you"].
-Hence, you should return "Hello how are you".
-
-
-
Example 2:
-
-
-Input: s = "What is the solution to this problem", k = 4
-Output: "What is the solution"
-Explanation:
-The words in s are ["What", "is" "the", "solution", "to", "this", "problem"].
-The first 4 words are ["What", "is", "the", "solution"].
-Hence, you should return "What is the solution".
-
-
Example 3:
-
-
-Input: s = "chopper is not a tanuki", k = 5
-Output: "chopper is not a tanuki"
-
-
-
-
Constraints:
-
-
-
1 <= s.length <= 500
-
k is in the range [1, the number of words in s].
-
s consist of only lowercase and uppercase English letters and spaces.
-
The words in s are separated by a single space.
-
There are no leading or trailing spaces.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Hints
-
-Hint 1
-It's easier to solve this problem on an array of strings so parse the string to an array of words
-
-
-
-Hint 2
-After return the first k words as a sentence
-
diff --git a/problems/tuple-with-same-product/README.md b/problems/tuple-with-same-product/README.md
deleted file mode 100644
index bca35af2d..000000000
--- a/problems/tuple-with-same-product/README.md
+++ /dev/null
@@ -1,61 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../number-of-rectangles-that-can-form-the-largest-square "Number Of Rectangles That Can Form The Largest Square")
-
-[Next >](../largest-submatrix-with-rearrangements "Largest Submatrix With Rearrangements")
-
-## [1726. Tuple with Same Product (Medium)](https://leetcode.com/problems/tuple-with-same-product "同积元组")
-
-
Given an array nums of distinct positive integers, return the number of tuples (a, b, c, d) such that a * b = c * d where a, b, c, and d are elements of nums, and a != b != c != d.
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
-
-### Hints
-
-Hint 1
-Note that all of the integers are distinct. This means that each time a product is formed it must be formed by two unique integers.
-
-
-
-Hint 2
-Count the frequency of each product of 2 distinct numbers. Then calculate the permutations formed.
-
diff --git a/problems/tweet-counts-per-frequency/README.md b/problems/tweet-counts-per-frequency/README.md
deleted file mode 100644
index ec49dcb06..000000000
--- a/problems/tweet-counts-per-frequency/README.md
+++ /dev/null
@@ -1,76 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-number-of-steps-to-make-two-strings-anagram "Minimum Number of Steps to Make Two Strings Anagram")
-
-[Next >](../maximum-students-taking-exam "Maximum Students Taking Exam")
-
-## [1348. Tweet Counts Per Frequency (Medium)](https://leetcode.com/problems/tweet-counts-per-frequency "推文计数")
-
-
A social media company is trying to monitor activity on their site by analyzing the number of tweets that occur in select periods of time. These periods can be partitioned into smaller time chunks based on a certain frequency (every minute, hour, or day).
-
-
For example, the period [10, 10000] (in seconds) would be partitioned into the following time chunks with these frequencies:
-
-
-
Every minute (60-second chunks): [10,69], [70,129], [130,189], ..., [9970,10000]
-
Every hour (3600-second chunks): [10,3609], [3610,7209], [7210,10000]
-
Every day (86400-second chunks): [10,10000]
-
-
-
Notice that the last chunk may be shorter than the specified frequency's chunk size and will always end with the end time of the period (10000 in the above example).
-
-
Design and implement an API to help the company with their analysis.
-
-
Implement the TweetCounts class:
-
-
-
TweetCounts() Initializes the TweetCounts object.
-
void recordTweet(String tweetName, int time) Stores the tweetName at the recorded time (in seconds).
-
List<Integer> getTweetCountsPerFrequency(String freq, String tweetName, int startTime, int endTime) Returns a list of integers representing the number of tweets with tweetName in each time chunk for the given period of time [startTime, endTime] (in seconds) and frequency freq.
-
-
freq is one of "minute", "hour", or "day" representing a frequency of every minute, hour, or day respectively.
-
-
-
-
-
-
Example:
-
-
-Input
-["TweetCounts","recordTweet","recordTweet","recordTweet","getTweetCountsPerFrequency","getTweetCountsPerFrequency","recordTweet","getTweetCountsPerFrequency"]
-[[],["tweet3",0],["tweet3",60],["tweet3",10],["minute","tweet3",0,59],["minute","tweet3",0,60],["tweet3",120],["hour","tweet3",0,210]]
-
-Output
-[null,null,null,null,[2],[2,1],null,[4]]
-
-Explanation
-TweetCounts tweetCounts = new TweetCounts();
-tweetCounts.recordTweet("tweet3", 0); // New tweet "tweet3" at time 0
-tweetCounts.recordTweet("tweet3", 60); // New tweet "tweet3" at time 60
-tweetCounts.recordTweet("tweet3", 10); // New tweet "tweet3" at time 10
-tweetCounts.getTweetCountsPerFrequency("minute", "tweet3", 0, 59); // return [2]; chunk [0,59] had 2 tweets
-tweetCounts.getTweetCountsPerFrequency("minute", "tweet3", 0, 60); // return [2,1]; chunk [0,59] had 2 tweets, chunk [60,60] had 1 tweet
-tweetCounts.recordTweet("tweet3", 120); // New tweet "tweet3" at time 120
-tweetCounts.getTweetCountsPerFrequency("hour", "tweet3", 0, 210); // return [4]; chunk [0,210] had 4 tweets
-
-
-
-
Constraints:
-
-
-
0 <= time, startTime, endTime <= 109
-
0 <= endTime - startTime <= 104
-
There will be at most 104 calls in total to recordTweet and getTweetCountsPerFrequency.
-
-
-### Related Topics
- [[Design](../../tag/design/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
- [[Ordered Set](../../tag/ordered-set/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
diff --git a/problems/two-best-non-overlapping-events/README.md b/problems/two-best-non-overlapping-events/README.md
deleted file mode 100644
index 4526374a2..000000000
--- a/problems/two-best-non-overlapping-events/README.md
+++ /dev/null
@@ -1,70 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../kth-distinct-string-in-an-array "Kth Distinct String in an Array")
-
-[Next >](../plates-between-candles "Plates Between Candles")
-
-## [2054. Two Best Non-Overlapping Events (Medium)](https://leetcode.com/problems/two-best-non-overlapping-events "两个最好的不重叠活动")
-
-
You are given a 0-indexed 2D integer array of events where events[i] = [startTimei, endTimei, valuei]. The ith event starts at startTimeiand ends at endTimei, and if you attend this event, you will receive a value of valuei. You can choose at mosttwonon-overlapping events to attend such that the sum of their values is maximized.
-
-
Return this maximum sum.
-
-
Note that the start time and end time is inclusive: that is, you cannot attend two events where one of them starts and the other ends at the same time. More specifically, if you attend an event with end time t, the next event must start at or after t + 1.
-
-
-
Example 1:
-
-
-Input: events = [[1,3,2],[4,5,2],[2,4,3]]
-Output: 4
-Explanation: Choose the green events, 0 and 1 for a sum of 2 + 2 = 4.
-
-
-
Example 2:
-
-
-Input: events = [[1,3,2],[4,5,2],[1,5,5]]
-Output: 5
-Explanation: Choose event 2 for a sum of 5.
-
-
-
Example 3:
-
-
-Input: events = [[1,5,3],[1,5,1],[6,6,5]]
-Output: 8
-Explanation: Choose events 0 and 2 for a sum of 3 + 5 = 8.
-
-
-
Constraints:
-
-
-
2 <= events.length <= 105
-
events[i].length == 3
-
1 <= startTimei <= endTimei <= 109
-
1 <= valuei <= 106
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
- [[Heap (Priority Queue)](../../tag/heap-priority-queue/README.md)]
-
-### Hints
-
-Hint 1
-How can sorting the events on the basis of their start times help? How about end times?
-
-
-
-Hint 2
-How can we quickly get the maximum score of an interval not intersecting with the interval we chose?
-
diff --git a/problems/two-city-scheduling/README.md b/problems/two-city-scheduling/README.md
deleted file mode 100644
index 854fd250e..000000000
--- a/problems/two-city-scheduling/README.md
+++ /dev/null
@@ -1,60 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../recover-a-tree-from-preorder-traversal "Recover a Tree From Preorder Traversal")
-
-[Next >](../matrix-cells-in-distance-order "Matrix Cells in Distance Order")
-
-## [1029. Two City Scheduling (Medium)](https://leetcode.com/problems/two-city-scheduling "两地调度")
-
-
A company is planning to interview 2n people. Given the array costs where costs[i] = [aCosti, bCosti], the cost of flying the ith person to city a is aCosti, and the cost of flying the ith person to city b is bCosti.
-
-
Return the minimum cost to fly every person to a city such that exactly n people arrive in each city.
-
-
-
Example 1:
-
-
-Input: costs = [[10,20],[30,200],[400,50],[30,20]]
-Output: 110
-Explanation:
-The first person goes to city A for a cost of 10.
-The second person goes to city A for a cost of 30.
-The third person goes to city B for a cost of 50.
-The fourth person goes to city B for a cost of 20.
-
-The total minimum cost is 10 + 30 + 50 + 20 = 110 to have half the people interviewing in each city.
-
There are n houses evenly lined up on the street, and each house is beautifully painted. You are given a 0-indexed integer array colors of length n, where colors[i] represents the color of the ith house.
-
-
Return the maximum distance between two houses with different colors.
-
-
The distance between the ith and jth houses is abs(i - j), where abs(x) is the absolute value of x.
-
-
-
Example 1:
-
-
-Input: colors = [1,1,1,6,1,1,1]
-Output: 3
-Explanation: In the above image, color 1 is blue, and color 6 is red.
-The furthest two houses with different colors are house 0 and house 3.
-House 0 has color 1, and house 3 has color 6. The distance between them is abs(0 - 3) = 3.
-Note that houses 3 and 6 can also produce the optimal answer.
-
-
-
Example 2:
-
-
-Input: colors = [1,8,3,8,3]
-Output: 4
-Explanation: In the above image, color 1 is blue, color 8 is yellow, and color 3 is green.
-The furthest two houses with different colors are house 0 and house 4.
-House 0 has color 1, and house 4 has color 3. The distance between them is abs(0 - 4) = 4.
-
-
-
Example 3:
-
-
-Input: colors = [0,1]
-Output: 1
-Explanation: The furthest two houses with different colors are house 0 and house 1.
-House 0 has color 0, and house 1 has color 1. The distance between them is abs(0 - 1) = 1.
-
-
-
-
Constraints:
-
-
-
n == colors.length
-
2 <= n <= 100
-
0 <= colors[i] <= 100
-
Test data are generated such that at least two houses have different colors.
-
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[Array](../../tag/array/README.md)]
-
-### Hints
-
-Hint 1
-The constraints are small. Can you try the combination of every two houses?
-
-
-
-Hint 2
-Greedily, the maximum distance will come from either the pair of the leftmost house and possibly some house on the right with a different color, or the pair of the rightmost house and possibly some house on the left with a different color.
-
diff --git a/problems/two-out-of-three/README.md b/problems/two-out-of-three/README.md
deleted file mode 100644
index 176e64f08..000000000
--- a/problems/two-out-of-three/README.md
+++ /dev/null
@@ -1,66 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../count-subarrays-with-more-ones-than-zeros "Count Subarrays With More Ones Than Zeros")
-
-[Next >](../minimum-operations-to-make-a-uni-value-grid "Minimum Operations to Make a Uni-Value Grid")
-
-## [2032. Two Out of Three (Easy)](https://leetcode.com/problems/two-out-of-three "至少在两个数组中出现的值")
-
-Given three integer arrays nums1, nums2, and nums3, return a distinct array containing all the values that are present in at least two out of the three arrays. You may return the values in any order.
-
-
Example 1:
-
-
-Input: nums1 = [1,1,3,2], nums2 = [2,3], nums3 = [3]
-Output: [3,2]
-Explanation: The values that are present in at least two arrays are:
-- 3, in all three arrays.
-- 2, in nums1 and nums2.
-
-
-
Example 2:
-
-
-Input: nums1 = [3,1], nums2 = [2,3], nums3 = [1,2]
-Output: [2,3,1]
-Explanation: The values that are present in at least two arrays are:
-- 2, in nums2 and nums3.
-- 3, in nums1 and nums2.
-- 1, in nums1 and nums3.
-
-
-
Example 3:
-
-
-Input: nums1 = [1,2,2], nums2 = [4,3,3], nums3 = [5]
-Output: []
-Explanation: No value is present in at least two arrays.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
-
-### Hints
-
-Hint 1
-What data structure can we use to help us quickly find whether an element belongs in an array?
-
-
-
-Hint 2
-Can we count the frequencies of the elements in each array?
-
diff --git a/problems/two-sum-bsts/README.md b/problems/two-sum-bsts/README.md
deleted file mode 100644
index a8e816200..000000000
--- a/problems/two-sum-bsts/README.md
+++ /dev/null
@@ -1,73 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../intersection-of-three-sorted-arrays "Intersection of Three Sorted Arrays")
-
-[Next >](../stepping-numbers "Stepping Numbers")
-
-## [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.
-
-
-
-
Example 1:
-
-
-
-
-Input: root1 = [2,1,4], root2 = [1,0,3], target = 5
-Output: true
-Explanation: 2 and 3 sum up to 5.
-
-
-
-### Related Topics
- [[Stack](../../tag/stack/README.md)]
- [[Tree](../../tag/tree/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Binary Search Tree](../../tag/binary-search-tree/README.md)]
- [[Two Pointers](../../tag/two-pointers/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
- [[Binary Tree](../../tag/binary-tree/README.md)]
-
-### Similar Questions
- 1. [Two Sum IV - Input is a BST](../two-sum-iv-input-is-a-bst) (Easy)
-
-### Hints
-
-Hint 1
-How can you reduce this problem to the classical Two Sum problem?
-
-
-
-Hint 2
-Do an in-order traversal of each tree to convert them to sorted arrays.
-
-
-
-Hint 3
-Solve the classical Two Sum problem.
-
diff --git a/problems/two-sum-ii-input-array-is-sorted/README.md b/problems/two-sum-ii-input-array-is-sorted/README.md
deleted file mode 100644
index 40afa44a6..000000000
--- a/problems/two-sum-ii-input-array-is-sorted/README.md
+++ /dev/null
@@ -1,62 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../fraction-to-recurring-decimal "Fraction to Recurring Decimal")
-
-[Next >](../excel-sheet-column-title "Excel Sheet Column Title")
-
-## [167. Two Sum II - Input array is sorted (Easy)](https://leetcode.com/problems/two-sum-ii-input-array-is-sorted "两数之和 II - 输入有序数组")
-
-
Given an array of integers numbers that is already sorted in non-decreasing order, find two numbers such that they add up to a specific target number.
-
-
Return the indices of the two numbers (1-indexed) as an integer array answer of size 2, where 1 <= answer[0] < answer[1] <= numbers.length.
-
-
The tests are generated such that there is exactly one solution. You may not use the same element twice.
-
-
-
Example 1:
-
-
-Input: numbers = [2,7,11,15], target = 9
-Output: [1,2]
-Explanation: The sum of 2 and 7 is 9. Therefore index1 = 1, index2 = 2.
-
-
-### Related Topics
- [[Design](../../tag/design/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Two Pointers](../../tag/two-pointers/README.md)]
- [[Data Stream](../../tag/data-stream/README.md)]
-
-### Similar Questions
- 1. [Two Sum](../two-sum) (Easy)
- 1. [Unique Word Abbreviation](../unique-word-abbreviation) (Medium)
- 1. [Two Sum IV - Input is a BST](../two-sum-iv-input-is-a-bst) (Easy)
diff --git a/problems/two-sum-iii-data-structure-design/two_sum_iii_data_structure_design.go b/problems/two-sum-iii-data-structure-design/two_sum_iii_data_structure_design.go
deleted file mode 100644
index 4aeecf401..000000000
--- a/problems/two-sum-iii-data-structure-design/two_sum_iii_data_structure_design.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem170
diff --git a/problems/two-sum-iii-data-structure-design/two_sum_iii_data_structure_design_test.go b/problems/two-sum-iii-data-structure-design/two_sum_iii_data_structure_design_test.go
deleted file mode 100644
index 4aeecf401..000000000
--- a/problems/two-sum-iii-data-structure-design/two_sum_iii_data_structure_design_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem170
diff --git a/problems/two-sum-iv-input-is-a-bst/README.md b/problems/two-sum-iv-input-is-a-bst/README.md
deleted file mode 100644
index 098f7ab54..000000000
--- a/problems/two-sum-iv-input-is-a-bst/README.md
+++ /dev/null
@@ -1,75 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../find-duplicate-subtrees "Find Duplicate Subtrees")
-
-[Next >](../maximum-binary-tree "Maximum Binary Tree")
-
-## [653. Two Sum IV - Input is a BST (Easy)](https://leetcode.com/problems/two-sum-iv-input-is-a-bst "两数之和 IV - 输入 BST")
-
-
Given the root of a Binary Search Tree and a target number k, return true if there exist two elements in the BST such that their sum is equal to the given target.
-
-
-
Example 1:
-
-
-Input: root = [5,3,6,2,4,null,7], k = 9
-Output: true
-
-
-
Example 2:
-
-
-Input: root = [5,3,6,2,4,null,7], k = 28
-Output: false
-
-
-
Example 3:
-
-
-Input: root = [2,1,3], k = 4
-Output: true
-
-
-
Example 4:
-
-
-Input: root = [2,1,3], k = 1
-Output: false
-
-
-
Example 5:
-
-
-Input: root = [2,1,3], k = 3
-Output: true
-
-
-
-
Constraints:
-
-
-
The number of nodes in the tree is in the range [1, 104].
-
-104 <= Node.val <= 104
-
root is guaranteed to be a valid binary search tree.
-
-105 <= k <= 105
-
-
-### Related Topics
- [[Tree](../../tag/tree/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Binary Search Tree](../../tag/binary-search-tree/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Two Pointers](../../tag/two-pointers/README.md)]
- [[Binary Tree](../../tag/binary-tree/README.md)]
-
-### Similar Questions
- 1. [Two Sum](../two-sum) (Easy)
- 1. [Two Sum II - Input Array Is Sorted](../two-sum-ii-input-array-is-sorted) (Easy)
- 1. [Two Sum III - Data structure design](../two-sum-iii-data-structure-design) (Easy)
- 1. [Two Sum BSTs](../two-sum-bsts) (Medium)
diff --git a/problems/two-sum-iv-input-is-a-bst/two_sum_iv_input_is_a_bst.go b/problems/two-sum-iv-input-is-a-bst/two_sum_iv_input_is_a_bst.go
deleted file mode 100644
index 12abcf428..000000000
--- a/problems/two-sum-iv-input-is-a-bst/two_sum_iv_input_is_a_bst.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem653
diff --git a/problems/two-sum-iv-input-is-a-bst/two_sum_iv_input_is_a_bst_test.go b/problems/two-sum-iv-input-is-a-bst/two_sum_iv_input_is_a_bst_test.go
deleted file mode 100644
index 12abcf428..000000000
--- a/problems/two-sum-iv-input-is-a-bst/two_sum_iv_input_is_a_bst_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem653
diff --git a/problems/two-sum-less-than-k/README.md b/problems/two-sum-less-than-k/README.md
deleted file mode 100644
index 396a01979..000000000
--- a/problems/two-sum-less-than-k/README.md
+++ /dev/null
@@ -1,67 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../unpopular-books "Unpopular Books")
-
-[Next >](../find-k-length-substrings-with-no-repeated-characters "Find K-Length Substrings With No Repeated Characters")
-
-## [1099. Two Sum Less Than K (Easy)](https://leetcode.com/problems/two-sum-less-than-k "小于 K 的两数之和")
-
-
Given an array A of integers and integer K, return the maximum S such that there exists i < j with A[i] + A[j] = S and S < K. If no i, j exist satisfying this equation, return -1.
-
-
-
-
Example 1:
-
-
-Input: A = [34,23,1,24,75,33,54,8], K = 60
-Output: 58
-Explanation:
-We can use 34 and 24 to sum 58 which is less than 60.
-
-
-
Example 2:
-
-
-Input: A = [10,20,30], K = 15
-Output: -1
-Explanation:
-In this case it's not possible to get a pair sum less that 15.
-
-
-
-
-
Note:
-
-
-
1 <= A.length <= 100
-
1 <= A[i] <= 1000
-
1 <= K <= 2000
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Two Pointers](../../tag/two-pointers/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Similar Questions
- 1. [Two Sum](../two-sum) (Easy)
- 1. [Two Sum II - Input Array Is Sorted](../two-sum-ii-input-array-is-sorted) (Easy)
- 1. [3Sum Smaller](../3sum-smaller) (Medium)
- 1. [Subarray Product Less Than K](../subarray-product-less-than-k) (Medium)
-
-### Hints
-
-Hint 1
-What if we have the array sorted?
-
-
-
-Hint 2
-Loop the array and get the value A[i] then we need to find a value A[j] such that A[i] + A[j] < K which means A[j] < K - A[i]. In order to do that we can find that value with a binary search.
-
diff --git a/problems/two-sum/README.md b/problems/two-sum/README.md
deleted file mode 100644
index aa409a146..000000000
--- a/problems/two-sum/README.md
+++ /dev/null
@@ -1,83 +0,0 @@
-
-
-
-
-
-
-
-< Previous
-
-[Next >](../add-two-numbers "Add Two Numbers")
-
-## [1. Two Sum (Easy)](https://leetcode.com/problems/two-sum "两数之和")
-
-
Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target.
-
-
You may assume that each input would have exactly one solution, and you may not use the same element twice.
-Follow-up: Can you come up with an algorithm that is less than O(n2) time complexity?
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
-
-### Similar Questions
- 1. [3Sum](../3sum) (Medium)
- 1. [4Sum](../4sum) (Medium)
- 1. [Two Sum II - Input Array Is Sorted](../two-sum-ii-input-array-is-sorted) (Medium)
- 1. [Two Sum III - Data structure design](../two-sum-iii-data-structure-design) (Easy)
- 1. [Subarray Sum Equals K](../subarray-sum-equals-k) (Medium)
- 1. [Two Sum IV - Input is a BST](../two-sum-iv-input-is-a-bst) (Easy)
- 1. [Two Sum Less Than K](../two-sum-less-than-k) (Easy)
-
-### Hints
-
-Hint 1
-A really brute force way would be to search for all possible pairs of numbers but that would be too slow. Again, it's best to try out brute force solutions for just for completeness. It is from these brute force solutions that you can come up with optimizations.
-
-
-
-Hint 2
-So, if we fix one of the numbers, say
x
, we have to scan the entire array to find the next number
y
which is
value - x
where value is the input parameter. Can we change our array somehow so that this search becomes faster?
-
-
-
-Hint 3
-The second train of thought is, without changing the array, can we use additional space somehow? Like maybe a hash map to speed up the search?
-
diff --git a/problems/two-sum/two_sum.go b/problems/two-sum/two_sum.go
deleted file mode 100644
index 0ef6d366e..000000000
--- a/problems/two-sum/two_sum.go
+++ /dev/null
@@ -1,12 +0,0 @@
-package problem1
-
-func twoSum(nums []int, target int) []int {
- m := make(map[int]int)
- for j, v := range nums {
- if i, ok := m[target-v]; ok {
- return []int{i, j}
- }
- m[v] = j
- }
- return nil
-}
diff --git a/problems/two-sum/two_sum_test.go b/problems/two-sum/two_sum_test.go
deleted file mode 100644
index 1236c35d9..000000000
--- a/problems/two-sum/two_sum_test.go
+++ /dev/null
@@ -1,38 +0,0 @@
-package problem1
-
-import (
- "reflect"
- "testing"
-)
-
-type testType struct {
- nums []int
- target int
- want []int
-}
-
-func TestTwoSum(t *testing.T) {
- tests := [...]testType{
- {
- nums: []int{2, 7, 11, 15},
- target: 9,
- want: []int{0, 1},
- },
- {
- nums: []int{2, 7, 11, 15},
- target: 10,
- want: nil,
- },
- {
- nums: []int{1, 2, 3, 4},
- target: 5,
- want: []int{1, 2},
- },
- }
- for _, tt := range tests {
- got := twoSum(tt.nums, tt.target)
- if !reflect.DeepEqual(got, tt.want) {
- t.Fatalf("in: %v, got: %v, want: %v", tt.nums, got, tt.want)
- }
- }
-}
diff --git a/problems/ugly-number-ii/README.md b/problems/ugly-number-ii/README.md
deleted file mode 100644
index 43eeab7b8..000000000
--- a/problems/ugly-number-ii/README.md
+++ /dev/null
@@ -1,75 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../ugly-number "Ugly Number")
-
-[Next >](../paint-house-ii "Paint House II")
-
-## [264. Ugly Number II (Medium)](https://leetcode.com/problems/ugly-number-ii "丑数 II")
-
-
An ugly number is a positive integer whose prime factors are limited to 2, 3, and 5.
-
-
Given an integer n, return thenthugly number.
-
-
-
Example 1:
-
-
-Input: n = 10
-Output: 12
-Explanation: [1, 2, 3, 4, 5, 6, 8, 9, 10, 12] is the sequence of the first 10 ugly numbers.
-
-
-
Example 2:
-
-
-Input: n = 1
-Output: 1
-Explanation: 1 has no prime factors, therefore all of its prime factors are limited to 2, 3, and 5.
-
-
-
-
Constraints:
-
-
-
1 <= n <= 1690
-
-
-### Related Topics
- [[Hash Table](../../tag/hash-table/README.md)]
- [[Math](../../tag/math/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Heap (Priority Queue)](../../tag/heap-priority-queue/README.md)]
-
-### Similar Questions
- 1. [Merge k Sorted Lists](../merge-k-sorted-lists) (Hard)
- 1. [Count Primes](../count-primes) (Medium)
- 1. [Ugly Number](../ugly-number) (Easy)
- 1. [Perfect Squares](../perfect-squares) (Medium)
- 1. [Super Ugly Number](../super-ugly-number) (Medium)
- 1. [Ugly Number III](../ugly-number-iii) (Medium)
-
-### Hints
-
-Hint 1
-The naive approach is to call isUgly for every number until you reach the nth one. Most numbers are not ugly. Try to focus your effort on generating only the ugly ones.
-
-
-
-Hint 2
-An ugly number must be multiplied by either 2, 3, or 5 from a smaller ugly number.
-
-
-
-Hint 3
-The key is how to maintain the order of the ugly numbers. Try a similar approach of merging from three sorted lists: L1, L2, and L3.
-
-
-
-Hint 4
-Assume you have Uk, the kth ugly number. Then Uk+1 must be Min(L1 * 2, L2 * 3, L3 * 5).
-
diff --git a/problems/ugly-number-ii/ugly_number_ii.go b/problems/ugly-number-ii/ugly_number_ii.go
deleted file mode 100644
index 652909643..000000000
--- a/problems/ugly-number-ii/ugly_number_ii.go
+++ /dev/null
@@ -1,19 +0,0 @@
-package problem264
-
-func nthUglyNumber(n int) int {
- ans, idx := make([]int, n), [3]int{}
- ans[0] = 1
- for i := 1; i < n; i++ {
- for j, n := range [...]int{2, 3, 5} {
- if ans[idx[j]]*n <= ans[i-1] {
- idx[j]++
- }
- if num := ans[idx[j]] * n; j == 0 {
- ans[i] = num
- } else if ans[i] > num {
- ans[i] = num
- }
- }
- }
- return ans[n-1]
-}
diff --git a/problems/ugly-number-ii/ugly_number_ii_test.go b/problems/ugly-number-ii/ugly_number_ii_test.go
deleted file mode 100644
index 45cf5fd00..000000000
--- a/problems/ugly-number-ii/ugly_number_ii_test.go
+++ /dev/null
@@ -1,39 +0,0 @@
-package problem264
-
-import "testing"
-
-type testType struct {
- in int
- want int
-}
-
-func TestNthUglyNumber(t *testing.T) {
- tests := [...]testType{
- {
- in: 10,
- want: 12,
- },
- {
- in: 9,
- want: 10,
- },
- {
- in: 60,
- want: 384,
- },
- {
- in: 90,
- want: 1152,
- },
- {
- in: 1,
- want: 1,
- },
- }
- for _, tt := range tests {
- got := nthUglyNumber(tt.in)
- if got != tt.want {
- t.Fatalf("in: %v, got: %v, want: %v", tt.in, got, tt.want)
- }
- }
-}
diff --git a/problems/ugly-number-iii/README.md b/problems/ugly-number-iii/README.md
deleted file mode 100644
index 0790cc0c7..000000000
--- a/problems/ugly-number-iii/README.md
+++ /dev/null
@@ -1,73 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-absolute-difference "Minimum Absolute Difference")
-
-[Next >](../smallest-string-with-swaps "Smallest String With Swaps")
-
-## [1201. Ugly Number III (Medium)](https://leetcode.com/problems/ugly-number-iii "丑数 III")
-
-
An ugly number is a positive integer that is divisible by a, b, or c.
-
-
Given four integers n, a, b, and c, return the nthugly number.
-
-
-
Example 1:
-
-
-Input: n = 3, a = 2, b = 3, c = 5
-Output: 4
-Explanation: The ugly numbers are 2, 3, 4, 5, 6, 8, 9, 10... The 3rd is 4.
-
-
-
Example 2:
-
-
-Input: n = 4, a = 2, b = 3, c = 4
-Output: 6
-Explanation: The ugly numbers are 2, 3, 4, 6, 8, 9, 10, 12... The 4th is 6.
-
-
-
Example 3:
-
-
-Input: n = 5, a = 2, b = 11, c = 13
-Output: 10
-Explanation: The ugly numbers are 2, 4, 6, 8, 10, 11, 12, 13... The 5th is 10.
-
-
-
Example 4:
-
-
-Input: n = 1000000000, a = 2, b = 217983653, c = 336916467
-Output: 1999999984
-
-
-
-
Constraints:
-
-
-
1 <= n, a, b, c <= 109
-
1 <= a * b * c <= 1018
-
It is guaranteed that the result will be in range [1, 2 * 109].
-
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
- [[Number Theory](../../tag/number-theory/README.md)]
-
-### Hints
-
-Hint 1
-Write a function f(k) to determine how many ugly numbers smaller than k. As f(k) is non-decreasing, try binary search.
-
-
-
-Hint 2
-Find all ugly numbers in [1, LCM(a, b, c)] (LCM is Least Common Multiple). Use inclusion-exclusion principle to expand the result.
-
diff --git a/problems/ugly-number/README.md b/problems/ugly-number/README.md
deleted file mode 100644
index 1a30c5d48..000000000
--- a/problems/ugly-number/README.md
+++ /dev/null
@@ -1,63 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../trips-and-users "Trips and Users")
-
-[Next >](../ugly-number-ii "Ugly Number II")
-
-## [263. Ugly Number (Easy)](https://leetcode.com/problems/ugly-number "丑数")
-
-
An ugly number is a positive integer whose prime factors are limited to 2, 3, and 5.
-
-
Given an integer n, return trueifnis an ugly number.
You are given two integer arrays nums1 and nums2. We write the integers of nums1 and nums2 (in the order they are given) on two separate horizontal lines.
-
-
We may draw connecting lines: a straight line connecting two numbers nums1[i] and nums2[j] such that:
-
-
-
nums1[i] == nums2[j], and
-
the line we draw does not intersect any other connecting (non-horizontal) line.
-
-
-
Note that a connecting line cannot intersect even at the endpoints (i.e., each number can only belong to one connecting line).
-
-
Return the maximum number of connecting lines we can draw in this way.
-
-
-
Example 1:
-
-
-Input: nums1 = [1,4,2], nums2 = [1,2,4]
-Output: 2
-Explanation: We can draw 2 uncrossed lines as in the diagram.
-We cannot draw 3 uncrossed lines, because the line from nums1[1] = 4 to nums2[2] = 4 will intersect the line from nums1[2]=2 to nums2[1]=2.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Similar Questions
- 1. [Edit Distance](../edit-distance) (Hard)
-
-### Hints
-
-Hint 1
-Think dynamic programming. Given an oracle dp(i,j) that tells us how many lines A[i:], B[j:] [the sequence A[i], A[i+1], ... and B[j], B[j+1], ...] are uncrossed, can we write this as a recursion?
-
diff --git a/problems/uncrossed-lines/uncrossed_lines.go b/problems/uncrossed-lines/uncrossed_lines.go
deleted file mode 100644
index b2fb26c6a..000000000
--- a/problems/uncrossed-lines/uncrossed_lines.go
+++ /dev/null
@@ -1,25 +0,0 @@
-package problem1035
-
-func maxUncrossedLines(A []int, B []int) int {
- m, n := len(A), len(B)
- dp := make([][]int, m+1)
- dp[0] = make([]int, n+1)
- for i := 1; i <= m; i++ {
- dp[i] = make([]int, n+1)
- for j := 1; j <= n; j++ {
- if A[i-1] == B[j-1] {
- dp[i][j] = 1 + dp[i-1][j-1]
- } else {
- dp[i][j] = max(dp[i][j-1], dp[i-1][j])
- }
- }
- }
- return dp[m][n]
-}
-
-func max(a, b int) int {
- if a > b {
- return a
- }
- return b
-}
diff --git a/problems/unique-binary-search-trees-ii/README.md b/problems/unique-binary-search-trees-ii/README.md
deleted file mode 100644
index 8fcad49b8..000000000
--- a/problems/unique-binary-search-trees-ii/README.md
+++ /dev/null
@@ -1,47 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../binary-tree-inorder-traversal "Binary Tree Inorder Traversal")
-
-[Next >](../unique-binary-search-trees "Unique Binary Search Trees")
-
-## [95. Unique Binary Search Trees II (Medium)](https://leetcode.com/problems/unique-binary-search-trees-ii "不同的二叉搜索树 II")
-
-
Given an integer n, return all the structurally unique BST's (binary search trees), which has exactly n nodes of unique values from1ton. Return the answer in any order.
-
-
-
Example 1:
-
-
-Input: n = 3
-Output: [[1,null,2,null,3],[1,null,3,2],[2,1,3],[3,1,null,null,2],[3,2,null,1]]
-
Every valid email consists of a local name and a domain name, separated by the '@' sign. Besides lowercase letters, the email may contain one or more '.' or '+'.
-
-
-
For example, in "alice@leetcode.com", "alice" is the local name, and "leetcode.com" is the domain name.
-
-
-
If you add periods '.' between some characters in the local name part of an email address, mail sent there will be forwarded to the same address without dots in the local name. Note that this rule does not apply to domain names.
-
-
-
For example, "alice.z@leetcode.com" and "alicez@leetcode.com" forward to the same email address.
-
-
-
If you add a plus '+' in the local name, everything after the first plus sign will be ignored. This allows certain emails to be filtered. Note that this rule does not apply to domain names.
-
-
-
For example, "m.y+name@email.com" will be forwarded to "my@email.com".
-
-
-
It is possible to use both of these rules at the same time.
-
-
Given an array of strings emails where we send one email to each email[i], return the number of different addresses that actually receive mails.
Given a string s, return the number of unique palindromes of length three that are a subsequence of s.
-
-
Note that even if there are multiple ways to obtain the same subsequence, it is still only counted once.
-
-
A palindrome is a string that reads the same forwards and backwards.
-
-
A subsequence of a string is a new string generated from the original string with some characters (can be none) deleted without changing the relative order of the remaining characters.
-
-
-
For example, "ace" is a subsequence of "abcde".
-
-
-
-
Example 1:
-
-
-Input: s = "aabca"
-Output: 3
-Explanation: The 3 palindromic subsequences of length 3 are:
-- "aba" (subsequence of "aabca")
-- "aaa" (subsequence of "aabca")
-- "aca" (subsequence of "aabca")
-
-
-
Example 2:
-
-
-Input: s = "adc"
-Output: 0
-Explanation: There are no palindromic subsequences of length 3 in "adc".
-
-
-
Example 3:
-
-
-Input: s = "bbcbaba"
-Output: 4
-Explanation: The 4 palindromic subsequences of length 3 are:
-- "bbb" (subsequence of "bbcbaba")
-- "bcb" (subsequence of "bbcbaba")
-- "bab" (subsequence of "bbcbaba")
-- "aba" (subsequence of "bbcbaba")
-
-
-
-
Constraints:
-
-
-
3 <= s.length <= 105
-
s consists of only lowercase English letters.
-
-
-### Related Topics
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
- [[Prefix Sum](../../tag/prefix-sum/README.md)]
-
-### Hints
-
-Hint 1
-What is the maximum number of length-3 palindromic strings?
-
-
-
-Hint 2
-How can we keep track of the characters that appeared to the left of a given position?
-
diff --git a/problems/unique-morse-code-words/README.md b/problems/unique-morse-code-words/README.md
deleted file mode 100644
index cc8a0767d..000000000
--- a/problems/unique-morse-code-words/README.md
+++ /dev/null
@@ -1,68 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../bricks-falling-when-hit "Bricks Falling When Hit")
-
-[Next >](../split-array-with-same-average "Split Array With Same Average")
-
-## [804. Unique Morse Code Words (Easy)](https://leetcode.com/problems/unique-morse-code-words "唯一摩尔斯密码词")
-
-
International Morse Code defines a standard encoding where each letter is mapped to a series of dots and dashes, as follows:
-
-
-
'a' maps to ".-",
-
'b' maps to "-...",
-
'c' maps to "-.-.", and so on.
-
-
-
For convenience, the full table for the 26 letters of the English alphabet is given below:
Given an array of strings words where each word can be written as a concatenation of the Morse code of each letter.
-
-
-
For example, "cab" can be written as "-.-..--...", which is the concatenation of "-.-.", ".-", and "-...". We will call such a concatenation the transformation of a word.
-
-
-
Return the number of different transformations among all words we have.
-
-
-
Example 1:
-
-
-Input: words = ["gin","zen","gig","msg"]
-Output: 2
-Explanation: The transformation of each word is:
-"gin" -> "--...-."
-"zen" -> "--...-."
-"gig" -> "--...--."
-"msg" -> "--...--."
-There are 2 different transformations: "--...-." and "--...--.".
-
Given an array of integers arr, return true if the number of occurrences of each value in the array is unique, or false otherwise.
-
-
-
Example 1:
-
-
-Input: arr = [1,2,2,1,1,3]
-Output: true
-Explanation: The value 1 has 3 occurrences, 2 has 2 and 3 has 1. No two values have the same number of occurrences.
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
-
-### Hints
-
-Hint 1
-Find the number of occurrences of each element in the array using a hash map.
-
-
-
-Hint 2
-Iterate through the hash map and check if there is a repeated value.
-
diff --git a/problems/unique-orders-and-customers-per-month/README.md b/problems/unique-orders-and-customers-per-month/README.md
deleted file mode 100644
index be33a1b8b..000000000
--- a/problems/unique-orders-and-customers-per-month/README.md
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../put-boxes-into-the-warehouse-i "Put Boxes Into the Warehouse I")
-
-[Next >](../detect-pattern-of-length-m-repeated-k-or-more-times "Detect Pattern of Length M Repeated K or More Times")
-
-## [1565. Unique Orders and Customers Per Month (Easy)](https://leetcode.com/problems/unique-orders-and-customers-per-month "按月统计订单数与顾客数")
-
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/unique-orders-and-customers-per-month/mysql_schemas.sql b/problems/unique-orders-and-customers-per-month/mysql_schemas.sql
deleted file mode 100644
index 6f3b8f4d1..000000000
--- a/problems/unique-orders-and-customers-per-month/mysql_schemas.sql
+++ /dev/null
@@ -1,12 +0,0 @@
-Create table If Not Exists Orders (order_id int, order_date date, customer_id int, invoice int);
-Truncate table Orders;
-insert into Orders (order_id, order_date, customer_id, invoice) values ('1', '2020-09-15', '1', '30');
-insert into Orders (order_id, order_date, customer_id, invoice) values ('2', '2020-09-17', '2', '90');
-insert into Orders (order_id, order_date, customer_id, invoice) values ('3', '2020-10-06', '3', '20');
-insert into Orders (order_id, order_date, customer_id, invoice) values ('4', '2020-10-20', '3', '21');
-insert into Orders (order_id, order_date, customer_id, invoice) values ('5', '2020-11-10', '1', '10');
-insert into Orders (order_id, order_date, customer_id, invoice) values ('6', '2020-11-21', '2', '15');
-insert into Orders (order_id, order_date, customer_id, invoice) values ('7', '2020-12-01', '4', '55');
-insert into Orders (order_id, order_date, customer_id, invoice) values ('8', '2020-12-03', '4', '77');
-insert into Orders (order_id, order_date, customer_id, invoice) values ('9', '2021-01-07', '3', '31');
-insert into Orders (order_id, order_date, customer_id, invoice) values ('10', '2021-01-15', '2', '20');
diff --git a/problems/unique-paths-ii/README.md b/problems/unique-paths-ii/README.md
deleted file mode 100644
index 7ebd71fff..000000000
--- a/problems/unique-paths-ii/README.md
+++ /dev/null
@@ -1,92 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../unique-paths "Unique Paths")
-
-[Next >](../minimum-path-sum "Minimum Path Sum")
-
-## [63. Unique Paths II (Medium)](https://leetcode.com/problems/unique-paths-ii "不同路径 II")
-
-
A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below).
-
-
The robot can only move either down or right at any point in time. The robot is trying to reach the bottom-right corner of the grid (marked 'Finish' in the diagram below).
-
-
Now consider if some obstacles are added to the grids. How many unique paths would there be?
-
-
An obstacle and space is marked as 1 and 0 respectively in the grid.
-
-
-
Example 1:
-
-
-Input: obstacleGrid = [[0,0,0],[0,1,0],[0,0,0]]
-Output: 2
-Explanation: There is one obstacle in the middle of the 3x3 grid above.
-There are two ways to reach the bottom-right corner:
-1. Right -> Right -> Down -> Down
-2. Down -> Down -> Right -> Right
-
-
-
Example 2:
-
-
-Input: obstacleGrid = [[0,1],[0,0]]
-Output: 1
-
-
-
-
Constraints:
-
-
-
m == obstacleGrid.length
-
n == obstacleGrid[i].length
-
1 <= m, n <= 100
-
obstacleGrid[i][j] is 0 or 1.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
-
-### Similar Questions
- 1. [Unique Paths](../unique-paths) (Medium)
- 1. [Unique Paths III](../unique-paths-iii) (Hard)
-
-### Hints
-
-Hint 1
-The robot can only move either down or right. Hence any cell in the first row can only be reached from the cell left to it. However, if any cell has an obstacle, you don't let that cell contribute to any path. So, for the first row, the number of ways will simply be
-
-
-if obstacleGrid[i][j] is not an obstacle
- obstacleGrid[i,j] = obstacleGrid[i,j - 1]
-else
- obstacleGrid[i,j] = 0
-
-
-You can do a similar processing for finding out the number of ways of reaching the cells in the first column.
-
-
-
-Hint 2
-For any other cell, we can find out the number of ways of reaching it, by making use of the number of ways of reaching the cell directly above it and the cell to the left of it in the grid. This is because these are the only two directions from which the robot can come to the current cell.
-
-
-
-Hint 3
-Since we are making use of pre-computed values along the iteration, this becomes a dynamic programming problem.
-
-
-if obstacleGrid[i][j] is not an obstacle
- obstacleGrid[i,j] = obstacleGrid[i,j - 1] + obstacleGrid[i - 1][j]
-else
- obstacleGrid[i,j] = 0
-
You are given an m x n integer array grid where grid[i][j] could be:
-
-
-
1 representing the starting square. There is exactly one starting square.
-
2 representing the ending square. There is exactly one ending square.
-
0 representing empty squares we can walk over.
-
-1 representing obstacles that we cannot walk over.
-
-
-
Return the number of 4-directional walks from the starting square to the ending square, that walk over every non-obstacle square exactly once.
-
-
-
Example 1:
-
-
-Input: grid = [[1,0,0,0],[0,0,0,0],[0,0,2,-1]]
-Output: 2
-Explanation: We have the following two paths:
-1. (0,0),(0,1),(0,2),(0,3),(1,3),(1,2),(1,1),(1,0),(2,0),(2,1),(2,2)
-2. (0,0),(1,0),(2,0),(2,1),(1,1),(0,1),(0,2),(0,3),(1,3),(1,2),(2,2)
-
-
-
Example 2:
-
-
-Input: grid = [[1,0,0,0],[0,0,0,0],[0,0,0,2]]
-Output: 4
-Explanation: We have the following four paths:
-1. (0,0),(0,1),(0,2),(0,3),(1,3),(1,2),(1,1),(1,0),(2,0),(2,1),(2,2),(2,3)
-2. (0,0),(0,1),(1,1),(1,0),(2,0),(2,1),(2,2),(1,2),(0,2),(0,3),(1,3),(2,3)
-3. (0,0),(1,0),(2,0),(2,1),(2,2),(1,2),(1,1),(0,1),(0,2),(0,3),(1,3),(2,3)
-4. (0,0),(1,0),(2,0),(2,1),(1,1),(0,1),(0,2),(0,3),(1,3),(1,2),(2,2),(2,3)
-
-
-
Example 3:
-
-
-Input: grid = [[0,1],[2,0]]
-Output: 0
-Explanation: There is no path that walks over every empty square exactly once.
-Note that the starting and ending square can be anywhere in the grid.
-
-
-
-
Constraints:
-
-
-
m == grid.length
-
n == grid[i].length
-
1 <= m, n <= 20
-
1 <= m * n <= 20
-
-1 <= grid[i][j] <= 2
-
There is exactly one starting cell and one ending cell.
A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below).
-
-
The robot can only move either down or right at any point in time. The robot is trying to reach the bottom-right corner of the grid (marked 'Finish' in the diagram below).
-
-
How many possible unique paths are there?
-
-
-
Example 1:
-
-
-Input: m = 3, n = 7
-Output: 28
-
-
-
Example 2:
-
-
-Input: m = 3, n = 2
-Output: 3
-Explanation:
-From the top-left corner, there are a total of 3 ways to reach the bottom-right corner:
-1. Right -> Down -> Down
-2. Down -> Down -> Right
-3. Down -> Right -> Down
-
-
-
Example 3:
-
-
-Input: m = 7, n = 3
-Output: 28
-
-
-
Example 4:
-
-
-Input: m = 3, n = 3
-Output: 6
-
-
-
-
Constraints:
-
-
-
1 <= m, n <= 100
-
It's guaranteed that the answer will be less than or equal to 2 * 109.
Given a string p, return the number of unique non-empty substrings of p are present in s.
-
-
-
Example 1:
-
-
-Input: p = "a"
-Output: 1
-Explanation: Only the substring "a" of p is in s.
-
-
-
Example 2:
-
-
-Input: p = "cac"
-Output: 2
-Explanation: There are two substrings ("a", "c") of p in s.
-
-
-
Example 3:
-
-
-Input: p = "zab"
-Output: 6
-Explanation: There are six substrings ("z", "a", "b", "za", "ab", and "zab") of p in s.
-
-
-
-
Constraints:
-
-
-
1 <= p.length <= 105
-
p consists of lowercase English letters.
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Hints
-
-Hint 1
-One possible solution might be to consider allocating an array size of 26 for each character in the alphabet. (Credits to @r2ysxu)
-
diff --git a/problems/unique-substrings-in-wraparound-string/unique_substrings_in_wraparound_string.go b/problems/unique-substrings-in-wraparound-string/unique_substrings_in_wraparound_string.go
deleted file mode 100644
index 2a4720da2..000000000
--- a/problems/unique-substrings-in-wraparound-string/unique_substrings_in_wraparound_string.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem467
diff --git a/problems/unique-substrings-in-wraparound-string/unique_substrings_in_wraparound_string_test.go b/problems/unique-substrings-in-wraparound-string/unique_substrings_in_wraparound_string_test.go
deleted file mode 100644
index 2a4720da2..000000000
--- a/problems/unique-substrings-in-wraparound-string/unique_substrings_in_wraparound_string_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem467
diff --git a/problems/unique-substrings-with-equal-digit-frequency/README.md b/problems/unique-substrings-with-equal-digit-frequency/README.md
deleted file mode 100644
index 18b80c84a..000000000
--- a/problems/unique-substrings-with-equal-digit-frequency/README.md
+++ /dev/null
@@ -1,47 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-time-to-remove-all-cars-containing-illegal-goods "Minimum Time to Remove All Cars Containing Illegal Goods")
-
-[Next >](../count-operations-to-obtain-zero "Count Operations to Obtain Zero")
-
-## [2168. Unique Substrings With Equal Digit Frequency (Medium)](https://leetcode.com/problems/unique-substrings-with-equal-digit-frequency "")
-
-
-
-### Related Topics
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
- [[Counting](../../tag/counting/README.md)]
- [[Hash Function](../../tag/hash-function/README.md)]
- [[Rolling Hash](../../tag/rolling-hash/README.md)]
-
-### Hints
-
-Hint 1
-With the constraints, could we try every substring?
-
-
-
-Hint 2
-Yes, checking every substring has runtime O(n^2), which will pass.
-
-
-
-Hint 3
-How can we make sure we only count unique substrings?
-
-
-
-Hint 4
-Use a set to store previously counted substrings. Hashing a string s of length m takes O(m) time. Is there a fast way to compute the hash of s if we know the hash of s[0..m - 2]?
-
-
-
-Hint 5
-Use a rolling hash.
-
diff --git a/problems/unique-word-abbreviation/README.md b/problems/unique-word-abbreviation/README.md
deleted file mode 100644
index 882609e43..000000000
--- a/problems/unique-word-abbreviation/README.md
+++ /dev/null
@@ -1,55 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../find-the-duplicate-number "Find the Duplicate Number")
-
-[Next >](../game-of-life "Game of Life")
-
-## [288. Unique Word Abbreviation (Medium)](https://leetcode.com/problems/unique-word-abbreviation "单词的唯一缩写")
-
-
An abbreviation of a word follows the form <first letter><number><last letter>. Below are some examples of word abbreviations:
Assume you have a dictionary and given a word, find whether its abbreviation is unique in the dictionary. A word's abbreviation is unique if no other word from the dictionary has the same abbreviation.
-+----------------+---------+
-| Column Name | Type |
-+----------------+---------+
-| book_id | int |
-| name | varchar |
-| available_from | date |
-+----------------+---------+
-book_id is the primary key of this table.
-
-
-
Table: Orders
-
-
-+----------------+---------+
-| Column Name | Type |
-+----------------+---------+
-| order_id | int |
-| book_id | int |
-| quantity | int |
-| dispatch_date | date |
-+----------------+---------+
-order_id is the primary key of this table.
-book_id is a foreign key to the Books table.
-
-
-
-
-
Write an SQL query that reports the books that have sold less than 10 copies in the last year, excluding books that have been available for less than 1 month from today. Assume today is 2019-06-23.
-
-
The query result format is in the following example:
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/unpopular-books/mysql_schemas.sql b/problems/unpopular-books/mysql_schemas.sql
deleted file mode 100644
index 171c4e090..000000000
--- a/problems/unpopular-books/mysql_schemas.sql
+++ /dev/null
@@ -1,16 +0,0 @@
-Create table If Not Exists Books (book_id int, name varchar(50), available_from date);
-Create table If Not Exists Orders (order_id int, book_id int, quantity int, dispatch_date date);
-Truncate table Books;
-insert into Books (book_id, name, available_from) values ('1', 'Kalila And Demna', '2010-01-01');
-insert into Books (book_id, name, available_from) values ('2', '28 Letters', '2012-05-12');
-insert into Books (book_id, name, available_from) values ('3', 'The Hobbit', '2019-06-10');
-insert into Books (book_id, name, available_from) values ('4', '13 Reasons Why', '2019-06-01');
-insert into Books (book_id, name, available_from) values ('5', 'The Hunger Games', '2008-09-21');
-Truncate table Orders;
-insert into Orders (order_id, book_id, quantity, dispatch_date) values ('1', '1', '2', '2018-07-26');
-insert into Orders (order_id, book_id, quantity, dispatch_date) values ('2', '1', '1', '2018-11-05');
-insert into Orders (order_id, book_id, quantity, dispatch_date) values ('3', '3', '8', '2019-06-11');
-insert into Orders (order_id, book_id, quantity, dispatch_date) values ('4', '4', '6', '2019-06-05');
-insert into Orders (order_id, book_id, quantity, dispatch_date) values ('5', '4', '5', '2019-06-20');
-insert into Orders (order_id, book_id, quantity, dispatch_date) values ('6', '5', '9', '2009-02-02');
-insert into Orders (order_id, book_id, quantity, dispatch_date) values ('7', '5', '8', '2010-04-13');
diff --git a/problems/unpopular-books/unpopular_books.sql b/problems/unpopular-books/unpopular_books.sql
deleted file mode 100644
index bae62cf19..000000000
--- a/problems/unpopular-books/unpopular_books.sql
+++ /dev/null
@@ -1 +0,0 @@
-# Write your MySQL query statement below
diff --git a/problems/user-activity-for-the-past-30-days-i/README.md b/problems/user-activity-for-the-past-30-days-i/README.md
deleted file mode 100644
index 123c6b996..000000000
--- a/problems/user-activity-for-the-past-30-days-i/README.md
+++ /dev/null
@@ -1,66 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../stone-game-ii "Stone Game II")
-
-[Next >](../user-activity-for-the-past-30-days-ii "User Activity for the Past 30 Days II")
-
-## [1141. User Activity for the Past 30 Days I (Easy)](https://leetcode.com/problems/user-activity-for-the-past-30-days-i "查询近30天活跃用户数")
-
-
Table: Activity
-
-
-+---------------+---------+
-| Column Name | Type |
-+---------------+---------+
-| user_id | int |
-| session_id | int |
-| activity_date | date |
-| activity_type | enum |
-+---------------+---------+
-There is no primary key for this table, it may have duplicate rows.
-The activity_type column is an ENUM of type ('open_session', 'end_session', 'scroll_down', 'send_message').
-The table shows the user activities for a social media website.
-Note that each session belongs to exactly one user.
-
-
-
-
-
Write an SQL query to find the daily active user count for a period of 30 days ending 2019-07-27 inclusively. A user was active on some day if he/she made at least one activity on that day.
-
-
The query result format is in the following example:
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/user-activity-for-the-past-30-days-i/mysql_schemas.sql b/problems/user-activity-for-the-past-30-days-i/mysql_schemas.sql
deleted file mode 100644
index 82d002fab..000000000
--- a/problems/user-activity-for-the-past-30-days-i/mysql_schemas.sql
+++ /dev/null
@@ -1,13 +0,0 @@
-Create table If Not Exists Activity (user_id int, session_id int, activity_date date, activity_type ENUM('open_session', 'end_session', 'scroll_down', 'send_message'));
-Truncate table Activity;
-insert into Activity (user_id, session_id, activity_date, activity_type) values ('1', '1', '2019-07-20', 'open_session');
-insert into Activity (user_id, session_id, activity_date, activity_type) values ('1', '1', '2019-07-20', 'scroll_down');
-insert into Activity (user_id, session_id, activity_date, activity_type) values ('1', '1', '2019-07-20', 'end_session');
-insert into Activity (user_id, session_id, activity_date, activity_type) values ('2', '4', '2019-07-20', 'open_session');
-insert into Activity (user_id, session_id, activity_date, activity_type) values ('2', '4', '2019-07-21', 'send_message');
-insert into Activity (user_id, session_id, activity_date, activity_type) values ('2', '4', '2019-07-21', 'end_session');
-insert into Activity (user_id, session_id, activity_date, activity_type) values ('3', '2', '2019-07-21', 'open_session');
-insert into Activity (user_id, session_id, activity_date, activity_type) values ('3', '2', '2019-07-21', 'send_message');
-insert into Activity (user_id, session_id, activity_date, activity_type) values ('3', '2', '2019-07-21', 'end_session');
-insert into Activity (user_id, session_id, activity_date, activity_type) values ('4', '3', '2019-06-25', 'open_session');
-insert into Activity (user_id, session_id, activity_date, activity_type) values ('4', '3', '2019-06-25', 'end_session');
diff --git a/problems/user-activity-for-the-past-30-days-ii/README.md b/problems/user-activity-for-the-past-30-days-ii/README.md
deleted file mode 100644
index 798f30669..000000000
--- a/problems/user-activity-for-the-past-30-days-ii/README.md
+++ /dev/null
@@ -1,66 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../user-activity-for-the-past-30-days-i "User Activity for the Past 30 Days I")
-
-[Next >](../longest-common-subsequence "Longest Common Subsequence")
-
-## [1142. User Activity for the Past 30 Days II (Easy)](https://leetcode.com/problems/user-activity-for-the-past-30-days-ii "过去30天的用户活动 II")
-
-
Table: Activity
-
-
-+---------------+---------+
-| Column Name | Type |
-+---------------+---------+
-| user_id | int |
-| session_id | int |
-| activity_date | date |
-| activity_type | enum |
-+---------------+---------+
-There is no primary key for this table, it may have duplicate rows.
-The activity_type column is an ENUM of type ('open_session', 'end_session', 'scroll_down', 'send_message').
-The table shows the user activities for a social media website.
-Note that each session belongs to exactly one user.
-
-
-
-
Write an SQL query to find the average number of sessions per user for a period of 30 days ending 2019-07-27 inclusively, rounded to 2 decimal places. The sessions we want to count for a user are those with at least one activity in that time period.
-
-
The query result format is in the following example:
-+-------------+---------+
-| Column Name | Type |
-+-------------+---------+
-| user_id | int |
-| spend_date | date |
-| platform | enum |
-| amount | int |
-+-------------+---------+
-The table logs the spendings history of users that make purchases from an online shopping website which has a desktop and a mobile application.
-(user_id, spend_date, platform) is the primary key of this table.
-The platform column is an ENUM type of ('desktop', 'mobile').
-
-
-
Write an SQL query to find the total number of users and the total amount spent using mobile only, desktop only and both mobile and desktop together for each date.
-
-
The query result format is in the following example:
-
-
-Spending table:
-+---------+------------+----------+--------+
-| user_id | spend_date | platform | amount |
-+---------+------------+----------+--------+
-| 1 | 2019-07-01 | mobile | 100 |
-| 1 | 2019-07-01 | desktop | 100 |
-| 2 | 2019-07-01 | mobile | 100 |
-| 2 | 2019-07-02 | mobile | 100 |
-| 3 | 2019-07-01 | desktop | 100 |
-| 3 | 2019-07-02 | desktop | 100 |
-+---------+------------+----------+--------+
-
-Result table:
-+------------+----------+--------------+-------------+
-| spend_date | platform | total_amount | total_users |
-+------------+----------+--------------+-------------+
-| 2019-07-01 | desktop | 100 | 1 |
-| 2019-07-01 | mobile | 100 | 1 |
-| 2019-07-01 | both | 200 | 1 |
-| 2019-07-02 | desktop | 100 | 1 |
-| 2019-07-02 | mobile | 100 | 1 |
-| 2019-07-02 | both | 0 | 0 |
-+------------+----------+--------------+-------------+
-On 2019-07-01, user 1 purchased using both desktop and mobile, user 2 purchased using mobile only and user 3 purchased using desktop only.
-On 2019-07-02, user 2 purchased using mobile only, user 3 purchased using desktop only and no one purchased using both platforms.
Note: The input is an array of integers. Only the least significant 8 bits of each integer is used to store the data. This means each integer represents only 1 byte of data.
-
-
-
Example 1:
-
-
-Input: data = [197,130,1]
-Output: true
-Explanation: data represents the octet sequence: 11000101 10000010 00000001.
-It is a valid utf-8 encoding for a 2-bytes character followed by a 1-byte character.
-
-
-
Example 2:
-
-
-Input: data = [235,140,4]
-Output: false
-Explanation: data represented the octet sequence: 11101011 10001100 00000100.
-The first 3 bits are all one's and the 4th bit is 0 means it is a 3-bytes character.
-The next byte is a continuation byte which starts with 10 and that's correct.
-But the second continuation byte does not start with 10, so it is invalid.
-
-
-
-
Constraints:
-
-
-
1 <= data.length <= 2 * 104
-
0 <= data[i] <= 255
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Bit Manipulation](../../tag/bit-manipulation/README.md)]
-
-### Hints
-
-Hint 1
-All you have to do is follow the rules. For a given integer, obtain its binary representation in the string form and work with the rules given in the problem.
-
-
-
-Hint 2
-An integer can either represent the start of a UTF-8 character, or a part of an existing UTF-8 character. There are two separate rules for these two scenarios in the problem.
-
-
-
-Hint 3
-If an integer is a part of an existing UTF-8 character, simply check the 2 most significant bits of in the binary representation string. They should be 10. If the integer represents the start of a UTF-8 character, then the first few bits would be 1 followed by a 0. The number of initial bits (most significant) bits determines the length of the UTF-8 character.
-
-
-Note: The array can contain multiple valid UTF-8 characters.
-
-
-
-Hint 4
-String manipulation will work fine here. But, it is too slow. Can we instead use bit manipulation to do the validations instead of string manipulations?
-
-
-
-Hint 5
-We can use bit masking to check how many initial bits are set for a given number. We only need to work with the 8 least significant bits as mentioned in the problem.
-
-
-
-Can you use bit-masking to perform the second validation as well i.e. checking if the most significant bit is 1 and the second most significant bit a 0?
-
-
-
-Hint 6
-To check if the most significant bit is a 1 and the second most significant bit is a 0, we can make use of the following two masks.
-
-
-mask1 = 1 << 7
-mask2 = 1 << 6
-
-if not (num & mask1 and not (num & mask2)):
- return False
-
Given two strings s and t, return trueiftis an anagram ofs, andfalseotherwise.
-
-
-
Example 1:
-
Input: s = "anagram", t = "nagaram"
-Output: true
-
Example 2:
-
Input: s = "rat", t = "car"
-Output: false
-
-
-
Constraints:
-
-
-
1 <= s.length, t.length <= 5 * 104
-
s and t consist of lowercase English letters.
-
-
-
-
Follow up: What if the inputs contain Unicode characters? How would you adapt your solution to such a case?
-
-### Related Topics
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
- [[Sorting](../../tag/sorting/README.md)]
-
-### Similar Questions
- 1. [Group Anagrams](../group-anagrams) (Medium)
- 1. [Palindrome Permutation](../palindrome-permutation) (Easy)
- 1. [Find All Anagrams in a String](../find-all-anagrams-in-a-string) (Medium)
diff --git a/problems/valid-anagram/valid_anagram.go b/problems/valid-anagram/valid_anagram.go
deleted file mode 100644
index b4178b134..000000000
--- a/problems/valid-anagram/valid_anagram.go
+++ /dev/null
@@ -1,20 +0,0 @@
-package problem242
-
-func isAnagram(s string, t string) bool {
- sl := len(s)
- tl := len(t)
- if sl != tl {
- return false
- }
- var sc [256]int
- for i := 0; i < sl; i++ {
- sc[s[i]]++
- }
- for i := 0; i < tl; i++ {
- sc[t[i]]--
- if sc[t[i]] < 0 {
- return false
- }
- }
- return true
-}
diff --git a/problems/valid-anagram/valid_anagram_test.go b/problems/valid-anagram/valid_anagram_test.go
deleted file mode 100644
index 10899056d..000000000
--- a/problems/valid-anagram/valid_anagram_test.go
+++ /dev/null
@@ -1,46 +0,0 @@
-package problem242
-
-import "testing"
-
-type testType struct {
- s string
- t string
- want bool
-}
-
-func TestIsAnagram(t *testing.T) {
- tests := [...]testType{
- {
- s: "anagram",
- t: "nagaram",
- want: true,
- },
- {
- s: "hannah",
- t: "hanna",
- want: false,
- },
- {
- s: "this is string",
- t: "this is string long",
- want: false,
- },
- {
- s: "this is string",
- t: "this as string",
- want: false,
- },
- {
- s: "你好,世界",
- t: "世界,你好",
- want: true,
- },
- }
-
- for _, tt := range tests {
- got := isAnagram(tt.s, tt.t)
- if got != tt.want {
- t.Fatalf("in: %v %v, got: %v, want: %v", tt.s, tt.t, got, tt.want)
- }
- }
-}
diff --git a/problems/valid-arrangement-of-pairs/README.md b/problems/valid-arrangement-of-pairs/README.md
deleted file mode 100644
index 68c06e545..000000000
--- a/problems/valid-arrangement-of-pairs/README.md
+++ /dev/null
@@ -1,87 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../step-by-step-directions-from-a-binary-tree-node-to-another "Step-By-Step Directions From a Binary Tree Node to Another")
-
-[Next >](../subsequence-of-size-k-with-the-largest-even-sum "Subsequence of Size K With the Largest Even Sum")
-
-## [2097. Valid Arrangement of Pairs (Hard)](https://leetcode.com/problems/valid-arrangement-of-pairs "合法重新排列数对")
-
-
You are given a 0-indexed 2D integer array pairs where pairs[i] = [starti, endi]. An arrangement of pairs is valid if for every index i where 1 <= i < pairs.length, we have endi-1 == starti.
-
-
Return any valid arrangement of pairs.
-
-
Note: The inputs will be generated such that there exists a valid arrangement of pairs.
-
-### Related Topics
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Graph](../../tag/graph/README.md)]
- [[Eulerian Circuit](../../tag/eulerian-circuit/README.md)]
-
-### Hints
-
-Hint 1
-Could you convert this into a graph problem?
-
-
-
-Hint 2
-Consider the pairs as edges and each number as a node.
-
-
-
-Hint 3
-We have to find an Eulerian path of this graph. Hierholzer’s algorithm can be used.
-
diff --git a/problems/valid-boomerang/README.md b/problems/valid-boomerang/README.md
deleted file mode 100644
index 5cd0d3c99..000000000
--- a/problems/valid-boomerang/README.md
+++ /dev/null
@@ -1,43 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../escape-a-large-maze "Escape a Large Maze")
-
-[Next >](../binary-search-tree-to-greater-sum-tree "Binary Search Tree to Greater Sum Tree")
-
-## [1037. Valid Boomerang (Easy)](https://leetcode.com/problems/valid-boomerang "有效的回旋镖")
-
-
Given an array points where points[i] = [xi, yi] represents a point on the X-Y plane, return trueif these points are a boomerang.
-
-
A boomerang is a set of three points that are all distinct and not in a straight line.
Given an array of integers arr, return true if and only if it is a valid mountain array.
-
-
Recall that arr is a mountain array if and only if:
-
-
-
arr.length >= 3
-
There exists some i with 0 < i < arr.length - 1 such that:
-
-
arr[0] < arr[1] < ... < arr[i - 1] < arr[i]
-
arr[i] > arr[i + 1] > ... > arr[arr.length - 1]
-
-
-
-
-
-
Example 1:
-
Input: arr = [2,1]
-Output: false
-
Example 2:
-
Input: arr = [3,5,5]
-Output: false
-
Example 3:
-
Input: arr = [0,3,2,1]
-Output: true
-
-
-
Constraints:
-
-
-
1 <= arr.length <= 104
-
0 <= arr[i] <= 104
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
-
-### Hints
-
-Hint 1
-It's very easy to keep track of a monotonically increasing or decreasing ordering of elements. You just need to be able to determine the start of the valley in the mountain and from that point onwards, it should be a valley i.e. no mini-hills after that. Use this information in regards to the values in the array and you will be able to come up with a straightforward solution.
-
diff --git a/problems/valid-mountain-array/valid_mountain_array.go b/problems/valid-mountain-array/valid_mountain_array.go
deleted file mode 100644
index 3c9f1d7db..000000000
--- a/problems/valid-mountain-array/valid_mountain_array.go
+++ /dev/null
@@ -1,19 +0,0 @@
-package problem941
-
-func validMountainArray(A []int) bool {
- flag := false
- if len(A) < 3 {
- return false
- }
- for i, v := range A[1:] {
- if !flag && v <= A[i] {
- if flag = true; i == 0 {
- return false
- }
- }
- if flag && v >= A[i] {
- return false
- }
- }
- return flag
-}
diff --git a/problems/valid-mountain-array/valid_mountain_array_test.go b/problems/valid-mountain-array/valid_mountain_array_test.go
deleted file mode 100644
index e0d0f2ab6..000000000
--- a/problems/valid-mountain-array/valid_mountain_array_test.go
+++ /dev/null
@@ -1,43 +0,0 @@
-package problem941
-
-import "testing"
-
-type testType struct {
- in []int
- want bool
-}
-
-func TestValidMountainArray(t *testing.T) {
- tests := [...]testType{
- {
- in: []int{2, 1},
- want: false,
- },
- {
- in: []int{3, 5, 5},
- want: false,
- },
- {
- in: []int{0, 3, 2, 1},
- want: true,
- },
- {
- in: []int{1, 2, 3, 2},
- want: true,
- },
- {
- in: []int{9, 8, 7, 6, 5, 4, 3, 2, 1, 0},
- want: false,
- },
- {
- in: []int{1, 2, 3, 4, 5},
- want: false,
- },
- }
- for _, tt := range tests {
- got := validMountainArray(tt.in)
- if got != tt.want {
- t.Fatalf("in: %v, got: %v, want: %v", tt.in, got, tt.want)
- }
- }
-}
diff --git a/problems/valid-number/README.md b/problems/valid-number/README.md
deleted file mode 100644
index 8b6567a68..000000000
--- a/problems/valid-number/README.md
+++ /dev/null
@@ -1,86 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../minimum-path-sum "Minimum Path Sum")
-
-[Next >](../plus-one "Plus One")
-
-## [65. Valid Number (Hard)](https://leetcode.com/problems/valid-number "有效数字")
-
-
A valid number can be split up into these components (in order):
-
-
-
A decimal number or an integer.
-
(Optional) An 'e' or 'E', followed by an integer.
-
-
-
A decimal number can be split up into these components (in order):
-
-
-
(Optional) A sign character (either '+' or '-').
-
One of the following formats:
-
-
One or more digits, followed by a dot '.'.
-
One or more digits, followed by a dot '.', followed by one or more digits.
-
A dot '.', followed by one or more digits.
-
-
-
-
-
An integer can be split up into these components (in order):
-
-
-
(Optional) A sign character (either '+' or '-').
-
One or more digits.
-
-
-
For example, all the following are valid numbers: ["2", "0089", "-0.1", "+3.14", "4.", "-.9", "2e10", "-90E3", "3e+7", "+6e-1", "53.5e93", "-123.456e789"], while the following are not valid numbers: ["abc", "1a", "1e", "e3", "99e2.5", "--6", "-+3", "95a54e53"].
-
-
Given a string s, return true if s is a valid number.
-
-
-
Example 1:
-
-
-Input: s = "0"
-Output: true
-
-
-
Example 2:
-
-
-Input: s = "e"
-Output: false
-
-
-
Example 3:
-
-
-Input: s = "."
-Output: false
-
-
-
Example 4:
-
-
-Input: s = ".1"
-Output: true
-
-
-
-
Constraints:
-
-
-
1 <= s.length <= 20
-
s consists of only English letters (both uppercase and lowercase), digits (0-9), plus '+', minus '-', or dot '.'.
Given a string s and an integer k, find out if the given string is a K-Palindrome or not.
-
-
A string is K-Palindrome if it can be transformed into a palindrome by removing at most k characters from it.
-
-
-
Example 1:
-
-
-Input: s = "abcdeca", k = 2
-Output: true
-Explanation: Remove 'b' and 'e' characters.
-
-
-
-
Constraints:
-
-
-
1 <= s.length <= 1000
-
s has only lowercase English letters.
-
1 <= k <= s.length
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Hints
-
-Hint 1
-Can you reduce this problem to a classic problem?
-
-
-
-Hint 2
-The problem is equivalent to finding any palindromic subsequence of length at least N-K where N is the length of the string.
-
-
-
-Hint 3
-Try to find the longest palindromic subsequence.
-
-
-
-Hint 4
-Use DP to do that.
-
diff --git a/problems/valid-palindrome/README.md b/problems/valid-palindrome/README.md
deleted file mode 100644
index c4df1f022..000000000
--- a/problems/valid-palindrome/README.md
+++ /dev/null
@@ -1,47 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../binary-tree-maximum-path-sum "Binary Tree Maximum Path Sum")
-
-[Next >](../word-ladder-ii "Word Ladder II")
-
-## [125. Valid Palindrome (Easy)](https://leetcode.com/problems/valid-palindrome "验证回文串")
-
-
Given a string s, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.
-
-
-
Example 1:
-
-
-Input: s = "A man, a plan, a canal: Panama"
-Output: true
-Explanation: "amanaplanacanalpanama" is a palindrome.
-
-
-
Example 2:
-
-
-Input: s = "race a car"
-Output: false
-Explanation: "raceacar" is not a palindrome.
-
Given a string s containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.
-
-
An input string is valid if:
-
-
-
Open brackets must be closed by the same type of brackets.
-
Open brackets must be closed in the correct order.
-
-
-
-
Example 1:
-
-
-Input: s = "()"
-Output: true
-
-
-
Example 2:
-
-
-Input: s = "()[]{}"
-Output: true
-
-
-
Example 3:
-
-
-Input: s = "(]"
-Output: false
-
-
-
Example 4:
-
-
-Input: s = "([)]"
-Output: false
-
-
-
Example 5:
-
-
-Input: s = "{[]}"
-Output: true
-
-
-
-
Constraints:
-
-
-
1 <= s.length <= 104
-
s consists of parentheses only '()[]{}'.
-
-
-### Related Topics
- [[Stack](../../tag/stack/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Similar Questions
- 1. [Generate Parentheses](../generate-parentheses) (Medium)
- 1. [Longest Valid Parentheses](../longest-valid-parentheses) (Hard)
- 1. [Remove Invalid Parentheses](../remove-invalid-parentheses) (Hard)
- 1. [Check If Word Is Valid After Substitutions](../check-if-word-is-valid-after-substitutions) (Medium)
-
-### Hints
-
-Hint 1
-An interesting property about a valid parenthesis expression is that a sub-expression of a valid expression should also be a valid expression. (Not every sub-expression) e.g.
-
-
-
-Can we exploit this recursive structure somehow?
-
-
-
-Hint 2
-What if whenever we encounter a matching pair of parenthesis in the expression, we simply remove it from the expression? This would keep on shortening the expression. e.g.
-
-
-Input: board =
-[["8","3",".",".","7",".",".",".","."]
-,["6",".",".","1","9","5",".",".","."]
-,[".","9","8",".",".",".",".","6","."]
-,["8",".",".",".","6",".",".",".","3"]
-,["4",".",".","8",".","3",".",".","1"]
-,["7",".",".",".","2",".",".",".","6"]
-,[".","6",".",".",".",".","2","8","."]
-,[".",".",".","4","1","9",".",".","5"]
-,[".",".",".",".","8",".",".","7","9"]]
-Output: false
-Explanation: Same as Example 1, except with the 5 in the top left corner being modified to 8. Since there are two 8's in the top left 3x3 sub-box, it is invalid.
-
Given a Tic-Tac-Toe board as a string array board, return true if and only if it is possible to reach this board position during the course of a valid tic-tac-toe game.
-
-
The board is a 3 x 3 array that consists of characters ' ', 'X', and 'O'. The ' ' character represents an empty square.
-
-
Here are the rules of Tic-Tac-Toe:
-
-
-
Players take turns placing characters into empty squares ' '.
-
The first player always places 'X' characters, while the second player always places 'O' characters.
-
'X' and 'O' characters are always placed into empty squares, never filled ones.
-
The game ends when there are three of the same (non-empty) character filling any row, column, or diagonal.
-
The game also ends if all squares are non-empty.
-
No more moves can be played if the game is over.
-
-
-
-
Example 1:
-
-
-Input: board = ["O "," "," "]
-Output: false
-Explanation: The first player always plays "X".
-
-
-
Example 2:
-
-
-Input: board = ["XOX"," X "," "]
-Output: false
-Explanation: Players take turns making moves.
-
Given an integer array nums, return the number of triplets chosen from the array that can make triangles if we take them as side lengths of a triangle.
-
-
-
Example 1:
-
-
-Input: nums = [2,2,3,4]
-Output: 3
-Explanation: Valid combinations are:
-2,3,4 (using the first 2)
-2,3,4 (using the second 2)
-2,2,3
-
-
-
-### Related Topics
- [[Two Pointers](../../tag/two-pointers/README.md)]
- [[String](../../tag/string/README.md)]
-
-### Similar Questions
- 1. [Minimum Unique Word Abbreviation](../minimum-unique-word-abbreviation) (Hard)
- 1. [Word Abbreviation](../word-abbreviation) (Hard)
- 1. [Check if an Original String Exists Given Two Encoded Strings](../check-if-an-original-string-exists-given-two-encoded-strings) (Hard)
diff --git a/problems/valid-word-abbreviation/valid_word_abbreviation.go b/problems/valid-word-abbreviation/valid_word_abbreviation.go
deleted file mode 100644
index a77ddb9b4..000000000
--- a/problems/valid-word-abbreviation/valid_word_abbreviation.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem408
diff --git a/problems/valid-word-abbreviation/valid_word_abbreviation_test.go b/problems/valid-word-abbreviation/valid_word_abbreviation_test.go
deleted file mode 100644
index a77ddb9b4..000000000
--- a/problems/valid-word-abbreviation/valid_word_abbreviation_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem408
diff --git a/problems/valid-word-square/README.md b/problems/valid-word-square/README.md
deleted file mode 100644
index 82c857ad4..000000000
--- a/problems/valid-word-square/README.md
+++ /dev/null
@@ -1,98 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-xor-of-two-numbers-in-an-array "Maximum XOR of Two Numbers in an Array")
-
-[Next >](../reconstruct-original-digits-from-english "Reconstruct Original Digits from English")
-
-## [422. Valid Word Square (Easy)](https://leetcode.com/problems/valid-word-square "有效的单词方块")
-
-
Given a sequence of words, check whether it forms a valid word square.
-
-
A sequence of words forms a valid word square if the kth row and column read the exact same string, where 0 ≤ k < max(numRows, numColumns).
-
-
Note:
-
-
The number of words given is at least 1 and does not exceed 500.
-
Word length will be at least 1 and does not exceed 500.
-
Each word contains only lowercase English alphabet a-z.
-
-
-
-
Example 1:
-
-Input:
-[
- "abcd",
- "bnrt",
- "crmy",
- "dtye"
-]
-
-Output:
-true
-
-Explanation:
-The first row and first column both read "abcd".
-The second row and second column both read "bnrt".
-The third row and third column both read "crmy".
-The fourth row and fourth column both read "dtye".
-
-Therefore, it is a valid word square.
-
-
-
-
Example 2:
-
-Input:
-[
- "abcd",
- "bnrt",
- "crm",
- "dt"
-]
-
-Output:
-true
-
-Explanation:
-The first row and first column both read "abcd".
-The second row and second column both read "bnrt".
-The third row and third column both read "crm".
-The fourth row and fourth column both read "dt".
-
-Therefore, it is a valid word square.
-
-
-
-
Example 3:
-
-Input:
-[
- "ball",
- "area",
- "read",
- "lady"
-]
-
-Output:
-false
-
-Explanation:
-The third row reads "read" while the third column reads "lead".
-
-Therefore, it is NOT a valid word square.
-
You have n binary tree nodes numbered from 0 to n - 1 where node i has two children leftChild[i] and rightChild[i], return true if and only if all the given nodes form exactly one valid binary tree.
-
-
If node i has no left child then leftChild[i] will equal -1, similarly for the right child.
-
-
Note that the nodes have no values and that we only use the node numbers in this problem.
-
-### Related Topics
- [[Tree](../../tag/tree/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Union Find](../../tag/union-find/README.md)]
- [[Graph](../../tag/graph/README.md)]
- [[Binary Tree](../../tag/binary-tree/README.md)]
-
-### Hints
-
-Hint 1
-Find the parent of each node.
-
-
-
-Hint 2
-A valid tree must have nodes with only one parent and exactly one node with no parent.
-
diff --git a/problems/validate-ip-address/README.md b/problems/validate-ip-address/README.md
deleted file mode 100644
index 9b8f41bc6..000000000
--- a/problems/validate-ip-address/README.md
+++ /dev/null
@@ -1,78 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../unique-substrings-in-wraparound-string "Unique Substrings in Wraparound String")
-
-[Next >](../convex-polygon "Convex Polygon")
-
-## [468. Validate IP Address (Medium)](https://leetcode.com/problems/validate-ip-address "验证IP地址")
-
-
Given a string IP, return "IPv4" if IP is a valid IPv4 address, "IPv6" if IP is a valid IPv6 address or "Neither" if IP is not a correct IP of any type.
-
-
A valid IPv4 address is an IP in the form "x1.x2.x3.x4" where 0 <= xi <= 255 and xicannot contain leading zeros. For example, "192.168.1.1" and "192.168.1.0" are valid IPv4 addresses but "192.168.01.1", while "192.168.1.00" and "192.168@1.1" are invalid IPv4 addresses.
-
-
A valid IPv6 address is an IP in the form "x1:x2:x3:x4:x5:x6:x7:x8" where:
-
-
-
1 <= xi.length <= 4
-
xi is a hexadecimal string which may contain digits, lower-case English letter ('a' to 'f') and upper-case English letters ('A' to 'F').
-
Leading zeros are allowed in xi.
-
-
-
For example, "2001:0db8:85a3:0000:0000:8a2e:0370:7334" and "2001:db8:85a3:0:0:8A2E:0370:7334" are valid IPv6 addresses, while "2001:0db8:85a3::8A2E:037j:7334" and "02001:0db8:85a3:0000:0000:8a2e:0370:7334" are invalid IPv6 addresses.
-
-
-
Example 1:
-
-
-Input: IP = "172.16.254.1"
-Output: "IPv4"
-Explanation: This is a valid IPv4 address, return "IPv4".
-
-
-
Example 2:
-
-
-Input: IP = "2001:0db8:85a3:0:0:8A2E:0370:7334"
-Output: "IPv6"
-Explanation: This is a valid IPv6 address, return "IPv6".
-
-
-
Example 3:
-
-
-Input: IP = "256.256.256.256"
-Output: "Neither"
-Explanation: This is neither a IPv4 address nor a IPv6 address.
-
-
-
Example 4:
-
-
-Input: IP = "2001:0db8:85a3:0:0:8A2E:0370:7334:"
-Output: "Neither"
-
-
-
Example 5:
-
-
-Input: IP = "1e1.4.5.6"
-Output: "Neither"
-
-
-
-
Constraints:
-
-
-
IP consists only of English letters, digits and the characters '.' and ':'.
Given two integer arrays pushed and popped each with distinct values, return true if this could have been the result of a sequence of push and pop operations on an initially empty stack, or false otherwise.
-
-
-
Example 1:
-
-
-Input: pushed = [1,2,3,4,5], popped = [4,5,3,2,1]
-Output: true
-Explanation: We might do the following sequence:
-push(1), push(2), push(3), push(4),
-pop() -> 4,
-push(5),
-pop() -> 5, pop() -> 3, pop() -> 2, pop() -> 1
-
-
-
Example 2:
-
-
-Input: pushed = [1,2,3,4,5], popped = [4,3,5,1,2]
-Output: false
-Explanation: 1 cannot be popped before 2.
-
One way to serialize a binary tree is to use preorder traversal. When we encounter a non-null node, we record the node's value. If it is a null node, we record using a sentinel value such as '#'.
-
-
For example, the above binary tree can be serialized to the string "9,3,4,#,#,1,#,#,2,#,6,#,#", where '#' represents a null node.
-
-
Given a string of comma-separated values preorder, return true if it is a correct preorder traversal serialization of a binary tree.
-
-
It is guaranteed that each comma-separated value in the string must be either an integer or a character '#' representing null pointer.
-
-
You may assume that the input format is always valid.
-
-
-
For example, it could never contain two consecutive commas, such as "1,,3".
-
-
-
Note: You are not allowed to reconstruct the tree.
In an alien language, surprisingly, they also use English lowercase letters, but possibly in a different order. The order of the alphabet is some permutation of lowercase letters.
-
-
Given a sequence of words written in the alien language, and the order of the alphabet, return true if and only if the given words are sorted lexicographically in this alien language.
-
-
-
Example 1:
-
-
-Input: words = ["hello","leetcode"], order = "hlabcdefgijkmnopqrstuvwxyz"
-Output: true
-Explanation: As 'h' comes before 'l' in this language, then the sequence is sorted.
-
-
-
Example 2:
-
-
-Input: words = ["word","world","row"], order = "worldabcefghijkmnpqstuvxyz"
-Output: false
-Explanation: As 'd' comes after 'l' in this language, then words[0] > words[1], hence the sequence is unsorted.
-
-
-
Example 3:
-
-
-Input: words = ["apple","app"], order = "abcdefghijklmnopqrstuvwxyz"
-Output: false
-Explanation: The first three characters "app" match, and the second string is shorter (in size.) According to lexicographical rules "apple" > "app", because 'l' > '∅', where '∅' is defined as the blank character which is less than any other character (More info).
-
-
-
-
Constraints:
-
-
-
1 <= words.length <= 100
-
1 <= words[i].length <= 20
-
order.length == 26
-
All characters in words[i] and order are English lowercase letters.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
diff --git a/problems/verifying-an-alien-dictionary/verifying_an_alien_dictionary.go b/problems/verifying-an-alien-dictionary/verifying_an_alien_dictionary.go
deleted file mode 100644
index 62345ee09..000000000
--- a/problems/verifying-an-alien-dictionary/verifying_an_alien_dictionary.go
+++ /dev/null
@@ -1,21 +0,0 @@
-package problem953
-
-func isAlienSorted(words []string, order string) bool {
- m := make(map[byte]int)
- for i := len(order) - 1; i >= 0; i-- {
- m[order[i]] = i
- }
- if len(words) > 1 {
- for pre, word := range words[1:] {
- l, wl := len(words[pre]), len(word)
- for i := 0; i < l; i++ {
- if wl <= i || m[words[pre][i]] > m[word[i]] {
- return false
- } else if m[words[pre][i]] < m[word[i]] {
- break
- }
- }
- }
- }
- return true
-}
diff --git a/problems/verifying-an-alien-dictionary/verifying_an_alien_dictionary_test.go b/problems/verifying-an-alien-dictionary/verifying_an_alien_dictionary_test.go
deleted file mode 100644
index 60f69fba5..000000000
--- a/problems/verifying-an-alien-dictionary/verifying_an_alien_dictionary_test.go
+++ /dev/null
@@ -1,35 +0,0 @@
-package problem953
-
-import "testing"
-
-type testType struct {
- words []string
- order string
- want bool
-}
-
-func TestIsAlienSorted(t *testing.T) {
- tests := [...]testType{
- {
- words: []string{"hello", "leetcode"},
- order: "hlabcdefgijkmnopqrstuvwxyz",
- want: true,
- },
- {
- words: []string{"word", "world", "row"},
- order: "worldabcefghijkmnpqstuvxyz",
- want: false,
- },
- {
- words: []string{"apple", "app"},
- order: "abcdefghijklmnopqrstuvwxyz",
- want: false,
- },
- }
- for _, tt := range tests {
- got := isAlienSorted(tt.words, tt.order)
- if got != tt.want {
- t.Fatalf("in: %v, got: %v, want: %v", tt.words, got, tt.want)
- }
- }
-}
diff --git a/problems/vertical-order-traversal-of-a-binary-tree/README.md b/problems/vertical-order-traversal-of-a-binary-tree/README.md
deleted file mode 100644
index b82b15314..000000000
--- a/problems/vertical-order-traversal-of-a-binary-tree/README.md
+++ /dev/null
@@ -1,72 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../interval-list-intersections "Interval List Intersections")
-
-[Next >](../smallest-string-starting-from-leaf "Smallest String Starting From Leaf")
-
-## [987. Vertical Order Traversal of a Binary Tree (Hard)](https://leetcode.com/problems/vertical-order-traversal-of-a-binary-tree "二叉树的垂序遍历")
-
-
Given the root of a binary tree, calculate the vertical order traversal of the binary tree.
-
-
For each node at position (row, col), its left and right children will be at positions (row + 1, col - 1) and (row + 1, col + 1) respectively. The root of the tree is at (0, 0).
-
-
The vertical order traversal of a binary tree is a list of top-to-bottom orderings for each column index starting from the leftmost column and ending on the rightmost column. There may be multiple nodes in the same row and same column. In such a case, sort these nodes by their values.
-
-
Return the vertical order traversal of the binary tree.
-
-
-
Example 1:
-
-
-Input: root = [3,9,20,null,null,15,7]
-Output: [[9],[3,15],[20],[7]]
-Explanation:
-Column -1: Only node 9 is in this column.
-Column 0: Nodes 3 and 15 are in this column in that order from top to bottom.
-Column 1: Only node 20 is in this column.
-Column 2: Only node 7 is in this column.
-
-
Example 2:
-
-
-Input: root = [1,2,3,4,5,6,7]
-Output: [[4],[2],[1,5,6],[3],[7]]
-Explanation:
-Column -2: Only node 4 is in this column.
-Column -1: Only node 2 is in this column.
-Column 0: Nodes 1, 5, and 6 are in this column.
- 1 is at the top, so it comes first.
- 5 and 6 are at the same position (2, 0), so we order them by their value, 5 before 6.
-Column 1: Only node 3 is in this column.
-Column 2: Only node 7 is in this column.
-
-
-
Example 3:
-
-
-Input: root = [1,2,3,4,6,5,7]
-Output: [[4],[2],[1,5,6],[3],[7]]
-Explanation:
-This case is the exact same as example 2, but with nodes 5 and 6 swapped.
-Note that the solution remains the same since 5 and 6 are in the same location and should be ordered by their values.
-
-
-
-
Constraints:
-
-
-
The number of nodes in the tree is in the range [1, 1000].
You are given a series of video clips from a sporting event that lasted time seconds. These video clips can be overlapping with each other and have varying lengths.
-
-
Each video clip is described by an array clips where clips[i] = [starti, endi] indicates that the ith clip started at starti and ended at endi.
-
-
We can cut these clips into segments freely.
-
-
-
For example, a clip [0, 7] can be cut into segments [0, 1] + [1, 3] + [3, 7].
-
-
-
Return the minimum number of clips needed so that we can cut the clips into segments that cover the entire sporting event[0, time]. If the task is impossible, return -1.
-
-
-
Example 1:
-
-
-Input: clips = [[0,2],[4,6],[8,10],[1,9],[1,5],[5,9]], time = 10
-Output: 3
-Explanation: We take the clips [0,2], [8,10], [1,9]; a total of 3 clips.
-Then, we can reconstruct the sporting event as follows:
-We cut [1,9] into segments [1,2] + [2,8] + [8,9].
-Now we have segments [0,2] + [2,8] + [8,10] which cover the sporting event [0, 10].
-
-
-
Example 2:
-
-
-Input: clips = [[0,1],[1,2]], time = 5
-Output: -1
-Explanation: We cannot cover [0,5] with only [0,1] and [1,2].
-
-
-
Example 3:
-
-
-Input: clips = [[0,1],[6,8],[0,2],[5,6],[0,4],[0,3],[6,7],[1,3],[4,7],[1,4],[2,5],[2,6],[3,4],[4,5],[5,7],[6,9]], time = 9
-Output: 3
-Explanation: We can take clips [0,4], [4,7], and [6,9].
-
-
-
-
Constraints:
-
-
-
1 <= clips.length <= 100
-
0 <= starti <= endi <= 100
-
1 <= time <= 100
-
-
-### Related Topics
- [[Greedy](../../tag/greedy/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Hints
-
-Hint 1
-What if we sort the intervals? Considering the sorted intervals, how can we solve the problem with dynamic programming?
-
-
-
-Hint 2
-Let's consider a DP(pos, limit) where pos represents the position of the current interval we are gonna take the decision and limit is the current covered area from [0 - limit]. This DP returns the minimum number of taken intervals or infinite if it's not possible to cover the [0 - T] section.
-
diff --git a/problems/video-stitching/video_stitching.go b/problems/video-stitching/video_stitching.go
deleted file mode 100644
index 2c1da3f0f..000000000
--- a/problems/video-stitching/video_stitching.go
+++ /dev/null
@@ -1,31 +0,0 @@
-package problem1024
-
-import "sort"
-
-func videoStitching(clips [][]int, T int) int {
- sort.Slice(clips, func(i int, j int) bool {
- return clips[i][0] < clips[j][0]
- })
-
- res := 0
-
- for i, start, end := 0, 0, 0; start < T; start = end {
- for i < len(clips) && clips[i][0] <= start {
- end = max(end, clips[i][1])
- i++
- }
- if start == end {
- return -1
- }
- res++
- }
-
- return res
-}
-
-func max(a, b int) int {
- if a > b {
- return a
- }
- return b
-}
diff --git a/problems/vowel-spellchecker/README.md b/problems/vowel-spellchecker/README.md
deleted file mode 100644
index b63489799..000000000
--- a/problems/vowel-spellchecker/README.md
+++ /dev/null
@@ -1,66 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../univalued-binary-tree "Univalued Binary Tree")
-
-[Next >](../numbers-with-same-consecutive-differences "Numbers With Same Consecutive Differences")
-
-## [966. Vowel Spellchecker (Medium)](https://leetcode.com/problems/vowel-spellchecker "元音拼写检查器")
-
-
Given a wordlist, we want to implement a spellchecker that converts a query word into a correct word.
-
-
For a given query word, the spell checker handles two categories of spelling mistakes:
-
-
-
Capitalization: If the query matches a word in the wordlist (case-insensitive), then the query word is returned with the same case as the case in the wordlist.
-
Vowel Errors: If after replacing the vowels ('a', 'e', 'i', 'o', 'u') of the query word with any vowel individually, it matches a word in the wordlist (case-insensitive), then the query word is returned with the same case as the match in the wordlist.
-
wordlist[i] and queries[i] consist only of only English letters.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Hash Table](../../tag/hash-table/README.md)]
- [[String](../../tag/string/README.md)]
diff --git a/problems/vowel-spellchecker/vowel_spellchecker.go b/problems/vowel-spellchecker/vowel_spellchecker.go
deleted file mode 100644
index a6f485bae..000000000
--- a/problems/vowel-spellchecker/vowel_spellchecker.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem966
diff --git a/problems/vowels-of-all-substrings/README.md b/problems/vowels-of-all-substrings/README.md
deleted file mode 100644
index a508e72c8..000000000
--- a/problems/vowels-of-all-substrings/README.md
+++ /dev/null
@@ -1,77 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../count-vowel-substrings-of-a-string "Count Vowel Substrings of a String")
-
-[Next >](../minimized-maximum-of-products-distributed-to-any-store "Minimized Maximum of Products Distributed to Any Store")
-
-## [2063. Vowels of All Substrings (Medium)](https://leetcode.com/problems/vowels-of-all-substrings "所有子字符串中的元音")
-
-
Given a string word, return the sum of the number of vowels ('a', 'e','i','o', and'u')in every substring of word.
-
-
A substring is a contiguous (non-empty) sequence of characters within a string.
-
-
Note: Due to the large constraints, the answer may not fit in a signed 32-bit integer. Please be careful during the calculations.
-
-
-
Example 1:
-
-
-Input: word = "aba"
-Output: 6
-Explanation:
-All possible substrings are: "a", "ab", "aba", "b", "ba", and "a".
-- "b" has 0 vowels in it
-- "a", "ab", "ba", and "a" have 1 vowel each
-- "aba" has 2 vowels in it
-Hence, the total sum of vowels = 0 + 1 + 1 + 1 + 1 + 2 = 6.
-
-
-
Example 2:
-
-
-Input: word = "abc"
-Output: 3
-Explanation:
-All possible substrings are: "a", "ab", "abc", "b", "bc", and "c".
-- "a", "ab", and "abc" have 1 vowel each
-- "b", "bc", and "c" have 0 vowels each
-Hence, the total sum of vowels = 1 + 1 + 1 + 0 + 0 + 0 = 3.
-
-
-
Example 3:
-
-
-Input: word = "ltcd"
-Output: 0
-Explanation: There are no vowels in any substring of "ltcd".
-
-
-
-
Constraints:
-
-
-
1 <= word.length <= 105
-
word consists of lowercase English letters.
-
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
- [[String](../../tag/string/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Combinatorics](../../tag/combinatorics/README.md)]
-
-### Hints
-
-Hint 1
-Since generating substrings is not an option, can we count the number of substrings a vowel appears in?
-
-
-
-Hint 2
-How much does each vowel contribute to the total sum?
-
diff --git a/problems/walking-robot-simulation-ii/README.md b/problems/walking-robot-simulation-ii/README.md
deleted file mode 100644
index 89f18a29f..000000000
--- a/problems/walking-robot-simulation-ii/README.md
+++ /dev/null
@@ -1,88 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../check-whether-two-strings-are-almost-equivalent "Check Whether Two Strings are Almost Equivalent")
-
-[Next >](../most-beautiful-item-for-each-query "Most Beautiful Item for Each Query")
-
-## [2069. Walking Robot Simulation II (Medium)](https://leetcode.com/problems/walking-robot-simulation-ii "模拟行走机器人 II")
-
-
A width x height grid is on an XY-plane with the bottom-left cell at (0, 0) and the top-right cell at (width - 1, height - 1). The grid is aligned with the four cardinal directions ("North", "East", "South", and "West"). A robot is initially at cell (0, 0) facing direction "East".
-
-
The robot can be instructed to move for a specific number of steps. For each step, it does the following.
-
-
-
Attempts to move forward one cell in the direction it is facing.
-
If the cell the robot is moving to is out of bounds, the robot instead turns 90 degrees counterclockwise and retries the step.
-
-
-
After the robot finishes moving the number of steps required, it stops and awaits the next instruction.
-
-
Implement the Robot class:
-
-
-
Robot(int width, int height) Initializes the width x height grid with the robot at (0, 0) facing "East".
-
void step(int num) Instructs the robot to move forward num steps.
-
int[] getPos() Returns the current cell the robot is at, as an array of length 2, [x, y].
-
String getDir() Returns the current direction of the robot, "North", "East", "South", or "West".
-
-
-
-
Example 1:
-
-
-Input
-["Robot", "move", "move", "getPos", "getDir", "move", "move", "move", "getPos", "getDir"]
-[[6, 3], [2], [2], [], [], [2], [1], [4], [], []]
-Output
-[null, null, null, [4, 0], "East", null, null, null, [1, 2], "West"]
-
-Explanation
-Robot robot = new Robot(6, 3); // Initialize the grid and the robot at (0, 0) facing East.
-robot.move(2); // It moves two steps East to (2, 0), and faces East.
-robot.move(2); // It moves two steps East to (4, 0), and faces East.
-robot.getPos(); // return [4, 0]
-robot.getDir(); // return "East"
-robot.move(2); // It moves one step East to (5, 0), and faces East.
- // Moving the next step East would be out of bounds, so it turns and faces North.
- // Then, it moves one step North to (5, 1), and faces North.
-robot.move(1); // It moves one step North to (5, 2), and faces North (not West).
-robot.move(4); // Moving the next step North would be out of bounds, so it turns and faces West.
- // Then, it moves four steps West to (1, 2), and faces West.
-robot.getPos(); // return [1, 2]
-robot.getDir(); // return "West"
-
-
-
-
-
Constraints:
-
-
-
2 <= width, height <= 100
-
1 <= num <= 105
-
At most 104 calls in total will be made to step, getPos, and getDir.
-
-
-### Related Topics
- [[Design](../../tag/design/README.md)]
- [[Simulation](../../tag/simulation/README.md)]
-
-### Hints
-
-Hint 1
-The robot only moves along the perimeter of the grid. Can you think if modulus can help you quickly compute which cell it stops at?
-
-
-
-Hint 2
-After the robot moves one time, whenever the robot stops at some cell, it will always face a specific direction. i.e., The direction it faces is determined by the cell it stops at.
-
-
-
-Hint 3
-Can you precompute what direction it faces when it stops at each cell along the perimeter, and reuse the results?
-
diff --git a/problems/walking-robot-simulation/README.md b/problems/walking-robot-simulation/README.md
deleted file mode 100644
index d73a44053..000000000
--- a/problems/walking-robot-simulation/README.md
+++ /dev/null
@@ -1,77 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../length-of-longest-fibonacci-subsequence "Length of Longest Fibonacci Subsequence")
-
-[Next >](../koko-eating-bananas "Koko Eating Bananas")
-
-## [874. Walking Robot Simulation (Easy)](https://leetcode.com/problems/walking-robot-simulation "模拟行走机器人")
-
-
A robot on an infinite XY-plane starts at point (0, 0) and faces north. The robot can receive one of three possible types of commands:
-
-
-
-2: turn left 90 degrees,
-
-1: turn right 90 degrees, or
-
1 <= k <= 9: move forward k units.
-
-
-
Some of the grid squares are obstacles. The ith obstacle is at grid point obstacles[i] = (xi, yi).
-
-
If the robot would try to move onto them, the robot stays on the previous grid square instead (but still continues following the rest of the route.)
-
-
Return the maximum Euclidean distance that the robot will be from the origin squared (i.e. if the distance is 5, return 25).
-
-
Note:
-
-
-
North means +Y direction.
-
East means +X direction.
-
South means -Y direction.
-
West means -X direction.
-
-
-
-
Example 1:
-
-
-Input: commands = [4,-1,3], obstacles = []
-Output: 25
-Explanation: The robot starts at (0, 0):
-1. Move north 4 units to (0, 4).
-2. Turn right.
-3. Move east 3 units to (3, 4).
-The furthest point away from the origin is (3, 4), which is 32 + 42 = 25 units away.
-
-
-
Example 2:
-
-
-Input: commands = [4,-1,4,-2,4], obstacles = [[2,4]]
-Output: 65
-Explanation: The robot starts at (0, 0):
-1. Move north 4 units to (0, 4).
-2. Turn right.
-3. Move east 1 unit and get blocked by the obstacle at (2, 4), robot is at (1, 4).
-4. Turn left.
-5. Move north 4 units to (1, 8).
-The furthest point away from the origin is (1, 8), which is 12 + 82 = 65 units away.
-
-
-
-
Constraints:
-
-
-
1 <= commands.length <= 104
-
commands[i] is one of the values in the list [-2,-1,1,2,3,4,5,6,7,8,9].
You are given a m x n 2D grid initialized with these three possible values.
-
-
-
-1 - A wall or an obstacle.
-
0 - A gate.
-
INF - Infinity means an empty room. We use the value 231 - 1 = 2147483647 to represent INF as you may assume that the distance to a gate is less than 2147483647.
-
-
-
Fill each empty room with the distance to its nearest gate. If it is impossible to reach a gate, it should be filled with INF.
You are given two jugs with capacities jug1Capacity and jug2Capacity liters. There is an infinite amount of water supply available. Determine whether it is possible to measure exactly targetCapacity liters using these two jugs.
-
-
If targetCapacity liters of water are measurable, you must have targetCapacity liters of water contained within one or both buckets by the end.
-
-
Operations allowed:
-
-
-
Fill any of the jugs with water.
-
Empty any of the jugs.
-
Pour water from one jug into another till the other jug is completely full, or the first jug itself is empty.
-
-
-
-
Example 1:
-
-
-Input: jug1Capacity = 3, jug2Capacity = 5, targetCapacity = 4
-Output: true
-Explanation: The famous Die Hard example
-
-
-### Related Topics
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Math](../../tag/math/README.md)]
diff --git a/problems/water-and-jug-problem/water_and_jug_problem.go b/problems/water-and-jug-problem/water_and_jug_problem.go
deleted file mode 100644
index 860a790a1..000000000
--- a/problems/water-and-jug-problem/water_and_jug_problem.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem365
diff --git a/problems/water-and-jug-problem/water_and_jug_problem_test.go b/problems/water-and-jug-problem/water_and_jug_problem_test.go
deleted file mode 100644
index 860a790a1..000000000
--- a/problems/water-and-jug-problem/water_and_jug_problem_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem365
diff --git a/problems/water-bottles/README.md b/problems/water-bottles/README.md
deleted file mode 100644
index b299bdd88..000000000
--- a/problems/water-bottles/README.md
+++ /dev/null
@@ -1,55 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../find-users-with-valid-e-mails "Find Users With Valid E-Mails")
-
-[Next >](../number-of-nodes-in-the-sub-tree-with-the-same-label "Number of Nodes in the Sub-Tree With the Same Label")
-
-## [1518. Water Bottles (Easy)](https://leetcode.com/problems/water-bottles "换酒问题")
-
-
There are numBottles water bottles that are initially full of water. You can exchange numExchange empty water bottles from the market with one full water bottle.
-
-
The operation of drinking a full water bottle turns it into an empty bottle.
-
-
Given the two integers numBottles and numExchange, return the maximum number of water bottles you can drink.
-
-
-
Example 1:
-
-
-Input: numBottles = 9, numExchange = 3
-Output: 13
-Explanation: You can exchange 3 empty bottles to get 1 full water bottle.
-Number of water bottles you can drink: 9 + 3 + 1 = 13.
-
-
-
Example 2:
-
-
-Input: numBottles = 15, numExchange = 4
-Output: 19
-Explanation: You can exchange 4 empty bottles to get 1 full water bottle.
-Number of water bottles you can drink: 15 + 3 + 1 = 19.
-
-
-
-
Constraints:
-
-
-
1 <= numBottles <= 100
-
2 <= numExchange <= 100
-
-
-### Related Topics
- [[Math](../../tag/math/README.md)]
- [[Simulation](../../tag/simulation/README.md)]
-
-### Hints
-
-Hint 1
-Simulate the process until there are not enough empty bottles for even one full bottle of water.
-
diff --git a/problems/watering-plants-ii/README.md b/problems/watering-plants-ii/README.md
deleted file mode 100644
index 1d68c1646..000000000
--- a/problems/watering-plants-ii/README.md
+++ /dev/null
@@ -1,94 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../sum-of-subarray-ranges "Sum of Subarray Ranges")
-
-[Next >](../maximum-fruits-harvested-after-at-most-k-steps "Maximum Fruits Harvested After at Most K Steps")
-
-## [2105. Watering Plants II (Medium)](https://leetcode.com/problems/watering-plants-ii "给植物浇水 II")
-
-
Alice and Bob want to water n plants in their garden. The plants are arranged in a row and are labeled from 0 to n - 1 from left to right where the ith plant is located at x = i.
-
-
Each plant needs a specific amount of water. Alice and Bob have a watering can each, initially full. They water the plants in the following way:
-
-
-
Alice waters the plants in order from left to right, starting from the 0th plant. Bob waters the plants in order from right to left, starting from the (n - 1)th plant. They begin watering the plants simultaneously.
-
It takes the same amount of time to water each plant regardless of how much water it needs.
-
Alice/Bob must water the plant if they have enough in their can to fully water it. Otherwise, they first refill their can (instantaneously) then water the plant.
-
In case both Alice and Bob reach the same plant, the one with more water currently in his/her watering can should water this plant. If they have the same amount of water, then Alice should water this plant.
-
-
-
Given a 0-indexed integer array plants of n integers, where plants[i] is the amount of water the ith plant needs, and two integers capacityA and capacityB representing the capacities of Alice's and Bob's watering cans respectively, return the number of times they have to refill to water all the plants.
-
-
-
Example 1:
-
-
-Input: plants = [2,2,3,3], capacityA = 5, capacityB = 5
-Output: 1
-Explanation:
-- Initially, Alice and Bob have 5 units of water each in their watering cans.
-- Alice waters plant 0, Bob waters plant 3.
-- Alice and Bob now have 3 units and 2 units of water respectively.
-- Alice has enough water for plant 1, so she waters it. Bob does not have enough water for plant 2, so he refills his can then waters it.
-So, the total number of times they have to refill to water all the plants is 0 + 0 + 1 + 0 = 1.
-
-
-
Example 2:
-
-
-Input: plants = [2,2,3,3], capacityA = 3, capacityB = 4
-Output: 2
-Explanation:
-- Initially, Alice and Bob have 3 units and 4 units of water in their watering cans respectively.
-- Alice waters plant 0, Bob waters plant 3.
-- Alice and Bob now have 1 unit of water each, and need to water plants 1 and 2 respectively.
-- Since neither of them have enough water for their current plants, they refill their cans and then water the plants.
-So, the total number of times they have to refill to water all the plants is 0 + 1 + 1 + 0 = 2.
-
-
-
Example 3:
-
-
-Input: plants = [5], capacityA = 10, capacityB = 8
-Output: 0
-Explanation:
-- There is only one plant.
-- Alice's watering can has 10 units of water, whereas Bob's can has 8 units. Since Alice has more water in her can, she waters this plant.
-So, the total number of times they have to refill is 0.
-
-
-
-
Constraints:
-
-
-
n == plants.length
-
1 <= n <= 105
-
1 <= plants[i] <= 106
-
max(plants[i]) <= capacityA, capacityB <= 109
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Two Pointers](../../tag/two-pointers/README.md)]
- [[Simulation](../../tag/simulation/README.md)]
-
-### Hints
-
-Hint 1
-Try "simulating" the process.
-
-
-
-Hint 2
-Since watering each plant takes the same amount of time, where will Alice and Bob meet if they start watering the plants simultaneously? How can you use this to optimize your solution?
-
-
-
-Hint 3
-What will you do when both Alice and Bob have to water the same plant?
-
diff --git a/problems/watering-plants/README.md b/problems/watering-plants/README.md
deleted file mode 100644
index a130195d4..000000000
--- a/problems/watering-plants/README.md
+++ /dev/null
@@ -1,88 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../two-furthest-houses-with-different-colors "Two Furthest Houses With Different Colors")
-
-[Next >](../range-frequency-queries "Range Frequency Queries")
-
-## [2079. Watering Plants (Medium)](https://leetcode.com/problems/watering-plants "给植物浇水")
-
-
You want to water n plants in your garden with a watering can. The plants are arranged in a row and are labeled from 0 to n - 1 from left to right where the ith plant is located at x = i. There is a river at x = -1 that you can refill your watering can at.
-
-
Each plant needs a specific amount of water. You will water the plants in the following way:
-
-
-
Water the plants in order from left to right.
-
After watering the current plant, if you do not have enough water to completely water the next plant, return to the river to fully refill the watering can.
-
You cannot refill the watering can early.
-
-
-
You are initially at the river (i.e., x = -1). It takes one step to move one unit on the x-axis.
-
-
Given a 0-indexed integer array plants of n integers, where plants[i] is the amount of water the ith plant needs, and an integer capacity representing the watering can capacity, return the number of steps needed to water all the plants.
-
-
-
Example 1:
-
-
-Input: plants = [2,2,3,3], capacity = 5
-Output: 14
-Explanation: Start at the river with a full watering can:
-- Walk to plant 0 (1 step) and water it. Watering can has 3 units of water.
-- Walk to plant 1 (1 step) and water it. Watering can has 1 unit of water.
-- Since you cannot completely water plant 2, walk back to the river to refill (2 steps).
-- Walk to plant 2 (3 steps) and water it. Watering can has 2 units of water.
-- Since you cannot completely water plant 3, walk back to the river to refill (3 steps).
-- Walk to plant 3 (4 steps) and water it.
-Steps needed = 1 + 1 + 2 + 3 + 3 + 4 = 14.
-
-
-
Example 2:
-
-
-Input: plants = [1,1,1,4,2,3], capacity = 4
-Output: 30
-Explanation: Start at the river with a full watering can:
-- Water plants 0, 1, and 2 (3 steps). Return to river (3 steps).
-- Water plant 3 (4 steps). Return to river (4 steps).
-- Water plant 4 (5 steps). Return to river (5 steps).
-- Water plant 5 (6 steps).
-Steps needed = 3 + 3 + 4 + 4 + 5 + 5 + 6 = 30.
-
-
-
Example 3:
-
-
-Input: plants = [7,7,7,7,7,7,7], capacity = 8
-Output: 49
-Explanation: You have to refill before watering each plant.
-Steps needed = 1 + 1 + 2 + 2 + 3 + 3 + 4 + 4 + 5 + 5 + 6 + 6 + 7 = 49.
-
-
-
-
Constraints:
-
-
-
n == plants.length
-
1 <= n <= 1000
-
1 <= plants[i] <= 106
-
max(plants[i]) <= capacity <= 109
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
-
-### Hints
-
-Hint 1
-Simulate the process.
-
-
-
-Hint 2
-Return to refill the container once you meet a plant that needs more water than you have.
-
diff --git a/problems/ways-to-make-a-fair-array/README.md b/problems/ways-to-make-a-fair-array/README.md
deleted file mode 100644
index b09a128d7..000000000
--- a/problems/ways-to-make-a-fair-array/README.md
+++ /dev/null
@@ -1,79 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../smallest-string-with-a-given-numeric-value "Smallest String With A Given Numeric Value")
-
-[Next >](../minimum-initial-energy-to-finish-tasks "Minimum Initial Energy to Finish Tasks")
-
-## [1664. Ways to Make a Fair Array (Medium)](https://leetcode.com/problems/ways-to-make-a-fair-array "生成平衡数组的方案数")
-
-
You are given an integer array nums. You can choose exactly one index (0-indexed) and remove the element. Notice that the index of the elements may change after the removal.
-
-
For example, if nums = [6,1,7,4,1]:
-
-
-
Choosing to remove index 1 results in nums = [6,7,4,1].
-
Choosing to remove index 2 results in nums = [6,1,4,1].
-
Choosing to remove index 4 results in nums = [6,1,7,4].
-
-
-
An array is fair if the sum of the odd-indexed values equals the sum of the even-indexed values.
-
-
Return the number of indices that you could choose such that after the removal, numsis fair.
-
-
-
Example 1:
-
-
-Input: nums = [2,1,6,4]
-Output: 1
-Explanation:
-Remove index 0: [1,6,4] -> Even sum: 1 + 4 = 5. Odd sum: 6. Not fair.
-Remove index 1: [2,6,4] -> Even sum: 2 + 4 = 6. Odd sum: 6. Fair.
-Remove index 2: [2,1,4] -> Even sum: 2 + 4 = 6. Odd sum: 1. Not fair.
-Remove index 3: [2,1,6] -> Even sum: 2 + 6 = 8. Odd sum: 1. Not fair.
-There is 1 index that you can remove to make nums fair.
-
-
-
Example 2:
-
-
-Input: nums = [1,1,1]
-Output: 3
-Explanation: You can remove any index and the remaining array is fair.
-
-
-
Example 3:
-
-
-Input: nums = [1,2,3]
-Output: 0
-Explanation: You cannot make a fair array after removing any index.
-
-
-
-
Constraints:
-
-
-
1 <= nums.length <= 105
-
1 <= nums[i] <= 104
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
-
-### Hints
-
-Hint 1
-The parity of the indices after the removed element changes.
-
-
-
-Hint 2
-Calculate prefix sums for even and odd indices separately to calculate for each index in O(1).
-
diff --git a/problems/ways-to-split-array-into-three-subarrays/README.md b/problems/ways-to-split-array-into-three-subarrays/README.md
deleted file mode 100644
index f9621b2da..000000000
--- a/problems/ways-to-split-array-into-three-subarrays/README.md
+++ /dev/null
@@ -1,80 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../count-good-meals "Count Good Meals")
-
-[Next >](../minimum-operations-to-make-a-subsequence "Minimum Operations to Make a Subsequence")
-
-## [1712. Ways to Split Array Into Three Subarrays (Medium)](https://leetcode.com/problems/ways-to-split-array-into-three-subarrays "将数组分成三个子数组的方案数")
-
-
A split of an integer array is good if:
-
-
-
The array is split into three non-empty contiguous subarrays - named left, mid, right respectively from left to right.
-
The sum of the elements in left is less than or equal to the sum of the elements in mid, and the sum of the elements in mid is less than or equal to the sum of the elements in right.
-
-
-
Given nums, an array of non-negative integers, return the number of good ways to splitnums. As the number may be too large, return it modulo109 + 7.
-
-
-
Example 1:
-
-
-Input: nums = [1,1,1]
-Output: 1
-Explanation: The only good way to split nums is [1] [1] [1].
-
-
Example 2:
-
-
-Input: nums = [1,2,2,2,5,0]
-Output: 3
-Explanation: There are three good ways of splitting nums:
-[1] [2] [2,2,5,0]
-[1] [2,2] [2,5,0]
-[1,2] [2,2] [5,0]
-
-
-
Example 3:
-
-
-Input: nums = [3,2,1]
-Output: 0
-Explanation: There is no good way to split nums.
-
-
-
Constraints:
-
-
-
3 <= nums.length <= 105
-
0 <= nums[i] <= 104
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[Two Pointers](../../tag/two-pointers/README.md)]
- [[Binary Search](../../tag/binary-search/README.md)]
- [[Prefix Sum](../../tag/prefix-sum/README.md)]
-
-### Similar Questions
- 1. [Number of Ways to Divide a Long Corridor](../number-of-ways-to-divide-a-long-corridor) (Hard)
-
-### Hints
-
-Hint 1
-Create a prefix array to efficiently find the sum of subarrays.
-
-
-
-Hint 2
-As we are dividing the array into three subarrays, there are two "walls". Iterate over the right wall positions and find where the left wall could be for each right wall position.
-
-
-
-Hint 3
-Use binary search to find the left-most position and right-most position the left wall could be.
-
diff --git a/problems/weather-type-in-each-country/README.md b/problems/weather-type-in-each-country/README.md
deleted file mode 100644
index a58e2ea24..000000000
--- a/problems/weather-type-in-each-country/README.md
+++ /dev/null
@@ -1,99 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../shortest-path-in-a-grid-with-obstacles-elimination "Shortest Path in a Grid with Obstacles Elimination")
-
-[Next >](../find-numbers-with-even-number-of-digits "Find Numbers with Even Number of Digits")
-
-## [1294. Weather Type in Each Country (Easy)](https://leetcode.com/problems/weather-type-in-each-country "不同国家的天气类型")
-
-
Table: Countries
-
-+---------------+---------+
-| Column Name | Type |
-+---------------+---------+
-| country_id | int |
-| country_name | varchar |
-+---------------+---------+
-country_id is the primary key for this table.
-Each row of this table contains the ID and the name of one country.
-
-
-
Table: Weather
-
-+---------------+---------+
-| Column Name | Type |
-+---------------+---------+
-| country_id | int |
-| weather_state | varchar |
-| day | date |
-+---------------+---------+
-(country_id, day) is the primary key for this table.
-Each row of this table indicates the weather state in a country for one day.
-
-
-Write an SQL query to find the type of weather in each country for November 2019.
-
-The type of weather is Cold if the average weather_state is less than or equal 15, Hot if the average weather_state is greater than or equal 25 and Warm otherwise.
-
-Return result table in any order.
-
-The query result format is in the following example:
-
-Countries table:
-+------------+--------------+
-| country_id | country_name |
-+------------+--------------+
-| 2 | USA |
-| 3 | Australia |
-| 7 | Peru |
-| 5 | China |
-| 8 | Morocco |
-| 9 | Spain |
-+------------+--------------+
-Weather table:
-+------------+---------------+------------+
-| country_id | weather_state | day |
-+------------+---------------+------------+
-| 2 | 15 | 2019-11-01 |
-| 2 | 12 | 2019-10-28 |
-| 2 | 12 | 2019-10-27 |
-| 3 | -2 | 2019-11-10 |
-| 3 | 0 | 2019-11-11 |
-| 3 | 3 | 2019-11-12 |
-| 5 | 16 | 2019-11-07 |
-| 5 | 18 | 2019-11-09 |
-| 5 | 21 | 2019-11-23 |
-| 7 | 25 | 2019-11-28 |
-| 7 | 22 | 2019-12-01 |
-| 7 | 20 | 2019-12-02 |
-| 8 | 25 | 2019-11-05 |
-| 8 | 27 | 2019-11-15 |
-| 8 | 31 | 2019-11-25 |
-| 9 | 7 | 2019-10-23 |
-| 9 | 3 | 2019-12-23 |
-+------------+---------------+------------+
-Result table:
-+--------------+--------------+
-| country_name | weather_type |
-+--------------+--------------+
-| USA | Cold |
-| Austraila | Cold |
-| Peru | Hot |
-| China | Warm |
-| Morocco | Hot |
-+--------------+--------------+
-Average weather_state in USA in November is (15) / 1 = 15 so weather type is Cold.
-Average weather_state in Austraila in November is (-2 + 0 + 3) / 3 = 0.333 so weather type is Cold.
-Average weather_state in Peru in November is (25) / 1 = 25 so weather type is Hot.
-Average weather_state in China in November is (16 + 18 + 21) / 3 = 18.333 so weather type is Warm.
-Average weather_state in Morocco in November is (25 + 27 + 31) / 3 = 27.667 so weather type is Hot.
-We know nothing about average weather_state in Spain in November so we don't include it in the result table.
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/weather-type-in-each-country/mysql_schemas.sql b/problems/weather-type-in-each-country/mysql_schemas.sql
deleted file mode 100644
index 047159d79..000000000
--- a/problems/weather-type-in-each-country/mysql_schemas.sql
+++ /dev/null
@@ -1,27 +0,0 @@
-Create table If Not Exists Countries (country_id int, country_name varchar(20));
-Create table If Not Exists Weather (country_id int, weather_state int, day date);
-Truncate table Countries;
-insert into Countries (country_id, country_name) values ('2', 'USA');
-insert into Countries (country_id, country_name) values ('3', 'Australia');
-insert into Countries (country_id, country_name) values ('7', 'Peru');
-insert into Countries (country_id, country_name) values ('5', 'China');
-insert into Countries (country_id, country_name) values ('8', 'Morocco');
-insert into Countries (country_id, country_name) values ('9', 'Spain');
-Truncate table Weather;
-insert into Weather (country_id, weather_state, day) values ('2', '15', '2019-11-01');
-insert into Weather (country_id, weather_state, day) values ('2', '12', '2019-10-28');
-insert into Weather (country_id, weather_state, day) values ('2', '12', '2019-10-27');
-insert into Weather (country_id, weather_state, day) values ('3', '-2', '2019-11-10');
-insert into Weather (country_id, weather_state, day) values ('3', '0', '2019-11-11');
-insert into Weather (country_id, weather_state, day) values ('3', '3', '2019-11-12');
-insert into Weather (country_id, weather_state, day) values ('5', '16', '2019-11-07');
-insert into Weather (country_id, weather_state, day) values ('5', '18', '2019-11-09');
-insert into Weather (country_id, weather_state, day) values ('5', '21', '2019-11-23');
-insert into Weather (country_id, weather_state, day) values ('7', '25', '2019-11-28');
-insert into Weather (country_id, weather_state, day) values ('7', '22', '2019-12-01');
-insert into Weather (country_id, weather_state, day) values ('7', '20', '2019-12-02');
-insert into Weather (country_id, weather_state, day) values ('8', '25', '2019-11-05');
-insert into Weather (country_id, weather_state, day) values ('8', '27', '2019-11-15');
-insert into Weather (country_id, weather_state, day) values ('8', '31', '2019-11-25');
-insert into Weather (country_id, weather_state, day) values ('9', '7', '2019-10-23');
-insert into Weather (country_id, weather_state, day) values ('9', '3', '2019-12-23');
diff --git a/problems/weather-type-in-each-country/weather_type_in_each_country.sql b/problems/weather-type-in-each-country/weather_type_in_each_country.sql
deleted file mode 100644
index 01fa68ac9..000000000
--- a/problems/weather-type-in-each-country/weather_type_in_each_country.sql
+++ /dev/null
@@ -1,11 +0,0 @@
-# Write your MySQL query statement below
-
-SELECT country_name,
- CASE
- WHEN avg(weather_state) <= 15 THEN "Cold"
- WHEN avg(weather_state) >= 25 THEN "Hot"
- ELSE "Warm" END AS weather_type
-FROM Countries
- INNER JOIN Weather ON Countries.country_id = Weather.country_id
-WHERE LEFT(DAY, 7) = '2019-11'
-GROUP BY country_name
diff --git a/problems/web-crawler-multithreaded/README.md b/problems/web-crawler-multithreaded/README.md
deleted file mode 100644
index 40b986e48..000000000
--- a/problems/web-crawler-multithreaded/README.md
+++ /dev/null
@@ -1,114 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../number-of-comments-per-post "Number of Comments per Post")
-
-[Next >](../array-transformation "Array Transformation")
-
-## [1242. Web Crawler Multithreaded (Medium)](https://leetcode.com/problems/web-crawler-multithreaded "多线程网页爬虫")
-
-
Given a url startUrl and an interface HtmlParser, implement a Multi-threaded web crawler to crawl all links that are under the same hostname as startUrl.
-
-
Return all urls obtained by your web crawler in any order.
-
-
Your crawler should:
-
-
-
Start from the page: startUrl
-
Call HtmlParser.getUrls(url) to get all urls from a webpage of given url.
-
Do not crawl the same link twice.
-
Explore only the links that are under the same hostname as startUrl.
-
-
-
-
-
As shown in the example url above, the hostname is example.org. For simplicity sake, you may assume all urls use http protocol without any port specified. For example, the urls http://leetcode.com/problems and http://leetcode.com/contest are under the same hostname, while urls http://example.org/test and http://example.com/abc are not under the same hostname.
-
-
The HtmlParser interface is defined as such:
-
-
-interface HtmlParser {
- // Return a list of all urls from a webpage of given url.
- // This is a blocking call, that means it will do HTTP request and return when this request is finished.
- public List<String> getUrls(String url);
-}
-
-
Note that getUrls(String url) simulates performing a HTTP request. You can treat it as a blocking function call which waits for a HTTP request to finish. It is guaranteed that getUrls(String url) will return the urls within 15ms. Single-threaded solutions will exceed the time limit so, can your multi-threaded web crawler do better?
-
-
Below are two examples explaining the functionality of the problem, for custom testing purposes you'll have three variables urls, edges and startUrl. Notice that you will only have access to startUrl in your code, while urls and edges are not directly accessible to you in code.
-
-
-
-
Follow up:
-
-
-
Assume we have 10,000 nodes and 1 billion URLs to crawl. We will deploy the same software onto each node. The software can know about all the nodes. We have to minimize communication between machines and make sure each node does equal amount of work. How would your web crawler design change?
-Input:
-urls = [
- "http://news.yahoo.com",
- "http://news.yahoo.com/news",
- "http://news.yahoo.com/news/topics/",
- "http://news.google.com"
-]
-edges = [[0,2],[2,1],[3,2],[3,1],[3,0]]
-startUrl = "http://news.google.com"
-Output: ["http://news.google.com"]
-Explanation: The startUrl links to all other pages that do not share the same hostname.
-
-
-
Constraints:
-
-
-
1 <= urls.length <= 1000
-
1 <= urls[i].length <= 300
-
startUrl is one of the urls.
-
Hostname label must be from 1 to 63 characters long, including the dots, may contain only the ASCII letters from 'a' to 'z', digits from '0' to '9' and the hyphen-minus character ('-').
-
The hostname may not start or end with the hyphen-minus character ('-').
You may assume there're no duplicates in url library.
-
-
-### Related Topics
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Concurrency](../../tag/concurrency/README.md)]
-
-### Similar Questions
- 1. [Web Crawler](../web-crawler) (Medium)
diff --git a/problems/web-crawler/README.md b/problems/web-crawler/README.md
deleted file mode 100644
index e6bd65041..000000000
--- a/problems/web-crawler/README.md
+++ /dev/null
@@ -1,108 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-profit-in-job-scheduling "Maximum Profit in Job Scheduling")
-
-[Next >](../find-positive-integer-solution-for-a-given-equation "Find Positive Integer Solution for a Given Equation")
-
-## [1236. Web Crawler (Medium)](https://leetcode.com/problems/web-crawler "网络爬虫")
-
-
Given a url startUrl and an interface HtmlParser, implement a web crawler to crawl all links that are under the same hostname as startUrl.
-
-
Return all urls obtained by your web crawler in any order.
-
-
Your crawler should:
-
-
-
Start from the page: startUrl
-
Call HtmlParser.getUrls(url) to get all urls from a webpage of given url.
-
Do not crawl the same link twice.
-
Explore only the links that are under the same hostname as startUrl.
-
-
-
-
-
As shown in the example url above, the hostname is example.org. For simplicity sake, you may assume all urls use http protocol without any port specified. For example, the urls http://leetcode.com/problems and http://leetcode.com/contest are under the same hostname, while urls http://example.org/test and http://example.com/abc are not under the same hostname.
-
-
The HtmlParser interface is defined as such:
-
-
-interface HtmlParser {
- // Return a list of all urls from a webpage of given url.
- public List<String> getUrls(String url);
-}
-
-
Below are two examples explaining the functionality of the problem, for custom testing purposes you'll have three variables urls, edges and startUrl. Notice that you will only have access to startUrl in your code, while urls and edges are not directly accessible to you in code.
-Input:
-urls = [
- "http://news.yahoo.com",
- "http://news.yahoo.com/news",
- "http://news.yahoo.com/news/topics/",
- "http://news.google.com"
-]
-edges = [[0,2],[2,1],[3,2],[3,1],[3,0]]
-startUrl = "http://news.google.com"
-Output: ["http://news.google.com"]
-Explanation: The startUrl links to all other pages that do not share the same hostname.
-
-
-
Constraints:
-
-
-
1 <= urls.length <= 1000
-
1 <= urls[i].length <= 300
-
startUrl is one of the urls.
-
Hostname label must be from 1 to 63 characters long, including the dots, may contain only the ASCII letters from 'a' to 'z', digits from '0' to '9' and the hyphen-minus character ('-').
-
The hostname may not start or end with the hyphen-minus character ('-').
You may assume there're no duplicates in url library.
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Breadth-First Search](../../tag/breadth-first-search/README.md)]
- [[Interactive](../../tag/interactive/README.md)]
-
-### Similar Questions
- 1. [Web Crawler Multithreaded](../web-crawler-multithreaded) (Medium)
-
-### Hints
-
-Hint 1
-Use DFS/BFS to search start from the startURL. Remember to get rid of duplicate URLs.
-
diff --git a/problems/where-will-the-ball-fall/README.md b/problems/where-will-the-ball-fall/README.md
deleted file mode 100644
index 5d79d418e..000000000
--- a/problems/where-will-the-ball-fall/README.md
+++ /dev/null
@@ -1,84 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../maximum-number-of-eaten-apples "Maximum Number of Eaten Apples")
-
-[Next >](../maximum-xor-with-an-element-from-array "Maximum XOR With an Element From Array")
-
-## [1706. Where Will the Ball Fall (Medium)](https://leetcode.com/problems/where-will-the-ball-fall "球会落何处")
-
-
You have a 2-D grid of size m x n representing a box, and you have n balls. The box is open on the top and bottom sides.
-
-
Each cell in the box has a diagonal board spanning two corners of the cell that can redirect a ball to the right or to the left.
-
-
-
A board that redirects the ball to the right spans the top-left corner to the bottom-right corner and is represented in the grid as 1.
-
A board that redirects the ball to the left spans the top-right corner to the bottom-left corner and is represented in the grid as -1.
-
-
-
We drop one ball at the top of each column of the box. Each ball can get stuck in the box or fall out of the bottom. A ball gets stuck if it hits a "V" shaped pattern between two boards or if a board redirects the ball into either wall of the box.
-
-
Return an array answer of size n where answer[i] is the column that the ball falls out of at the bottom after dropping the ball from the ith column at the top, or -1 if the ball gets stuck in the box.
-
-
-
Example 1:
-
-
-
-
-Input: grid = [[1,1,1,-1,-1],[1,1,1,-1,-1],[-1,-1,-1,1,1],[1,1,1,1,-1],[-1,-1,-1,-1,-1]]
-Output: [1,-1,-1,-1,-1]
-Explanation: This example is shown in the photo.
-Ball b0 is dropped at column 0 and falls out of the box at column 1.
-Ball b1 is dropped at column 1 and will get stuck in the box between column 2 and 3 and row 1.
-Ball b2 is dropped at column 2 and will get stuck on the box between column 2 and 3 and row 0.
-Ball b3 is dropped at column 3 and will get stuck on the box between column 2 and 3 and row 0.
-Ball b4 is dropped at column 4 and will get stuck on the box between column 2 and 3 and row 1.
-
-
-
Example 2:
-
-
-Input: grid = [[-1]]
-Output: [-1]
-Explanation: The ball gets stuck against the left wall.
-
-
-### Related Topics
- [[Depth-First Search](../../tag/depth-first-search/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Dynamic Programming](../../tag/dynamic-programming/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
- [[Simulation](../../tag/simulation/README.md)]
-
-### Hints
-
-Hint 1
-Use DFS.
-
-
-
-Hint 2
-Traverse the path of the ball downwards until you reach the bottom or get stuck.
-
diff --git a/problems/widest-pair-of-indices-with-equal-range-sum/README.md b/problems/widest-pair-of-indices-with-equal-range-sum/README.md
deleted file mode 100644
index 03bb08145..000000000
--- a/problems/widest-pair-of-indices-with-equal-range-sum/README.md
+++ /dev/null
@@ -1,35 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../find-array-given-subset-sums "Find Array Given Subset Sums")
-
-[Next >](../minimum-difference-between-highest-and-lowest-of-k-scores "Minimum Difference Between Highest and Lowest of K Scores")
-
-## [1983. Widest Pair of Indices With Equal Range Sum (Medium)](https://leetcode.com/problems/widest-pair-of-indices-with-equal-range-sum "")
-
-
-
-### Hints
-
-Hint 1
-Keep prefix sums of both arrays.
-
-
-
-Hint 2
-Can the difference between the prefix sums at an index help us?
-
-
-
-Hint 3
-What happens if the difference between the two prefix sums at an index a is x, and x again at a different index b?
-
-
-
-Hint 4
-This means that the sum of nums1 from index a + 1 to index b is equal to the sum of nums2 from index a + 1 to index b.
-
diff --git a/problems/widest-vertical-area-between-two-points-containing-no-points/README.md b/problems/widest-vertical-area-between-two-points-containing-no-points/README.md
deleted file mode 100644
index 9e0d052f3..000000000
--- a/problems/widest-vertical-area-between-two-points-containing-no-points/README.md
+++ /dev/null
@@ -1,59 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../sort-array-by-increasing-frequency "Sort Array by Increasing Frequency")
-
-[Next >](../count-substrings-that-differ-by-one-character "Count Substrings That Differ by One Character")
-
-## [1637. Widest Vertical Area Between Two Points Containing No Points (Medium)](https://leetcode.com/problems/widest-vertical-area-between-two-points-containing-no-points "两点之间不包含任何点的最宽垂直面积")
-
-
Given npoints on a 2D plane where points[i] = [xi, yi], Return the widest vertical area between two points such that no points are inside the area.
-
-
A vertical area is an area of fixed-width extending infinitely along the y-axis (i.e., infinite height). The widest vertical area is the one with the maximum width.
-
-
Note that points on the edge of a vertical area are not considered included in the area.
-
-
-
Example 1:
-
-
-Input: points = [[8,7],[9,9],[7,4],[9,7]]
-Output: 1
-Explanation: Both the red and the blue area are optimal.
-
A wiggle sequence is a sequence where the differences between successive numbers strictly alternate between positive and negative. The first difference (if one exists) may be either positive or negative. A sequence with one element and a sequence with two non-equal elements are trivially wiggle sequences.
-
-
-
For example, [1, 7, 4, 9, 2, 5] is a wiggle sequence because the differences (6, -3, 5, -7, 3) alternate between positive and negative.
-
In contrast, [1, 4, 7, 2, 5] and [1, 7, 4, 5, 5] are not wiggle sequences. The first is not because its first two differences are positive, and the second is not because its last difference is zero.
-
-
-
A subsequence is obtained by deleting some elements (possibly zero) from the original sequence, leaving the remaining elements in their original order.
-
-
Given an integer array nums, return the length of the longest wiggle subsequence of nums.
-
-
-
Example 1:
-
-
-Input: nums = [1,7,4,9,2,5]
-Output: 6
-Explanation: The entire sequence is a wiggle sequence with differences (6, -3, 5, -7, 3).
-
-
-
Example 2:
-
-
-Input: nums = [1,17,5,10,13,15,10,5,16,8]
-Output: 7
-Explanation: There are several subsequences that achieve this length.
-One is [1, 17, 10, 13, 10, 16, 8] with differences (16, -7, 3, -3, 6, -8).
-
Given an input string (s) and a pattern (p), implement wildcard pattern matching with support for '?' and '*' where:
-
-
-
'?' Matches any single character.
-
'*' Matches any sequence of characters (including the empty sequence).
-
-
-
The matching should cover the entire input string (not partial).
-
-
-
Example 1:
-
-
-Input: s = "aa", p = "a"
-Output: false
-Explanation: "a" does not match the entire string "aa".
-
-
-
Example 2:
-
-
-Input: s = "aa", p = "*"
-Output: true
-Explanation: '*' matches any sequence.
-
-
-
Example 3:
-
-
-Input: s = "cb", p = "?a"
-Output: false
-Explanation: '?' matches 'c', but the second letter is 'a', which does not match 'b'.
-
-
-
Example 4:
-
-
-Input: s = "adceb", p = "*a*b"
-Output: true
-Explanation: The first '*' matches the empty sequence, while the second '*' matches the substring "dce".
-
-
-
Example 5:
-
-
-Input: s = "acdcb", p = "a*c?b"
-Output: false
-
-
-
-
Constraints:
-
-
-
0 <= s.length, p.length <= 2000
-
s contains only lowercase English letters.
-
p contains only lowercase English letters, '?' or '*'.
-+-----+---------+
-| id | Name |
-+-----+---------+
-| 1 | A |
-| 2 | B |
-| 3 | C |
-| 4 | D |
-| 5 | E |
-+-----+---------+
-
-
-
Table: Vote
-
-
-+-----+--------------+
-| id | CandidateId |
-+-----+--------------+
-| 1 | 2 |
-| 2 | 4 |
-| 3 | 3 |
-| 4 | 2 |
-| 5 | 5 |
-+-----+--------------+
-id is the auto-increment primary key,
-CandidateId is the id appeared in Candidate table.
-
-
-
Write a sql to find the name of the winning candidate, the above example will return the winner B.
-
-
-+------+
-| Name |
-+------+
-| B |
-+------+
-
-
-
Notes:
-
-
-
You may assume there is no tie, in other words there will be only one winning candidate.
-
-
-
-
-### Related Topics
- [[Database](../../tag/database/README.md)]
diff --git a/problems/winning-candidate/mysql_schemas.sql b/problems/winning-candidate/mysql_schemas.sql
deleted file mode 100644
index 38b3cc5f1..000000000
--- a/problems/winning-candidate/mysql_schemas.sql
+++ /dev/null
@@ -1,14 +0,0 @@
-Create table If Not Exists Candidate (id int, Name varchar(255));
-Create table If Not Exists Vote (id int, CandidateId int);
-Truncate table Candidate;
-insert into Candidate (id, Name) values ('1', 'A');
-insert into Candidate (id, Name) values ('2', 'B');
-insert into Candidate (id, Name) values ('3', 'C');
-insert into Candidate (id, Name) values ('4', 'D');
-insert into Candidate (id, Name) values ('5', 'E');
-Truncate table Vote;
-insert into Vote (id, CandidateId) values ('1', '2');
-insert into Vote (id, CandidateId) values ('2', '4');
-insert into Vote (id, CandidateId) values ('3', '3');
-insert into Vote (id, CandidateId) values ('4', '2');
-insert into Vote (id, CandidateId) values ('5', '5');
diff --git a/problems/winning-candidate/winning_candidate.sql b/problems/winning-candidate/winning_candidate.sql
deleted file mode 100644
index 5cf961c52..000000000
--- a/problems/winning-candidate/winning_candidate.sql
+++ /dev/null
@@ -1,17 +0,0 @@
-# Write your MySQL query statement below
-
-SELECT `name` AS 'Name'
-FROM
- Candidate
- JOIN (
- SELECT Candidateid
- FROM
- Vote
- GROUP BY
- Candidateid
- ORDER BY
- COUNT(*) DESC
- LIMIT 1
- ) AS winner
-WHERE
- Candidate.id = winner.Candidateid;
diff --git a/problems/word-abbreviation/README.md b/problems/word-abbreviation/README.md
deleted file mode 100644
index 7fd9f8a67..000000000
--- a/problems/word-abbreviation/README.md
+++ /dev/null
@@ -1,47 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../beautiful-arrangement "Beautiful Arrangement")
-
-[Next >](../random-pick-with-weight "Random Pick with Weight")
-
-## [527. Word Abbreviation (Hard)](https://leetcode.com/problems/word-abbreviation "单词缩写")
-
-
Given an array of n distinct non-empty strings, you need to generate minimal possible abbreviations for every word following rules below.
-
-
-
Begin with the first character and then the number of characters abbreviated, which followed by the last character.
-
If there are any conflict, that is more than one words share the same abbreviation, a longer prefix is used instead of only the first character until making the map from word to abbreviation become unique. In other words, a final abbreviation cannot map to more than one original words.
-
If the abbreviation doesn't make the word shorter, then keep it as original.
Given a string s and a dictionary of strings wordDict, add spaces in s to construct a sentence where each word is a valid dictionary word. Return all such possible sentences in any order.
-
-
Note that the same word in the dictionary may be reused multiple times in the segmentation.
-
-
-
Example 1:
-
-
-Input: s = "catsanddog", wordDict = ["cat","cats","and","sand","dog"]
-Output: ["cats and dog","cat sand dog"]
-
-
-
Example 2:
-
-
-Input: s = "pineapplepenapple", wordDict = ["apple","pen","applepen","pine","pineapple"]
-Output: ["pine apple pen apple","pineapple pen apple","pine applepen apple"]
-Explanation: Note that you are allowed to reuse a dictionary word.
-
-
-
Example 3:
-
-
-Input: s = "catsandog", wordDict = ["cats","dog","sand","and","cat"]
-Output: []
-
-
-
-
Constraints:
-
-
-
1 <= s.length <= 20
-
1 <= wordDict.length <= 1000
-
1 <= wordDict[i].length <= 10
-
s and wordDict[i] consist of only lowercase English letters.
Given a string s and a dictionary of strings wordDict, return true if s can be segmented into a space-separated sequence of one or more dictionary words.
-
-
Note that the same word in the dictionary may be reused multiple times in the segmentation.
-
-
-
Example 1:
-
-
-Input: s = "leetcode", wordDict = ["leet","code"]
-Output: true
-Explanation: Return true because "leetcode" can be segmented as "leet code".
-
-
-
Example 2:
-
-
-Input: s = "applepenapple", wordDict = ["apple","pen"]
-Output: true
-Explanation: Return true because "applepenapple" can be segmented as "apple pen apple".
-Note that you are allowed to reuse a dictionary word.
-
-
-
Example 3:
-
-
-Input: s = "catsandog", wordDict = ["cats","dog","sand","and","cat"]
-Output: false
-
-
-
-
Constraints:
-
-
-
1 <= s.length <= 300
-
1 <= wordDict.length <= 1000
-
1 <= wordDict[i].length <= 20
-
s and wordDict[i] consist of only lowercase English letters.
-
-### Related Topics
- [[Shell](../../tag/shell/README.md)]
-
-### Similar Questions
- 1. [Top K Frequent Elements](../top-k-frequent-elements) (Medium)
diff --git a/problems/word-frequency/word_frequency.bash b/problems/word-frequency/word_frequency.bash
deleted file mode 100755
index fe817eebd..000000000
--- a/problems/word-frequency/word_frequency.bash
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/usr/bin/env bash
-
-# Read from the file words.txt and output the word frequency list to stdout.
-
-awk '{for(i=1;i<=NF;i++) a[$i]++} END {for(k in a) print k,a[k]}' words.txt | sort -k2 -nr
diff --git a/problems/word-frequency/words.txt b/problems/word-frequency/words.txt
deleted file mode 100644
index 18d52475f..000000000
--- a/problems/word-frequency/words.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-the day is sunny the the
-the sunny is is
diff --git a/problems/word-ladder-ii/README.md b/problems/word-ladder-ii/README.md
deleted file mode 100644
index fd36368df..000000000
--- a/problems/word-ladder-ii/README.md
+++ /dev/null
@@ -1,63 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../valid-palindrome "Valid Palindrome")
-
-[Next >](../word-ladder "Word Ladder")
-
-## [126. Word Ladder II (Hard)](https://leetcode.com/problems/word-ladder-ii "单词接龙 II")
-
-
A transformation sequence from word beginWord to word endWord using a dictionary wordList is a sequence of words beginWord -> s1 -> s2 -> ... -> sk such that:
-
-
-
Every adjacent pair of words differs by a single letter.
-
Every si for 1 <= i <= k is in wordList. Note that beginWord does not need to be in wordList.
-
sk == endWord
-
-
-
Given two words, beginWord and endWord, and a dictionary wordList, return all the shortest transformation sequences frombeginWordtoendWord, or an empty list if no such sequence exists. Each sequence should be returned as a list of the words [beginWord, s1, s2, ..., sk].
-Input: beginWord = "hit", endWord = "cog", wordList = ["hot","dot","dog","lot","log"]
-Output: []
-Explanation: The endWord "cog" is not in wordList, therefore there is no valid transformation sequence.
-
-
-
-
Constraints:
-
-
-
1 <= beginWord.length <= 5
-
endWord.length == beginWord.length
-
1 <= wordList.length <= 1000
-
wordList[i].length == beginWord.length
-
beginWord, endWord, and wordList[i] consist of lowercase English letters.
A transformation sequence from word beginWord to word endWord using a dictionary wordList is a sequence of words beginWord -> s1 -> s2 -> ... -> sk such that:
-
-
-
Every adjacent pair of words differs by a single letter.
-
Every si for 1 <= i <= k is in wordList. Note that beginWord does not need to be in wordList.
-
sk == endWord
-
-
-
Given two words, beginWord and endWord, and a dictionary wordList, return the number of words in the shortest transformation sequence frombeginWordtoendWord, or 0 if no such sequence exists.
-
-
-
Example 1:
-
-
-Input: beginWord = "hit", endWord = "cog", wordList = ["hot","dot","dog","lot","log","cog"]
-Output: 5
-Explanation: One shortest transformation sequence is "hit" -> "hot" -> "dot" -> "dog" -> cog", which is 5 words long.
-
-
-
Example 2:
-
-
-Input: beginWord = "hit", endWord = "cog", wordList = ["hot","dot","dog","lot","log"]
-Output: 0
-Explanation: The endWord "cog" is not in wordList, therefore there is no valid transformation sequence.
-
-
-
-
Constraints:
-
-
-
1 <= beginWord.length <= 10
-
endWord.length == beginWord.length
-
1 <= wordList.length <= 5000
-
wordList[i].length == beginWord.length
-
beginWord, endWord, and wordList[i] consist of lowercase English letters.
Given an m x nboard of characters and a list of strings words, return all words on the board.
-
-
Each word must be constructed from letters of sequentially adjacent cells, where adjacent cells are horizontally or vertically neighboring. The same letter cell may not be used more than once in a word.
-
-
-
Example 1:
-
-
-Input: board = [["o","a","a","n"],["e","t","a","e"],["i","h","k","r"],["i","f","l","v"]], words = ["oath","pea","eat","rain"]
-Output: ["eat","oath"]
-
-
-
Example 2:
-
-
-Input: board = [["a","b"],["c","d"]], words = ["abcb"]
-Output: []
-
-
-
-
Constraints:
-
-
-
m == board.length
-
n == board[i].length
-
1 <= m, n <= 12
-
board[i][j] is a lowercase English letter.
-
1 <= words.length <= 3 * 104
-
1 <= words[i].length <= 10
-
words[i] consists of lowercase English letters.
-
All the strings of words are unique.
-
-
-### Related Topics
- [[Array](../../tag/array/README.md)]
- [[String](../../tag/string/README.md)]
- [[Backtracking](../../tag/backtracking/README.md)]
- [[Trie](../../tag/trie/README.md)]
- [[Matrix](../../tag/matrix/README.md)]
-
-### Similar Questions
- 1. [Word Search](../word-search) (Medium)
- 1. [Unique Paths III](../unique-paths-iii) (Hard)
-
-### Hints
-
-Hint 1
-You would need to optimize your backtracking to pass the larger test. Could you stop backtracking earlier?
-
-
-
-Hint 2
-If the current candidate does not exist in all words' prefix, you could stop backtracking immediately. What kind of data structure could answer such query efficiently? Does a hash table work? Why or why not? How about a Trie? If you would like to learn how to implement a basic trie, please work on this problem: Implement Trie (Prefix Tree) first.
-
diff --git a/problems/word-search-ii/word_search_ii.go b/problems/word-search-ii/word_search_ii.go
deleted file mode 100644
index ea2d31176..000000000
--- a/problems/word-search-ii/word_search_ii.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem212
diff --git a/problems/word-search-ii/word_search_ii_test.go b/problems/word-search-ii/word_search_ii_test.go
deleted file mode 100644
index ea2d31176..000000000
--- a/problems/word-search-ii/word_search_ii_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package problem212
diff --git a/problems/word-search/README.md b/problems/word-search/README.md
deleted file mode 100644
index 743c2ff89..000000000
--- a/problems/word-search/README.md
+++ /dev/null
@@ -1,60 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../subsets "Subsets")
-
-[Next >](../remove-duplicates-from-sorted-array-ii "Remove Duplicates from Sorted Array II")
-
-## [79. Word Search (Medium)](https://leetcode.com/problems/word-search "单词搜索")
-
-
Given an m x n grid of characters board and a string word, return trueifwordexists in the grid.
-
-
The word can be constructed from letters of sequentially adjacent cells, where adjacent cells are horizontally or vertically neighboring. The same letter cell may not be used more than once.
-
-
-
Example 1:
-
-
-Input: board = [["A","B","C","E"],["S","F","C","S"],["A","D","E","E"]], word = "ABCCED"
-Output: true
-
-
-
Example 2:
-
-
-Input: board = [["A","B","C","E"],["S","F","C","S"],["A","D","E","E"]], word = "SEE"
-Output: true
-
-
-
Example 3:
-
-
-Input: board = [["A","B","C","E"],["S","F","C","S"],["A","D","E","E"]], word = "ABCB"
-Output: false
-
-
-
-
Constraints:
-
-
-
m == board.length
-
n = board[i].length
-
1 <= m, n <= 6
-
1 <= word.length <= 15
-
board and word consists of only lowercase and uppercase English letters.
-
-
-
-
Follow up: Could you use search pruning to make your solution faster with a larger board?
Given a set of words (without duplicates), find all word squares you can build from them.
-
-
A sequence of words forms a valid word square if the kth row and column read the exact same string, where 0 ≤ k < max(numRows, numColumns).
-
-
For example, the word sequence ["ball","area","lead","lady"] forms a word square because each word reads the same both horizontally and vertically.
-
-
-b a l l
-a r e a
-l e a d
-l a d y
-
-
-
Note:
-
-
There are at least 1 and at most 1000 words.
-
All words will have the exact same length.
-
Word length is at least 1 and at most 5.
-
Each word contains only lowercase English alphabet a-z.
-
-
-
-
Example 1:
-
-Input:
-["area","lead","wall","lady","ball"]
-
-Output:
-[
- [ "wall",
- "area",
- "lead",
- "lady"
- ],
- [ "ball",
- "area",
- "lead",
- "lady"
- ]
-]
-
-Explanation:
-The output consists of two word squares. The order of output does not matter (just the order of words in each word square matters).
-
-
-
-
Example 2:
-
-Input:
-["abat","baba","atan","atal"]
-
-Output:
-[
- [ "baba",
- "abat",
- "baba",
- "atan"
- ],
- [ "baba",
- "abat",
- "baba",
- "atal"
- ]
-]
-
-Explanation:
-The output consists of two word squares. The order of output does not matter (just the order of words in each word square matters).
-
-
-### Related Topics
- [[Bit Manipulation](../../tag/bit-manipulation/README.md)]
- [[Array](../../tag/array/README.md)]
- [[Prefix Sum](../../tag/prefix-sum/README.md)]
-
-### Hints
-
-Hint 1
-What is the result of x ^ y ^ x ?
-
-
-
-Hint 2
-Compute the prefix sum for XOR.
-
-
-
-Hint 3
-Process the queries with the prefix sum values.
-
diff --git a/problems/zigzag-conversion/README.md b/problems/zigzag-conversion/README.md
deleted file mode 100644
index 2307a86c4..000000000
--- a/problems/zigzag-conversion/README.md
+++ /dev/null
@@ -1,67 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../longest-palindromic-substring "Longest Palindromic Substring")
-
-[Next >](../reverse-integer "Reverse Integer")
-
-## [6. Zigzag Conversion (Medium)](https://leetcode.com/problems/zigzag-conversion "Z 字形变换")
-
-
The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility)
-
-
-P A H N
-A P L S I I G
-Y I R
-
-
-
And then read line by line: "PAHNAPLSIIGYIR"
-
-
Write the code that will take a string and make this conversion given a number of rows:
-
-
-string convert(string s, int numRows);
-
-
-
-
Example 1:
-
-
-Input: s = "PAYPALISHIRING", numRows = 3
-Output: "PAHNAPLSIIGYIR"
-
-
-
Example 2:
-
-
-Input: s = "PAYPALISHIRING", numRows = 4
-Output: "PINALSIGYAHRPI"
-Explanation:
-P I N
-A L S I G
-Y A H R
-P I
-
-
-
Example 3:
-
-
-Input: s = "A", numRows = 1
-Output: "A"
-
-
-
-
Constraints:
-
-
-
1 <= s.length <= 1000
-
s consists of English letters (lower-case and upper-case), ',' and '.'.
-
1 <= numRows <= 1000
-
-
-### Related Topics
- [[String](../../tag/string/README.md)]
diff --git a/problems/zigzag-conversion/zigzag_conversion.go b/problems/zigzag-conversion/zigzag_conversion.go
deleted file mode 100644
index 9df2bdd1c..000000000
--- a/problems/zigzag-conversion/zigzag_conversion.go
+++ /dev/null
@@ -1,20 +0,0 @@
-package problem6
-
-func convert(s string, numRows int) string {
- l := len(s)
- if l <= numRows || numRows < 2 {
- return s
- }
- ans, col := make([]byte, 0, l), (l-1)/(numRows-1)
- for r := 0; r < numRows; r++ {
- for c := 0; c <= col; c++ {
- if c&1 == 0 || r > 0 && r < numRows-1 {
- k := (numRows-1)*(c+c&1) + r*(1-c&1*2)
- if k < l {
- ans = append(ans, s[k])
- }
- }
- }
- }
- return string(ans)
-}
diff --git a/problems/zigzag-conversion/zigzag_conversion_test.go b/problems/zigzag-conversion/zigzag_conversion_test.go
deleted file mode 100644
index b23fa2c22..000000000
--- a/problems/zigzag-conversion/zigzag_conversion_test.go
+++ /dev/null
@@ -1,35 +0,0 @@
-package problem6
-
-import "testing"
-
-type testType struct {
- in string
- numRows int
- want string
-}
-
-func TestConvert(t *testing.T) {
- tests := [...]testType{
- {
- in: "PAYPALISHIRING",
- numRows: 3,
- want: "PAHNAPLSIIGYIR",
- },
- {
- in: "PAYPALISHIRING",
- numRows: 4,
- want: "PINALSIGYAHRPI",
- },
- {
- in: "AB",
- numRows: 1,
- want: "AB",
- },
- }
- for _, tt := range tests {
- got := convert(tt.in, tt.numRows)
- if got != tt.want {
- t.Fatalf("in: %v, got: %v, want: %v", tt.in, got, tt.want)
- }
- }
-}
diff --git a/problems/zigzag-iterator/README.md b/problems/zigzag-iterator/README.md
deleted file mode 100644
index 9c3ae3609..000000000
--- a/problems/zigzag-iterator/README.md
+++ /dev/null
@@ -1,52 +0,0 @@
-
-
-
-
-
-
-
-[< Previous](../wiggle-sort "Wiggle Sort")
-
-[Next >](../expression-add-operators "Expression Add Operators")
-
-## [281. Zigzag Iterator (Medium)](https://leetcode.com/problems/zigzag-iterator "锯齿迭代器")
-
-
Given two 1d vectors, implement an iterator to return their elements alternately.
-
-
Example:
-
-
-Input:
-v1 = [1,2]
-v2 = [3,4,5,6]
-
-Output:[1,3,2,4,5,6]
-
-Explanation: By calling next repeatedly until hasNext returns false,
- the order of elements returned by next should be: [1,3,2,4,5,6].
-
-
Follow up: What if you are given k 1d vectors? How well can your code be extended to such cases?
-
-
Clarification for the follow up question:
-The "Zigzag" order is not clearly defined and is ambiguous for k > 2 cases. If "Zigzag" does not look right to you, replace "Zigzag" with "Cyclic". For example:
In this variation of Zuma, there is a single row of colored balls on a board, where each ball can be colored red 'R', yellow 'Y', blue 'B', green 'G', or white 'W'. You also have several colored balls in your hand.
-
-
Your goal is to clear all of the balls from the board. On each turn:
-
-
-
Pick any ball from your hand and insert it in between two balls in the row or on either end of the row.
-
If there is a group of three or more consecutive balls of the same color, remove the group of balls from the board.
-
-
If this removal causes more groups of three or more of the same color to form, then continue removing each group until there are none left.
-
-
-
If there are no more balls on the board, then you win the game.
-
Repeat this process until you either win or do not have any more balls in your hand.
-
-
-
Given a string board, representing the row of balls on the board, and a string hand, representing the balls in your hand, return the minimum number of balls you have to insert to clear all the balls from the board. If you cannot clear all the balls from the board using the balls in your hand, return -1.
-
-
-
Example 1:
-
-
-Input: board = "WRRBBW", hand = "RB"
-Output: -1
-Explanation: It is impossible to clear all the balls. The best you can do is:
-- Insert 'R' so the board becomes WRRRBBW. WRRRBBW -> WBBW.
-- Insert 'B' so the board becomes WBBBW. WBBBW -> WW.
-There are still balls remaining on the board, and you are out of balls to insert.
-
-
Example 2:
-
-
-Input: board = "WWRRBBWW", hand = "WRBRW"
-Output: 2
-Explanation: To make the board empty:
-- Insert 'R' so the board becomes WWRRRBBWW. WWRRRBBWW -> WWBBWW.
-- Insert 'B' so the board becomes WWBBBWW. WWBBBWW -> WWWW -> empty.
-2 balls from your hand were needed to clear the board.
-
-
-
Example 3:
-
-
-Input: board = "G", hand = "GGGGG"
-Output: 2
-Explanation: To make the board empty:
-- Insert 'G' so the board becomes GG.
-- Insert 'G' so the board becomes GGG. GGG -> empty.
-2 balls from your hand were needed to clear the board.
-
-
-
Example 4:
-
-
-Input: board = "RBYYBBRRB", hand = "YRBGB"
-Output: 3
-Explanation: To make the board empty:
-- Insert 'Y' so the board becomes RBYYYBBRRB. RBYYYBBRRB -> RBBBRRB -> RRRB -> B.
-- Insert 'B' so the board becomes BB.
-- Insert 'B' so the board becomes BBB. BBB -> empty.
-3 balls from your hand were needed to clear the board.
-
-
-
-
Constraints:
-
-
-
1 <= board.length <= 16
-
1 <= hand.length <= 5
-
board and hand consist of the characters 'R', 'Y', 'B', 'G', and 'W'.
-
The initial row of balls on the board will not have any groups of three or more consecutive balls of the same color.
-
-| # | Title | Solution | Difficulty |
-| :-: | - | - | :-: |
-| 1201 | [Ugly Number III](https://leetcode.com/problems/ugly-number-iii "丑数 III") | [Go](../problems/ugly-number-iii) | Medium |
-| 1202 | [Smallest String With Swaps](https://leetcode.com/problems/smallest-string-with-swaps "交换字符串中的元素") | [Go](../problems/smallest-string-with-swaps) | Medium |
-| 1203 | [Sort Items by Groups Respecting Dependencies](https://leetcode.com/problems/sort-items-by-groups-respecting-dependencies "项目管理") | [Go](../problems/sort-items-by-groups-respecting-dependencies) | Hard |
-| 1204 | [Last Person to Fit in the Bus](https://leetcode.com/problems/last-person-to-fit-in-the-bus "最后一个能进入电梯的人") 🔒 | [MySQL](../problems/last-person-to-fit-in-the-bus) | Medium |
-| 1205 | [Monthly Transactions II](https://leetcode.com/problems/monthly-transactions-ii "每月交易II") 🔒 | [MySQL](../problems/monthly-transactions-ii) | Medium |
-| 1206 | [Design Skiplist](https://leetcode.com/problems/design-skiplist "设计跳表") | [Go](../problems/design-skiplist) | Hard |
-| 1207 | [Unique Number of Occurrences](https://leetcode.com/problems/unique-number-of-occurrences "独一无二的出现次数") | [Go](../problems/unique-number-of-occurrences) | Easy |
-| 1208 | [Get Equal Substrings Within Budget](https://leetcode.com/problems/get-equal-substrings-within-budget "尽可能使字符串相等") | [Go](../problems/get-equal-substrings-within-budget) | Medium |
-| 1209 | [Remove All Adjacent Duplicates in String II](https://leetcode.com/problems/remove-all-adjacent-duplicates-in-string-ii "删除字符串中的所有相邻重复项 II") | [Go](../problems/remove-all-adjacent-duplicates-in-string-ii) | Medium |
-| 1210 | [Minimum Moves to Reach Target with Rotations](https://leetcode.com/problems/minimum-moves-to-reach-target-with-rotations "穿过迷宫的最少移动次数") | [Go](../problems/minimum-moves-to-reach-target-with-rotations) | Hard |
-| 1211 | [Queries Quality and Percentage](https://leetcode.com/problems/queries-quality-and-percentage "查询结果的质量和占比") 🔒 | [MySQL](../problems/queries-quality-and-percentage) | Easy |
-| 1212 | [Team Scores in Football Tournament](https://leetcode.com/problems/team-scores-in-football-tournament "查询球队积分") 🔒 | [MySQL](../problems/team-scores-in-football-tournament) | Medium |
-| 1213 | [Intersection of Three Sorted Arrays](https://leetcode.com/problems/intersection-of-three-sorted-arrays "三个有序数组的交集") 🔒 | [Go](../problems/intersection-of-three-sorted-arrays) | Easy |
-| 1214 | [Two Sum BSTs](https://leetcode.com/problems/two-sum-bsts "查找两棵二叉搜索树之和") 🔒 | [Go](../problems/two-sum-bsts) | Medium |
-| 1215 | [Stepping Numbers](https://leetcode.com/problems/stepping-numbers "步进数") 🔒 | [Go](../problems/stepping-numbers) | Medium |
-| 1216 | [Valid Palindrome III](https://leetcode.com/problems/valid-palindrome-iii "验证回文字符串 III") 🔒 | [Go](../problems/valid-palindrome-iii) | Hard |
-| 1217 | [Minimum Cost to Move Chips to The Same Position](https://leetcode.com/problems/minimum-cost-to-move-chips-to-the-same-position "玩筹码") | [Go](../problems/minimum-cost-to-move-chips-to-the-same-position) | Easy |
-| 1218 | [Longest Arithmetic Subsequence of Given Difference](https://leetcode.com/problems/longest-arithmetic-subsequence-of-given-difference "最长定差子序列") | [Go](../problems/longest-arithmetic-subsequence-of-given-difference) | Medium |
-| 1219 | [Path with Maximum Gold](https://leetcode.com/problems/path-with-maximum-gold "黄金矿工") | [Go](../problems/path-with-maximum-gold) | Medium |
-| 1220 | [Count Vowels Permutation](https://leetcode.com/problems/count-vowels-permutation "统计元音字母序列的数目") | [Go](../problems/count-vowels-permutation) | Hard |
-| 1221 | [Split a String in Balanced Strings](https://leetcode.com/problems/split-a-string-in-balanced-strings "分割平衡字符串") | [Go](../problems/split-a-string-in-balanced-strings) | Easy |
-| 1222 | [Queens That Can Attack the King](https://leetcode.com/problems/queens-that-can-attack-the-king "可以攻击国王的皇后") | [Go](../problems/queens-that-can-attack-the-king) | Medium |
-| 1223 | [Dice Roll Simulation](https://leetcode.com/problems/dice-roll-simulation "掷骰子模拟") | [Go](../problems/dice-roll-simulation) | Hard |
-| 1224 | [Maximum Equal Frequency](https://leetcode.com/problems/maximum-equal-frequency "最大相等频率") | [Go](../problems/maximum-equal-frequency) | Hard |
-| 1225 | [Report Contiguous Dates](https://leetcode.com/problems/report-contiguous-dates "报告系统状态的连续日期") 🔒 | [MySQL](../problems/report-contiguous-dates) | Hard |
-| 1226 | [The Dining Philosophers](https://leetcode.com/problems/the-dining-philosophers "哲学家进餐") | [Go](../problems/the-dining-philosophers) | Medium |
-| 1227 | [Airplane Seat Assignment Probability](https://leetcode.com/problems/airplane-seat-assignment-probability "飞机座位分配概率") | [Go](../problems/airplane-seat-assignment-probability) | Medium |
-| 1228 | [Missing Number In Arithmetic Progression](https://leetcode.com/problems/missing-number-in-arithmetic-progression "等差数列中缺失的数字") 🔒 | [Go](../problems/missing-number-in-arithmetic-progression) | Easy |
-| 1229 | [Meeting Scheduler](https://leetcode.com/problems/meeting-scheduler "安排会议日程") 🔒 | [Go](../problems/meeting-scheduler) | Medium |
-| 1230 | [Toss Strange Coins](https://leetcode.com/problems/toss-strange-coins "抛掷硬币") 🔒 | [Go](../problems/toss-strange-coins) | Medium |
-| 1231 | [Divide Chocolate](https://leetcode.com/problems/divide-chocolate "分享巧克力") 🔒 | [Go](../problems/divide-chocolate) | Hard |
-| 1232 | [Check If It Is a Straight Line](https://leetcode.com/problems/check-if-it-is-a-straight-line "缀点成线") | [Go](../problems/check-if-it-is-a-straight-line) | Easy |
-| 1233 | [Remove Sub-Folders from the Filesystem](https://leetcode.com/problems/remove-sub-folders-from-the-filesystem "删除子文件夹") | [Go](../problems/remove-sub-folders-from-the-filesystem) | Medium |
-| 1234 | [Replace the Substring for Balanced String](https://leetcode.com/problems/replace-the-substring-for-balanced-string "替换子串得到平衡字符串") | [Go](../problems/replace-the-substring-for-balanced-string) | Medium |
-| 1235 | [Maximum Profit in Job Scheduling](https://leetcode.com/problems/maximum-profit-in-job-scheduling "规划兼职工作") | [Go](../problems/maximum-profit-in-job-scheduling) | Hard |
-| 1236 | [Web Crawler](https://leetcode.com/problems/web-crawler "网络爬虫") 🔒 | [Go](../problems/web-crawler) | Medium |
-| 1237 | [Find Positive Integer Solution for a Given Equation](https://leetcode.com/problems/find-positive-integer-solution-for-a-given-equation "找出给定方程的正整数解") | [Go](../problems/find-positive-integer-solution-for-a-given-equation) | Medium |
-| 1238 | [Circular Permutation in Binary Representation](https://leetcode.com/problems/circular-permutation-in-binary-representation "循环码排列") | [Go](../problems/circular-permutation-in-binary-representation) | Medium |
-| 1239 | [Maximum Length of a Concatenated String with Unique Characters](https://leetcode.com/problems/maximum-length-of-a-concatenated-string-with-unique-characters "串联字符串的最大长度") | [Go](../problems/maximum-length-of-a-concatenated-string-with-unique-characters) | Medium |
-| 1240 | [Tiling a Rectangle with the Fewest Squares](https://leetcode.com/problems/tiling-a-rectangle-with-the-fewest-squares "铺瓷砖") | [Go](../problems/tiling-a-rectangle-with-the-fewest-squares) | Hard |
-| 1241 | [Number of Comments per Post](https://leetcode.com/problems/number-of-comments-per-post "每个帖子的评论数") 🔒 | [MySQL](../problems/number-of-comments-per-post) | Easy |
-| 1242 | [Web Crawler Multithreaded](https://leetcode.com/problems/web-crawler-multithreaded "多线程网页爬虫") 🔒 | [Go](../problems/web-crawler-multithreaded) | Medium |
-| 1243 | [Array Transformation](https://leetcode.com/problems/array-transformation "数组变换") 🔒 | [Go](../problems/array-transformation) | Easy |
-| 1244 | [Design A Leaderboard](https://leetcode.com/problems/design-a-leaderboard "力扣排行榜") 🔒 | [Go](../problems/design-a-leaderboard) | Medium |
-| 1245 | [Tree Diameter](https://leetcode.com/problems/tree-diameter "树的直径") 🔒 | [Go](../problems/tree-diameter) | Medium |
-| 1246 | [Palindrome Removal](https://leetcode.com/problems/palindrome-removal "删除回文子数组") 🔒 | [Go](../problems/palindrome-removal) | Hard |
-| 1247 | [Minimum Swaps to Make Strings Equal](https://leetcode.com/problems/minimum-swaps-to-make-strings-equal "交换字符使得字符串相同") | [Go](../problems/minimum-swaps-to-make-strings-equal) | Medium |
-| 1248 | [Count Number of Nice Subarrays](https://leetcode.com/problems/count-number-of-nice-subarrays "统计「优美子数组」") | [Go](../problems/count-number-of-nice-subarrays) | Medium |
-| 1249 | [Minimum Remove to Make Valid Parentheses](https://leetcode.com/problems/minimum-remove-to-make-valid-parentheses "移除无效的括号") | [Go](../problems/minimum-remove-to-make-valid-parentheses) | Medium |
-| 1250 | [Check If It Is a Good Array](https://leetcode.com/problems/check-if-it-is-a-good-array "检查「好数组」") | [Go](../problems/check-if-it-is-a-good-array) | Hard |
-| 1251 | [Average Selling Price](https://leetcode.com/problems/average-selling-price "平均售价") 🔒 | [MySQL](../problems/average-selling-price) | Easy |
-| 1252 | [Cells with Odd Values in a Matrix](https://leetcode.com/problems/cells-with-odd-values-in-a-matrix "奇数值单元格的数目") | [Go](../problems/cells-with-odd-values-in-a-matrix) | Easy |
-| 1253 | [Reconstruct a 2-Row Binary Matrix](https://leetcode.com/problems/reconstruct-a-2-row-binary-matrix "重构 2 行二进制矩阵") | [Go](../problems/reconstruct-a-2-row-binary-matrix) | Medium |
-| 1254 | [Number of Closed Islands](https://leetcode.com/problems/number-of-closed-islands "统计封闭岛屿的数目") | [Go](../problems/number-of-closed-islands) | Medium |
-| 1255 | [Maximum Score Words Formed by Letters](https://leetcode.com/problems/maximum-score-words-formed-by-letters "得分最高的单词集合") | [Go](../problems/maximum-score-words-formed-by-letters) | Hard |
-| 1256 | [Encode Number](https://leetcode.com/problems/encode-number "加密数字") 🔒 | [Go](../problems/encode-number) | Medium |
-| 1257 | [Smallest Common Region](https://leetcode.com/problems/smallest-common-region "最小公共区域") 🔒 | [Go](../problems/smallest-common-region) | Medium |
-| 1258 | [Synonymous Sentences](https://leetcode.com/problems/synonymous-sentences "近义词句子") 🔒 | [Go](../problems/synonymous-sentences) | Medium |
-| 1259 | [Handshakes That Don't Cross](https://leetcode.com/problems/handshakes-that-dont-cross "不相交的握手") 🔒 | [Go](../problems/handshakes-that-dont-cross) | Hard |
-| 1260 | [Shift 2D Grid](https://leetcode.com/problems/shift-2d-grid "二维网格迁移") | [Go](../problems/shift-2d-grid) | Easy |
-| 1261 | [Find Elements in a Contaminated Binary Tree](https://leetcode.com/problems/find-elements-in-a-contaminated-binary-tree "在受污染的二叉树中查找元素") | [Go](../problems/find-elements-in-a-contaminated-binary-tree) | Medium |
-| 1262 | [Greatest Sum Divisible by Three](https://leetcode.com/problems/greatest-sum-divisible-by-three "可被三整除的最大和") | [Go](../problems/greatest-sum-divisible-by-three) | Medium |
-| 1263 | [Minimum Moves to Move a Box to Their Target Location](https://leetcode.com/problems/minimum-moves-to-move-a-box-to-their-target-location "推箱子") | [Go](../problems/minimum-moves-to-move-a-box-to-their-target-location) | Hard |
-| 1264 | [Page Recommendations](https://leetcode.com/problems/page-recommendations "页面推荐") 🔒 | [MySQL](../problems/page-recommendations) | Medium |
-| 1265 | [Print Immutable Linked List in Reverse](https://leetcode.com/problems/print-immutable-linked-list-in-reverse "逆序打印不可变链表") 🔒 | [Go](../problems/print-immutable-linked-list-in-reverse) | Medium |
-| 1266 | [Minimum Time Visiting All Points](https://leetcode.com/problems/minimum-time-visiting-all-points "访问所有点的最小时间") | [Go](../problems/minimum-time-visiting-all-points) | Easy |
-| 1267 | [Count Servers that Communicate](https://leetcode.com/problems/count-servers-that-communicate "统计参与通信的服务器") | [Go](../problems/count-servers-that-communicate) | Medium |
-| 1268 | [Search Suggestions System](https://leetcode.com/problems/search-suggestions-system "搜索推荐系统") | [Go](../problems/search-suggestions-system) | Medium |
-| 1269 | [Number of Ways to Stay in the Same Place After Some Steps](https://leetcode.com/problems/number-of-ways-to-stay-in-the-same-place-after-some-steps "停在原地的方案数") | [Go](../problems/number-of-ways-to-stay-in-the-same-place-after-some-steps) | Hard |
-| 1270 | [All People Report to the Given Manager](https://leetcode.com/problems/all-people-report-to-the-given-manager "向公司CEO汇报工作的所有人") 🔒 | [MySQL](../problems/all-people-report-to-the-given-manager) | Medium |
-| 1271 | [Hexspeak](https://leetcode.com/problems/hexspeak "十六进制魔术数字") 🔒 | [Go](../problems/hexspeak) | Easy |
-| 1272 | [Remove Interval](https://leetcode.com/problems/remove-interval "删除区间") 🔒 | [Go](../problems/remove-interval) | Medium |
-| 1273 | [Delete Tree Nodes](https://leetcode.com/problems/delete-tree-nodes "删除树节点") 🔒 | [Go](../problems/delete-tree-nodes) | Medium |
-| 1274 | [Number of Ships in a Rectangle](https://leetcode.com/problems/number-of-ships-in-a-rectangle "矩形内船只的数目") 🔒 | [Go](../problems/number-of-ships-in-a-rectangle) | Hard |
-| 1275 | [Find Winner on a Tic Tac Toe Game](https://leetcode.com/problems/find-winner-on-a-tic-tac-toe-game "找出井字棋的获胜者") | [Go](../problems/find-winner-on-a-tic-tac-toe-game) | Easy |
-| 1276 | [Number of Burgers with No Waste of Ingredients](https://leetcode.com/problems/number-of-burgers-with-no-waste-of-ingredients "不浪费原料的汉堡制作方案") | [Go](../problems/number-of-burgers-with-no-waste-of-ingredients) | Medium |
-| 1277 | [Count Square Submatrices with All Ones](https://leetcode.com/problems/count-square-submatrices-with-all-ones "统计全为 1 的正方形子矩阵") | [Go](../problems/count-square-submatrices-with-all-ones) | Medium |
-| 1278 | [Palindrome Partitioning III](https://leetcode.com/problems/palindrome-partitioning-iii "分割回文串 III") | [Go](../problems/palindrome-partitioning-iii) | Hard |
-| 1279 | [Traffic Light Controlled Intersection](https://leetcode.com/problems/traffic-light-controlled-intersection "红绿灯路口") 🔒 | [Go](../problems/traffic-light-controlled-intersection) | Easy |
-| 1280 | [Students and Examinations](https://leetcode.com/problems/students-and-examinations "学生们参加各科测试的次数") 🔒 | [MySQL](../problems/students-and-examinations) | Easy |
-| 1281 | [Subtract the Product and Sum of Digits of an Integer](https://leetcode.com/problems/subtract-the-product-and-sum-of-digits-of-an-integer "整数的各位积和之差") | [Go](../problems/subtract-the-product-and-sum-of-digits-of-an-integer) | Easy |
-| 1282 | [Group the People Given the Group Size They Belong To](https://leetcode.com/problems/group-the-people-given-the-group-size-they-belong-to "用户分组") | [Go](../problems/group-the-people-given-the-group-size-they-belong-to) | Medium |
-| 1283 | [Find the Smallest Divisor Given a Threshold](https://leetcode.com/problems/find-the-smallest-divisor-given-a-threshold "使结果不超过阈值的最小除数") | [Go](../problems/find-the-smallest-divisor-given-a-threshold) | Medium |
-| 1284 | [Minimum Number of Flips to Convert Binary Matrix to Zero Matrix](https://leetcode.com/problems/minimum-number-of-flips-to-convert-binary-matrix-to-zero-matrix "转化为全零矩阵的最少反转次数") | [Go](../problems/minimum-number-of-flips-to-convert-binary-matrix-to-zero-matrix) | Hard |
-| 1285 | [Find the Start and End Number of Continuous Ranges](https://leetcode.com/problems/find-the-start-and-end-number-of-continuous-ranges "找到连续区间的开始和结束数字") 🔒 | [MySQL](../problems/find-the-start-and-end-number-of-continuous-ranges) | Medium |
-| 1286 | [Iterator for Combination](https://leetcode.com/problems/iterator-for-combination "字母组合迭代器") | [Go](../problems/iterator-for-combination) | Medium |
-| 1287 | [Element Appearing More Than 25% In Sorted Array](https://leetcode.com/problems/element-appearing-more-than-25-in-sorted-array "有序数组中出现次数超过25%的元素") | [Go](../problems/element-appearing-more-than-25-in-sorted-array) | Easy |
-| 1288 | [Remove Covered Intervals](https://leetcode.com/problems/remove-covered-intervals "删除被覆盖区间") | [Go](../problems/remove-covered-intervals) | Medium |
-| 1289 | [Minimum Falling Path Sum II](https://leetcode.com/problems/minimum-falling-path-sum-ii "下降路径最小和 II") | [Go](../problems/minimum-falling-path-sum-ii) | Hard |
-| 1290 | [Convert Binary Number in a Linked List to Integer](https://leetcode.com/problems/convert-binary-number-in-a-linked-list-to-integer "二进制链表转整数") | [Go](../problems/convert-binary-number-in-a-linked-list-to-integer) | Easy |
-| 1291 | [Sequential Digits](https://leetcode.com/problems/sequential-digits "顺次数") | [Go](../problems/sequential-digits) | Medium |
-| 1292 | [Maximum Side Length of a Square with Sum Less than or Equal to Threshold](https://leetcode.com/problems/maximum-side-length-of-a-square-with-sum-less-than-or-equal-to-threshold "元素和小于等于阈值的正方形的最大边长") | [Go](../problems/maximum-side-length-of-a-square-with-sum-less-than-or-equal-to-threshold) | Medium |
-| 1293 | [Shortest Path in a Grid with Obstacles Elimination](https://leetcode.com/problems/shortest-path-in-a-grid-with-obstacles-elimination "网格中的最短路径") | [Go](../problems/shortest-path-in-a-grid-with-obstacles-elimination) | Hard |
-| 1294 | [Weather Type in Each Country](https://leetcode.com/problems/weather-type-in-each-country "不同国家的天气类型") 🔒 | [MySQL](../problems/weather-type-in-each-country) | Easy |
-| 1295 | [Find Numbers with Even Number of Digits](https://leetcode.com/problems/find-numbers-with-even-number-of-digits "统计位数为偶数的数字") | [Go](../problems/find-numbers-with-even-number-of-digits) | Easy |
-| 1296 | [Divide Array in Sets of K Consecutive Numbers](https://leetcode.com/problems/divide-array-in-sets-of-k-consecutive-numbers "划分数组为连续数字的集合") | [Go](../problems/divide-array-in-sets-of-k-consecutive-numbers) | Medium |
-| 1297 | [Maximum Number of Occurrences of a Substring](https://leetcode.com/problems/maximum-number-of-occurrences-of-a-substring "子串的最大出现次数") | [Go](../problems/maximum-number-of-occurrences-of-a-substring) | Medium |
-| 1298 | [Maximum Candies You Can Get from Boxes](https://leetcode.com/problems/maximum-candies-you-can-get-from-boxes "你能从盒子里获得的最大糖果数") | [Go](../problems/maximum-candies-you-can-get-from-boxes) | Hard |
-| 1299 | [Replace Elements with Greatest Element on Right Side](https://leetcode.com/problems/replace-elements-with-greatest-element-on-right-side "将每个元素替换为右侧最大元素") | [Go](../problems/replace-elements-with-greatest-element-on-right-side) | Easy |
-| 1300 | [Sum of Mutated Array Closest to Target](https://leetcode.com/problems/sum-of-mutated-array-closest-to-target "转变数组后最接近目标值的数组和") | [Go](../problems/sum-of-mutated-array-closest-to-target) | Medium |
-| 1301 | [Number of Paths with Max Score](https://leetcode.com/problems/number-of-paths-with-max-score "最大得分的路径数目") | [Go](../problems/number-of-paths-with-max-score) | Hard |
-| 1302 | [Deepest Leaves Sum](https://leetcode.com/problems/deepest-leaves-sum "层数最深叶子节点的和") | [Go](../problems/deepest-leaves-sum) | Medium |
-| 1303 | [Find the Team Size](https://leetcode.com/problems/find-the-team-size "求团队人数") 🔒 | [MySQL](../problems/find-the-team-size) | Easy |
-| 1304 | [Find N Unique Integers Sum up to Zero](https://leetcode.com/problems/find-n-unique-integers-sum-up-to-zero "和为零的N个唯一整数") | [Go](../problems/find-n-unique-integers-sum-up-to-zero) | Easy |
-| 1305 | [All Elements in Two Binary Search Trees](https://leetcode.com/problems/all-elements-in-two-binary-search-trees "两棵二叉搜索树中的所有元素") | [Go](../problems/all-elements-in-two-binary-search-trees) | Medium |
-| 1306 | [Jump Game III](https://leetcode.com/problems/jump-game-iii "跳跃游戏 III") | [Go](../problems/jump-game-iii) | Medium |
-| 1307 | [Verbal Arithmetic Puzzle](https://leetcode.com/problems/verbal-arithmetic-puzzle "口算难题") | [Go](../problems/verbal-arithmetic-puzzle) | Hard |
-| 1308 | [Running Total for Different Genders](https://leetcode.com/problems/running-total-for-different-genders "不同性别每日分数总计") 🔒 | [MySQL](../problems/running-total-for-different-genders) | Medium |
-| 1309 | [Decrypt String from Alphabet to Integer Mapping](https://leetcode.com/problems/decrypt-string-from-alphabet-to-integer-mapping "解码字母到整数映射") | [Go](../problems/decrypt-string-from-alphabet-to-integer-mapping) | Easy |
-| 1310 | [XOR Queries of a Subarray](https://leetcode.com/problems/xor-queries-of-a-subarray "子数组异或查询") | [Go](../problems/xor-queries-of-a-subarray) | Medium |
-| 1311 | [Get Watched Videos by Your Friends](https://leetcode.com/problems/get-watched-videos-by-your-friends "获取你好友已观看的视频") | [Go](../problems/get-watched-videos-by-your-friends) | Medium |
-| 1312 | [Minimum Insertion Steps to Make a String Palindrome](https://leetcode.com/problems/minimum-insertion-steps-to-make-a-string-palindrome "让字符串成为回文串的最少插入次数") | [Go](../problems/minimum-insertion-steps-to-make-a-string-palindrome) | Hard |
-| 1313 | [Decompress Run-Length Encoded List](https://leetcode.com/problems/decompress-run-length-encoded-list "解压缩编码列表") | [Go](../problems/decompress-run-length-encoded-list) | Easy |
-| 1314 | [Matrix Block Sum](https://leetcode.com/problems/matrix-block-sum "矩阵区域和") | [Go](../problems/matrix-block-sum) | Medium |
-| 1315 | [Sum of Nodes with Even-Valued Grandparent](https://leetcode.com/problems/sum-of-nodes-with-even-valued-grandparent "祖父节点值为偶数的节点和") | [Go](../problems/sum-of-nodes-with-even-valued-grandparent) | Medium |
-| 1316 | [Distinct Echo Substrings](https://leetcode.com/problems/distinct-echo-substrings "不同的循环子字符串") | [Go](../problems/distinct-echo-substrings) | Hard |
-| 1317 | [Convert Integer to the Sum of Two No-Zero Integers](https://leetcode.com/problems/convert-integer-to-the-sum-of-two-no-zero-integers "将整数转换为两个无零整数的和") | [Go](../problems/convert-integer-to-the-sum-of-two-no-zero-integers) | Easy |
-| 1318 | [Minimum Flips to Make a OR b Equal to c](https://leetcode.com/problems/minimum-flips-to-make-a-or-b-equal-to-c "或运算的最小翻转次数") | [Go](../problems/minimum-flips-to-make-a-or-b-equal-to-c) | Medium |
-| 1319 | [Number of Operations to Make Network Connected](https://leetcode.com/problems/number-of-operations-to-make-network-connected "连通网络的操作次数") | [Go](../problems/number-of-operations-to-make-network-connected) | Medium |
-| 1320 | [Minimum Distance to Type a Word Using Two Fingers](https://leetcode.com/problems/minimum-distance-to-type-a-word-using-two-fingers "二指输入的的最小距离") | [Go](../problems/minimum-distance-to-type-a-word-using-two-fingers) | Hard |
-| 1321 | [Restaurant Growth](https://leetcode.com/problems/restaurant-growth "餐馆营业额变化增长") 🔒 | [MySQL](../problems/restaurant-growth) | Medium |
-| 1322 | [Ads Performance](https://leetcode.com/problems/ads-performance "广告效果") 🔒 | [MySQL](../problems/ads-performance) | Easy |
-| 1323 | [Maximum 69 Number](https://leetcode.com/problems/maximum-69-number "6 和 9 组成的最大数字") | [Go](../problems/maximum-69-number) | Easy |
-| 1324 | [Print Words Vertically](https://leetcode.com/problems/print-words-vertically "竖直打印单词") | [Go](../problems/print-words-vertically) | Medium |
-| 1325 | [Delete Leaves With a Given Value](https://leetcode.com/problems/delete-leaves-with-a-given-value "删除给定值的叶子节点") | [Go](../problems/delete-leaves-with-a-given-value) | Medium |
-| 1326 | [Minimum Number of Taps to Open to Water a Garden](https://leetcode.com/problems/minimum-number-of-taps-to-open-to-water-a-garden "灌溉花园的最少水龙头数目") | [Go](../problems/minimum-number-of-taps-to-open-to-water-a-garden) | Hard |
-| 1327 | [List the Products Ordered in a Period](https://leetcode.com/problems/list-the-products-ordered-in-a-period "列出指定时间段内所有的下单产品") 🔒 | [MySQL](../problems/list-the-products-ordered-in-a-period) | Easy |
-| 1328 | [Break a Palindrome](https://leetcode.com/problems/break-a-palindrome "破坏回文串") | [Go](../problems/break-a-palindrome) | Medium |
-| 1329 | [Sort the Matrix Diagonally](https://leetcode.com/problems/sort-the-matrix-diagonally "将矩阵按对角线排序") | [Go](../problems/sort-the-matrix-diagonally) | Medium |
-| 1330 | [Reverse Subarray To Maximize Array Value](https://leetcode.com/problems/reverse-subarray-to-maximize-array-value "翻转子数组得到最大的数组值") | [Go](../problems/reverse-subarray-to-maximize-array-value) | Hard |
-| 1331 | [Rank Transform of an Array](https://leetcode.com/problems/rank-transform-of-an-array "数组序号转换") | [Go](../problems/rank-transform-of-an-array) | Easy |
-| 1332 | [Remove Palindromic Subsequences](https://leetcode.com/problems/remove-palindromic-subsequences "删除回文子序列") | [Go](../problems/remove-palindromic-subsequences) | Easy |
-| 1333 | [Filter Restaurants by Vegan-Friendly, Price and Distance](https://leetcode.com/problems/filter-restaurants-by-vegan-friendly-price-and-distance "餐厅过滤器") | [Go](../problems/filter-restaurants-by-vegan-friendly-price-and-distance) | Medium |
-| 1334 | [Find the City With the Smallest Number of Neighbors at a Threshold Distance](https://leetcode.com/problems/find-the-city-with-the-smallest-number-of-neighbors-at-a-threshold-distance "阈值距离内邻居最少的城市") | [Go](../problems/find-the-city-with-the-smallest-number-of-neighbors-at-a-threshold-distance) | Medium |
-| 1335 | [Minimum Difficulty of a Job Schedule](https://leetcode.com/problems/minimum-difficulty-of-a-job-schedule "工作计划的最低难度") | [Go](../problems/minimum-difficulty-of-a-job-schedule) | Hard |
-| 1336 | [Number of Transactions per Visit](https://leetcode.com/problems/number-of-transactions-per-visit "每次访问的交易次数") 🔒 | [MySQL](../problems/number-of-transactions-per-visit) | Hard |
-| 1337 | [The K Weakest Rows in a Matrix](https://leetcode.com/problems/the-k-weakest-rows-in-a-matrix "矩阵中战斗力最弱的 K 行") | [Go](../problems/the-k-weakest-rows-in-a-matrix) | Easy |
-| 1338 | [Reduce Array Size to The Half](https://leetcode.com/problems/reduce-array-size-to-the-half "数组大小减半") | [Go](../problems/reduce-array-size-to-the-half) | Medium |
-| 1339 | [Maximum Product of Splitted Binary Tree](https://leetcode.com/problems/maximum-product-of-splitted-binary-tree "分裂二叉树的最大乘积") | [Go](../problems/maximum-product-of-splitted-binary-tree) | Medium |
-| 1340 | [Jump Game V](https://leetcode.com/problems/jump-game-v "跳跃游戏 V") | [Go](../problems/jump-game-v) | Hard |
-| 1341 | [Movie Rating](https://leetcode.com/problems/movie-rating "电影评分") 🔒 | [MySQL](../problems/movie-rating) | Medium |
-| 1342 | [Number of Steps to Reduce a Number to Zero](https://leetcode.com/problems/number-of-steps-to-reduce-a-number-to-zero "将数字变成 0 的操作次数") | [Go](../problems/number-of-steps-to-reduce-a-number-to-zero) | Easy |
-| 1343 | [Number of Sub-arrays of Size K and Average Greater than or Equal to Threshold](https://leetcode.com/problems/number-of-sub-arrays-of-size-k-and-average-greater-than-or-equal-to-threshold "大小为 K 且平均值大于等于阈值的子数组数目") | [Go](../problems/number-of-sub-arrays-of-size-k-and-average-greater-than-or-equal-to-threshold) | Medium |
-| 1344 | [Angle Between Hands of a Clock](https://leetcode.com/problems/angle-between-hands-of-a-clock "时钟指针的夹角") | [Go](../problems/angle-between-hands-of-a-clock) | Medium |
-| 1345 | [Jump Game IV](https://leetcode.com/problems/jump-game-iv "跳跃游戏 IV") | [Go](../problems/jump-game-iv) | Hard |
-| 1346 | [Check If N and Its Double Exist](https://leetcode.com/problems/check-if-n-and-its-double-exist "检查整数及其两倍数是否存在") | [Go](../problems/check-if-n-and-its-double-exist) | Easy |
-| 1347 | [Minimum Number of Steps to Make Two Strings Anagram](https://leetcode.com/problems/minimum-number-of-steps-to-make-two-strings-anagram "制造字母异位词的最小步骤数") | [Go](../problems/minimum-number-of-steps-to-make-two-strings-anagram) | Medium |
-| 1348 | [Tweet Counts Per Frequency](https://leetcode.com/problems/tweet-counts-per-frequency "推文计数") | [Go](../problems/tweet-counts-per-frequency) | Medium |
-| 1349 | [Maximum Students Taking Exam](https://leetcode.com/problems/maximum-students-taking-exam "参加考试的最大学生数") | [Go](../problems/maximum-students-taking-exam) | Hard |
-| 1350 | [Students With Invalid Departments](https://leetcode.com/problems/students-with-invalid-departments "院系无效的学生") 🔒 | [MySQL](../problems/students-with-invalid-departments) | Easy |
-| 1351 | [Count Negative Numbers in a Sorted Matrix](https://leetcode.com/problems/count-negative-numbers-in-a-sorted-matrix "统计有序矩阵中的负数") | [Go](../problems/count-negative-numbers-in-a-sorted-matrix) | Easy |
-| 1352 | [Product of the Last K Numbers](https://leetcode.com/problems/product-of-the-last-k-numbers "最后 K 个数的乘积") | [Go](../problems/product-of-the-last-k-numbers) | Medium |
-| 1353 | [Maximum Number of Events That Can Be Attended](https://leetcode.com/problems/maximum-number-of-events-that-can-be-attended "最多可以参加的会议数目") | [Go](../problems/maximum-number-of-events-that-can-be-attended) | Medium |
-| 1354 | [Construct Target Array With Multiple Sums](https://leetcode.com/problems/construct-target-array-with-multiple-sums "多次求和构造目标数组") | [Go](../problems/construct-target-array-with-multiple-sums) | Hard |
-| 1355 | [Activity Participants](https://leetcode.com/problems/activity-participants "活动参与者") 🔒 | [MySQL](../problems/activity-participants) | Medium |
-| 1356 | [Sort Integers by The Number of 1 Bits](https://leetcode.com/problems/sort-integers-by-the-number-of-1-bits "根据数字二进制下 1 的数目排序") | [Go](../problems/sort-integers-by-the-number-of-1-bits) | Easy |
-| 1357 | [Apply Discount Every n Orders](https://leetcode.com/problems/apply-discount-every-n-orders "每隔 n 个顾客打折") | [Go](../problems/apply-discount-every-n-orders) | Medium |
-| 1358 | [Number of Substrings Containing All Three Characters](https://leetcode.com/problems/number-of-substrings-containing-all-three-characters "包含所有三种字符的子字符串数目") | [Go](../problems/number-of-substrings-containing-all-three-characters) | Medium |
-| 1359 | [Count All Valid Pickup and Delivery Options](https://leetcode.com/problems/count-all-valid-pickup-and-delivery-options "有效的快递序列数目") | [Go](../problems/count-all-valid-pickup-and-delivery-options) | Hard |
-| 1360 | [Number of Days Between Two Dates](https://leetcode.com/problems/number-of-days-between-two-dates "日期之间隔几天") | [Go](../problems/number-of-days-between-two-dates) | Easy |
-| 1361 | [Validate Binary Tree Nodes](https://leetcode.com/problems/validate-binary-tree-nodes "验证二叉树") | [Go](../problems/validate-binary-tree-nodes) | Medium |
-| 1362 | [Closest Divisors](https://leetcode.com/problems/closest-divisors "最接近的因数") | [Go](../problems/closest-divisors) | Medium |
-| 1363 | [Largest Multiple of Three](https://leetcode.com/problems/largest-multiple-of-three "形成三的最大倍数") | [Go](../problems/largest-multiple-of-three) | Hard |
-| 1364 | [Number of Trusted Contacts of a Customer](https://leetcode.com/problems/number-of-trusted-contacts-of-a-customer "顾客的可信联系人数量") 🔒 | [MySQL](../problems/number-of-trusted-contacts-of-a-customer) | Medium |
-| 1365 | [How Many Numbers Are Smaller Than the Current Number](https://leetcode.com/problems/how-many-numbers-are-smaller-than-the-current-number "有多少小于当前数字的数字") | [Go](../problems/how-many-numbers-are-smaller-than-the-current-number) | Easy |
-| 1366 | [Rank Teams by Votes](https://leetcode.com/problems/rank-teams-by-votes "通过投票对团队排名") | [Go](../problems/rank-teams-by-votes) | Medium |
-| 1367 | [Linked List in Binary Tree](https://leetcode.com/problems/linked-list-in-binary-tree "二叉树中的列表") | [Go](../problems/linked-list-in-binary-tree) | Medium |
-| 1368 | [Minimum Cost to Make at Least One Valid Path in a Grid](https://leetcode.com/problems/minimum-cost-to-make-at-least-one-valid-path-in-a-grid "使网格图至少有一条有效路径的最小代价") | [Go](../problems/minimum-cost-to-make-at-least-one-valid-path-in-a-grid) | Hard |
-| 1369 | [Get the Second Most Recent Activity](https://leetcode.com/problems/get-the-second-most-recent-activity "获取最近第二次的活动") 🔒 | [MySQL](../problems/get-the-second-most-recent-activity) | Hard |
-| 1370 | [Increasing Decreasing String](https://leetcode.com/problems/increasing-decreasing-string "上升下降字符串") | [Go](../problems/increasing-decreasing-string) | Easy |
-| 1371 | [Find the Longest Substring Containing Vowels in Even Counts](https://leetcode.com/problems/find-the-longest-substring-containing-vowels-in-even-counts "每个元音包含偶数次的最长子字符串") | [Go](../problems/find-the-longest-substring-containing-vowels-in-even-counts) | Medium |
-| 1372 | [Longest ZigZag Path in a Binary Tree](https://leetcode.com/problems/longest-zigzag-path-in-a-binary-tree "二叉树中的最长交错路径") | [Go](../problems/longest-zigzag-path-in-a-binary-tree) | Medium |
-| 1373 | [Maximum Sum BST in Binary Tree](https://leetcode.com/problems/maximum-sum-bst-in-binary-tree "二叉搜索子树的最大键值和") | [Go](../problems/maximum-sum-bst-in-binary-tree) | Hard |
-| 1374 | [Generate a String With Characters That Have Odd Counts](https://leetcode.com/problems/generate-a-string-with-characters-that-have-odd-counts "生成每种字符都是奇数个的字符串") | [Go](../problems/generate-a-string-with-characters-that-have-odd-counts) | Easy |
-| 1375 | [Number of Times Binary String Is Prefix-Aligned](https://leetcode.com/problems/number-of-times-binary-string-is-prefix-aligned "二进制字符串前缀一致的次数") | [Go](../problems/number-of-times-binary-string-is-prefix-aligned) | Medium |
-| 1376 | [Time Needed to Inform All Employees](https://leetcode.com/problems/time-needed-to-inform-all-employees "通知所有员工所需的时间") | [Go](../problems/time-needed-to-inform-all-employees) | Medium |
-| 1377 | [Frog Position After T Seconds](https://leetcode.com/problems/frog-position-after-t-seconds "T 秒后青蛙的位置") | [Go](../problems/frog-position-after-t-seconds) | Hard |
-| 1378 | [Replace Employee ID With The Unique Identifier](https://leetcode.com/problems/replace-employee-id-with-the-unique-identifier "使用唯一标识码替换员工ID") 🔒 | [MySQL](../problems/replace-employee-id-with-the-unique-identifier) | Easy |
-| 1379 | [Find a Corresponding Node of a Binary Tree in a Clone of That Tree](https://leetcode.com/problems/find-a-corresponding-node-of-a-binary-tree-in-a-clone-of-that-tree "找出克隆二叉树中的相同节点") | [Go](../problems/find-a-corresponding-node-of-a-binary-tree-in-a-clone-of-that-tree) | Medium |
-| 1380 | [Lucky Numbers in a Matrix](https://leetcode.com/problems/lucky-numbers-in-a-matrix "矩阵中的幸运数") | [Go](../problems/lucky-numbers-in-a-matrix) | Easy |
-| 1381 | [Design a Stack With Increment Operation](https://leetcode.com/problems/design-a-stack-with-increment-operation "设计一个支持增量操作的栈") | [Go](../problems/design-a-stack-with-increment-operation) | Medium |
-| 1382 | [Balance a Binary Search Tree](https://leetcode.com/problems/balance-a-binary-search-tree "将二叉搜索树变平衡") | [Go](../problems/balance-a-binary-search-tree) | Medium |
-| 1383 | [Maximum Performance of a Team](https://leetcode.com/problems/maximum-performance-of-a-team "最大的团队表现值") | [Go](../problems/maximum-performance-of-a-team) | Hard |
-| 1384 | [Total Sales Amount by Year](https://leetcode.com/problems/total-sales-amount-by-year "按年度列出销售总额") 🔒 | [MySQL](../problems/total-sales-amount-by-year) | Hard |
-| 1385 | [Find the Distance Value Between Two Arrays](https://leetcode.com/problems/find-the-distance-value-between-two-arrays "两个数组间的距离值") | [Go](../problems/find-the-distance-value-between-two-arrays) | Easy |
-| 1386 | [Cinema Seat Allocation](https://leetcode.com/problems/cinema-seat-allocation "安排电影院座位") | [Go](../problems/cinema-seat-allocation) | Medium |
-| 1387 | [Sort Integers by The Power Value](https://leetcode.com/problems/sort-integers-by-the-power-value "将整数按权重排序") | [Go](../problems/sort-integers-by-the-power-value) | Medium |
-| 1388 | [Pizza With 3n Slices](https://leetcode.com/problems/pizza-with-3n-slices "3n 块披萨") | [Go](../problems/pizza-with-3n-slices) | Hard |
-| 1389 | [Create Target Array in the Given Order](https://leetcode.com/problems/create-target-array-in-the-given-order "按既定顺序创建目标数组") | [Go](../problems/create-target-array-in-the-given-order) | Easy |
-| 1390 | [Four Divisors](https://leetcode.com/problems/four-divisors "四因数") | [Go](../problems/four-divisors) | Medium |
-| 1391 | [Check if There is a Valid Path in a Grid](https://leetcode.com/problems/check-if-there-is-a-valid-path-in-a-grid "检查网格中是否存在有效路径") | [Go](../problems/check-if-there-is-a-valid-path-in-a-grid) | Medium |
-| 1392 | [Longest Happy Prefix](https://leetcode.com/problems/longest-happy-prefix "最长快乐前缀") | [Go](../problems/longest-happy-prefix) | Hard |
-| 1393 | [Capital Gain/Loss](https://leetcode.com/problems/capital-gainloss "股票的资本损益") 🔒 | [MySQL](../problems/capital-gainloss) | Medium |
-| 1394 | [Find Lucky Integer in an Array](https://leetcode.com/problems/find-lucky-integer-in-an-array "找出数组中的幸运数") | [Go](../problems/find-lucky-integer-in-an-array) | Easy |
-| 1395 | [Count Number of Teams](https://leetcode.com/problems/count-number-of-teams "统计作战单位数") | [Go](../problems/count-number-of-teams) | Medium |
-| 1396 | [Design Underground System](https://leetcode.com/problems/design-underground-system "设计地铁系统") | [Go](../problems/design-underground-system) | Medium |
-| 1397 | [Find All Good Strings](https://leetcode.com/problems/find-all-good-strings "找到所有好字符串") | [Go](../problems/find-all-good-strings) | Hard |
-| 1398 | [Customers Who Bought Products A and B but Not C](https://leetcode.com/problems/customers-who-bought-products-a-and-b-but-not-c "购买了产品 A 和产品 B 却没有购买产品 C 的顾客") 🔒 | [MySQL](../problems/customers-who-bought-products-a-and-b-but-not-c) | Medium |
-| 1399 | [Count Largest Group](https://leetcode.com/problems/count-largest-group "统计最大组的数目") | [Go](../problems/count-largest-group) | Easy |
-| 1400 | [Construct K Palindrome Strings](https://leetcode.com/problems/construct-k-palindrome-strings "构造 K 个回文字符串") | [Go](../problems/construct-k-palindrome-strings) | Medium |
-| 1401 | [Circle and Rectangle Overlapping](https://leetcode.com/problems/circle-and-rectangle-overlapping "圆和矩形是否有重叠") | [Go](../problems/circle-and-rectangle-overlapping) | Medium |
-| 1402 | [Reducing Dishes](https://leetcode.com/problems/reducing-dishes "做菜顺序") | [Go](../problems/reducing-dishes) | Hard |
-| 1403 | [Minimum Subsequence in Non-Increasing Order](https://leetcode.com/problems/minimum-subsequence-in-non-increasing-order "非递增顺序的最小子序列") | [Go](../problems/minimum-subsequence-in-non-increasing-order) | Easy |
-| 1404 | [Number of Steps to Reduce a Number in Binary Representation to One](https://leetcode.com/problems/number-of-steps-to-reduce-a-number-in-binary-representation-to-one "将二进制表示减到 1 的步骤数") | [Go](../problems/number-of-steps-to-reduce-a-number-in-binary-representation-to-one) | Medium |
-| 1405 | [Longest Happy String](https://leetcode.com/problems/longest-happy-string "最长快乐字符串") | [Go](../problems/longest-happy-string) | Medium |
-| 1406 | [Stone Game III](https://leetcode.com/problems/stone-game-iii "石子游戏 III") | [Go](../problems/stone-game-iii) | Hard |
-| 1407 | [Top Travellers](https://leetcode.com/problems/top-travellers "排名靠前的旅行者") 🔒 | [MySQL](../problems/top-travellers) | Easy |
-| 1408 | [String Matching in an Array](https://leetcode.com/problems/string-matching-in-an-array "数组中的字符串匹配") | [Go](../problems/string-matching-in-an-array) | Easy |
-| 1409 | [Queries on a Permutation With Key](https://leetcode.com/problems/queries-on-a-permutation-with-key "查询带键的排列") | [Go](../problems/queries-on-a-permutation-with-key) | Medium |
-| 1410 | [HTML Entity Parser](https://leetcode.com/problems/html-entity-parser "HTML 实体解析器") | [Go](../problems/html-entity-parser) | Medium |
-| 1411 | [Number of Ways to Paint N × 3 Grid](https://leetcode.com/problems/number-of-ways-to-paint-n-3-grid "给 N x 3 网格图涂色的方案数") | [Go](../problems/number-of-ways-to-paint-n-3-grid) | Hard |
-| 1412 | [Find the Quiet Students in All Exams](https://leetcode.com/problems/find-the-quiet-students-in-all-exams "查找成绩处于中游的学生") 🔒 | [MySQL](../problems/find-the-quiet-students-in-all-exams) | Hard |
-| 1413 | [Minimum Value to Get Positive Step by Step Sum](https://leetcode.com/problems/minimum-value-to-get-positive-step-by-step-sum "逐步求和得到正数的最小值") | [Go](../problems/minimum-value-to-get-positive-step-by-step-sum) | Easy |
-| 1414 | [Find the Minimum Number of Fibonacci Numbers Whose Sum Is K](https://leetcode.com/problems/find-the-minimum-number-of-fibonacci-numbers-whose-sum-is-k "和为 K 的最少斐波那契数字数目") | [Go](../problems/find-the-minimum-number-of-fibonacci-numbers-whose-sum-is-k) | Medium |
-| 1415 | [The k-th Lexicographical String of All Happy Strings of Length n](https://leetcode.com/problems/the-k-th-lexicographical-string-of-all-happy-strings-of-length-n "长度为 n 的开心字符串中字典序第 k 小的字符串") | [Go](../problems/the-k-th-lexicographical-string-of-all-happy-strings-of-length-n) | Medium |
-| 1416 | [Restore The Array](https://leetcode.com/problems/restore-the-array "恢复数组") | [Go](../problems/restore-the-array) | Hard |
-| 1417 | [Reformat The String](https://leetcode.com/problems/reformat-the-string "重新格式化字符串") | [Go](../problems/reformat-the-string) | Easy |
-| 1418 | [Display Table of Food Orders in a Restaurant](https://leetcode.com/problems/display-table-of-food-orders-in-a-restaurant "点菜展示表") | [Go](../problems/display-table-of-food-orders-in-a-restaurant) | Medium |
-| 1419 | [Minimum Number of Frogs Croaking](https://leetcode.com/problems/minimum-number-of-frogs-croaking "数青蛙") | [Go](../problems/minimum-number-of-frogs-croaking) | Medium |
-| 1420 | [Build Array Where You Can Find The Maximum Exactly K Comparisons](https://leetcode.com/problems/build-array-where-you-can-find-the-maximum-exactly-k-comparisons "生成数组") | [Go](../problems/build-array-where-you-can-find-the-maximum-exactly-k-comparisons) | Hard |
-| 1421 | [NPV Queries](https://leetcode.com/problems/npv-queries "净现值查询") 🔒 | [MySQL](../problems/npv-queries) | Easy |
-| 1422 | [Maximum Score After Splitting a String](https://leetcode.com/problems/maximum-score-after-splitting-a-string "分割字符串的最大得分") | [Go](../problems/maximum-score-after-splitting-a-string) | Easy |
-| 1423 | [Maximum Points You Can Obtain from Cards](https://leetcode.com/problems/maximum-points-you-can-obtain-from-cards "可获得的最大点数") | [Go](../problems/maximum-points-you-can-obtain-from-cards) | Medium |
-| 1424 | [Diagonal Traverse II](https://leetcode.com/problems/diagonal-traverse-ii "对角线遍历 II") | [Go](../problems/diagonal-traverse-ii) | Medium |
-| 1425 | [Constrained Subsequence Sum](https://leetcode.com/problems/constrained-subsequence-sum "带限制的子序列和") | [Go](../problems/constrained-subsequence-sum) | Hard |
-| 1426 | [Counting Elements](https://leetcode.com/problems/counting-elements "数元素") 🔒 | [Go](../problems/counting-elements) | Easy |
-| 1427 | [Perform String Shifts](https://leetcode.com/problems/perform-string-shifts "字符串的左右移") 🔒 | [Go](../problems/perform-string-shifts) | Easy |
-| 1428 | [Leftmost Column with at Least a One](https://leetcode.com/problems/leftmost-column-with-at-least-a-one "至少有一个 1 的最左端列") 🔒 | [Go](../problems/leftmost-column-with-at-least-a-one) | Medium |
-| 1429 | [First Unique Number](https://leetcode.com/problems/first-unique-number "第一个唯一数字") 🔒 | [Go](../problems/first-unique-number) | Medium |
-| 1430 | [Check If a String Is a Valid Sequence from Root to Leaves Path in a Binary Tree](https://leetcode.com/problems/check-if-a-string-is-a-valid-sequence-from-root-to-leaves-path-in-a-binary-tree "判断给定的序列是否是二叉树从根到叶的路径") 🔒 | [Go](../problems/check-if-a-string-is-a-valid-sequence-from-root-to-leaves-path-in-a-binary-tree) | Medium |
-| 1431 | [Kids With the Greatest Number of Candies](https://leetcode.com/problems/kids-with-the-greatest-number-of-candies "拥有最多糖果的孩子") | [Go](../problems/kids-with-the-greatest-number-of-candies) | Easy |
-| 1432 | [Max Difference You Can Get From Changing an Integer](https://leetcode.com/problems/max-difference-you-can-get-from-changing-an-integer "改变一个整数能得到的最大差值") | [Go](../problems/max-difference-you-can-get-from-changing-an-integer) | Medium |
-| 1433 | [Check If a String Can Break Another String](https://leetcode.com/problems/check-if-a-string-can-break-another-string "检查一个字符串是否可以打破另一个字符串") | [Go](../problems/check-if-a-string-can-break-another-string) | Medium |
-| 1434 | [Number of Ways to Wear Different Hats to Each Other](https://leetcode.com/problems/number-of-ways-to-wear-different-hats-to-each-other "每个人戴不同帽子的方案数") | [Go](../problems/number-of-ways-to-wear-different-hats-to-each-other) | Hard |
-| 1435 | [Create a Session Bar Chart](https://leetcode.com/problems/create-a-session-bar-chart "制作会话柱状图") 🔒 | [MySQL](../problems/create-a-session-bar-chart) | Easy |
-| 1436 | [Destination City](https://leetcode.com/problems/destination-city "旅行终点站") | [Go](../problems/destination-city) | Easy |
-| 1437 | [Check If All 1's Are at Least Length K Places Away](https://leetcode.com/problems/check-if-all-1s-are-at-least-length-k-places-away "是否所有 1 都至少相隔 k 个元素") | [Go](../problems/check-if-all-1s-are-at-least-length-k-places-away) | Easy |
-| 1438 | [Longest Continuous Subarray With Absolute Diff Less Than or Equal to Limit](https://leetcode.com/problems/longest-continuous-subarray-with-absolute-diff-less-than-or-equal-to-limit "绝对差不超过限制的最长连续子数组") | [Go](../problems/longest-continuous-subarray-with-absolute-diff-less-than-or-equal-to-limit) | Medium |
-| 1439 | [Find the Kth Smallest Sum of a Matrix With Sorted Rows](https://leetcode.com/problems/find-the-kth-smallest-sum-of-a-matrix-with-sorted-rows "有序矩阵中的第 k 个最小数组和") | [Go](../problems/find-the-kth-smallest-sum-of-a-matrix-with-sorted-rows) | Hard |
-| 1440 | [Evaluate Boolean Expression](https://leetcode.com/problems/evaluate-boolean-expression "计算布尔表达式的值") 🔒 | [MySQL](../problems/evaluate-boolean-expression) | Medium |
-| 1441 | [Build an Array With Stack Operations](https://leetcode.com/problems/build-an-array-with-stack-operations "用栈操作构建数组") | [Go](../problems/build-an-array-with-stack-operations) | Easy |
-| 1442 | [Count Triplets That Can Form Two Arrays of Equal XOR](https://leetcode.com/problems/count-triplets-that-can-form-two-arrays-of-equal-xor "形成两个异或相等数组的三元组数目") | [Go](../problems/count-triplets-that-can-form-two-arrays-of-equal-xor) | Medium |
-| 1443 | [Minimum Time to Collect All Apples in a Tree](https://leetcode.com/problems/minimum-time-to-collect-all-apples-in-a-tree "收集树上所有苹果的最少时间") | [Go](../problems/minimum-time-to-collect-all-apples-in-a-tree) | Medium |
-| 1444 | [Number of Ways of Cutting a Pizza](https://leetcode.com/problems/number-of-ways-of-cutting-a-pizza "切披萨的方案数") | [Go](../problems/number-of-ways-of-cutting-a-pizza) | Hard |
-| 1445 | [Apples & Oranges](https://leetcode.com/problems/apples-oranges "苹果和桔子") 🔒 | [MySQL](../problems/apples-oranges) | Medium |
-| 1446 | [Consecutive Characters](https://leetcode.com/problems/consecutive-characters "连续字符") | [Go](../problems/consecutive-characters) | Easy |
-| 1447 | [Simplified Fractions](https://leetcode.com/problems/simplified-fractions "最简分数") | [Go](../problems/simplified-fractions) | Medium |
-| 1448 | [Count Good Nodes in Binary Tree](https://leetcode.com/problems/count-good-nodes-in-binary-tree "统计二叉树中好节点的数目") | [Go](../problems/count-good-nodes-in-binary-tree) | Medium |
-| 1449 | [Form Largest Integer With Digits That Add up to Target](https://leetcode.com/problems/form-largest-integer-with-digits-that-add-up-to-target "数位成本和为目标值的最大数字") | [Go](../problems/form-largest-integer-with-digits-that-add-up-to-target) | Hard |
-| 1450 | [Number of Students Doing Homework at a Given Time](https://leetcode.com/problems/number-of-students-doing-homework-at-a-given-time "在既定时间做作业的学生人数") | [Go](../problems/number-of-students-doing-homework-at-a-given-time) | Easy |
-| 1451 | [Rearrange Words in a Sentence](https://leetcode.com/problems/rearrange-words-in-a-sentence "重新排列句子中的单词") | [Go](../problems/rearrange-words-in-a-sentence) | Medium |
-| 1452 | [People Whose List of Favorite Companies Is Not a Subset of Another List](https://leetcode.com/problems/people-whose-list-of-favorite-companies-is-not-a-subset-of-another-list "收藏清单") | [Go](../problems/people-whose-list-of-favorite-companies-is-not-a-subset-of-another-list) | Medium |
-| 1453 | [Maximum Number of Darts Inside of a Circular Dartboard](https://leetcode.com/problems/maximum-number-of-darts-inside-of-a-circular-dartboard "圆形靶内的最大飞镖数量") | [Go](../problems/maximum-number-of-darts-inside-of-a-circular-dartboard) | Hard |
-| 1454 | [Active Users](https://leetcode.com/problems/active-users "活跃用户") 🔒 | [MySQL](../problems/active-users) | Medium |
-| 1455 | [Check If a Word Occurs As a Prefix of Any Word in a Sentence](https://leetcode.com/problems/check-if-a-word-occurs-as-a-prefix-of-any-word-in-a-sentence "检查单词是否为句中其他单词的前缀") | [Go](../problems/check-if-a-word-occurs-as-a-prefix-of-any-word-in-a-sentence) | Easy |
-| 1456 | [Maximum Number of Vowels in a Substring of Given Length](https://leetcode.com/problems/maximum-number-of-vowels-in-a-substring-of-given-length "定长子串中元音的最大数目") | [Go](../problems/maximum-number-of-vowels-in-a-substring-of-given-length) | Medium |
-| 1457 | [Pseudo-Palindromic Paths in a Binary Tree](https://leetcode.com/problems/pseudo-palindromic-paths-in-a-binary-tree "二叉树中的伪回文路径") | [Go](../problems/pseudo-palindromic-paths-in-a-binary-tree) | Medium |
-| 1458 | [Max Dot Product of Two Subsequences](https://leetcode.com/problems/max-dot-product-of-two-subsequences "两个子序列的最大点积") | [Go](../problems/max-dot-product-of-two-subsequences) | Hard |
-| 1459 | [Rectangles Area](https://leetcode.com/problems/rectangles-area "矩形面积") 🔒 | [MySQL](../problems/rectangles-area) | Medium |
-| 1460 | [Make Two Arrays Equal by Reversing Sub-arrays](https://leetcode.com/problems/make-two-arrays-equal-by-reversing-sub-arrays "通过翻转子数组使两个数组相等") | [Go](../problems/make-two-arrays-equal-by-reversing-sub-arrays) | Easy |
-| 1461 | [Check If a String Contains All Binary Codes of Size K](https://leetcode.com/problems/check-if-a-string-contains-all-binary-codes-of-size-k "检查一个字符串是否包含所有长度为 K 的二进制子串") | [Go](../problems/check-if-a-string-contains-all-binary-codes-of-size-k) | Medium |
-| 1462 | [Course Schedule IV](https://leetcode.com/problems/course-schedule-iv "课程表 IV") | [Go](../problems/course-schedule-iv) | Medium |
-| 1463 | [Cherry Pickup II](https://leetcode.com/problems/cherry-pickup-ii "摘樱桃 II") | [Go](../problems/cherry-pickup-ii) | Hard |
-| 1464 | [Maximum Product of Two Elements in an Array](https://leetcode.com/problems/maximum-product-of-two-elements-in-an-array "数组中两元素的最大乘积") | [Go](../problems/maximum-product-of-two-elements-in-an-array) | Easy |
-| 1465 | [Maximum Area of a Piece of Cake After Horizontal and Vertical Cuts](https://leetcode.com/problems/maximum-area-of-a-piece-of-cake-after-horizontal-and-vertical-cuts "切割后面积最大的蛋糕") | [Go](../problems/maximum-area-of-a-piece-of-cake-after-horizontal-and-vertical-cuts) | Medium |
-| 1466 | [Reorder Routes to Make All Paths Lead to the City Zero](https://leetcode.com/problems/reorder-routes-to-make-all-paths-lead-to-the-city-zero "重新规划路线") | [Go](../problems/reorder-routes-to-make-all-paths-lead-to-the-city-zero) | Medium |
-| 1467 | [Probability of a Two Boxes Having The Same Number of Distinct Balls](https://leetcode.com/problems/probability-of-a-two-boxes-having-the-same-number-of-distinct-balls "两个盒子中球的颜色数相同的概率") | [Go](../problems/probability-of-a-two-boxes-having-the-same-number-of-distinct-balls) | Hard |
-| 1468 | [Calculate Salaries](https://leetcode.com/problems/calculate-salaries "计算税后工资") 🔒 | [MySQL](../problems/calculate-salaries) | Medium |
-| 1469 | [Find All The Lonely Nodes](https://leetcode.com/problems/find-all-the-lonely-nodes "寻找所有的独生节点") 🔒 | [Go](../problems/find-all-the-lonely-nodes) | Easy |
-| 1470 | [Shuffle the Array](https://leetcode.com/problems/shuffle-the-array "重新排列数组") | [Go](../problems/shuffle-the-array) | Easy |
-| 1471 | [The k Strongest Values in an Array](https://leetcode.com/problems/the-k-strongest-values-in-an-array "数组中的 k 个最强值") | [Go](../problems/the-k-strongest-values-in-an-array) | Medium |
-| 1472 | [Design Browser History](https://leetcode.com/problems/design-browser-history "设计浏览器历史记录") | [Go](../problems/design-browser-history) | Medium |
-| 1473 | [Paint House III](https://leetcode.com/problems/paint-house-iii "粉刷房子 III") | [Go](../problems/paint-house-iii) | Hard |
-| 1474 | [Delete N Nodes After M Nodes of a Linked List](https://leetcode.com/problems/delete-n-nodes-after-m-nodes-of-a-linked-list "删除链表 M 个节点之后的 N 个节点") 🔒 | [Go](../problems/delete-n-nodes-after-m-nodes-of-a-linked-list) | Easy |
-| 1475 | [Final Prices With a Special Discount in a Shop](https://leetcode.com/problems/final-prices-with-a-special-discount-in-a-shop "商品折扣后的最终价格") | [Go](../problems/final-prices-with-a-special-discount-in-a-shop) | Easy |
-| 1476 | [Subrectangle Queries](https://leetcode.com/problems/subrectangle-queries "子矩形查询") | [Go](../problems/subrectangle-queries) | Medium |
-| 1477 | [Find Two Non-overlapping Sub-arrays Each With Target Sum](https://leetcode.com/problems/find-two-non-overlapping-sub-arrays-each-with-target-sum "找两个和为目标值且不重叠的子数组") | [Go](../problems/find-two-non-overlapping-sub-arrays-each-with-target-sum) | Medium |
-| 1478 | [Allocate Mailboxes](https://leetcode.com/problems/allocate-mailboxes "安排邮筒") | [Go](../problems/allocate-mailboxes) | Hard |
-| 1479 | [Sales by Day of the Week](https://leetcode.com/problems/sales-by-day-of-the-week "周内每天的销售情况") 🔒 | [MySQL](../problems/sales-by-day-of-the-week) | Hard |
-| 1480 | [Running Sum of 1d Array](https://leetcode.com/problems/running-sum-of-1d-array "一维数组的动态和") | [Go](../problems/running-sum-of-1d-array) | Easy |
-| 1481 | [Least Number of Unique Integers after K Removals](https://leetcode.com/problems/least-number-of-unique-integers-after-k-removals "不同整数的最少数目") | [Go](../problems/least-number-of-unique-integers-after-k-removals) | Medium |
-| 1482 | [Minimum Number of Days to Make m Bouquets](https://leetcode.com/problems/minimum-number-of-days-to-make-m-bouquets "制作 m 束花所需的最少天数") | [Go](../problems/minimum-number-of-days-to-make-m-bouquets) | Medium |
-| 1483 | [Kth Ancestor of a Tree Node](https://leetcode.com/problems/kth-ancestor-of-a-tree-node "树节点的第 K 个祖先") | [Go](../problems/kth-ancestor-of-a-tree-node) | Hard |
-| 1484 | [Group Sold Products By The Date](https://leetcode.com/problems/group-sold-products-by-the-date "按日期分组销售产品") 🔒 | [MySQL](../problems/group-sold-products-by-the-date) | Easy |
-| 1485 | [Clone Binary Tree With Random Pointer](https://leetcode.com/problems/clone-binary-tree-with-random-pointer "克隆含随机指针的二叉树") 🔒 | [Go](../problems/clone-binary-tree-with-random-pointer) | Medium |
-| 1486 | [XOR Operation in an Array](https://leetcode.com/problems/xor-operation-in-an-array "数组异或操作") | [Go](../problems/xor-operation-in-an-array) | Easy |
-| 1487 | [Making File Names Unique](https://leetcode.com/problems/making-file-names-unique "保证文件名唯一") | [Go](../problems/making-file-names-unique) | Medium |
-| 1488 | [Avoid Flood in The City](https://leetcode.com/problems/avoid-flood-in-the-city "避免洪水泛滥") | [Go](../problems/avoid-flood-in-the-city) | Medium |
-| 1489 | [Find Critical and Pseudo-Critical Edges in Minimum Spanning Tree](https://leetcode.com/problems/find-critical-and-pseudo-critical-edges-in-minimum-spanning-tree "找到最小生成树里的关键边和伪关键边") | [Go](../problems/find-critical-and-pseudo-critical-edges-in-minimum-spanning-tree) | Hard |
-| 1490 | [Clone N-ary Tree](https://leetcode.com/problems/clone-n-ary-tree "克隆 N 叉树") 🔒 | [Go](../problems/clone-n-ary-tree) | Medium |
-| 1491 | [Average Salary Excluding the Minimum and Maximum Salary](https://leetcode.com/problems/average-salary-excluding-the-minimum-and-maximum-salary "去掉最低工资和最高工资后的工资平均值") | [Go](../problems/average-salary-excluding-the-minimum-and-maximum-salary) | Easy |
-| 1492 | [The kth Factor of n](https://leetcode.com/problems/the-kth-factor-of-n "n 的第 k 个因子") | [Go](../problems/the-kth-factor-of-n) | Medium |
-| 1493 | [Longest Subarray of 1's After Deleting One Element](https://leetcode.com/problems/longest-subarray-of-1s-after-deleting-one-element "删掉一个元素以后全为 1 的最长子数组") | [Go](../problems/longest-subarray-of-1s-after-deleting-one-element) | Medium |
-| 1494 | [Parallel Courses II](https://leetcode.com/problems/parallel-courses-ii "并行课程 II") | [Go](../problems/parallel-courses-ii) | Hard |
-| 1495 | [Friendly Movies Streamed Last Month](https://leetcode.com/problems/friendly-movies-streamed-last-month "上月播放的儿童适宜电影") 🔒 | [MySQL](../problems/friendly-movies-streamed-last-month) | Easy |
-| 1496 | [Path Crossing](https://leetcode.com/problems/path-crossing "判断路径是否相交") | [Go](../problems/path-crossing) | Easy |
-| 1497 | [Check If Array Pairs Are Divisible by k](https://leetcode.com/problems/check-if-array-pairs-are-divisible-by-k "检查数组对是否可以被 k 整除") | [Go](../problems/check-if-array-pairs-are-divisible-by-k) | Medium |
-| 1498 | [Number of Subsequences That Satisfy the Given Sum Condition](https://leetcode.com/problems/number-of-subsequences-that-satisfy-the-given-sum-condition "满足条件的子序列数目") | [Go](../problems/number-of-subsequences-that-satisfy-the-given-sum-condition) | Medium |
-| 1499 | [Max Value of Equation](https://leetcode.com/problems/max-value-of-equation "满足不等式的最大值") | [Go](../problems/max-value-of-equation) | Hard |
-| 1500 | [Design a File Sharing System](https://leetcode.com/problems/design-a-file-sharing-system "设计文件分享系统") 🔒 | [Go](../problems/design-a-file-sharing-system) | Medium |
diff --git a/readme/1501-1800.md b/readme/1501-1800.md
deleted file mode 100644
index 85463f503..000000000
--- a/readme/1501-1800.md
+++ /dev/null
@@ -1,388 +0,0 @@
-
-
-
-
-
-
-
-# [LeetCode](https://awesee.github.io/leetcode)
-LeetCode Problems' Solutions
-[[力扣](https://awesee.github.io/categories/leetcode/) ∙ [话题分类](https://github.com/awesee/leetcode/blob/master/tag/README.md)]
-
-[](https://github.com/awesee/leetcode/actions)
-[](https://codecov.io/gh/awesee/leetcode)
-[](https://goreportcard.com/report/github.com/awesee/leetcode)
-[](https://github.com/awesee/leetcode/graphs/contributors)
-[](https://github.com/awesee/leetcode/blob/master/LICENSE)
-[](https://app.fossa.io/projects/git%2Bgithub.com%2Fawesee%2Fleetcode?ref=badge_shield)
-[](https://gitter.im/awesee/leetcode?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
-
-