diff --git a/README.md b/README.md index 92292654c..559a978ee 100644 --- a/README.md +++ b/README.md @@ -62,6 +62,7 @@ LeetCode Problems' Solutions | # | Title | Solution | Difficulty | | :-: | - | - | :-: | +| 1270 | [All People Report to the Given Manager](https://leetcode.com/problems/all-people-report-to-the-given-manager) 🔒 | [MySQL](https://github.com/openset/leetcode/tree/master/problems/all-people-report-to-the-given-manager) | 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](https://github.com/openset/leetcode/tree/master/problems/number-of-ways-to-stay-in-the-same-place-after-some-steps) | Hard | | 1268 | [Search Suggestions System](https://leetcode.com/problems/search-suggestions-system "搜索推荐系统") | [Go](https://github.com/openset/leetcode/tree/master/problems/search-suggestions-system) | Medium | | 1267 | [Count Servers that Communicate](https://leetcode.com/problems/count-servers-that-communicate "统计参与通信的服务器") | [Go](https://github.com/openset/leetcode/tree/master/problems/count-servers-that-communicate) | Medium | diff --git a/internal/leetcode/question_data.go b/internal/leetcode/question_data.go index 216cc6f8b..7bcf25a03 100644 --- a/internal/leetcode/question_data.go +++ b/internal/leetcode/question_data.go @@ -224,6 +224,25 @@ func (question *questionType) RenamePackageName() { } } +func (question *questionType) Restore() { + filename := question.getFilePath("README.md") + body := fileGetContents(filename) + pattern := `## [^\n]+\n\n([\S\s]+)` + if bytes.Contains(body, []byte("\n### ")) { + pattern = `## [^\n]+\n\n([\S\s]+?)\n### ` + } + reg := regexp.MustCompile(pattern) + matches := reg.FindSubmatch(body) + if len(matches)>= 2 { + return + } + question.Content = string(matches[1]) + name := fmt.Sprintf(questionDataFile, question.TitleSnake()) + filePutContents(getCachePath(name), jsonEncode(QuestionDataType{ + Data: dataType{Question: *question}, + })) +} + func (question *questionType) getSimilarQuestion() []byte { sq := question.GetSimilarQuestion() var buf bytes.Buffer diff --git a/problems/all-people-report-to-the-given-manager/README.md b/problems/all-people-report-to-the-given-manager/README.md new file mode 100644 index 000000000..b7e1080ef --- /dev/null +++ b/problems/all-people-report-to-the-given-manager/README.md @@ -0,0 +1,14 @@ + + + + + + + +[< Previous](https://github.com/openset/leetcode/tree/master/problems/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> + +## [1270. All People Report to the Given Manager (Medium)](https://leetcode.com/problems/all-people-report-to-the-given-manager "") + + 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 new file mode 100644 index 000000000..25fc46e17 --- /dev/null +++ b/problems/all-people-report-to-the-given-manager/mysql_schemas.sql @@ -0,0 +1,10 @@ +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/longest-substring-with-at-most-k-distinct-characters/README.md b/problems/longest-substring-with-at-most-k-distinct-characters/README.md index 2eda24fa3..338beeb23 100644 --- a/problems/longest-substring-with-at-most-k-distinct-characters/README.md +++ b/problems/longest-substring-with-at-most-k-distinct-characters/README.md @@ -37,7 +37,7 @@ ### Similar Questions 1. [Longest Substring Without Repeating Characters](https://github.com/openset/leetcode/tree/master/problems/longest-substring-without-repeating-characters) (Medium) - 1. [Longest Substring with At Most Two Distinct Characters](https://github.com/openset/leetcode/tree/master/problems/longest-substring-with-at-most-two-distinct-characters) (Hard) + 1. [Longest Substring with At Most Two Distinct Characters](https://github.com/openset/leetcode/tree/master/problems/longest-substring-with-at-most-two-distinct-characters) (Medium) 1. [Longest Repeating Character Replacement](https://github.com/openset/leetcode/tree/master/problems/longest-repeating-character-replacement) (Medium) 1. [Subarrays with K Different Integers](https://github.com/openset/leetcode/tree/master/problems/subarrays-with-k-different-integers) (Hard) 1. [Max Consecutive Ones III](https://github.com/openset/leetcode/tree/master/problems/max-consecutive-ones-iii) (Medium) diff --git a/problems/longest-substring-with-at-most-two-distinct-characters/README.md b/problems/longest-substring-with-at-most-two-distinct-characters/README.md index 92dcd96cd..5968b8604 100644 --- a/problems/longest-substring-with-at-most-two-distinct-characters/README.md +++ b/problems/longest-substring-with-at-most-two-distinct-characters/README.md @@ -9,7 +9,7 @@ [Next>](https://github.com/openset/leetcode/tree/master/problems/intersection-of-two-linked-lists "Intersection of Two Linked Lists") -## [159. Longest Substring with At Most Two Distinct Characters (Hard)](https://leetcode.com/problems/longest-substring-with-at-most-two-distinct-characters "至多包含两个不同字符的最长子串") +## [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.

