From 05ecea3dcedf0a54694a79e293089fb438e54119 Mon Sep 17 00:00:00 2001 From: thinkasany <117748716+thinkasany@users.noreply.github.com> Date: Thu, 6 Apr 2023 22:33:52 +0800 Subject: [PATCH 1/7] style: update desciption to lc problem: No.0003 (#969) --- .../README.md | 8 ++++---- solution/main.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/solution/0000-0099/0003.Longest Substring Without Repeating Characters/README.md b/solution/0000-0099/0003.Longest Substring Without Repeating Characters/README.md index 30a0694ac6393..4c0f519bc0dc4 100644 --- a/solution/0000-0099/0003.Longest Substring Without Repeating Characters/README.md +++ b/solution/0000-0099/0003.Longest Substring Without Repeating Characters/README.md @@ -15,7 +15,7 @@
 输入: s = "abcabcbb"
 输出: 3 
-解释: 因为无重复字符的最长子串是 "abc",所以其长度为 3。
+解释: 因为无重复字符的最长子串是 "abc",所以其长度为 3。
 

示例 2:

@@ -23,7 +23,7 @@
 输入: s = "bbbbb"
 输出: 1
-解释: 因为无重复字符的最长子串是 "b",所以其长度为 1。
+解释: 因为无重复字符的最长子串是 "b",所以其长度为 1。
 

示例 3:

@@ -31,8 +31,8 @@
 输入: s = "pwwkew"
 输出: 3
-解释: 因为无重复字符的最长子串是 "wke",所以其长度为 3。
-     请注意,你的答案必须是 子串 的长度,"pwke" 是一个子序列,不是子串。
+解释: 因为无重复字符的最长子串是 "wke",所以其长度为 3。
+请注意,你的答案必须是 子串 的长度,"pwke" 是一个子序列,不是子串。
 

 

diff --git a/solution/main.py b/solution/main.py index 73b1ec3cd7e34..d9a248683f6ae 100644 --- a/solution/main.py +++ b/solution/main.py @@ -134,7 +134,7 @@ def generate_summary(result): def refresh(result): """update problems""" pattern = re.compile("src=\"(.*?)\"") - skip_question_ids = {1599} + skip_question_ids = {3, 1599} for question in result: front_question_id = question['frontend_question_id'] From d19e4e40aecee229858bb8e50294c9e33b820544 Mon Sep 17 00:00:00 2001 From: yanglbme Date: Thu, 6 Apr 2023 23:43:42 +0800 Subject: [PATCH 2/7] feat: add solutions to lc problem: No.1040 No.1040.Moving Stones Until Consecutive II --- .../README.md | 99 ++++++++++++++++++- .../README_EN.md | 95 +++++++++++++++++- .../Solution.cpp | 20 ++++ .../Solution.go | 32 ++++++ .../Solution.java | 19 ++++ .../Solution.py | 14 +++ 6 files changed, 277 insertions(+), 2 deletions(-) create mode 100644 solution/1000-1099/1040.Moving Stones Until Consecutive II/Solution.cpp create mode 100644 solution/1000-1099/1040.Moving Stones Until Consecutive II/Solution.go create mode 100644 solution/1000-1099/1040.Moving Stones Until Consecutive II/Solution.java create mode 100644 solution/1000-1099/1040.Moving Stones Until Consecutive II/Solution.py diff --git a/solution/1000-1099/1040.Moving Stones Until Consecutive II/README.md b/solution/1000-1099/1040.Moving Stones Until Consecutive II/README.md index 30f3ef4cb32db..f11d1ec6945d8 100644 --- a/solution/1000-1099/1040.Moving Stones Until Consecutive II/README.md +++ b/solution/1000-1099/1040.Moving Stones Until Consecutive II/README.md @@ -61,6 +61,10 @@ +**方法一:排序 + 分类讨论 + 双指针** + +时间复杂度 $O(n \times \log n)$,空间复杂度 $O(\log n)$。其中 $n$ 为数组 `stones` 的长度。 + ### **Python3** @@ -68,7 +72,20 @@ ```python - +class Solution: + def numMovesStonesII(self, stones: List[int]) -> List[int]: + stones.sort() + mi = n = len(stones) + mx = max(stones[-1] - stones[1] + 1, stones[-2] - stones[0] + 1) - (n - 1) + i = 0 + for j, x in enumerate(stones): + while x - stones[i] + 1 > n: + i += 1 + if j - i + 1 == n - 1 and x - stones[i] == n - 2: + mi = min(mi, 2) + else: + mi = min(mi, n - (j - i + 1)) + return [mi, mx] ``` ### **Java** @@ -76,7 +93,87 @@ ```java +class Solution { + public int[] numMovesStonesII(int[] stones) { + Arrays.sort(stones); + int n = stones.length; + int mi = n; + int mx = Math.max(stones[n - 1] - stones[1] + 1, stones[n - 2] - stones[0] + 1) - (n - 1); + for (int i = 0, j = 0; j < n; ++j) { + while (stones[j] - stones[i] + 1 > n) { + ++i; + } + if (j - i + 1 == n - 1 && stones[j] - stones[i] == n - 2) { + mi = Math.min(mi, 2); + } else { + mi = Math.min(mi, n - (j - i + 1)); + } + } + return new int[] {mi, mx}; + } +} +``` + +### **C++** + +```cpp +class Solution { +public: + vector numMovesStonesII(vector& stones) { + sort(stones.begin(), stones.end()); + int n = stones.size(); + int mi = n; + int mx = max(stones[n - 1] - stones[1] + 1, stones[n - 2] - stones[0] + 1) - (n - 1); + for (int i = 0, j = 0; j < n; ++j) { + while (stones[j] - stones[i] + 1 > n) { + ++i; + } + if (j - i + 1 == n - 1 && stones[j] - stones[i] == n - 2) { + mi = min(mi, 2); + } else { + mi = min(mi, n - (j - i + 1)); + } + } + return {mi, mx}; + } +}; +``` +### **Go** + +```go +func numMovesStonesII(stones []int) []int { + sort.Ints(stones) + n := len(stones) + mi := n + mx := max(stones[n-1]-stones[1]+1, stones[n-2]-stones[0]+1) - (n - 1) + i := 0 + for j, x := range stones { + for x-stones[i]+1 > n { + i++ + } + if j-i+1 == n-1 && stones[j]-stones[i] == n-2 { + mi = min(mi, 2) + } else { + mi = min(mi, n-(j-i+1)) + } + } + return []int{mi, mx} +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} + +func min(a, b int) int { + if a < b { + return a + } + return b +} ``` ### **...** diff --git a/solution/1000-1099/1040.Moving Stones Until Consecutive II/README_EN.md b/solution/1000-1099/1040.Moving Stones Until Consecutive II/README_EN.md index 7ad960864fe1b..9532713c48920 100644 --- a/solution/1000-1099/1040.Moving Stones Until Consecutive II/README_EN.md +++ b/solution/1000-1099/1040.Moving Stones Until Consecutive II/README_EN.md @@ -57,13 +57,106 @@ Notice we cannot move 10 -> 2 to finish the game, because that would be an il ### **Python3** ```python - +class Solution: + def numMovesStonesII(self, stones: List[int]) -> List[int]: + stones.sort() + mi = n = len(stones) + mx = max(stones[-1] - stones[1] + 1, stones[-2] - stones[0] + 1) - (n - 1) + i = 0 + for j, x in enumerate(stones): + while x - stones[i] + 1 > n: + i += 1 + if j - i + 1 == n - 1 and x - stones[i] == n - 2: + mi = min(mi, 2) + else: + mi = min(mi, n - (j - i + 1)) + return [mi, mx] ``` ### **Java** ```java +class Solution { + public int[] numMovesStonesII(int[] stones) { + Arrays.sort(stones); + int n = stones.length; + int mi = n; + int mx = Math.max(stones[n - 1] - stones[1] + 1, stones[n - 2] - stones[0] + 1) - (n - 1); + for (int i = 0, j = 0; j < n; ++j) { + while (stones[j] - stones[i] + 1 > n) { + ++i; + } + if (j - i + 1 == n - 1 && stones[j] - stones[i] == n - 2) { + mi = Math.min(mi, 2); + } else { + mi = Math.min(mi, n - (j - i + 1)); + } + } + return new int[] {mi, mx}; + } +} +``` + +### **C++** + +```cpp +class Solution { +public: + vector numMovesStonesII(vector& stones) { + sort(stones.begin(), stones.end()); + int n = stones.size(); + int mi = n; + int mx = max(stones[n - 1] - stones[1] + 1, stones[n - 2] - stones[0] + 1) - (n - 1); + for (int i = 0, j = 0; j < n; ++j) { + while (stones[j] - stones[i] + 1 > n) { + ++i; + } + if (j - i + 1 == n - 1 && stones[j] - stones[i] == n - 2) { + mi = min(mi, 2); + } else { + mi = min(mi, n - (j - i + 1)); + } + } + return {mi, mx}; + } +}; +``` +### **Go** + +```go +func numMovesStonesII(stones []int) []int { + sort.Ints(stones) + n := len(stones) + mi := n + mx := max(stones[n-1]-stones[1]+1, stones[n-2]-stones[0]+1) - (n - 1) + i := 0 + for j, x := range stones { + for x-stones[i]+1 > n { + i++ + } + if j-i+1 == n-1 && stones[j]-stones[i] == n-2 { + mi = min(mi, 2) + } else { + mi = min(mi, n-(j-i+1)) + } + } + return []int{mi, mx} +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} + +func min(a, b int) int { + if a < b { + return a + } + return b +} ``` ### **...** diff --git a/solution/1000-1099/1040.Moving Stones Until Consecutive II/Solution.cpp b/solution/1000-1099/1040.Moving Stones Until Consecutive II/Solution.cpp new file mode 100644 index 0000000000000..314885e94bfc7 --- /dev/null +++ b/solution/1000-1099/1040.Moving Stones Until Consecutive II/Solution.cpp @@ -0,0 +1,20 @@ +class Solution { +public: + vector numMovesStonesII(vector& stones) { + sort(stones.begin(), stones.end()); + int n = stones.size(); + int mi = n; + int mx = max(stones[n - 1] - stones[1] + 1, stones[n - 2] - stones[0] + 1) - (n - 1); + for (int i = 0, j = 0; j < n; ++j) { + while (stones[j] - stones[i] + 1 > n) { + ++i; + } + if (j - i + 1 == n - 1 && stones[j] - stones[i] == n - 2) { + mi = min(mi, 2); + } else { + mi = min(mi, n - (j - i + 1)); + } + } + return {mi, mx}; + } +}; \ No newline at end of file diff --git a/solution/1000-1099/1040.Moving Stones Until Consecutive II/Solution.go b/solution/1000-1099/1040.Moving Stones Until Consecutive II/Solution.go new file mode 100644 index 0000000000000..b3f712ddbc7c0 --- /dev/null +++ b/solution/1000-1099/1040.Moving Stones Until Consecutive II/Solution.go @@ -0,0 +1,32 @@ +func numMovesStonesII(stones []int) []int { + sort.Ints(stones) + n := len(stones) + mi := n + mx := max(stones[n-1]-stones[1]+1, stones[n-2]-stones[0]+1) - (n - 1) + i := 0 + for j, x := range stones { + for x-stones[i]+1 > n { + i++ + } + if j-i+1 == n-1 && stones[j]-stones[i] == n-2 { + mi = min(mi, 2) + } else { + mi = min(mi, n-(j-i+1)) + } + } + return []int{mi, mx} +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} + +func min(a, b int) int { + if a < b { + return a + } + return b +} \ No newline at end of file diff --git a/solution/1000-1099/1040.Moving Stones Until Consecutive II/Solution.java b/solution/1000-1099/1040.Moving Stones Until Consecutive II/Solution.java new file mode 100644 index 0000000000000..d5d8e6a54835f --- /dev/null +++ b/solution/1000-1099/1040.Moving Stones Until Consecutive II/Solution.java @@ -0,0 +1,19 @@ +class Solution { + public int[] numMovesStonesII(int[] stones) { + Arrays.sort(stones); + int n = stones.length; + int mi = n; + int mx = Math.max(stones[n - 1] - stones[1] + 1, stones[n - 2] - stones[0] + 1) - (n - 1); + for (int i = 0, j = 0; j < n; ++j) { + while (stones[j] - stones[i] + 1 > n) { + ++i; + } + if (j - i + 1 == n - 1 && stones[j] - stones[i] == n - 2) { + mi = Math.min(mi, 2); + } else { + mi = Math.min(mi, n - (j - i + 1)); + } + } + return new int[] {mi, mx}; + } +} \ No newline at end of file diff --git a/solution/1000-1099/1040.Moving Stones Until Consecutive II/Solution.py b/solution/1000-1099/1040.Moving Stones Until Consecutive II/Solution.py new file mode 100644 index 0000000000000..9aa212f569ce4 --- /dev/null +++ b/solution/1000-1099/1040.Moving Stones Until Consecutive II/Solution.py @@ -0,0 +1,14 @@ +class Solution: + def numMovesStonesII(self, stones: List[int]) -> List[int]: + stones.sort() + mi = n = len(stones) + mx = max(stones[-1] - stones[1] + 1, stones[-2] - stones[0] + 1) - (n - 1) + i = 0 + for j, x in enumerate(stones): + while x - stones[i] + 1 > n: + i += 1 + if j - i + 1 == n - 1 and x - stones[i] == n - 2: + mi = min(mi, 2) + else: + mi = min(mi, n - (j - i + 1)) + return [mi, mx] From 3531802c0163dece5a31a3d080d1751fc39d232d Mon Sep 17 00:00:00 2001 From: thinkasany <480968828@qq.com> Date: Thu, 6 Apr 2023 23:45:30 +0800 Subject: [PATCH 3/7] feat: add solutions to lc problems: No.1041 --- .../1041.Robot Bounded In Circle/README.md | 22 +++++++++++++++++++ .../1041.Robot Bounded In Circle/README_EN.md | 22 +++++++++++++++++++ .../1041.Robot Bounded In Circle/Solution.ts | 17 ++++++++++++++ 3 files changed, 61 insertions(+) create mode 100644 solution/1000-1099/1041.Robot Bounded In Circle/Solution.ts diff --git a/solution/1000-1099/1041.Robot Bounded In Circle/README.md b/solution/1000-1099/1041.Robot Bounded In Circle/README.md index 8000f8ff91e6a..5e9dc8f969881 100644 --- a/solution/1000-1099/1041.Robot Bounded In Circle/README.md +++ b/solution/1000-1099/1041.Robot Bounded In Circle/README.md @@ -178,6 +178,28 @@ func isRobotBounded(instructions string) bool { } ``` +### **TypeScript** + +```ts +function isRobotBounded(instructions: string): boolean { + const direction = new Array(4).fill(0); + let cur = 0; + for (const c of instructions.split('')) { + if (c === 'L') { + cur = (cur + 1) % 4; + } else if (c === 'R') { + cur = (cur + 3) % 4; + } else { + ++direction[cur]; + } + } + return ( + cur !== 0 || + (direction[0] === direction[2] && direction[1] === direction[3]) + ); +} +``` + ### **...** ``` diff --git a/solution/1000-1099/1041.Robot Bounded In Circle/README_EN.md b/solution/1000-1099/1041.Robot Bounded In Circle/README_EN.md index 906194839e41a..caee4aff6baf2 100644 --- a/solution/1000-1099/1041.Robot Bounded In Circle/README_EN.md +++ b/solution/1000-1099/1041.Robot Bounded In Circle/README_EN.md @@ -163,6 +163,28 @@ func isRobotBounded(instructions string) bool { } ``` +### **TypeScript** + +```ts +function isRobotBounded(instructions: string): boolean { + const direction = new Array(4).fill(0); + let cur = 0; + for (const c of instructions.split('')) { + if (c === 'L') { + cur = (cur + 1) % 4; + } else if (c === 'R') { + cur = (cur + 3) % 4; + } else { + ++direction[cur]; + } + } + return ( + cur !== 0 || + (direction[0] === direction[2] && direction[1] === direction[3]) + ); +} +``` + ### **...** ``` diff --git a/solution/1000-1099/1041.Robot Bounded In Circle/Solution.ts b/solution/1000-1099/1041.Robot Bounded In Circle/Solution.ts new file mode 100644 index 0000000000000..fd8d424f77da0 --- /dev/null +++ b/solution/1000-1099/1041.Robot Bounded In Circle/Solution.ts @@ -0,0 +1,17 @@ +function isRobotBounded(instructions: string): boolean { + const direction = new Array(4).fill(0); + let cur = 0; + for (const c of instructions.split('')) { + if (c === 'L') { + cur = (cur + 1) % 4; + } else if (c === 'R') { + cur = (cur + 3) % 4; + } else { + ++direction[cur]; + } + } + return ( + cur !== 0 || + (direction[0] === direction[2] && direction[1] === direction[3]) + ); +} From e14f8a8e5402cf7ad808f65e183b10f4ff1b39a5 Mon Sep 17 00:00:00 2001 From: thinkasany <480968828@qq.com> Date: Thu, 6 Apr 2023 23:51:58 +0800 Subject: [PATCH 4/7] feat: add solutions to lc problems: No.1040 --- .../README.md | 24 +++++++++++++++++++ .../README_EN.md | 24 +++++++++++++++++++ .../Solution.ts | 19 +++++++++++++++ 3 files changed, 67 insertions(+) create mode 100644 solution/1000-1099/1040.Moving Stones Until Consecutive II/Solution.ts diff --git a/solution/1000-1099/1040.Moving Stones Until Consecutive II/README.md b/solution/1000-1099/1040.Moving Stones Until Consecutive II/README.md index f11d1ec6945d8..7081c8369522d 100644 --- a/solution/1000-1099/1040.Moving Stones Until Consecutive II/README.md +++ b/solution/1000-1099/1040.Moving Stones Until Consecutive II/README.md @@ -176,6 +176,30 @@ func min(a, b int) int { } ``` +### **TypeScript** + +```ts +function numMovesStonesII(stones: number[]): number[] { + stones.sort((a, b) => a - b); + const n = stones.length; + let mi = n; + const mx = + Math.max(stones[n - 1] - stones[1] + 1, stones[n - 2] - stones[0] + 1) - + (n - 1); + for (let i = 0, j = 0; j < n; ++j) { + while (stones[j] - stones[i] + 1 > n) { + ++i; + } + if (j - i + 1 === n - 1 && stones[j] - stones[i] === n - 2) { + mi = Math.min(mi, 2); + } else { + mi = Math.min(mi, n - (j - i + 1)); + } + } + return [mi, mx]; +} +``` + ### **...** ``` diff --git a/solution/1000-1099/1040.Moving Stones Until Consecutive II/README_EN.md b/solution/1000-1099/1040.Moving Stones Until Consecutive II/README_EN.md index 9532713c48920..ebfd2b254cf93 100644 --- a/solution/1000-1099/1040.Moving Stones Until Consecutive II/README_EN.md +++ b/solution/1000-1099/1040.Moving Stones Until Consecutive II/README_EN.md @@ -159,6 +159,30 @@ func min(a, b int) int { } ``` +### **TypeScript** + +```ts +function numMovesStonesII(stones: number[]): number[] { + stones.sort((a, b) => a - b); + const n = stones.length; + let mi = n; + const mx = + Math.max(stones[n - 1] - stones[1] + 1, stones[n - 2] - stones[0] + 1) - + (n - 1); + for (let i = 0, j = 0; j < n; ++j) { + while (stones[j] - stones[i] + 1 > n) { + ++i; + } + if (j - i + 1 === n - 1 && stones[j] - stones[i] === n - 2) { + mi = Math.min(mi, 2); + } else { + mi = Math.min(mi, n - (j - i + 1)); + } + } + return [mi, mx]; +} +``` + ### **...** ``` diff --git a/solution/1000-1099/1040.Moving Stones Until Consecutive II/Solution.ts b/solution/1000-1099/1040.Moving Stones Until Consecutive II/Solution.ts new file mode 100644 index 0000000000000..ecd444c136472 --- /dev/null +++ b/solution/1000-1099/1040.Moving Stones Until Consecutive II/Solution.ts @@ -0,0 +1,19 @@ +function numMovesStonesII(stones: number[]): number[] { + stones.sort((a, b) => a - b); + const n = stones.length; + let mi = n; + const mx = + Math.max(stones[n - 1] - stones[1] + 1, stones[n - 2] - stones[0] + 1) - + (n - 1); + for (let i = 0, j = 0; j < n; ++j) { + while (stones[j] - stones[i] + 1 > n) { + ++i; + } + if (j - i + 1 === n - 1 && stones[j] - stones[i] === n - 2) { + mi = Math.min(mi, 2); + } else { + mi = Math.min(mi, n - (j - i + 1)); + } + } + return [mi, mx]; +} From 8cc9aa22546f6e536ad4e7b7be2a01a8c652e7b8 Mon Sep 17 00:00:00 2001 From: thinkasany <480968828@qq.com> Date: Thu, 6 Apr 2023 23:58:24 +0800 Subject: [PATCH 5/7] feat: update solutions to lc problems: No.0006 --- solution/0000-0099/0006.Zigzag Conversion/README.md | 4 ++-- solution/0000-0099/0006.Zigzag Conversion/README_EN.md | 4 ++-- solution/0000-0099/0006.Zigzag Conversion/Solution.js | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/solution/0000-0099/0006.Zigzag Conversion/README.md b/solution/0000-0099/0006.Zigzag Conversion/README.md index a5668dd8a258c..86415cacdbde7 100644 --- a/solution/0000-0099/0006.Zigzag Conversion/README.md +++ b/solution/0000-0099/0006.Zigzag Conversion/README.md @@ -211,7 +211,7 @@ func convert(s string, numRows int) string { */ var convert = function (s, numRows) { if (numRows == 1) return s; - let arr = new Array(numRows); + const arr = new Array(numRows); for (let i = 0; i < numRows; i++) arr[i] = []; let mi = 0, isDown = true; @@ -225,7 +225,7 @@ var convert = function (s, numRows) { else mi--; } let ans = []; - for (let item of arr) { + for (const item of arr) { ans = ans.concat(item); } return ans.join(''); diff --git a/solution/0000-0099/0006.Zigzag Conversion/README_EN.md b/solution/0000-0099/0006.Zigzag Conversion/README_EN.md index 471c1be5b271f..303851237fa12 100644 --- a/solution/0000-0099/0006.Zigzag Conversion/README_EN.md +++ b/solution/0000-0099/0006.Zigzag Conversion/README_EN.md @@ -205,7 +205,7 @@ func convert(s string, numRows int) string { */ var convert = function (s, numRows) { if (numRows == 1) return s; - let arr = new Array(numRows); + const arr = new Array(numRows); for (let i = 0; i < numRows; i++) arr[i] = []; let mi = 0, isDown = true; @@ -219,7 +219,7 @@ var convert = function (s, numRows) { else mi--; } let ans = []; - for (let item of arr) { + for (const item of arr) { ans = ans.concat(item); } return ans.join(''); diff --git a/solution/0000-0099/0006.Zigzag Conversion/Solution.js b/solution/0000-0099/0006.Zigzag Conversion/Solution.js index c6d4dcd721ae1..e291e38cb6b18 100644 --- a/solution/0000-0099/0006.Zigzag Conversion/Solution.js +++ b/solution/0000-0099/0006.Zigzag Conversion/Solution.js @@ -5,7 +5,7 @@ */ var convert = function (s, numRows) { if (numRows == 1) return s; - let arr = new Array(numRows); + const arr = new Array(numRows); for (let i = 0; i < numRows; i++) arr[i] = []; let mi = 0, isDown = true; @@ -19,7 +19,7 @@ var convert = function (s, numRows) { else mi--; } let ans = []; - for (let item of arr) { + for (const item of arr) { ans = ans.concat(item); } return ans.join(''); From 8c7e7a2ba39b9781ebabafdc3fc2a62b9d6bba48 Mon Sep 17 00:00:00 2001 From: thinkasany <480968828@qq.com> Date: Fri, 7 Apr 2023 00:03:15 +0800 Subject: [PATCH 6/7] style: update desciption to lc problem: No.33 --- .../0000-0099/0033.Search in Rotated Sorted Array/README.md | 4 ++-- solution/main.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/solution/0000-0099/0033.Search in Rotated Sorted Array/README.md b/solution/0000-0099/0033.Search in Rotated Sorted Array/README.md index 5763f2f1203bb..177b710b7ed04 100644 --- a/solution/0000-0099/0033.Search in Rotated Sorted Array/README.md +++ b/solution/0000-0099/0033.Search in Rotated Sorted Array/README.md @@ -19,14 +19,14 @@

示例 1:

-输入:nums = [4,5,6,7,0,1,2], target = 0
+输入:nums = [4,5,6,7,0,1,2], target = 0
 输出:4
 

示例 2:

-输入:nums = [4,5,6,7,0,1,2], target = 3
+输入:nums = [4,5,6,7,0,1,2], target = 3
 输出:-1

示例 3:

diff --git a/solution/main.py b/solution/main.py index d9a248683f6ae..2a2591f3c14b4 100644 --- a/solution/main.py +++ b/solution/main.py @@ -134,7 +134,7 @@ def generate_summary(result): def refresh(result): """update problems""" pattern = re.compile("src=\"(.*?)\"") - skip_question_ids = {3, 1599} + skip_question_ids = {3, 33, 1599} for question in result: front_question_id = question['frontend_question_id'] From 4a27e7be6f5336b798d4e56966d3445c4a27084f Mon Sep 17 00:00:00 2001 From: thinkasany <480968828@qq.com> Date: Fri, 7 Apr 2023 00:07:32 +0800 Subject: [PATCH 7/7] style: update desciption to lc problem: No.34 --- .../README.md | 4 ++-- solution/main.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/solution/0000-0099/0034.Find First and Last Position of Element in Sorted Array/README.md b/solution/0000-0099/0034.Find First and Last Position of Element in Sorted Array/README.md index a1550b28c8c39..f8d23d79a642a 100644 --- a/solution/0000-0099/0034.Find First and Last Position of Element in Sorted Array/README.md +++ b/solution/0000-0099/0034.Find First and Last Position of Element in Sorted Array/README.md @@ -17,13 +17,13 @@

示例 1:

-输入:nums = [5,7,7,8,8,10], target = 8
+输入:nums = [5,7,7,8,8,10], target = 8
 输出:[3,4]

示例 2:

-输入:nums = [5,7,7,8,8,10], target = 6
+输入:nums = [5,7,7,8,8,10], target = 6
 输出:[-1,-1]

示例 3:

diff --git a/solution/main.py b/solution/main.py index 2a2591f3c14b4..eb1e311112c61 100644 --- a/solution/main.py +++ b/solution/main.py @@ -134,7 +134,7 @@ def generate_summary(result): def refresh(result): """update problems""" pattern = re.compile("src=\"(.*?)\"") - skip_question_ids = {3, 33, 1599} + skip_question_ids = {3, 33, 34, 1599} for question in result: front_question_id = question['frontend_question_id']