diff --git a/problems/longest-substring-without-repeating-characters/README.md b/problems/longest-substring-without-repeating-characters/README.md index f4832fa86..000b16105 100644 --- a/problems/longest-substring-without-repeating-characters/README.md +++ b/problems/longest-substring-without-repeating-characters/README.md @@ -51,6 +51,6 @@ [[Sliding Window](https://github.com/openset/leetcode/tree/master/tag/sliding-window/README.md)] ### Similar Questions - 1. [Longest Substring with At Most Two Distinct Characters](https://github.com/openset/leetcode/tree/master/problems/longest-substring-with-at-most-two-distinct-characters) (Hard) + 1. [Longest Substring with At Most Two Distinct Characters](https://github.com/openset/leetcode/tree/master/problems/longest-substring-with-at-most-two-distinct-characters) (Medium) 1. [Longest Substring with At Most K Distinct Characters](https://github.com/openset/leetcode/tree/master/problems/longest-substring-with-at-most-k-distinct-characters) (Hard) 1. [Subarrays with K Different Integers](https://github.com/openset/leetcode/tree/master/problems/subarrays-with-k-different-integers) (Hard) diff --git a/problems/majority-element/README.md b/problems/majority-element/README.md index d9ec695b2..0c3be1c1f 100644 --- a/problems/majority-element/README.md +++ b/problems/majority-element/README.md @@ -9,7 +9,7 @@ [Next>](https://github.com/openset/leetcode/tree/master/problems/two-sum-iii-data-structure-design "Two Sum III - Data structure design") -## [169. Majority Element (Easy)](https://leetcode.com/problems/majority-element "求众数") +## [169. Majority Element (Easy)](https://leetcode.com/problems/majority-element "多数元素")

Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times.

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 index 1efe15fea..2bde286e7 100644 --- 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 @@ -7,7 +7,7 @@ [< Previous](https://github.com/openset/leetcode/tree/master/problems/search-suggestions-system "Search Suggestions System") -Next> +[Next>](https://github.com/openset/leetcode/tree/master/problems/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 "停在原地的方案数") diff --git a/problems/sliding-window-maximum/README.md b/problems/sliding-window-maximum/README.md index 7eadabe28..0976d4e33 100644 --- a/problems/sliding-window-maximum/README.md +++ b/problems/sliding-window-maximum/README.md @@ -43,7 +43,7 @@ Could you solve it in linear time?

### Similar Questions 1. [Minimum Window Substring](https://github.com/openset/leetcode/tree/master/problems/minimum-window-substring) (Hard) 1. [Min Stack](https://github.com/openset/leetcode/tree/master/problems/min-stack) (Easy) - 1. [Longest Substring with At Most Two Distinct Characters](https://github.com/openset/leetcode/tree/master/problems/longest-substring-with-at-most-two-distinct-characters) (Hard) + 1. [Longest Substring with At Most Two Distinct Characters](https://github.com/openset/leetcode/tree/master/problems/longest-substring-with-at-most-two-distinct-characters) (Medium) 1. [Paint House II](https://github.com/openset/leetcode/tree/master/problems/paint-house-ii) (Hard) ### Hints diff --git a/problems/subarrays-with-k-different-integers/README.md b/problems/subarrays-with-k-different-integers/README.md index 94262db20..1314603bd 100644 --- a/problems/subarrays-with-k-different-integers/README.md +++ b/problems/subarrays-with-k-different-integers/README.md @@ -52,5 +52,5 @@ ### Similar Questions 1. [Longest Substring Without Repeating Characters](https://github.com/openset/leetcode/tree/master/problems/longest-substring-without-repeating-characters) (Medium) - 1. [Longest Substring with At Most Two Distinct Characters](https://github.com/openset/leetcode/tree/master/problems/longest-substring-with-at-most-two-distinct-characters) (Hard) + 1. [Longest Substring with At Most Two Distinct Characters](https://github.com/openset/leetcode/tree/master/problems/longest-substring-with-at-most-two-distinct-characters) (Medium) 1. [Longest Substring with At Most K Distinct Characters](https://github.com/openset/leetcode/tree/master/problems/longest-substring-with-at-most-k-distinct-characters) (Hard) diff --git a/readme/1-300.md b/readme/1-300.md index e41e877ef..9ce3ea5c0 100644 --- a/readme/1-300.md +++ b/readme/1-300.md @@ -220,7 +220,7 @@ LeetCode Problems' Solutions | 156 | [Binary Tree Upside Down](https://leetcode.com/problems/binary-tree-upside-down "上下翻转二叉树") 🔒 | [Go](https://github.com/openset/leetcode/tree/master/problems/binary-tree-upside-down) | Medium | | 157 | [Read N Characters Given Read4](https://leetcode.com/problems/read-n-characters-given-read4 "用 Read4 读取 N 个字符") 🔒 | [Go](https://github.com/openset/leetcode/tree/master/problems/read-n-characters-given-read4) | Easy | | 158 | [Read N Characters Given Read4 II - Call multiple times](https://leetcode.com/problems/read-n-characters-given-read4-ii-call-multiple-times "用 Read4 读取 N 个字符 II") 🔒 | [Go](https://github.com/openset/leetcode/tree/master/problems/read-n-characters-given-read4-ii-call-multiple-times) | Hard | -| 159 | [Longest Substring with At Most Two Distinct Characters](https://leetcode.com/problems/longest-substring-with-at-most-two-distinct-characters "至多包含两个不同字符的最长子串") 🔒 | [Go](https://github.com/openset/leetcode/tree/master/problems/longest-substring-with-at-most-two-distinct-characters) | Hard | +| 159 | [Longest Substring with At Most Two Distinct Characters](https://leetcode.com/problems/longest-substring-with-at-most-two-distinct-characters "至多包含两个不同字符的最长子串") 🔒 | [Go](https://github.com/openset/leetcode/tree/master/problems/longest-substring-with-at-most-two-distinct-characters) | Medium | | 160 | [Intersection of Two Linked Lists](https://leetcode.com/problems/intersection-of-two-linked-lists "相交链表") | [Go](https://github.com/openset/leetcode/tree/master/problems/intersection-of-two-linked-lists) | Easy | | 161 | [One Edit Distance](https://leetcode.com/problems/one-edit-distance "相隔为 1 的编辑距离") 🔒 | [Go](https://github.com/openset/leetcode/tree/master/problems/one-edit-distance) | Medium | | 162 | [Find Peak Element](https://leetcode.com/problems/find-peak-element "寻找峰值") | [Go](https://github.com/openset/leetcode/tree/master/problems/find-peak-element) | Medium | @@ -230,7 +230,7 @@ LeetCode Problems' Solutions | 166 | [Fraction to Recurring Decimal](https://leetcode.com/problems/fraction-to-recurring-decimal "分数到小数") | [Go](https://github.com/openset/leetcode/tree/master/problems/fraction-to-recurring-decimal) | Medium | | 167 | [Two Sum II - Input array is sorted](https://leetcode.com/problems/two-sum-ii-input-array-is-sorted "两数之和 II - 输入有序数组") | [Go](https://github.com/openset/leetcode/tree/master/problems/two-sum-ii-input-array-is-sorted) | Easy | | 168 | [Excel Sheet Column Title](https://leetcode.com/problems/excel-sheet-column-title "Excel表列名称") | [Go](https://github.com/openset/leetcode/tree/master/problems/excel-sheet-column-title) | Easy | -| 169 | [Majority Element](https://leetcode.com/problems/majority-element "求众数") | [Go](https://github.com/openset/leetcode/tree/master/problems/majority-element) | Easy | +| 169 | [Majority Element](https://leetcode.com/problems/majority-element "多数元素") | [Go](https://github.com/openset/leetcode/tree/master/problems/majority-element) | Easy | | 170 | [Two Sum III - Data structure design](https://leetcode.com/problems/two-sum-iii-data-structure-design "两数之和 III - 数据结构设计") 🔒 | [Go](https://github.com/openset/leetcode/tree/master/problems/two-sum-iii-data-structure-design) | Easy | | 171 | [Excel Sheet Column Number](https://leetcode.com/problems/excel-sheet-column-number "Excel表列序号") | [Go](https://github.com/openset/leetcode/tree/master/problems/excel-sheet-column-number) | Easy | | 172 | [Factorial Trailing Zeroes](https://leetcode.com/problems/factorial-trailing-zeroes "阶乘后的零") | [Go](https://github.com/openset/leetcode/tree/master/problems/factorial-trailing-zeroes) | Easy | diff --git a/tag/array/README.md b/tag/array/README.md index a7b5afe04..718c93833 100644 --- a/tag/array/README.md +++ b/tag/array/README.md @@ -159,7 +159,7 @@ | 216 | [组合总和 III](https://github.com/openset/leetcode/tree/master/problems/combination-sum-iii) | [[数组](https://github.com/openset/leetcode/tree/master/tag/array/README.md)] [[回溯算法](https://github.com/openset/leetcode/tree/master/tag/backtracking/README.md)] | Medium | | 209 | [长度最小的子数组](https://github.com/openset/leetcode/tree/master/problems/minimum-size-subarray-sum) | [[数组](https://github.com/openset/leetcode/tree/master/tag/array/README.md)] [[双指针](https://github.com/openset/leetcode/tree/master/tag/two-pointers/README.md)] [[二分查找](https://github.com/openset/leetcode/tree/master/tag/binary-search/README.md)] | Medium | | 189 | [旋转数组](https://github.com/openset/leetcode/tree/master/problems/rotate-array) | [[数组](https://github.com/openset/leetcode/tree/master/tag/array/README.md)] | Easy | -| 169 | [求众数](https://github.com/openset/leetcode/tree/master/problems/majority-element) | [[位运算](https://github.com/openset/leetcode/tree/master/tag/bit-manipulation/README.md)] [[数组](https://github.com/openset/leetcode/tree/master/tag/array/README.md)] [[分治算法](https://github.com/openset/leetcode/tree/master/tag/divide-and-conquer/README.md)] | Easy | +| 169 | [多数元素](https://github.com/openset/leetcode/tree/master/problems/majority-element) | [[位运算](https://github.com/openset/leetcode/tree/master/tag/bit-manipulation/README.md)] [[数组](https://github.com/openset/leetcode/tree/master/tag/array/README.md)] [[分治算法](https://github.com/openset/leetcode/tree/master/tag/divide-and-conquer/README.md)] | Easy | | 167 | [两数之和 II - 输入有序数组](https://github.com/openset/leetcode/tree/master/problems/two-sum-ii-input-array-is-sorted) | [[数组](https://github.com/openset/leetcode/tree/master/tag/array/README.md)] [[双指针](https://github.com/openset/leetcode/tree/master/tag/two-pointers/README.md)] [[二分查找](https://github.com/openset/leetcode/tree/master/tag/binary-search/README.md)] | Easy | | 163 | [缺失的区间](https://github.com/openset/leetcode/tree/master/problems/missing-ranges) 🔒 | [[数组](https://github.com/openset/leetcode/tree/master/tag/array/README.md)] | Medium | | 162 | [寻找峰值](https://github.com/openset/leetcode/tree/master/problems/find-peak-element) | [[数组](https://github.com/openset/leetcode/tree/master/tag/array/README.md)] [[二分查找](https://github.com/openset/leetcode/tree/master/tag/binary-search/README.md)] | Medium | diff --git a/tag/bit-manipulation/README.md b/tag/bit-manipulation/README.md index b5355e137..c6c3c849c 100644 --- a/tag/bit-manipulation/README.md +++ b/tag/bit-manipulation/README.md @@ -43,7 +43,7 @@ | 191 | [位1的个数](https://github.com/openset/leetcode/tree/master/problems/number-of-1-bits) | [[位运算](https://github.com/openset/leetcode/tree/master/tag/bit-manipulation/README.md)] | Easy | | 190 | [颠倒二进制位](https://github.com/openset/leetcode/tree/master/problems/reverse-bits) | [[位运算](https://github.com/openset/leetcode/tree/master/tag/bit-manipulation/README.md)] | Easy | | 187 | [重复的DNA序列](https://github.com/openset/leetcode/tree/master/problems/repeated-dna-sequences) | [[位运算](https://github.com/openset/leetcode/tree/master/tag/bit-manipulation/README.md)] [[哈希表](https://github.com/openset/leetcode/tree/master/tag/hash-table/README.md)] | Medium | -| 169 | [求众数](https://github.com/openset/leetcode/tree/master/problems/majority-element) | [[位运算](https://github.com/openset/leetcode/tree/master/tag/bit-manipulation/README.md)] [[数组](https://github.com/openset/leetcode/tree/master/tag/array/README.md)] [[分治算法](https://github.com/openset/leetcode/tree/master/tag/divide-and-conquer/README.md)] | Easy | +| 169 | [多数元素](https://github.com/openset/leetcode/tree/master/problems/majority-element) | [[位运算](https://github.com/openset/leetcode/tree/master/tag/bit-manipulation/README.md)] [[数组](https://github.com/openset/leetcode/tree/master/tag/array/README.md)] [[分治算法](https://github.com/openset/leetcode/tree/master/tag/divide-and-conquer/README.md)] | Easy | | 137 | [只出现一次的数字 II](https://github.com/openset/leetcode/tree/master/problems/single-number-ii) | [[位运算](https://github.com/openset/leetcode/tree/master/tag/bit-manipulation/README.md)] | Medium | | 136 | [只出现一次的数字](https://github.com/openset/leetcode/tree/master/problems/single-number) | [[位运算](https://github.com/openset/leetcode/tree/master/tag/bit-manipulation/README.md)] [[哈希表](https://github.com/openset/leetcode/tree/master/tag/hash-table/README.md)] | Easy | | 78 | [子集](https://github.com/openset/leetcode/tree/master/problems/subsets) | [[位运算](https://github.com/openset/leetcode/tree/master/tag/bit-manipulation/README.md)] [[数组](https://github.com/openset/leetcode/tree/master/tag/array/README.md)] [[回溯算法](https://github.com/openset/leetcode/tree/master/tag/backtracking/README.md)] | Medium | diff --git a/tag/divide-and-conquer/README.md b/tag/divide-and-conquer/README.md index c6f39afdc..60dbc0a64 100644 --- a/tag/divide-and-conquer/README.md +++ b/tag/divide-and-conquer/README.md @@ -23,7 +23,7 @@ | 240 | [搜索二维矩阵 II](https://github.com/openset/leetcode/tree/master/problems/search-a-2d-matrix-ii) | [[二分查找](https://github.com/openset/leetcode/tree/master/tag/binary-search/README.md)] [[分治算法](https://github.com/openset/leetcode/tree/master/tag/divide-and-conquer/README.md)] | Medium | | 218 | [天际线问题](https://github.com/openset/leetcode/tree/master/problems/the-skyline-problem) | [[堆](https://github.com/openset/leetcode/tree/master/tag/heap/README.md)] [[树状数组](https://github.com/openset/leetcode/tree/master/tag/binary-indexed-tree/README.md)] [[线段树](https://github.com/openset/leetcode/tree/master/tag/segment-tree/README.md)] [[分治算法](https://github.com/openset/leetcode/tree/master/tag/divide-and-conquer/README.md)] [[Line Sweep](https://github.com/openset/leetcode/tree/master/tag/line-sweep/README.md)] | Hard | | 215 | [数组中的第K个最大元素](https://github.com/openset/leetcode/tree/master/problems/kth-largest-element-in-an-array) | [[堆](https://github.com/openset/leetcode/tree/master/tag/heap/README.md)] [[分治算法](https://github.com/openset/leetcode/tree/master/tag/divide-and-conquer/README.md)] | Medium | -| 169 | [求众数](https://github.com/openset/leetcode/tree/master/problems/majority-element) | [[位运算](https://github.com/openset/leetcode/tree/master/tag/bit-manipulation/README.md)] [[数组](https://github.com/openset/leetcode/tree/master/tag/array/README.md)] [[分治算法](https://github.com/openset/leetcode/tree/master/tag/divide-and-conquer/README.md)] | Easy | +| 169 | [多数元素](https://github.com/openset/leetcode/tree/master/problems/majority-element) | [[位运算](https://github.com/openset/leetcode/tree/master/tag/bit-manipulation/README.md)] [[数组](https://github.com/openset/leetcode/tree/master/tag/array/README.md)] [[分治算法](https://github.com/openset/leetcode/tree/master/tag/divide-and-conquer/README.md)] | Easy | | 53 | [最大子序和](https://github.com/openset/leetcode/tree/master/problems/maximum-subarray) | [[数组](https://github.com/openset/leetcode/tree/master/tag/array/README.md)] [[分治算法](https://github.com/openset/leetcode/tree/master/tag/divide-and-conquer/README.md)] [[动态规划](https://github.com/openset/leetcode/tree/master/tag/dynamic-programming/README.md)] | Easy | | 23 | [合并K个排序链表](https://github.com/openset/leetcode/tree/master/problems/merge-k-sorted-lists) | [[堆](https://github.com/openset/leetcode/tree/master/tag/heap/README.md)] [[链表](https://github.com/openset/leetcode/tree/master/tag/linked-list/README.md)] [[分治算法](https://github.com/openset/leetcode/tree/master/tag/divide-and-conquer/README.md)] | Hard | | 4 | [寻找两个有序数组的中位数](https://github.com/openset/leetcode/tree/master/problems/median-of-two-sorted-arrays) | [[数组](https://github.com/openset/leetcode/tree/master/tag/array/README.md)] [[二分查找](https://github.com/openset/leetcode/tree/master/tag/binary-search/README.md)] [[分治算法](https://github.com/openset/leetcode/tree/master/tag/divide-and-conquer/README.md)] | Hard | diff --git a/tag/hash-table/README.md b/tag/hash-table/README.md index 0c6969d5f..4a94414ad 100644 --- a/tag/hash-table/README.md +++ b/tag/hash-table/README.md @@ -116,7 +116,7 @@ | 187 | [重复的DNA序列](https://github.com/openset/leetcode/tree/master/problems/repeated-dna-sequences) | [[位运算](https://github.com/openset/leetcode/tree/master/tag/bit-manipulation/README.md)] [[哈希表](https://github.com/openset/leetcode/tree/master/tag/hash-table/README.md)] | Medium | | 170 | [两数之和 III - 数据结构设计](https://github.com/openset/leetcode/tree/master/problems/two-sum-iii-data-structure-design) 🔒 | [[设计](https://github.com/openset/leetcode/tree/master/tag/design/README.md)] [[哈希表](https://github.com/openset/leetcode/tree/master/tag/hash-table/README.md)] | Easy | | 166 | [分数到小数](https://github.com/openset/leetcode/tree/master/problems/fraction-to-recurring-decimal) | [[哈希表](https://github.com/openset/leetcode/tree/master/tag/hash-table/README.md)] [[数学](https://github.com/openset/leetcode/tree/master/tag/math/README.md)] | Medium | -| 159 | [至多包含两个不同字符的最长子串](https://github.com/openset/leetcode/tree/master/problems/longest-substring-with-at-most-two-distinct-characters) 🔒 | [[哈希表](https://github.com/openset/leetcode/tree/master/tag/hash-table/README.md)] [[双指针](https://github.com/openset/leetcode/tree/master/tag/two-pointers/README.md)] [[字符串](https://github.com/openset/leetcode/tree/master/tag/string/README.md)] [[Sliding Window](https://github.com/openset/leetcode/tree/master/tag/sliding-window/README.md)] | Hard | +| 159 | [至多包含两个不同字符的最长子串](https://github.com/openset/leetcode/tree/master/problems/longest-substring-with-at-most-two-distinct-characters) 🔒 | [[哈希表](https://github.com/openset/leetcode/tree/master/tag/hash-table/README.md)] [[双指针](https://github.com/openset/leetcode/tree/master/tag/two-pointers/README.md)] [[字符串](https://github.com/openset/leetcode/tree/master/tag/string/README.md)] [[Sliding Window](https://github.com/openset/leetcode/tree/master/tag/sliding-window/README.md)] | Medium | | 149 | [直线上最多的点数](https://github.com/openset/leetcode/tree/master/problems/max-points-on-a-line) | [[哈希表](https://github.com/openset/leetcode/tree/master/tag/hash-table/README.md)] [[数学](https://github.com/openset/leetcode/tree/master/tag/math/README.md)] | Hard | | 138 | [复制带随机指针的链表](https://github.com/openset/leetcode/tree/master/problems/copy-list-with-random-pointer) | [[哈希表](https://github.com/openset/leetcode/tree/master/tag/hash-table/README.md)] [[链表](https://github.com/openset/leetcode/tree/master/tag/linked-list/README.md)] | Medium | | 136 | [只出现一次的数字](https://github.com/openset/leetcode/tree/master/problems/single-number) | [[位运算](https://github.com/openset/leetcode/tree/master/tag/bit-manipulation/README.md)] [[哈希表](https://github.com/openset/leetcode/tree/master/tag/hash-table/README.md)] | Easy | diff --git a/tag/sliding-window/README.md b/tag/sliding-window/README.md index ce776e7b0..9943e5b44 100644 --- a/tag/sliding-window/README.md +++ b/tag/sliding-window/README.md @@ -26,6 +26,6 @@ | 424 | [替换后的最长重复字符](https://github.com/openset/leetcode/tree/master/problems/longest-repeating-character-replacement) | [[双指针](https://github.com/openset/leetcode/tree/master/tag/two-pointers/README.md)] [[Sliding Window](https://github.com/openset/leetcode/tree/master/tag/sliding-window/README.md)] | Medium | | 340 | [至多包含 K 个不同字符的最长子串](https://github.com/openset/leetcode/tree/master/problems/longest-substring-with-at-most-k-distinct-characters) 🔒 | [[哈希表](https://github.com/openset/leetcode/tree/master/tag/hash-table/README.md)] [[字符串](https://github.com/openset/leetcode/tree/master/tag/string/README.md)] [[Sliding Window](https://github.com/openset/leetcode/tree/master/tag/sliding-window/README.md)] | Hard | | 239 | [滑动窗口最大值](https://github.com/openset/leetcode/tree/master/problems/sliding-window-maximum) | [[堆](https://github.com/openset/leetcode/tree/master/tag/heap/README.md)] [[Sliding Window](https://github.com/openset/leetcode/tree/master/tag/sliding-window/README.md)] | Hard | -| 159 | [至多包含两个不同字符的最长子串](https://github.com/openset/leetcode/tree/master/problems/longest-substring-with-at-most-two-distinct-characters) 🔒 | [[哈希表](https://github.com/openset/leetcode/tree/master/tag/hash-table/README.md)] [[双指针](https://github.com/openset/leetcode/tree/master/tag/two-pointers/README.md)] [[字符串](https://github.com/openset/leetcode/tree/master/tag/string/README.md)] [[Sliding Window](https://github.com/openset/leetcode/tree/master/tag/sliding-window/README.md)] | Hard | +| 159 | [至多包含两个不同字符的最长子串](https://github.com/openset/leetcode/tree/master/problems/longest-substring-with-at-most-two-distinct-characters) 🔒 | [[哈希表](https://github.com/openset/leetcode/tree/master/tag/hash-table/README.md)] [[双指针](https://github.com/openset/leetcode/tree/master/tag/two-pointers/README.md)] [[字符串](https://github.com/openset/leetcode/tree/master/tag/string/README.md)] [[Sliding Window](https://github.com/openset/leetcode/tree/master/tag/sliding-window/README.md)] | Medium | | 76 | [最小覆盖子串](https://github.com/openset/leetcode/tree/master/problems/minimum-window-substring) | [[哈希表](https://github.com/openset/leetcode/tree/master/tag/hash-table/README.md)] [[双指针](https://github.com/openset/leetcode/tree/master/tag/two-pointers/README.md)] [[字符串](https://github.com/openset/leetcode/tree/master/tag/string/README.md)] [[Sliding Window](https://github.com/openset/leetcode/tree/master/tag/sliding-window/README.md)] | Hard | | 3 | [无重复字符的最长子串](https://github.com/openset/leetcode/tree/master/problems/longest-substring-without-repeating-characters) | [[哈希表](https://github.com/openset/leetcode/tree/master/tag/hash-table/README.md)] [[双指针](https://github.com/openset/leetcode/tree/master/tag/two-pointers/README.md)] [[字符串](https://github.com/openset/leetcode/tree/master/tag/string/README.md)] [[Sliding Window](https://github.com/openset/leetcode/tree/master/tag/sliding-window/README.md)] | Medium | diff --git a/tag/string/README.md b/tag/string/README.md index 6430ac8c1..c9b22d9b0 100644 --- a/tag/string/README.md +++ b/tag/string/README.md @@ -122,7 +122,7 @@ | 186 | [翻转字符串里的单词 II](https://github.com/openset/leetcode/tree/master/problems/reverse-words-in-a-string-ii) 🔒 | [[字符串](https://github.com/openset/leetcode/tree/master/tag/string/README.md)] | Medium | | 165 | [比较版本号](https://github.com/openset/leetcode/tree/master/problems/compare-version-numbers) | [[字符串](https://github.com/openset/leetcode/tree/master/tag/string/README.md)] | Medium | | 161 | [相隔为 1 的编辑距离](https://github.com/openset/leetcode/tree/master/problems/one-edit-distance) 🔒 | [[字符串](https://github.com/openset/leetcode/tree/master/tag/string/README.md)] | Medium | -| 159 | [至多包含两个不同字符的最长子串](https://github.com/openset/leetcode/tree/master/problems/longest-substring-with-at-most-two-distinct-characters) 🔒 | [[哈希表](https://github.com/openset/leetcode/tree/master/tag/hash-table/README.md)] [[双指针](https://github.com/openset/leetcode/tree/master/tag/two-pointers/README.md)] [[字符串](https://github.com/openset/leetcode/tree/master/tag/string/README.md)] [[Sliding Window](https://github.com/openset/leetcode/tree/master/tag/sliding-window/README.md)] | Hard | +| 159 | [至多包含两个不同字符的最长子串](https://github.com/openset/leetcode/tree/master/problems/longest-substring-with-at-most-two-distinct-characters) 🔒 | [[哈希表](https://github.com/openset/leetcode/tree/master/tag/hash-table/README.md)] [[双指针](https://github.com/openset/leetcode/tree/master/tag/two-pointers/README.md)] [[字符串](https://github.com/openset/leetcode/tree/master/tag/string/README.md)] [[Sliding Window](https://github.com/openset/leetcode/tree/master/tag/sliding-window/README.md)] | Medium | | 158 | [用 Read4 读取 N 个字符 II](https://github.com/openset/leetcode/tree/master/problems/read-n-characters-given-read4-ii-call-multiple-times) 🔒 | [[字符串](https://github.com/openset/leetcode/tree/master/tag/string/README.md)] | Hard | | 157 | [用 Read4 读取 N 个字符](https://github.com/openset/leetcode/tree/master/problems/read-n-characters-given-read4) 🔒 | [[字符串](https://github.com/openset/leetcode/tree/master/tag/string/README.md)] | Easy | | 151 | [翻转字符串里的单词](https://github.com/openset/leetcode/tree/master/problems/reverse-words-in-a-string) | [[字符串](https://github.com/openset/leetcode/tree/master/tag/string/README.md)] | Medium | diff --git a/tag/two-pointers/README.md b/tag/two-pointers/README.md index 2bc681822..8e1982275 100644 --- a/tag/two-pointers/README.md +++ b/tag/two-pointers/README.md @@ -48,7 +48,7 @@ | 234 | [回文链表](https://github.com/openset/leetcode/tree/master/problems/palindrome-linked-list) | [[链表](https://github.com/openset/leetcode/tree/master/tag/linked-list/README.md)] [[双指针](https://github.com/openset/leetcode/tree/master/tag/two-pointers/README.md)] | Easy | | 209 | [长度最小的子数组](https://github.com/openset/leetcode/tree/master/problems/minimum-size-subarray-sum) | [[数组](https://github.com/openset/leetcode/tree/master/tag/array/README.md)] [[双指针](https://github.com/openset/leetcode/tree/master/tag/two-pointers/README.md)] [[二分查找](https://github.com/openset/leetcode/tree/master/tag/binary-search/README.md)] | Medium | | 167 | [两数之和 II - 输入有序数组](https://github.com/openset/leetcode/tree/master/problems/two-sum-ii-input-array-is-sorted) | [[数组](https://github.com/openset/leetcode/tree/master/tag/array/README.md)] [[双指针](https://github.com/openset/leetcode/tree/master/tag/two-pointers/README.md)] [[二分查找](https://github.com/openset/leetcode/tree/master/tag/binary-search/README.md)] | Easy | -| 159 | [至多包含两个不同字符的最长子串](https://github.com/openset/leetcode/tree/master/problems/longest-substring-with-at-most-two-distinct-characters) 🔒 | [[哈希表](https://github.com/openset/leetcode/tree/master/tag/hash-table/README.md)] [[双指针](https://github.com/openset/leetcode/tree/master/tag/two-pointers/README.md)] [[字符串](https://github.com/openset/leetcode/tree/master/tag/string/README.md)] [[Sliding Window](https://github.com/openset/leetcode/tree/master/tag/sliding-window/README.md)] | Hard | +| 159 | [至多包含两个不同字符的最长子串](https://github.com/openset/leetcode/tree/master/problems/longest-substring-with-at-most-two-distinct-characters) 🔒 | [[哈希表](https://github.com/openset/leetcode/tree/master/tag/hash-table/README.md)] [[双指针](https://github.com/openset/leetcode/tree/master/tag/two-pointers/README.md)] [[字符串](https://github.com/openset/leetcode/tree/master/tag/string/README.md)] [[Sliding Window](https://github.com/openset/leetcode/tree/master/tag/sliding-window/README.md)] | Medium | | 142 | [环形链表 II](https://github.com/openset/leetcode/tree/master/problems/linked-list-cycle-ii) | [[链表](https://github.com/openset/leetcode/tree/master/tag/linked-list/README.md)] [[双指针](https://github.com/openset/leetcode/tree/master/tag/two-pointers/README.md)] | Medium | | 141 | [环形链表](https://github.com/openset/leetcode/tree/master/problems/linked-list-cycle) | [[链表](https://github.com/openset/leetcode/tree/master/tag/linked-list/README.md)] [[双指针](https://github.com/openset/leetcode/tree/master/tag/two-pointers/README.md)] | Easy | | 125 | [验证回文串](https://github.com/openset/leetcode/tree/master/problems/valid-palindrome) | [[双指针](https://github.com/openset/leetcode/tree/master/tag/two-pointers/README.md)] [[字符串](https://github.com/openset/leetcode/tree/master/tag/string/README.md)] | Easy |

AltStyle によって変換されたページ (->オリジナル) /