diff --git a/leetcode/3001-3100/3001.Minimum-Moves-to-Capture-The-Queen/README.md b/leetcode/3001-3100/3001.Minimum-Moves-to-Capture-The-Queen/README.md new file mode 100755 index 00000000..ed11facf --- /dev/null +++ b/leetcode/3001-3100/3001.Minimum-Moves-to-Capture-The-Queen/README.md @@ -0,0 +1,32 @@ +# [3001.Minimum Moves to Capture The Queen][title] + +> [!WARNING|style:flat] +> This question is temporarily unanswered if you have good ideas. Welcome to [Create Pull Request PR](https://github.com/kylesliu/awesome-golang-algorithm) + +## Description + +**Example 1:** + +``` +Input: a = "11", b = "1" +Output: "100" +``` + +## 题意 +> ... + +## 题解 + +### 思路1 +> ... +Minimum Moves to Capture The Queen +```go +``` + + +## 结语 + +如果你同我一样热爱数据结构、算法、LeetCode,可以关注我 GitHub 上的 LeetCode 题解:[awesome-golang-algorithm][me] + +[title]: https://leetcode.com/problems/minimum-moves-to-capture-the-queen/ +[me]: https://github.com/kylesliu/awesome-golang-algorithm diff --git a/leetcode/3001-3100/3001.Minimum-Moves-to-Capture-The-Queen/Solution.go b/leetcode/3001-3100/3001.Minimum-Moves-to-Capture-The-Queen/Solution.go new file mode 100644 index 00000000..d115ccf5 --- /dev/null +++ b/leetcode/3001-3100/3001.Minimum-Moves-to-Capture-The-Queen/Solution.go @@ -0,0 +1,5 @@ +package Solution + +func Solution(x bool) bool { + return x +} diff --git a/leetcode/3001-3100/3001.Minimum-Moves-to-Capture-The-Queen/Solution_test.go b/leetcode/3001-3100/3001.Minimum-Moves-to-Capture-The-Queen/Solution_test.go new file mode 100644 index 00000000..14ff50eb --- /dev/null +++ b/leetcode/3001-3100/3001.Minimum-Moves-to-Capture-The-Queen/Solution_test.go @@ -0,0 +1,39 @@ +package Solution + +import ( + "reflect" + "strconv" + "testing" +) + +func TestSolution(t *testing.T) { + // 测试用例 + cases := []struct { + name string + inputs bool + expect bool + }{ + {"TestCase", true, true}, + {"TestCase", true, true}, + {"TestCase", false, false}, + } + + // 开始测试 + for i, c := range cases { + t.Run(c.name+" "+strconv.Itoa(i), func(t *testing.T) { + got := Solution(c.inputs) + if !reflect.DeepEqual(got, c.expect) { + t.Fatalf("expected: %v, but got: %v, with inputs: %v", + c.expect, got, c.inputs) + } + }) + } +} + +// 压力测试 +func BenchmarkSolution(b *testing.B) { +} + +// 使用案列 +func ExampleSolution() { +} diff --git a/leetcode/3001-3100/3002.Maximum-Size-of-a-Set-After-Removals/README.md b/leetcode/3001-3100/3002.Maximum-Size-of-a-Set-After-Removals/README.md new file mode 100755 index 00000000..0826bd24 --- /dev/null +++ b/leetcode/3001-3100/3002.Maximum-Size-of-a-Set-After-Removals/README.md @@ -0,0 +1,32 @@ +# [3002.Maximum Size of a Set After Removals][title] + +> [!WARNING|style:flat] +> This question is temporarily unanswered if you have good ideas. Welcome to [Create Pull Request PR](https://github.com/kylesliu/awesome-golang-algorithm) + +## Description + +**Example 1:** + +``` +Input: a = "11", b = "1" +Output: "100" +``` + +## 题意 +> ... + +## 题解 + +### 思路1 +> ... +Maximum Size of a Set After Removals +```go +``` + + +## 结语 + +如果你同我一样热爱数据结构、算法、LeetCode,可以关注我 GitHub 上的 LeetCode 题解:[awesome-golang-algorithm][me] + +[title]: https://leetcode.com/problems/maximum-size-of-a-set-after-removals/ +[me]: https://github.com/kylesliu/awesome-golang-algorithm diff --git a/leetcode/3001-3100/3002.Maximum-Size-of-a-Set-After-Removals/Solution.go b/leetcode/3001-3100/3002.Maximum-Size-of-a-Set-After-Removals/Solution.go new file mode 100644 index 00000000..d115ccf5 --- /dev/null +++ b/leetcode/3001-3100/3002.Maximum-Size-of-a-Set-After-Removals/Solution.go @@ -0,0 +1,5 @@ +package Solution + +func Solution(x bool) bool { + return x +} diff --git a/leetcode/3001-3100/3002.Maximum-Size-of-a-Set-After-Removals/Solution_test.go b/leetcode/3001-3100/3002.Maximum-Size-of-a-Set-After-Removals/Solution_test.go new file mode 100644 index 00000000..14ff50eb --- /dev/null +++ b/leetcode/3001-3100/3002.Maximum-Size-of-a-Set-After-Removals/Solution_test.go @@ -0,0 +1,39 @@ +package Solution + +import ( + "reflect" + "strconv" + "testing" +) + +func TestSolution(t *testing.T) { + // 测试用例 + cases := []struct { + name string + inputs bool + expect bool + }{ + {"TestCase", true, true}, + {"TestCase", true, true}, + {"TestCase", false, false}, + } + + // 开始测试 + for i, c := range cases { + t.Run(c.name+" "+strconv.Itoa(i), func(t *testing.T) { + got := Solution(c.inputs) + if !reflect.DeepEqual(got, c.expect) { + t.Fatalf("expected: %v, but got: %v, with inputs: %v", + c.expect, got, c.inputs) + } + }) + } +} + +// 压力测试 +func BenchmarkSolution(b *testing.B) { +} + +// 使用案列 +func ExampleSolution() { +} diff --git a/leetcode/3001-3100/3003.Maximize-the-Number-of-Partitions-After-Operations/README.md b/leetcode/3001-3100/3003.Maximize-the-Number-of-Partitions-After-Operations/README.md new file mode 100755 index 00000000..90b1ec01 --- /dev/null +++ b/leetcode/3001-3100/3003.Maximize-the-Number-of-Partitions-After-Operations/README.md @@ -0,0 +1,32 @@ +# [3003.Maximize the Number of Partitions After Operations][title] + +> [!WARNING|style:flat] +> This question is temporarily unanswered if you have good ideas. Welcome to [Create Pull Request PR](https://github.com/kylesliu/awesome-golang-algorithm) + +## Description + +**Example 1:** + +``` +Input: a = "11", b = "1" +Output: "100" +``` + +## 题意 +> ... + +## 题解 + +### 思路1 +> ... +Maximize the Number of Partitions After Operations +```go +``` + + +## 结语 + +如果你同我一样热爱数据结构、算法、LeetCode,可以关注我 GitHub 上的 LeetCode 题解:[awesome-golang-algorithm][me] + +[title]: https://leetcode.com/problems/maximize-the-number-of-partitions-after-operations/ +[me]: https://github.com/kylesliu/awesome-golang-algorithm diff --git a/leetcode/3001-3100/3003.Maximize-the-Number-of-Partitions-After-Operations/Solution.go b/leetcode/3001-3100/3003.Maximize-the-Number-of-Partitions-After-Operations/Solution.go new file mode 100644 index 00000000..d115ccf5 --- /dev/null +++ b/leetcode/3001-3100/3003.Maximize-the-Number-of-Partitions-After-Operations/Solution.go @@ -0,0 +1,5 @@ +package Solution + +func Solution(x bool) bool { + return x +} diff --git a/leetcode/3001-3100/3003.Maximize-the-Number-of-Partitions-After-Operations/Solution_test.go b/leetcode/3001-3100/3003.Maximize-the-Number-of-Partitions-After-Operations/Solution_test.go new file mode 100644 index 00000000..14ff50eb --- /dev/null +++ b/leetcode/3001-3100/3003.Maximize-the-Number-of-Partitions-After-Operations/Solution_test.go @@ -0,0 +1,39 @@ +package Solution + +import ( + "reflect" + "strconv" + "testing" +) + +func TestSolution(t *testing.T) { + // 测试用例 + cases := []struct { + name string + inputs bool + expect bool + }{ + {"TestCase", true, true}, + {"TestCase", true, true}, + {"TestCase", false, false}, + } + + // 开始测试 + for i, c := range cases { + t.Run(c.name+" "+strconv.Itoa(i), func(t *testing.T) { + got := Solution(c.inputs) + if !reflect.DeepEqual(got, c.expect) { + t.Fatalf("expected: %v, but got: %v, with inputs: %v", + c.expect, got, c.inputs) + } + }) + } +} + +// 压力测试 +func BenchmarkSolution(b *testing.B) { +} + +// 使用案列 +func ExampleSolution() { +} diff --git a/leetcode/3001-3100/3005.Count-Elements-With-Maximum-Frequency/README.md b/leetcode/3001-3100/3005.Count-Elements-With-Maximum-Frequency/README.md new file mode 100755 index 00000000..e74fde81 --- /dev/null +++ b/leetcode/3001-3100/3005.Count-Elements-With-Maximum-Frequency/README.md @@ -0,0 +1,32 @@ +# [3005.Count Elements With Maximum Frequency][title] + +> [!WARNING|style:flat] +> This question is temporarily unanswered if you have good ideas. Welcome to [Create Pull Request PR](https://github.com/kylesliu/awesome-golang-algorithm) + +## Description + +**Example 1:** + +``` +Input: a = "11", b = "1" +Output: "100" +``` + +## 题意 +> ... + +## 题解 + +### 思路1 +> ... +Count Elements With Maximum Frequency +```go +``` + + +## 结语 + +如果你同我一样热爱数据结构、算法、LeetCode,可以关注我 GitHub 上的 LeetCode 题解:[awesome-golang-algorithm][me] + +[title]: https://leetcode.com/problems/count-elements-with-maximum-frequency/ +[me]: https://github.com/kylesliu/awesome-golang-algorithm diff --git a/leetcode/3001-3100/3005.Count-Elements-With-Maximum-Frequency/Solution.go b/leetcode/3001-3100/3005.Count-Elements-With-Maximum-Frequency/Solution.go new file mode 100644 index 00000000..d115ccf5 --- /dev/null +++ b/leetcode/3001-3100/3005.Count-Elements-With-Maximum-Frequency/Solution.go @@ -0,0 +1,5 @@ +package Solution + +func Solution(x bool) bool { + return x +} diff --git a/leetcode/3001-3100/3005.Count-Elements-With-Maximum-Frequency/Solution_test.go b/leetcode/3001-3100/3005.Count-Elements-With-Maximum-Frequency/Solution_test.go new file mode 100644 index 00000000..14ff50eb --- /dev/null +++ b/leetcode/3001-3100/3005.Count-Elements-With-Maximum-Frequency/Solution_test.go @@ -0,0 +1,39 @@ +package Solution + +import ( + "reflect" + "strconv" + "testing" +) + +func TestSolution(t *testing.T) { + // 测试用例 + cases := []struct { + name string + inputs bool + expect bool + }{ + {"TestCase", true, true}, + {"TestCase", true, true}, + {"TestCase", false, false}, + } + + // 开始测试 + for i, c := range cases { + t.Run(c.name+" "+strconv.Itoa(i), func(t *testing.T) { + got := Solution(c.inputs) + if !reflect.DeepEqual(got, c.expect) { + t.Fatalf("expected: %v, but got: %v, with inputs: %v", + c.expect, got, c.inputs) + } + }) + } +} + +// 压力测试 +func BenchmarkSolution(b *testing.B) { +} + +// 使用案列 +func ExampleSolution() { +} diff --git a/leetcode/3001-3100/3006.Find-Beautiful-Indices-in-the-Given-Array-I/README.md b/leetcode/3001-3100/3006.Find-Beautiful-Indices-in-the-Given-Array-I/README.md new file mode 100755 index 00000000..5d6e193e --- /dev/null +++ b/leetcode/3001-3100/3006.Find-Beautiful-Indices-in-the-Given-Array-I/README.md @@ -0,0 +1,32 @@ +# [3006.Find Beautiful Indices in the Given Array I][title] + +> [!WARNING|style:flat] +> This question is temporarily unanswered if you have good ideas. Welcome to [Create Pull Request PR](https://github.com/kylesliu/awesome-golang-algorithm) + +## Description + +**Example 1:** + +``` +Input: a = "11", b = "1" +Output: "100" +``` + +## 题意 +> ... + +## 题解 + +### 思路1 +> ... +Find Beautiful Indices in the Given Array I +```go +``` + + +## 结语 + +如果你同我一样热爱数据结构、算法、LeetCode,可以关注我 GitHub 上的 LeetCode 题解:[awesome-golang-algorithm][me] + +[title]: https://leetcode.com/problems/find-beautiful-indices-in-the-given-array-i/ +[me]: https://github.com/kylesliu/awesome-golang-algorithm diff --git a/leetcode/3001-3100/3006.Find-Beautiful-Indices-in-the-Given-Array-I/Solution.go b/leetcode/3001-3100/3006.Find-Beautiful-Indices-in-the-Given-Array-I/Solution.go new file mode 100644 index 00000000..d115ccf5 --- /dev/null +++ b/leetcode/3001-3100/3006.Find-Beautiful-Indices-in-the-Given-Array-I/Solution.go @@ -0,0 +1,5 @@ +package Solution + +func Solution(x bool) bool { + return x +} diff --git a/leetcode/3001-3100/3006.Find-Beautiful-Indices-in-the-Given-Array-I/Solution_test.go b/leetcode/3001-3100/3006.Find-Beautiful-Indices-in-the-Given-Array-I/Solution_test.go new file mode 100644 index 00000000..14ff50eb --- /dev/null +++ b/leetcode/3001-3100/3006.Find-Beautiful-Indices-in-the-Given-Array-I/Solution_test.go @@ -0,0 +1,39 @@ +package Solution + +import ( + "reflect" + "strconv" + "testing" +) + +func TestSolution(t *testing.T) { + // 测试用例 + cases := []struct { + name string + inputs bool + expect bool + }{ + {"TestCase", true, true}, + {"TestCase", true, true}, + {"TestCase", false, false}, + } + + // 开始测试 + for i, c := range cases { + t.Run(c.name+" "+strconv.Itoa(i), func(t *testing.T) { + got := Solution(c.inputs) + if !reflect.DeepEqual(got, c.expect) { + t.Fatalf("expected: %v, but got: %v, with inputs: %v", + c.expect, got, c.inputs) + } + }) + } +} + +// 压力测试 +func BenchmarkSolution(b *testing.B) { +} + +// 使用案列 +func ExampleSolution() { +} diff --git a/leetcode/3001-3100/3007.Maximum-Number-That-Sum-of-the-Prices-Is-Less-Than-or-Equal-to-K/README.md b/leetcode/3001-3100/3007.Maximum-Number-That-Sum-of-the-Prices-Is-Less-Than-or-Equal-to-K/README.md new file mode 100755 index 00000000..82b7d74a --- /dev/null +++ b/leetcode/3001-3100/3007.Maximum-Number-That-Sum-of-the-Prices-Is-Less-Than-or-Equal-to-K/README.md @@ -0,0 +1,32 @@ +# [3007.Maximum Number That Sum of the Prices Is Less Than or Equal to K][title] + +> [!WARNING|style:flat] +> This question is temporarily unanswered if you have good ideas. Welcome to [Create Pull Request PR](https://github.com/kylesliu/awesome-golang-algorithm) + +## Description + +**Example 1:** + +``` +Input: a = "11", b = "1" +Output: "100" +``` + +## 题意 +> ... + +## 题解 + +### 思路1 +> ... +Maximum Number That Sum of the Prices Is Less Than or Equal to K +```go +``` + + +## 结语 + +如果你同我一样热爱数据结构、算法、LeetCode,可以关注我 GitHub 上的 LeetCode 题解:[awesome-golang-algorithm][me] + +[title]: https://leetcode.com/problems/maximum-number-that-sum-of-the-prices-is-less-than-or-equal-to-k/ +[me]: https://github.com/kylesliu/awesome-golang-algorithm diff --git a/leetcode/3001-3100/3007.Maximum-Number-That-Sum-of-the-Prices-Is-Less-Than-or-Equal-to-K/Solution.go b/leetcode/3001-3100/3007.Maximum-Number-That-Sum-of-the-Prices-Is-Less-Than-or-Equal-to-K/Solution.go new file mode 100644 index 00000000..d115ccf5 --- /dev/null +++ b/leetcode/3001-3100/3007.Maximum-Number-That-Sum-of-the-Prices-Is-Less-Than-or-Equal-to-K/Solution.go @@ -0,0 +1,5 @@ +package Solution + +func Solution(x bool) bool { + return x +} diff --git a/leetcode/3001-3100/3007.Maximum-Number-That-Sum-of-the-Prices-Is-Less-Than-or-Equal-to-K/Solution_test.go b/leetcode/3001-3100/3007.Maximum-Number-That-Sum-of-the-Prices-Is-Less-Than-or-Equal-to-K/Solution_test.go new file mode 100644 index 00000000..14ff50eb --- /dev/null +++ b/leetcode/3001-3100/3007.Maximum-Number-That-Sum-of-the-Prices-Is-Less-Than-or-Equal-to-K/Solution_test.go @@ -0,0 +1,39 @@ +package Solution + +import ( + "reflect" + "strconv" + "testing" +) + +func TestSolution(t *testing.T) { + // 测试用例 + cases := []struct { + name string + inputs bool + expect bool + }{ + {"TestCase", true, true}, + {"TestCase", true, true}, + {"TestCase", false, false}, + } + + // 开始测试 + for i, c := range cases { + t.Run(c.name+" "+strconv.Itoa(i), func(t *testing.T) { + got := Solution(c.inputs) + if !reflect.DeepEqual(got, c.expect) { + t.Fatalf("expected: %v, but got: %v, with inputs: %v", + c.expect, got, c.inputs) + } + }) + } +} + +// 压力测试 +func BenchmarkSolution(b *testing.B) { +} + +// 使用案列 +func ExampleSolution() { +} diff --git a/leetcode/3001-3100/3008.Find-Beautiful-Indices-in-the-Given-Array-II/README.md b/leetcode/3001-3100/3008.Find-Beautiful-Indices-in-the-Given-Array-II/README.md new file mode 100755 index 00000000..d210e078 --- /dev/null +++ b/leetcode/3001-3100/3008.Find-Beautiful-Indices-in-the-Given-Array-II/README.md @@ -0,0 +1,32 @@ +# [3008.Find Beautiful Indices in the Given Array II][title] + +> [!WARNING|style:flat] +> This question is temporarily unanswered if you have good ideas. Welcome to [Create Pull Request PR](https://github.com/kylesliu/awesome-golang-algorithm) + +## Description + +**Example 1:** + +``` +Input: a = "11", b = "1" +Output: "100" +``` + +## 题意 +> ... + +## 题解 + +### 思路1 +> ... +Find Beautiful Indices in the Given Array II +```go +``` + + +## 结语 + +如果你同我一样热爱数据结构、算法、LeetCode,可以关注我 GitHub 上的 LeetCode 题解:[awesome-golang-algorithm][me] + +[title]: https://leetcode.com/problems/find-beautiful-indices-in-the-given-array-ii/ +[me]: https://github.com/kylesliu/awesome-golang-algorithm diff --git a/leetcode/3001-3100/3008.Find-Beautiful-Indices-in-the-Given-Array-II/Solution.go b/leetcode/3001-3100/3008.Find-Beautiful-Indices-in-the-Given-Array-II/Solution.go new file mode 100644 index 00000000..d115ccf5 --- /dev/null +++ b/leetcode/3001-3100/3008.Find-Beautiful-Indices-in-the-Given-Array-II/Solution.go @@ -0,0 +1,5 @@ +package Solution + +func Solution(x bool) bool { + return x +} diff --git a/leetcode/3001-3100/3008.Find-Beautiful-Indices-in-the-Given-Array-II/Solution_test.go b/leetcode/3001-3100/3008.Find-Beautiful-Indices-in-the-Given-Array-II/Solution_test.go new file mode 100644 index 00000000..14ff50eb --- /dev/null +++ b/leetcode/3001-3100/3008.Find-Beautiful-Indices-in-the-Given-Array-II/Solution_test.go @@ -0,0 +1,39 @@ +package Solution + +import ( + "reflect" + "strconv" + "testing" +) + +func TestSolution(t *testing.T) { + // 测试用例 + cases := []struct { + name string + inputs bool + expect bool + }{ + {"TestCase", true, true}, + {"TestCase", true, true}, + {"TestCase", false, false}, + } + + // 开始测试 + for i, c := range cases { + t.Run(c.name+" "+strconv.Itoa(i), func(t *testing.T) { + got := Solution(c.inputs) + if !reflect.DeepEqual(got, c.expect) { + t.Fatalf("expected: %v, but got: %v, with inputs: %v", + c.expect, got, c.inputs) + } + }) + } +} + +// 压力测试 +func BenchmarkSolution(b *testing.B) { +} + +// 使用案列 +func ExampleSolution() { +} diff --git a/leetcode/3001-3100/3010.Divide-an-Array-Into-Subarrays-With-Minimum-Cost-I/README.md b/leetcode/3001-3100/3010.Divide-an-Array-Into-Subarrays-With-Minimum-Cost-I/README.md new file mode 100755 index 00000000..729789f6 --- /dev/null +++ b/leetcode/3001-3100/3010.Divide-an-Array-Into-Subarrays-With-Minimum-Cost-I/README.md @@ -0,0 +1,32 @@ +# [3010.Divide an Array Into Subarrays With Minimum Cost I][title] + +> [!WARNING|style:flat] +> This question is temporarily unanswered if you have good ideas. Welcome to [Create Pull Request PR](https://github.com/kylesliu/awesome-golang-algorithm) + +## Description + +**Example 1:** + +``` +Input: a = "11", b = "1" +Output: "100" +``` + +## 题意 +> ... + +## 题解 + +### 思路1 +> ... +Divide an Array Into Subarrays With Minimum Cost I +```go +``` + + +## 结语 + +如果你同我一样热爱数据结构、算法、LeetCode,可以关注我 GitHub 上的 LeetCode 题解:[awesome-golang-algorithm][me] + +[title]: https://leetcode.com/problems/divide-an-array-into-subarrays-with-minimum-cost-i/ +[me]: https://github.com/kylesliu/awesome-golang-algorithm diff --git a/leetcode/3001-3100/3010.Divide-an-Array-Into-Subarrays-With-Minimum-Cost-I/Solution.go b/leetcode/3001-3100/3010.Divide-an-Array-Into-Subarrays-With-Minimum-Cost-I/Solution.go new file mode 100644 index 00000000..d115ccf5 --- /dev/null +++ b/leetcode/3001-3100/3010.Divide-an-Array-Into-Subarrays-With-Minimum-Cost-I/Solution.go @@ -0,0 +1,5 @@ +package Solution + +func Solution(x bool) bool { + return x +} diff --git a/leetcode/3001-3100/3010.Divide-an-Array-Into-Subarrays-With-Minimum-Cost-I/Solution_test.go b/leetcode/3001-3100/3010.Divide-an-Array-Into-Subarrays-With-Minimum-Cost-I/Solution_test.go new file mode 100644 index 00000000..14ff50eb --- /dev/null +++ b/leetcode/3001-3100/3010.Divide-an-Array-Into-Subarrays-With-Minimum-Cost-I/Solution_test.go @@ -0,0 +1,39 @@ +package Solution + +import ( + "reflect" + "strconv" + "testing" +) + +func TestSolution(t *testing.T) { + // 测试用例 + cases := []struct { + name string + inputs bool + expect bool + }{ + {"TestCase", true, true}, + {"TestCase", true, true}, + {"TestCase", false, false}, + } + + // 开始测试 + for i, c := range cases { + t.Run(c.name+" "+strconv.Itoa(i), func(t *testing.T) { + got := Solution(c.inputs) + if !reflect.DeepEqual(got, c.expect) { + t.Fatalf("expected: %v, but got: %v, with inputs: %v", + c.expect, got, c.inputs) + } + }) + } +} + +// 压力测试 +func BenchmarkSolution(b *testing.B) { +} + +// 使用案列 +func ExampleSolution() { +} diff --git a/leetcode/3001-3100/3011.Find-if-Array-Can-Be-Sorted/README.md b/leetcode/3001-3100/3011.Find-if-Array-Can-Be-Sorted/README.md new file mode 100755 index 00000000..cba6d106 --- /dev/null +++ b/leetcode/3001-3100/3011.Find-if-Array-Can-Be-Sorted/README.md @@ -0,0 +1,32 @@ +# [3011.Find if Array Can Be Sorted][title] + +> [!WARNING|style:flat] +> This question is temporarily unanswered if you have good ideas. Welcome to [Create Pull Request PR](https://github.com/kylesliu/awesome-golang-algorithm) + +## Description + +**Example 1:** + +``` +Input: a = "11", b = "1" +Output: "100" +``` + +## 题意 +> ... + +## 题解 + +### 思路1 +> ... +Find if Array Can Be Sorted +```go +``` + + +## 结语 + +如果你同我一样热爱数据结构、算法、LeetCode,可以关注我 GitHub 上的 LeetCode 题解:[awesome-golang-algorithm][me] + +[title]: https://leetcode.com/problems/find-if-array-can-be-sorted/ +[me]: https://github.com/kylesliu/awesome-golang-algorithm diff --git a/leetcode/3001-3100/3011.Find-if-Array-Can-Be-Sorted/Solution.go b/leetcode/3001-3100/3011.Find-if-Array-Can-Be-Sorted/Solution.go new file mode 100644 index 00000000..d115ccf5 --- /dev/null +++ b/leetcode/3001-3100/3011.Find-if-Array-Can-Be-Sorted/Solution.go @@ -0,0 +1,5 @@ +package Solution + +func Solution(x bool) bool { + return x +} diff --git a/leetcode/3001-3100/3011.Find-if-Array-Can-Be-Sorted/Solution_test.go b/leetcode/3001-3100/3011.Find-if-Array-Can-Be-Sorted/Solution_test.go new file mode 100644 index 00000000..14ff50eb --- /dev/null +++ b/leetcode/3001-3100/3011.Find-if-Array-Can-Be-Sorted/Solution_test.go @@ -0,0 +1,39 @@ +package Solution + +import ( + "reflect" + "strconv" + "testing" +) + +func TestSolution(t *testing.T) { + // 测试用例 + cases := []struct { + name string + inputs bool + expect bool + }{ + {"TestCase", true, true}, + {"TestCase", true, true}, + {"TestCase", false, false}, + } + + // 开始测试 + for i, c := range cases { + t.Run(c.name+" "+strconv.Itoa(i), func(t *testing.T) { + got := Solution(c.inputs) + if !reflect.DeepEqual(got, c.expect) { + t.Fatalf("expected: %v, but got: %v, with inputs: %v", + c.expect, got, c.inputs) + } + }) + } +} + +// 压力测试 +func BenchmarkSolution(b *testing.B) { +} + +// 使用案列 +func ExampleSolution() { +} diff --git a/leetcode/3001-3100/3012.Minimize-Length-of-Array-Using-Operations/README.md b/leetcode/3001-3100/3012.Minimize-Length-of-Array-Using-Operations/README.md new file mode 100755 index 00000000..5249d3c8 --- /dev/null +++ b/leetcode/3001-3100/3012.Minimize-Length-of-Array-Using-Operations/README.md @@ -0,0 +1,32 @@ +# [3012.Minimize Length of Array Using Operations][title] + +> [!WARNING|style:flat] +> This question is temporarily unanswered if you have good ideas. Welcome to [Create Pull Request PR](https://github.com/kylesliu/awesome-golang-algorithm) + +## Description + +**Example 1:** + +``` +Input: a = "11", b = "1" +Output: "100" +``` + +## 题意 +> ... + +## 题解 + +### 思路1 +> ... +Minimize Length of Array Using Operations +```go +``` + + +## 结语 + +如果你同我一样热爱数据结构、算法、LeetCode,可以关注我 GitHub 上的 LeetCode 题解:[awesome-golang-algorithm][me] + +[title]: https://leetcode.com/problems/minimize-length-of-array-using-operations/ +[me]: https://github.com/kylesliu/awesome-golang-algorithm diff --git a/leetcode/3001-3100/3012.Minimize-Length-of-Array-Using-Operations/Solution.go b/leetcode/3001-3100/3012.Minimize-Length-of-Array-Using-Operations/Solution.go new file mode 100644 index 00000000..d115ccf5 --- /dev/null +++ b/leetcode/3001-3100/3012.Minimize-Length-of-Array-Using-Operations/Solution.go @@ -0,0 +1,5 @@ +package Solution + +func Solution(x bool) bool { + return x +} diff --git a/leetcode/3001-3100/3012.Minimize-Length-of-Array-Using-Operations/Solution_test.go b/leetcode/3001-3100/3012.Minimize-Length-of-Array-Using-Operations/Solution_test.go new file mode 100644 index 00000000..14ff50eb --- /dev/null +++ b/leetcode/3001-3100/3012.Minimize-Length-of-Array-Using-Operations/Solution_test.go @@ -0,0 +1,39 @@ +package Solution + +import ( + "reflect" + "strconv" + "testing" +) + +func TestSolution(t *testing.T) { + // 测试用例 + cases := []struct { + name string + inputs bool + expect bool + }{ + {"TestCase", true, true}, + {"TestCase", true, true}, + {"TestCase", false, false}, + } + + // 开始测试 + for i, c := range cases { + t.Run(c.name+" "+strconv.Itoa(i), func(t *testing.T) { + got := Solution(c.inputs) + if !reflect.DeepEqual(got, c.expect) { + t.Fatalf("expected: %v, but got: %v, with inputs: %v", + c.expect, got, c.inputs) + } + }) + } +} + +// 压力测试 +func BenchmarkSolution(b *testing.B) { +} + +// 使用案列 +func ExampleSolution() { +} diff --git a/leetcode/3001-3100/3013.Divide-an-Array-Into-Subarrays-With-Minimum-Cost-II/README.md b/leetcode/3001-3100/3013.Divide-an-Array-Into-Subarrays-With-Minimum-Cost-II/README.md new file mode 100755 index 00000000..9896d8c0 --- /dev/null +++ b/leetcode/3001-3100/3013.Divide-an-Array-Into-Subarrays-With-Minimum-Cost-II/README.md @@ -0,0 +1,32 @@ +# [3013.Divide an Array Into Subarrays With Minimum Cost II][title] + +> [!WARNING|style:flat] +> This question is temporarily unanswered if you have good ideas. Welcome to [Create Pull Request PR](https://github.com/kylesliu/awesome-golang-algorithm) + +## Description + +**Example 1:** + +``` +Input: a = "11", b = "1" +Output: "100" +``` + +## 题意 +> ... + +## 题解 + +### 思路1 +> ... +Divide an Array Into Subarrays With Minimum Cost II +```go +``` + + +## 结语 + +如果你同我一样热爱数据结构、算法、LeetCode,可以关注我 GitHub 上的 LeetCode 题解:[awesome-golang-algorithm][me] + +[title]: https://leetcode.com/problems/divide-an-array-into-subarrays-with-minimum-cost-ii/ +[me]: https://github.com/kylesliu/awesome-golang-algorithm diff --git a/leetcode/3001-3100/3013.Divide-an-Array-Into-Subarrays-With-Minimum-Cost-II/Solution.go b/leetcode/3001-3100/3013.Divide-an-Array-Into-Subarrays-With-Minimum-Cost-II/Solution.go new file mode 100644 index 00000000..d115ccf5 --- /dev/null +++ b/leetcode/3001-3100/3013.Divide-an-Array-Into-Subarrays-With-Minimum-Cost-II/Solution.go @@ -0,0 +1,5 @@ +package Solution + +func Solution(x bool) bool { + return x +} diff --git a/leetcode/3001-3100/3013.Divide-an-Array-Into-Subarrays-With-Minimum-Cost-II/Solution_test.go b/leetcode/3001-3100/3013.Divide-an-Array-Into-Subarrays-With-Minimum-Cost-II/Solution_test.go new file mode 100644 index 00000000..14ff50eb --- /dev/null +++ b/leetcode/3001-3100/3013.Divide-an-Array-Into-Subarrays-With-Minimum-Cost-II/Solution_test.go @@ -0,0 +1,39 @@ +package Solution + +import ( + "reflect" + "strconv" + "testing" +) + +func TestSolution(t *testing.T) { + // 测试用例 + cases := []struct { + name string + inputs bool + expect bool + }{ + {"TestCase", true, true}, + {"TestCase", true, true}, + {"TestCase", false, false}, + } + + // 开始测试 + for i, c := range cases { + t.Run(c.name+" "+strconv.Itoa(i), func(t *testing.T) { + got := Solution(c.inputs) + if !reflect.DeepEqual(got, c.expect) { + t.Fatalf("expected: %v, but got: %v, with inputs: %v", + c.expect, got, c.inputs) + } + }) + } +} + +// 压力测试 +func BenchmarkSolution(b *testing.B) { +} + +// 使用案列 +func ExampleSolution() { +} diff --git a/leetcode/3001-3100/3014.Minimum-Number-of-Pushes-to-Type-Word-I/README.md b/leetcode/3001-3100/3014.Minimum-Number-of-Pushes-to-Type-Word-I/README.md new file mode 100755 index 00000000..2a8e042b --- /dev/null +++ b/leetcode/3001-3100/3014.Minimum-Number-of-Pushes-to-Type-Word-I/README.md @@ -0,0 +1,32 @@ +# [3014.Minimum Number of Pushes to Type Word I][title] + +> [!WARNING|style:flat] +> This question is temporarily unanswered if you have good ideas. Welcome to [Create Pull Request PR](https://github.com/kylesliu/awesome-golang-algorithm) + +## Description + +**Example 1:** + +``` +Input: a = "11", b = "1" +Output: "100" +``` + +## 题意 +> ... + +## 题解 + +### 思路1 +> ... +Minimum Number of Pushes to Type Word I +```go +``` + + +## 结语 + +如果你同我一样热爱数据结构、算法、LeetCode,可以关注我 GitHub 上的 LeetCode 题解:[awesome-golang-algorithm][me] + +[title]: https://leetcode.com/problems/minimum-number-of-pushes-to-type-word-i/ +[me]: https://github.com/kylesliu/awesome-golang-algorithm diff --git a/leetcode/3001-3100/3014.Minimum-Number-of-Pushes-to-Type-Word-I/Solution.go b/leetcode/3001-3100/3014.Minimum-Number-of-Pushes-to-Type-Word-I/Solution.go new file mode 100644 index 00000000..d115ccf5 --- /dev/null +++ b/leetcode/3001-3100/3014.Minimum-Number-of-Pushes-to-Type-Word-I/Solution.go @@ -0,0 +1,5 @@ +package Solution + +func Solution(x bool) bool { + return x +} diff --git a/leetcode/3001-3100/3014.Minimum-Number-of-Pushes-to-Type-Word-I/Solution_test.go b/leetcode/3001-3100/3014.Minimum-Number-of-Pushes-to-Type-Word-I/Solution_test.go new file mode 100644 index 00000000..14ff50eb --- /dev/null +++ b/leetcode/3001-3100/3014.Minimum-Number-of-Pushes-to-Type-Word-I/Solution_test.go @@ -0,0 +1,39 @@ +package Solution + +import ( + "reflect" + "strconv" + "testing" +) + +func TestSolution(t *testing.T) { + // 测试用例 + cases := []struct { + name string + inputs bool + expect bool + }{ + {"TestCase", true, true}, + {"TestCase", true, true}, + {"TestCase", false, false}, + } + + // 开始测试 + for i, c := range cases { + t.Run(c.name+" "+strconv.Itoa(i), func(t *testing.T) { + got := Solution(c.inputs) + if !reflect.DeepEqual(got, c.expect) { + t.Fatalf("expected: %v, but got: %v, with inputs: %v", + c.expect, got, c.inputs) + } + }) + } +} + +// 压力测试 +func BenchmarkSolution(b *testing.B) { +} + +// 使用案列 +func ExampleSolution() { +} diff --git a/leetcode/3001-3100/3015.Count-the-Number-of-Houses-at-a-Certain-Distance-I/README.md b/leetcode/3001-3100/3015.Count-the-Number-of-Houses-at-a-Certain-Distance-I/README.md new file mode 100755 index 00000000..219e476a --- /dev/null +++ b/leetcode/3001-3100/3015.Count-the-Number-of-Houses-at-a-Certain-Distance-I/README.md @@ -0,0 +1,32 @@ +# [3015.Count the Number of Houses at a Certain Distance I][title] + +> [!WARNING|style:flat] +> This question is temporarily unanswered if you have good ideas. Welcome to [Create Pull Request PR](https://github.com/kylesliu/awesome-golang-algorithm) + +## Description + +**Example 1:** + +``` +Input: a = "11", b = "1" +Output: "100" +``` + +## 题意 +> ... + +## 题解 + +### 思路1 +> ... +Count the Number of Houses at a Certain Distance I +```go +``` + + +## 结语 + +如果你同我一样热爱数据结构、算法、LeetCode,可以关注我 GitHub 上的 LeetCode 题解:[awesome-golang-algorithm][me] + +[title]: https://leetcode.com/problems/count-the-number-of-houses-at-a-certain-distance-i/ +[me]: https://github.com/kylesliu/awesome-golang-algorithm diff --git a/leetcode/3001-3100/3015.Count-the-Number-of-Houses-at-a-Certain-Distance-I/Solution.go b/leetcode/3001-3100/3015.Count-the-Number-of-Houses-at-a-Certain-Distance-I/Solution.go new file mode 100644 index 00000000..d115ccf5 --- /dev/null +++ b/leetcode/3001-3100/3015.Count-the-Number-of-Houses-at-a-Certain-Distance-I/Solution.go @@ -0,0 +1,5 @@ +package Solution + +func Solution(x bool) bool { + return x +} diff --git a/leetcode/3001-3100/3015.Count-the-Number-of-Houses-at-a-Certain-Distance-I/Solution_test.go b/leetcode/3001-3100/3015.Count-the-Number-of-Houses-at-a-Certain-Distance-I/Solution_test.go new file mode 100644 index 00000000..14ff50eb --- /dev/null +++ b/leetcode/3001-3100/3015.Count-the-Number-of-Houses-at-a-Certain-Distance-I/Solution_test.go @@ -0,0 +1,39 @@ +package Solution + +import ( + "reflect" + "strconv" + "testing" +) + +func TestSolution(t *testing.T) { + // 测试用例 + cases := []struct { + name string + inputs bool + expect bool + }{ + {"TestCase", true, true}, + {"TestCase", true, true}, + {"TestCase", false, false}, + } + + // 开始测试 + for i, c := range cases { + t.Run(c.name+" "+strconv.Itoa(i), func(t *testing.T) { + got := Solution(c.inputs) + if !reflect.DeepEqual(got, c.expect) { + t.Fatalf("expected: %v, but got: %v, with inputs: %v", + c.expect, got, c.inputs) + } + }) + } +} + +// 压力测试 +func BenchmarkSolution(b *testing.B) { +} + +// 使用案列 +func ExampleSolution() { +} diff --git a/leetcode/3001-3100/3016.Minimum-Number-of-Pushes-to-Type-Word-II/README.md b/leetcode/3001-3100/3016.Minimum-Number-of-Pushes-to-Type-Word-II/README.md new file mode 100755 index 00000000..3e065e71 --- /dev/null +++ b/leetcode/3001-3100/3016.Minimum-Number-of-Pushes-to-Type-Word-II/README.md @@ -0,0 +1,32 @@ +# [3016.Minimum Number of Pushes to Type Word II][title] + +> [!WARNING|style:flat] +> This question is temporarily unanswered if you have good ideas. Welcome to [Create Pull Request PR](https://github.com/kylesliu/awesome-golang-algorithm) + +## Description + +**Example 1:** + +``` +Input: a = "11", b = "1" +Output: "100" +``` + +## 题意 +> ... + +## 题解 + +### 思路1 +> ... +Minimum Number of Pushes to Type Word II +```go +``` + + +## 结语 + +如果你同我一样热爱数据结构、算法、LeetCode,可以关注我 GitHub 上的 LeetCode 题解:[awesome-golang-algorithm][me] + +[title]: https://leetcode.com/problems/minimum-number-of-pushes-to-type-word-ii/ +[me]: https://github.com/kylesliu/awesome-golang-algorithm diff --git a/leetcode/3001-3100/3016.Minimum-Number-of-Pushes-to-Type-Word-II/Solution.go b/leetcode/3001-3100/3016.Minimum-Number-of-Pushes-to-Type-Word-II/Solution.go new file mode 100644 index 00000000..d115ccf5 --- /dev/null +++ b/leetcode/3001-3100/3016.Minimum-Number-of-Pushes-to-Type-Word-II/Solution.go @@ -0,0 +1,5 @@ +package Solution + +func Solution(x bool) bool { + return x +} diff --git a/leetcode/3001-3100/3016.Minimum-Number-of-Pushes-to-Type-Word-II/Solution_test.go b/leetcode/3001-3100/3016.Minimum-Number-of-Pushes-to-Type-Word-II/Solution_test.go new file mode 100644 index 00000000..14ff50eb --- /dev/null +++ b/leetcode/3001-3100/3016.Minimum-Number-of-Pushes-to-Type-Word-II/Solution_test.go @@ -0,0 +1,39 @@ +package Solution + +import ( + "reflect" + "strconv" + "testing" +) + +func TestSolution(t *testing.T) { + // 测试用例 + cases := []struct { + name string + inputs bool + expect bool + }{ + {"TestCase", true, true}, + {"TestCase", true, true}, + {"TestCase", false, false}, + } + + // 开始测试 + for i, c := range cases { + t.Run(c.name+" "+strconv.Itoa(i), func(t *testing.T) { + got := Solution(c.inputs) + if !reflect.DeepEqual(got, c.expect) { + t.Fatalf("expected: %v, but got: %v, with inputs: %v", + c.expect, got, c.inputs) + } + }) + } +} + +// 压力测试 +func BenchmarkSolution(b *testing.B) { +} + +// 使用案列 +func ExampleSolution() { +} diff --git a/leetcode/3001-3100/3017.Count-the-Number-of-Houses-at-a-Certain-Distance-II/README.md b/leetcode/3001-3100/3017.Count-the-Number-of-Houses-at-a-Certain-Distance-II/README.md new file mode 100755 index 00000000..94b6334d --- /dev/null +++ b/leetcode/3001-3100/3017.Count-the-Number-of-Houses-at-a-Certain-Distance-II/README.md @@ -0,0 +1,32 @@ +# [3017.Count the Number of Houses at a Certain Distance II][title] + +> [!WARNING|style:flat] +> This question is temporarily unanswered if you have good ideas. Welcome to [Create Pull Request PR](https://github.com/kylesliu/awesome-golang-algorithm) + +## Description + +**Example 1:** + +``` +Input: a = "11", b = "1" +Output: "100" +``` + +## 题意 +> ... + +## 题解 + +### 思路1 +> ... +Count the Number of Houses at a Certain Distance II +```go +``` + + +## 结语 + +如果你同我一样热爱数据结构、算法、LeetCode,可以关注我 GitHub 上的 LeetCode 题解:[awesome-golang-algorithm][me] + +[title]: https://leetcode.com/problems/count-the-number-of-houses-at-a-certain-distance-ii/ +[me]: https://github.com/kylesliu/awesome-golang-algorithm diff --git a/leetcode/3001-3100/3017.Count-the-Number-of-Houses-at-a-Certain-Distance-II/Solution.go b/leetcode/3001-3100/3017.Count-the-Number-of-Houses-at-a-Certain-Distance-II/Solution.go new file mode 100644 index 00000000..d115ccf5 --- /dev/null +++ b/leetcode/3001-3100/3017.Count-the-Number-of-Houses-at-a-Certain-Distance-II/Solution.go @@ -0,0 +1,5 @@ +package Solution + +func Solution(x bool) bool { + return x +} diff --git a/leetcode/3001-3100/3017.Count-the-Number-of-Houses-at-a-Certain-Distance-II/Solution_test.go b/leetcode/3001-3100/3017.Count-the-Number-of-Houses-at-a-Certain-Distance-II/Solution_test.go new file mode 100644 index 00000000..14ff50eb --- /dev/null +++ b/leetcode/3001-3100/3017.Count-the-Number-of-Houses-at-a-Certain-Distance-II/Solution_test.go @@ -0,0 +1,39 @@ +package Solution + +import ( + "reflect" + "strconv" + "testing" +) + +func TestSolution(t *testing.T) { + // 测试用例 + cases := []struct { + name string + inputs bool + expect bool + }{ + {"TestCase", true, true}, + {"TestCase", true, true}, + {"TestCase", false, false}, + } + + // 开始测试 + for i, c := range cases { + t.Run(c.name+" "+strconv.Itoa(i), func(t *testing.T) { + got := Solution(c.inputs) + if !reflect.DeepEqual(got, c.expect) { + t.Fatalf("expected: %v, but got: %v, with inputs: %v", + c.expect, got, c.inputs) + } + }) + } +} + +// 压力测试 +func BenchmarkSolution(b *testing.B) { +} + +// 使用案列 +func ExampleSolution() { +} diff --git a/leetcode/3001-3100/3019.Number-of-Changing-Keys/README.md b/leetcode/3001-3100/3019.Number-of-Changing-Keys/README.md new file mode 100755 index 00000000..a8e4d4c0 --- /dev/null +++ b/leetcode/3001-3100/3019.Number-of-Changing-Keys/README.md @@ -0,0 +1,32 @@ +# [3019.Number of Changing Keys][title] + +> [!WARNING|style:flat] +> This question is temporarily unanswered if you have good ideas. Welcome to [Create Pull Request PR](https://github.com/kylesliu/awesome-golang-algorithm) + +## Description + +**Example 1:** + +``` +Input: a = "11", b = "1" +Output: "100" +``` + +## 题意 +> ... + +## 题解 + +### 思路1 +> ... +Number of Changing Keys +```go +``` + + +## 结语 + +如果你同我一样热爱数据结构、算法、LeetCode,可以关注我 GitHub 上的 LeetCode 题解:[awesome-golang-algorithm][me] + +[title]: https://leetcode.com/problems/number-of-changing-keys/ +[me]: https://github.com/kylesliu/awesome-golang-algorithm diff --git a/leetcode/3001-3100/3019.Number-of-Changing-Keys/Solution.go b/leetcode/3001-3100/3019.Number-of-Changing-Keys/Solution.go new file mode 100644 index 00000000..d115ccf5 --- /dev/null +++ b/leetcode/3001-3100/3019.Number-of-Changing-Keys/Solution.go @@ -0,0 +1,5 @@ +package Solution + +func Solution(x bool) bool { + return x +} diff --git a/leetcode/3001-3100/3019.Number-of-Changing-Keys/Solution_test.go b/leetcode/3001-3100/3019.Number-of-Changing-Keys/Solution_test.go new file mode 100644 index 00000000..14ff50eb --- /dev/null +++ b/leetcode/3001-3100/3019.Number-of-Changing-Keys/Solution_test.go @@ -0,0 +1,39 @@ +package Solution + +import ( + "reflect" + "strconv" + "testing" +) + +func TestSolution(t *testing.T) { + // 测试用例 + cases := []struct { + name string + inputs bool + expect bool + }{ + {"TestCase", true, true}, + {"TestCase", true, true}, + {"TestCase", false, false}, + } + + // 开始测试 + for i, c := range cases { + t.Run(c.name+" "+strconv.Itoa(i), func(t *testing.T) { + got := Solution(c.inputs) + if !reflect.DeepEqual(got, c.expect) { + t.Fatalf("expected: %v, but got: %v, with inputs: %v", + c.expect, got, c.inputs) + } + }) + } +} + +// 压力测试 +func BenchmarkSolution(b *testing.B) { +} + +// 使用案列 +func ExampleSolution() { +} diff --git a/leetcode/3001-3100/3020.Find-the-Maximum-Number-of-Elements-in-Subset/README.md b/leetcode/3001-3100/3020.Find-the-Maximum-Number-of-Elements-in-Subset/README.md new file mode 100755 index 00000000..bb5f030d --- /dev/null +++ b/leetcode/3001-3100/3020.Find-the-Maximum-Number-of-Elements-in-Subset/README.md @@ -0,0 +1,32 @@ +# [3020.Find the Maximum Number of Elements in Subset][title] + +> [!WARNING|style:flat] +> This question is temporarily unanswered if you have good ideas. Welcome to [Create Pull Request PR](https://github.com/kylesliu/awesome-golang-algorithm) + +## Description + +**Example 1:** + +``` +Input: a = "11", b = "1" +Output: "100" +``` + +## 题意 +> ... + +## 题解 + +### 思路1 +> ... +Find the Maximum Number of Elements in Subset +```go +``` + + +## 结语 + +如果你同我一样热爱数据结构、算法、LeetCode,可以关注我 GitHub 上的 LeetCode 题解:[awesome-golang-algorithm][me] + +[title]: https://leetcode.com/problems/find-the-maximum-number-of-elements-in-subset/ +[me]: https://github.com/kylesliu/awesome-golang-algorithm diff --git a/leetcode/3001-3100/3020.Find-the-Maximum-Number-of-Elements-in-Subset/Solution.go b/leetcode/3001-3100/3020.Find-the-Maximum-Number-of-Elements-in-Subset/Solution.go new file mode 100644 index 00000000..d115ccf5 --- /dev/null +++ b/leetcode/3001-3100/3020.Find-the-Maximum-Number-of-Elements-in-Subset/Solution.go @@ -0,0 +1,5 @@ +package Solution + +func Solution(x bool) bool { + return x +} diff --git a/leetcode/3001-3100/3020.Find-the-Maximum-Number-of-Elements-in-Subset/Solution_test.go b/leetcode/3001-3100/3020.Find-the-Maximum-Number-of-Elements-in-Subset/Solution_test.go new file mode 100644 index 00000000..14ff50eb --- /dev/null +++ b/leetcode/3001-3100/3020.Find-the-Maximum-Number-of-Elements-in-Subset/Solution_test.go @@ -0,0 +1,39 @@ +package Solution + +import ( + "reflect" + "strconv" + "testing" +) + +func TestSolution(t *testing.T) { + // 测试用例 + cases := []struct { + name string + inputs bool + expect bool + }{ + {"TestCase", true, true}, + {"TestCase", true, true}, + {"TestCase", false, false}, + } + + // 开始测试 + for i, c := range cases { + t.Run(c.name+" "+strconv.Itoa(i), func(t *testing.T) { + got := Solution(c.inputs) + if !reflect.DeepEqual(got, c.expect) { + t.Fatalf("expected: %v, but got: %v, with inputs: %v", + c.expect, got, c.inputs) + } + }) + } +} + +// 压力测试 +func BenchmarkSolution(b *testing.B) { +} + +// 使用案列 +func ExampleSolution() { +} diff --git a/leetcode/3001-3100/3021.Alice-and-Bob-Playing-Flower-Game/README.md b/leetcode/3001-3100/3021.Alice-and-Bob-Playing-Flower-Game/README.md new file mode 100755 index 00000000..5b451799 --- /dev/null +++ b/leetcode/3001-3100/3021.Alice-and-Bob-Playing-Flower-Game/README.md @@ -0,0 +1,32 @@ +# [3021.Alice and Bob Playing Flower Game][title] + +> [!WARNING|style:flat] +> This question is temporarily unanswered if you have good ideas. Welcome to [Create Pull Request PR](https://github.com/kylesliu/awesome-golang-algorithm) + +## Description + +**Example 1:** + +``` +Input: a = "11", b = "1" +Output: "100" +``` + +## 题意 +> ... + +## 题解 + +### 思路1 +> ... +Alice and Bob Playing Flower Game +```go +``` + + +## 结语 + +如果你同我一样热爱数据结构、算法、LeetCode,可以关注我 GitHub 上的 LeetCode 题解:[awesome-golang-algorithm][me] + +[title]: https://leetcode.com/problems/alice-and-bob-playing-flower-game/ +[me]: https://github.com/kylesliu/awesome-golang-algorithm diff --git a/leetcode/3001-3100/3021.Alice-and-Bob-Playing-Flower-Game/Solution.go b/leetcode/3001-3100/3021.Alice-and-Bob-Playing-Flower-Game/Solution.go new file mode 100644 index 00000000..d115ccf5 --- /dev/null +++ b/leetcode/3001-3100/3021.Alice-and-Bob-Playing-Flower-Game/Solution.go @@ -0,0 +1,5 @@ +package Solution + +func Solution(x bool) bool { + return x +} diff --git a/leetcode/3001-3100/3021.Alice-and-Bob-Playing-Flower-Game/Solution_test.go b/leetcode/3001-3100/3021.Alice-and-Bob-Playing-Flower-Game/Solution_test.go new file mode 100644 index 00000000..14ff50eb --- /dev/null +++ b/leetcode/3001-3100/3021.Alice-and-Bob-Playing-Flower-Game/Solution_test.go @@ -0,0 +1,39 @@ +package Solution + +import ( + "reflect" + "strconv" + "testing" +) + +func TestSolution(t *testing.T) { + // 测试用例 + cases := []struct { + name string + inputs bool + expect bool + }{ + {"TestCase", true, true}, + {"TestCase", true, true}, + {"TestCase", false, false}, + } + + // 开始测试 + for i, c := range cases { + t.Run(c.name+" "+strconv.Itoa(i), func(t *testing.T) { + got := Solution(c.inputs) + if !reflect.DeepEqual(got, c.expect) { + t.Fatalf("expected: %v, but got: %v, with inputs: %v", + c.expect, got, c.inputs) + } + }) + } +} + +// 压力测试 +func BenchmarkSolution(b *testing.B) { +} + +// 使用案列 +func ExampleSolution() { +} diff --git a/leetcode/3001-3100/3022.Minimize-OR-of-Remaining-Elements-Using-Operations/README.md b/leetcode/3001-3100/3022.Minimize-OR-of-Remaining-Elements-Using-Operations/README.md new file mode 100755 index 00000000..0a9f508e --- /dev/null +++ b/leetcode/3001-3100/3022.Minimize-OR-of-Remaining-Elements-Using-Operations/README.md @@ -0,0 +1,32 @@ +# [3022.Minimize OR of Remaining Elements Using Operations][title] + +> [!WARNING|style:flat] +> This question is temporarily unanswered if you have good ideas. Welcome to [Create Pull Request PR](https://github.com/kylesliu/awesome-golang-algorithm) + +## Description + +**Example 1:** + +``` +Input: a = "11", b = "1" +Output: "100" +``` + +## 题意 +> ... + +## 题解 + +### 思路1 +> ... +Minimize OR of Remaining Elements Using Operations +```go +``` + + +## 结语 + +如果你同我一样热爱数据结构、算法、LeetCode,可以关注我 GitHub 上的 LeetCode 题解:[awesome-golang-algorithm][me] + +[title]: https://leetcode.com/problems/minimize-or-of-remaining-elements-using-operations/ +[me]: https://github.com/kylesliu/awesome-golang-algorithm diff --git a/leetcode/3001-3100/3022.Minimize-OR-of-Remaining-Elements-Using-Operations/Solution.go b/leetcode/3001-3100/3022.Minimize-OR-of-Remaining-Elements-Using-Operations/Solution.go new file mode 100644 index 00000000..d115ccf5 --- /dev/null +++ b/leetcode/3001-3100/3022.Minimize-OR-of-Remaining-Elements-Using-Operations/Solution.go @@ -0,0 +1,5 @@ +package Solution + +func Solution(x bool) bool { + return x +} diff --git a/leetcode/3001-3100/3022.Minimize-OR-of-Remaining-Elements-Using-Operations/Solution_test.go b/leetcode/3001-3100/3022.Minimize-OR-of-Remaining-Elements-Using-Operations/Solution_test.go new file mode 100644 index 00000000..14ff50eb --- /dev/null +++ b/leetcode/3001-3100/3022.Minimize-OR-of-Remaining-Elements-Using-Operations/Solution_test.go @@ -0,0 +1,39 @@ +package Solution + +import ( + "reflect" + "strconv" + "testing" +) + +func TestSolution(t *testing.T) { + // 测试用例 + cases := []struct { + name string + inputs bool + expect bool + }{ + {"TestCase", true, true}, + {"TestCase", true, true}, + {"TestCase", false, false}, + } + + // 开始测试 + for i, c := range cases { + t.Run(c.name+" "+strconv.Itoa(i), func(t *testing.T) { + got := Solution(c.inputs) + if !reflect.DeepEqual(got, c.expect) { + t.Fatalf("expected: %v, but got: %v, with inputs: %v", + c.expect, got, c.inputs) + } + }) + } +} + +// 压力测试 +func BenchmarkSolution(b *testing.B) { +} + +// 使用案列 +func ExampleSolution() { +} diff --git a/leetcode/3001-3100/3024.Type-of-Triangle/README.md b/leetcode/3001-3100/3024.Type-of-Triangle/README.md new file mode 100755 index 00000000..a7c5e1bb --- /dev/null +++ b/leetcode/3001-3100/3024.Type-of-Triangle/README.md @@ -0,0 +1,32 @@ +# [3024.Type of Triangle][title] + +> [!WARNING|style:flat] +> This question is temporarily unanswered if you have good ideas. Welcome to [Create Pull Request PR](https://github.com/kylesliu/awesome-golang-algorithm) + +## Description + +**Example 1:** + +``` +Input: a = "11", b = "1" +Output: "100" +``` + +## 题意 +> ... + +## 题解 + +### 思路1 +> ... +Type of Triangle +```go +``` + + +## 结语 + +如果你同我一样热爱数据结构、算法、LeetCode,可以关注我 GitHub 上的 LeetCode 题解:[awesome-golang-algorithm][me] + +[title]: https://leetcode.com/problems/type-of-triangle/ +[me]: https://github.com/kylesliu/awesome-golang-algorithm diff --git a/leetcode/3001-3100/3024.Type-of-Triangle/Solution.go b/leetcode/3001-3100/3024.Type-of-Triangle/Solution.go new file mode 100644 index 00000000..d115ccf5 --- /dev/null +++ b/leetcode/3001-3100/3024.Type-of-Triangle/Solution.go @@ -0,0 +1,5 @@ +package Solution + +func Solution(x bool) bool { + return x +} diff --git a/leetcode/3001-3100/3024.Type-of-Triangle/Solution_test.go b/leetcode/3001-3100/3024.Type-of-Triangle/Solution_test.go new file mode 100644 index 00000000..14ff50eb --- /dev/null +++ b/leetcode/3001-3100/3024.Type-of-Triangle/Solution_test.go @@ -0,0 +1,39 @@ +package Solution + +import ( + "reflect" + "strconv" + "testing" +) + +func TestSolution(t *testing.T) { + // 测试用例 + cases := []struct { + name string + inputs bool + expect bool + }{ + {"TestCase", true, true}, + {"TestCase", true, true}, + {"TestCase", false, false}, + } + + // 开始测试 + for i, c := range cases { + t.Run(c.name+" "+strconv.Itoa(i), func(t *testing.T) { + got := Solution(c.inputs) + if !reflect.DeepEqual(got, c.expect) { + t.Fatalf("expected: %v, but got: %v, with inputs: %v", + c.expect, got, c.inputs) + } + }) + } +} + +// 压力测试 +func BenchmarkSolution(b *testing.B) { +} + +// 使用案列 +func ExampleSolution() { +} diff --git a/leetcode/3001-3100/3025.Find-the-Number-of-Ways-to-Place-People-I/README.md b/leetcode/3001-3100/3025.Find-the-Number-of-Ways-to-Place-People-I/README.md new file mode 100755 index 00000000..3d5a5f8d --- /dev/null +++ b/leetcode/3001-3100/3025.Find-the-Number-of-Ways-to-Place-People-I/README.md @@ -0,0 +1,32 @@ +# [3025.Find the Number of Ways to Place People I][title] + +> [!WARNING|style:flat] +> This question is temporarily unanswered if you have good ideas. Welcome to [Create Pull Request PR](https://github.com/kylesliu/awesome-golang-algorithm) + +## Description + +**Example 1:** + +``` +Input: a = "11", b = "1" +Output: "100" +``` + +## 题意 +> ... + +## 题解 + +### 思路1 +> ... +Find the Number of Ways to Place People I +```go +``` + + +## 结语 + +如果你同我一样热爱数据结构、算法、LeetCode,可以关注我 GitHub 上的 LeetCode 题解:[awesome-golang-algorithm][me] + +[title]: https://leetcode.com/problems/find-the-number-of-ways-to-place-people-i/ +[me]: https://github.com/kylesliu/awesome-golang-algorithm diff --git a/leetcode/3001-3100/3025.Find-the-Number-of-Ways-to-Place-People-I/Solution.go b/leetcode/3001-3100/3025.Find-the-Number-of-Ways-to-Place-People-I/Solution.go new file mode 100644 index 00000000..d115ccf5 --- /dev/null +++ b/leetcode/3001-3100/3025.Find-the-Number-of-Ways-to-Place-People-I/Solution.go @@ -0,0 +1,5 @@ +package Solution + +func Solution(x bool) bool { + return x +} diff --git a/leetcode/3001-3100/3025.Find-the-Number-of-Ways-to-Place-People-I/Solution_test.go b/leetcode/3001-3100/3025.Find-the-Number-of-Ways-to-Place-People-I/Solution_test.go new file mode 100644 index 00000000..14ff50eb --- /dev/null +++ b/leetcode/3001-3100/3025.Find-the-Number-of-Ways-to-Place-People-I/Solution_test.go @@ -0,0 +1,39 @@ +package Solution + +import ( + "reflect" + "strconv" + "testing" +) + +func TestSolution(t *testing.T) { + // 测试用例 + cases := []struct { + name string + inputs bool + expect bool + }{ + {"TestCase", true, true}, + {"TestCase", true, true}, + {"TestCase", false, false}, + } + + // 开始测试 + for i, c := range cases { + t.Run(c.name+" "+strconv.Itoa(i), func(t *testing.T) { + got := Solution(c.inputs) + if !reflect.DeepEqual(got, c.expect) { + t.Fatalf("expected: %v, but got: %v, with inputs: %v", + c.expect, got, c.inputs) + } + }) + } +} + +// 压力测试 +func BenchmarkSolution(b *testing.B) { +} + +// 使用案列 +func ExampleSolution() { +} diff --git a/leetcode/3001-3100/3026.Maximum-Good-Subarray-Sum/README.md b/leetcode/3001-3100/3026.Maximum-Good-Subarray-Sum/README.md new file mode 100755 index 00000000..20b39d49 --- /dev/null +++ b/leetcode/3001-3100/3026.Maximum-Good-Subarray-Sum/README.md @@ -0,0 +1,32 @@ +# [3026.Maximum Good Subarray Sum][title] + +> [!WARNING|style:flat] +> This question is temporarily unanswered if you have good ideas. Welcome to [Create Pull Request PR](https://github.com/kylesliu/awesome-golang-algorithm) + +## Description + +**Example 1:** + +``` +Input: a = "11", b = "1" +Output: "100" +``` + +## 题意 +> ... + +## 题解 + +### 思路1 +> ... +Maximum Good Subarray Sum +```go +``` + + +## 结语 + +如果你同我一样热爱数据结构、算法、LeetCode,可以关注我 GitHub 上的 LeetCode 题解:[awesome-golang-algorithm][me] + +[title]: https://leetcode.com/problems/maximum-good-subarray-sum/ +[me]: https://github.com/kylesliu/awesome-golang-algorithm diff --git a/leetcode/3001-3100/3026.Maximum-Good-Subarray-Sum/Solution.go b/leetcode/3001-3100/3026.Maximum-Good-Subarray-Sum/Solution.go new file mode 100644 index 00000000..d115ccf5 --- /dev/null +++ b/leetcode/3001-3100/3026.Maximum-Good-Subarray-Sum/Solution.go @@ -0,0 +1,5 @@ +package Solution + +func Solution(x bool) bool { + return x +} diff --git a/leetcode/3001-3100/3026.Maximum-Good-Subarray-Sum/Solution_test.go b/leetcode/3001-3100/3026.Maximum-Good-Subarray-Sum/Solution_test.go new file mode 100644 index 00000000..14ff50eb --- /dev/null +++ b/leetcode/3001-3100/3026.Maximum-Good-Subarray-Sum/Solution_test.go @@ -0,0 +1,39 @@ +package Solution + +import ( + "reflect" + "strconv" + "testing" +) + +func TestSolution(t *testing.T) { + // 测试用例 + cases := []struct { + name string + inputs bool + expect bool + }{ + {"TestCase", true, true}, + {"TestCase", true, true}, + {"TestCase", false, false}, + } + + // 开始测试 + for i, c := range cases { + t.Run(c.name+" "+strconv.Itoa(i), func(t *testing.T) { + got := Solution(c.inputs) + if !reflect.DeepEqual(got, c.expect) { + t.Fatalf("expected: %v, but got: %v, with inputs: %v", + c.expect, got, c.inputs) + } + }) + } +} + +// 压力测试 +func BenchmarkSolution(b *testing.B) { +} + +// 使用案列 +func ExampleSolution() { +} diff --git a/leetcode/3001-3100/3027.Find-the-Number-of-Ways-to-Place-People-II/README.md b/leetcode/3001-3100/3027.Find-the-Number-of-Ways-to-Place-People-II/README.md new file mode 100755 index 00000000..10a0906d --- /dev/null +++ b/leetcode/3001-3100/3027.Find-the-Number-of-Ways-to-Place-People-II/README.md @@ -0,0 +1,32 @@ +# [3027.Find the Number of Ways to Place People II][title] + +> [!WARNING|style:flat] +> This question is temporarily unanswered if you have good ideas. Welcome to [Create Pull Request PR](https://github.com/kylesliu/awesome-golang-algorithm) + +## Description + +**Example 1:** + +``` +Input: a = "11", b = "1" +Output: "100" +``` + +## 题意 +> ... + +## 题解 + +### 思路1 +> ... +Find the Number of Ways to Place People II +```go +``` + + +## 结语 + +如果你同我一样热爱数据结构、算法、LeetCode,可以关注我 GitHub 上的 LeetCode 题解:[awesome-golang-algorithm][me] + +[title]: https://leetcode.com/problems/find-the-number-of-ways-to-place-people-ii/ +[me]: https://github.com/kylesliu/awesome-golang-algorithm diff --git a/leetcode/3001-3100/3027.Find-the-Number-of-Ways-to-Place-People-II/Solution.go b/leetcode/3001-3100/3027.Find-the-Number-of-Ways-to-Place-People-II/Solution.go new file mode 100644 index 00000000..d115ccf5 --- /dev/null +++ b/leetcode/3001-3100/3027.Find-the-Number-of-Ways-to-Place-People-II/Solution.go @@ -0,0 +1,5 @@ +package Solution + +func Solution(x bool) bool { + return x +} diff --git a/leetcode/3001-3100/3027.Find-the-Number-of-Ways-to-Place-People-II/Solution_test.go b/leetcode/3001-3100/3027.Find-the-Number-of-Ways-to-Place-People-II/Solution_test.go new file mode 100644 index 00000000..14ff50eb --- /dev/null +++ b/leetcode/3001-3100/3027.Find-the-Number-of-Ways-to-Place-People-II/Solution_test.go @@ -0,0 +1,39 @@ +package Solution + +import ( + "reflect" + "strconv" + "testing" +) + +func TestSolution(t *testing.T) { + // 测试用例 + cases := []struct { + name string + inputs bool + expect bool + }{ + {"TestCase", true, true}, + {"TestCase", true, true}, + {"TestCase", false, false}, + } + + // 开始测试 + for i, c := range cases { + t.Run(c.name+" "+strconv.Itoa(i), func(t *testing.T) { + got := Solution(c.inputs) + if !reflect.DeepEqual(got, c.expect) { + t.Fatalf("expected: %v, but got: %v, with inputs: %v", + c.expect, got, c.inputs) + } + }) + } +} + +// 压力测试 +func BenchmarkSolution(b *testing.B) { +} + +// 使用案列 +func ExampleSolution() { +} diff --git a/leetcode/3001-3100/3028.Ant-on-the-Boundary/README.md b/leetcode/3001-3100/3028.Ant-on-the-Boundary/README.md new file mode 100755 index 00000000..2b9a4c89 --- /dev/null +++ b/leetcode/3001-3100/3028.Ant-on-the-Boundary/README.md @@ -0,0 +1,32 @@ +# [3028.Ant on the Boundary][title] + +> [!WARNING|style:flat] +> This question is temporarily unanswered if you have good ideas. Welcome to [Create Pull Request PR](https://github.com/kylesliu/awesome-golang-algorithm) + +## Description + +**Example 1:** + +``` +Input: a = "11", b = "1" +Output: "100" +``` + +## 题意 +> ... + +## 题解 + +### 思路1 +> ... +Ant on the Boundary +```go +``` + + +## 结语 + +如果你同我一样热爱数据结构、算法、LeetCode,可以关注我 GitHub 上的 LeetCode 题解:[awesome-golang-algorithm][me] + +[title]: https://leetcode.com/problems/ant-on-the-boundary/ +[me]: https://github.com/kylesliu/awesome-golang-algorithm diff --git a/leetcode/3001-3100/3028.Ant-on-the-Boundary/Solution.go b/leetcode/3001-3100/3028.Ant-on-the-Boundary/Solution.go new file mode 100644 index 00000000..d115ccf5 --- /dev/null +++ b/leetcode/3001-3100/3028.Ant-on-the-Boundary/Solution.go @@ -0,0 +1,5 @@ +package Solution + +func Solution(x bool) bool { + return x +} diff --git a/leetcode/3001-3100/3028.Ant-on-the-Boundary/Solution_test.go b/leetcode/3001-3100/3028.Ant-on-the-Boundary/Solution_test.go new file mode 100644 index 00000000..14ff50eb --- /dev/null +++ b/leetcode/3001-3100/3028.Ant-on-the-Boundary/Solution_test.go @@ -0,0 +1,39 @@ +package Solution + +import ( + "reflect" + "strconv" + "testing" +) + +func TestSolution(t *testing.T) { + // 测试用例 + cases := []struct { + name string + inputs bool + expect bool + }{ + {"TestCase", true, true}, + {"TestCase", true, true}, + {"TestCase", false, false}, + } + + // 开始测试 + for i, c := range cases { + t.Run(c.name+" "+strconv.Itoa(i), func(t *testing.T) { + got := Solution(c.inputs) + if !reflect.DeepEqual(got, c.expect) { + t.Fatalf("expected: %v, but got: %v, with inputs: %v", + c.expect, got, c.inputs) + } + }) + } +} + +// 压力测试 +func BenchmarkSolution(b *testing.B) { +} + +// 使用案列 +func ExampleSolution() { +} diff --git a/leetcode/3001-3100/3029.Minimum-Time-to-Revert-Word-to-Initial-State-I/README.md b/leetcode/3001-3100/3029.Minimum-Time-to-Revert-Word-to-Initial-State-I/README.md new file mode 100755 index 00000000..150eaa36 --- /dev/null +++ b/leetcode/3001-3100/3029.Minimum-Time-to-Revert-Word-to-Initial-State-I/README.md @@ -0,0 +1,32 @@ +# [3029.Minimum Time to Revert Word to Initial State I][title] + +> [!WARNING|style:flat] +> This question is temporarily unanswered if you have good ideas. Welcome to [Create Pull Request PR](https://github.com/kylesliu/awesome-golang-algorithm) + +## Description + +**Example 1:** + +``` +Input: a = "11", b = "1" +Output: "100" +``` + +## 题意 +> ... + +## 题解 + +### 思路1 +> ... +Minimum Time to Revert Word to Initial State I +```go +``` + + +## 结语 + +如果你同我一样热爱数据结构、算法、LeetCode,可以关注我 GitHub 上的 LeetCode 题解:[awesome-golang-algorithm][me] + +[title]: https://leetcode.com/problems/minimum-time-to-revert-word-to-initial-state-i/ +[me]: https://github.com/kylesliu/awesome-golang-algorithm diff --git a/leetcode/3001-3100/3029.Minimum-Time-to-Revert-Word-to-Initial-State-I/Solution.go b/leetcode/3001-3100/3029.Minimum-Time-to-Revert-Word-to-Initial-State-I/Solution.go new file mode 100644 index 00000000..d115ccf5 --- /dev/null +++ b/leetcode/3001-3100/3029.Minimum-Time-to-Revert-Word-to-Initial-State-I/Solution.go @@ -0,0 +1,5 @@ +package Solution + +func Solution(x bool) bool { + return x +} diff --git a/leetcode/3001-3100/3029.Minimum-Time-to-Revert-Word-to-Initial-State-I/Solution_test.go b/leetcode/3001-3100/3029.Minimum-Time-to-Revert-Word-to-Initial-State-I/Solution_test.go new file mode 100644 index 00000000..14ff50eb --- /dev/null +++ b/leetcode/3001-3100/3029.Minimum-Time-to-Revert-Word-to-Initial-State-I/Solution_test.go @@ -0,0 +1,39 @@ +package Solution + +import ( + "reflect" + "strconv" + "testing" +) + +func TestSolution(t *testing.T) { + // 测试用例 + cases := []struct { + name string + inputs bool + expect bool + }{ + {"TestCase", true, true}, + {"TestCase", true, true}, + {"TestCase", false, false}, + } + + // 开始测试 + for i, c := range cases { + t.Run(c.name+" "+strconv.Itoa(i), func(t *testing.T) { + got := Solution(c.inputs) + if !reflect.DeepEqual(got, c.expect) { + t.Fatalf("expected: %v, but got: %v, with inputs: %v", + c.expect, got, c.inputs) + } + }) + } +} + +// 压力测试 +func BenchmarkSolution(b *testing.B) { +} + +// 使用案列 +func ExampleSolution() { +} diff --git a/leetcode/3001-3100/3030.Find-the-Grid-of-Region-Average/README.md b/leetcode/3001-3100/3030.Find-the-Grid-of-Region-Average/README.md new file mode 100755 index 00000000..e43981f5 --- /dev/null +++ b/leetcode/3001-3100/3030.Find-the-Grid-of-Region-Average/README.md @@ -0,0 +1,32 @@ +# [3030.Find the Grid of Region Average][title] + +> [!WARNING|style:flat] +> This question is temporarily unanswered if you have good ideas. Welcome to [Create Pull Request PR](https://github.com/kylesliu/awesome-golang-algorithm) + +## Description + +**Example 1:** + +``` +Input: a = "11", b = "1" +Output: "100" +``` + +## 题意 +> ... + +## 题解 + +### 思路1 +> ... +Find the Grid of Region Average +```go +``` + + +## 结语 + +如果你同我一样热爱数据结构、算法、LeetCode,可以关注我 GitHub 上的 LeetCode 题解:[awesome-golang-algorithm][me] + +[title]: https://leetcode.com/problems/find-the-grid-of-region-average/ +[me]: https://github.com/kylesliu/awesome-golang-algorithm diff --git a/leetcode/3001-3100/3030.Find-the-Grid-of-Region-Average/Solution.go b/leetcode/3001-3100/3030.Find-the-Grid-of-Region-Average/Solution.go new file mode 100644 index 00000000..d115ccf5 --- /dev/null +++ b/leetcode/3001-3100/3030.Find-the-Grid-of-Region-Average/Solution.go @@ -0,0 +1,5 @@ +package Solution + +func Solution(x bool) bool { + return x +} diff --git a/leetcode/3001-3100/3030.Find-the-Grid-of-Region-Average/Solution_test.go b/leetcode/3001-3100/3030.Find-the-Grid-of-Region-Average/Solution_test.go new file mode 100644 index 00000000..14ff50eb --- /dev/null +++ b/leetcode/3001-3100/3030.Find-the-Grid-of-Region-Average/Solution_test.go @@ -0,0 +1,39 @@ +package Solution + +import ( + "reflect" + "strconv" + "testing" +) + +func TestSolution(t *testing.T) { + // 测试用例 + cases := []struct { + name string + inputs bool + expect bool + }{ + {"TestCase", true, true}, + {"TestCase", true, true}, + {"TestCase", false, false}, + } + + // 开始测试 + for i, c := range cases { + t.Run(c.name+" "+strconv.Itoa(i), func(t *testing.T) { + got := Solution(c.inputs) + if !reflect.DeepEqual(got, c.expect) { + t.Fatalf("expected: %v, but got: %v, with inputs: %v", + c.expect, got, c.inputs) + } + }) + } +} + +// 压力测试 +func BenchmarkSolution(b *testing.B) { +} + +// 使用案列 +func ExampleSolution() { +} diff --git a/leetcode/3001-3100/3031.Minimum-Time-to-Revert-Word-to-Initial-State-II/README.md b/leetcode/3001-3100/3031.Minimum-Time-to-Revert-Word-to-Initial-State-II/README.md new file mode 100755 index 00000000..af18663d --- /dev/null +++ b/leetcode/3001-3100/3031.Minimum-Time-to-Revert-Word-to-Initial-State-II/README.md @@ -0,0 +1,32 @@ +# [3031.Minimum Time to Revert Word to Initial State II][title] + +> [!WARNING|style:flat] +> This question is temporarily unanswered if you have good ideas. Welcome to [Create Pull Request PR](https://github.com/kylesliu/awesome-golang-algorithm) + +## Description + +**Example 1:** + +``` +Input: a = "11", b = "1" +Output: "100" +``` + +## 题意 +> ... + +## 题解 + +### 思路1 +> ... +Minimum Time to Revert Word to Initial State II +```go +``` + + +## 结语 + +如果你同我一样热爱数据结构、算法、LeetCode,可以关注我 GitHub 上的 LeetCode 题解:[awesome-golang-algorithm][me] + +[title]: https://leetcode.com/problems/minimum-time-to-revert-word-to-initial-state-ii/ +[me]: https://github.com/kylesliu/awesome-golang-algorithm diff --git a/leetcode/3001-3100/3031.Minimum-Time-to-Revert-Word-to-Initial-State-II/Solution.go b/leetcode/3001-3100/3031.Minimum-Time-to-Revert-Word-to-Initial-State-II/Solution.go new file mode 100644 index 00000000..d115ccf5 --- /dev/null +++ b/leetcode/3001-3100/3031.Minimum-Time-to-Revert-Word-to-Initial-State-II/Solution.go @@ -0,0 +1,5 @@ +package Solution + +func Solution(x bool) bool { + return x +} diff --git a/leetcode/3001-3100/3031.Minimum-Time-to-Revert-Word-to-Initial-State-II/Solution_test.go b/leetcode/3001-3100/3031.Minimum-Time-to-Revert-Word-to-Initial-State-II/Solution_test.go new file mode 100644 index 00000000..14ff50eb --- /dev/null +++ b/leetcode/3001-3100/3031.Minimum-Time-to-Revert-Word-to-Initial-State-II/Solution_test.go @@ -0,0 +1,39 @@ +package Solution + +import ( + "reflect" + "strconv" + "testing" +) + +func TestSolution(t *testing.T) { + // 测试用例 + cases := []struct { + name string + inputs bool + expect bool + }{ + {"TestCase", true, true}, + {"TestCase", true, true}, + {"TestCase", false, false}, + } + + // 开始测试 + for i, c := range cases { + t.Run(c.name+" "+strconv.Itoa(i), func(t *testing.T) { + got := Solution(c.inputs) + if !reflect.DeepEqual(got, c.expect) { + t.Fatalf("expected: %v, but got: %v, with inputs: %v", + c.expect, got, c.inputs) + } + }) + } +} + +// 压力测试 +func BenchmarkSolution(b *testing.B) { +} + +// 使用案列 +func ExampleSolution() { +} diff --git a/leetcode/3001-3100/3033.Modify-the-Matrix/README.md b/leetcode/3001-3100/3033.Modify-the-Matrix/README.md new file mode 100755 index 00000000..0fc82187 --- /dev/null +++ b/leetcode/3001-3100/3033.Modify-the-Matrix/README.md @@ -0,0 +1,32 @@ +# [3033.Modify the Matrix][title] + +> [!WARNING|style:flat] +> This question is temporarily unanswered if you have good ideas. Welcome to [Create Pull Request PR](https://github.com/kylesliu/awesome-golang-algorithm) + +## Description + +**Example 1:** + +``` +Input: a = "11", b = "1" +Output: "100" +``` + +## 题意 +> ... + +## 题解 + +### 思路1 +> ... +Modify the Matrix +```go +``` + + +## 结语 + +如果你同我一样热爱数据结构、算法、LeetCode,可以关注我 GitHub 上的 LeetCode 题解:[awesome-golang-algorithm][me] + +[title]: https://leetcode.com/problems/modify-the-matrix/ +[me]: https://github.com/kylesliu/awesome-golang-algorithm diff --git a/leetcode/3001-3100/3033.Modify-the-Matrix/Solution.go b/leetcode/3001-3100/3033.Modify-the-Matrix/Solution.go new file mode 100644 index 00000000..d115ccf5 --- /dev/null +++ b/leetcode/3001-3100/3033.Modify-the-Matrix/Solution.go @@ -0,0 +1,5 @@ +package Solution + +func Solution(x bool) bool { + return x +} diff --git a/leetcode/3001-3100/3033.Modify-the-Matrix/Solution_test.go b/leetcode/3001-3100/3033.Modify-the-Matrix/Solution_test.go new file mode 100644 index 00000000..14ff50eb --- /dev/null +++ b/leetcode/3001-3100/3033.Modify-the-Matrix/Solution_test.go @@ -0,0 +1,39 @@ +package Solution + +import ( + "reflect" + "strconv" + "testing" +) + +func TestSolution(t *testing.T) { + // 测试用例 + cases := []struct { + name string + inputs bool + expect bool + }{ + {"TestCase", true, true}, + {"TestCase", true, true}, + {"TestCase", false, false}, + } + + // 开始测试 + for i, c := range cases { + t.Run(c.name+" "+strconv.Itoa(i), func(t *testing.T) { + got := Solution(c.inputs) + if !reflect.DeepEqual(got, c.expect) { + t.Fatalf("expected: %v, but got: %v, with inputs: %v", + c.expect, got, c.inputs) + } + }) + } +} + +// 压力测试 +func BenchmarkSolution(b *testing.B) { +} + +// 使用案列 +func ExampleSolution() { +} diff --git a/leetcode/3001-3100/3034.Number-of-Subarrays-That-Match-a-Pattern-I/README.md b/leetcode/3001-3100/3034.Number-of-Subarrays-That-Match-a-Pattern-I/README.md new file mode 100755 index 00000000..be2c4fb2 --- /dev/null +++ b/leetcode/3001-3100/3034.Number-of-Subarrays-That-Match-a-Pattern-I/README.md @@ -0,0 +1,32 @@ +# [3034.Number of Subarrays That Match a Pattern I][title] + +> [!WARNING|style:flat] +> This question is temporarily unanswered if you have good ideas. Welcome to [Create Pull Request PR](https://github.com/kylesliu/awesome-golang-algorithm) + +## Description + +**Example 1:** + +``` +Input: a = "11", b = "1" +Output: "100" +``` + +## 题意 +> ... + +## 题解 + +### 思路1 +> ... +Number of Subarrays That Match a Pattern I +```go +``` + + +## 结语 + +如果你同我一样热爱数据结构、算法、LeetCode,可以关注我 GitHub 上的 LeetCode 题解:[awesome-golang-algorithm][me] + +[title]: https://leetcode.com/problems/number-of-subarrays-that-match-a-pattern-i/ +[me]: https://github.com/kylesliu/awesome-golang-algorithm diff --git a/leetcode/3001-3100/3034.Number-of-Subarrays-That-Match-a-Pattern-I/Solution.go b/leetcode/3001-3100/3034.Number-of-Subarrays-That-Match-a-Pattern-I/Solution.go new file mode 100644 index 00000000..d115ccf5 --- /dev/null +++ b/leetcode/3001-3100/3034.Number-of-Subarrays-That-Match-a-Pattern-I/Solution.go @@ -0,0 +1,5 @@ +package Solution + +func Solution(x bool) bool { + return x +} diff --git a/leetcode/3001-3100/3034.Number-of-Subarrays-That-Match-a-Pattern-I/Solution_test.go b/leetcode/3001-3100/3034.Number-of-Subarrays-That-Match-a-Pattern-I/Solution_test.go new file mode 100644 index 00000000..14ff50eb --- /dev/null +++ b/leetcode/3001-3100/3034.Number-of-Subarrays-That-Match-a-Pattern-I/Solution_test.go @@ -0,0 +1,39 @@ +package Solution + +import ( + "reflect" + "strconv" + "testing" +) + +func TestSolution(t *testing.T) { + // 测试用例 + cases := []struct { + name string + inputs bool + expect bool + }{ + {"TestCase", true, true}, + {"TestCase", true, true}, + {"TestCase", false, false}, + } + + // 开始测试 + for i, c := range cases { + t.Run(c.name+" "+strconv.Itoa(i), func(t *testing.T) { + got := Solution(c.inputs) + if !reflect.DeepEqual(got, c.expect) { + t.Fatalf("expected: %v, but got: %v, with inputs: %v", + c.expect, got, c.inputs) + } + }) + } +} + +// 压力测试 +func BenchmarkSolution(b *testing.B) { +} + +// 使用案列 +func ExampleSolution() { +} diff --git a/leetcode/3001-3100/3035.Maximum-Palindromes-After-Operations/README.md b/leetcode/3001-3100/3035.Maximum-Palindromes-After-Operations/README.md new file mode 100755 index 00000000..d24769b1 --- /dev/null +++ b/leetcode/3001-3100/3035.Maximum-Palindromes-After-Operations/README.md @@ -0,0 +1,32 @@ +# [3035.Maximum Palindromes After Operations][title] + +> [!WARNING|style:flat] +> This question is temporarily unanswered if you have good ideas. Welcome to [Create Pull Request PR](https://github.com/kylesliu/awesome-golang-algorithm) + +## Description + +**Example 1:** + +``` +Input: a = "11", b = "1" +Output: "100" +``` + +## 题意 +> ... + +## 题解 + +### 思路1 +> ... +Maximum Palindromes After Operations +```go +``` + + +## 结语 + +如果你同我一样热爱数据结构、算法、LeetCode,可以关注我 GitHub 上的 LeetCode 题解:[awesome-golang-algorithm][me] + +[title]: https://leetcode.com/problems/maximum-palindromes-after-operations/ +[me]: https://github.com/kylesliu/awesome-golang-algorithm diff --git a/leetcode/3001-3100/3035.Maximum-Palindromes-After-Operations/Solution.go b/leetcode/3001-3100/3035.Maximum-Palindromes-After-Operations/Solution.go new file mode 100644 index 00000000..d115ccf5 --- /dev/null +++ b/leetcode/3001-3100/3035.Maximum-Palindromes-After-Operations/Solution.go @@ -0,0 +1,5 @@ +package Solution + +func Solution(x bool) bool { + return x +} diff --git a/leetcode/3001-3100/3035.Maximum-Palindromes-After-Operations/Solution_test.go b/leetcode/3001-3100/3035.Maximum-Palindromes-After-Operations/Solution_test.go new file mode 100644 index 00000000..14ff50eb --- /dev/null +++ b/leetcode/3001-3100/3035.Maximum-Palindromes-After-Operations/Solution_test.go @@ -0,0 +1,39 @@ +package Solution + +import ( + "reflect" + "strconv" + "testing" +) + +func TestSolution(t *testing.T) { + // 测试用例 + cases := []struct { + name string + inputs bool + expect bool + }{ + {"TestCase", true, true}, + {"TestCase", true, true}, + {"TestCase", false, false}, + } + + // 开始测试 + for i, c := range cases { + t.Run(c.name+" "+strconv.Itoa(i), func(t *testing.T) { + got := Solution(c.inputs) + if !reflect.DeepEqual(got, c.expect) { + t.Fatalf("expected: %v, but got: %v, with inputs: %v", + c.expect, got, c.inputs) + } + }) + } +} + +// 压力测试 +func BenchmarkSolution(b *testing.B) { +} + +// 使用案列 +func ExampleSolution() { +} diff --git a/leetcode/3001-3100/3036.Number-of-Subarrays-That-Match-a-Pattern-II/README.md b/leetcode/3001-3100/3036.Number-of-Subarrays-That-Match-a-Pattern-II/README.md new file mode 100755 index 00000000..f7c8e51f --- /dev/null +++ b/leetcode/3001-3100/3036.Number-of-Subarrays-That-Match-a-Pattern-II/README.md @@ -0,0 +1,32 @@ +# [3036.Number of Subarrays That Match a Pattern II][title] + +> [!WARNING|style:flat] +> This question is temporarily unanswered if you have good ideas. Welcome to [Create Pull Request PR](https://github.com/kylesliu/awesome-golang-algorithm) + +## Description + +**Example 1:** + +``` +Input: a = "11", b = "1" +Output: "100" +``` + +## 题意 +> ... + +## 题解 + +### 思路1 +> ... +Number of Subarrays That Match a Pattern II +```go +``` + + +## 结语 + +如果你同我一样热爱数据结构、算法、LeetCode,可以关注我 GitHub 上的 LeetCode 题解:[awesome-golang-algorithm][me] + +[title]: https://leetcode.com/problems/number-of-subarrays-that-match-a-pattern-ii/ +[me]: https://github.com/kylesliu/awesome-golang-algorithm diff --git a/leetcode/3001-3100/3036.Number-of-Subarrays-That-Match-a-Pattern-II/Solution.go b/leetcode/3001-3100/3036.Number-of-Subarrays-That-Match-a-Pattern-II/Solution.go new file mode 100644 index 00000000..d115ccf5 --- /dev/null +++ b/leetcode/3001-3100/3036.Number-of-Subarrays-That-Match-a-Pattern-II/Solution.go @@ -0,0 +1,5 @@ +package Solution + +func Solution(x bool) bool { + return x +} diff --git a/leetcode/3001-3100/3036.Number-of-Subarrays-That-Match-a-Pattern-II/Solution_test.go b/leetcode/3001-3100/3036.Number-of-Subarrays-That-Match-a-Pattern-II/Solution_test.go new file mode 100644 index 00000000..14ff50eb --- /dev/null +++ b/leetcode/3001-3100/3036.Number-of-Subarrays-That-Match-a-Pattern-II/Solution_test.go @@ -0,0 +1,39 @@ +package Solution + +import ( + "reflect" + "strconv" + "testing" +) + +func TestSolution(t *testing.T) { + // 测试用例 + cases := []struct { + name string + inputs bool + expect bool + }{ + {"TestCase", true, true}, + {"TestCase", true, true}, + {"TestCase", false, false}, + } + + // 开始测试 + for i, c := range cases { + t.Run(c.name+" "+strconv.Itoa(i), func(t *testing.T) { + got := Solution(c.inputs) + if !reflect.DeepEqual(got, c.expect) { + t.Fatalf("expected: %v, but got: %v, with inputs: %v", + c.expect, got, c.inputs) + } + }) + } +} + +// 压力测试 +func BenchmarkSolution(b *testing.B) { +} + +// 使用案列 +func ExampleSolution() { +} diff --git a/leetcode/3001-3100/3038.Maximum-Number-of-Operations-With-the-Same-Score-I/README.md b/leetcode/3001-3100/3038.Maximum-Number-of-Operations-With-the-Same-Score-I/README.md new file mode 100755 index 00000000..b32fdd13 --- /dev/null +++ b/leetcode/3001-3100/3038.Maximum-Number-of-Operations-With-the-Same-Score-I/README.md @@ -0,0 +1,32 @@ +# [3038.Maximum Number of Operations With the Same Score I][title] + +> [!WARNING|style:flat] +> This question is temporarily unanswered if you have good ideas. Welcome to [Create Pull Request PR](https://github.com/kylesliu/awesome-golang-algorithm) + +## Description + +**Example 1:** + +``` +Input: a = "11", b = "1" +Output: "100" +``` + +## 题意 +> ... + +## 题解 + +### 思路1 +> ... +Maximum Number of Operations With the Same Score I +```go +``` + + +## 结语 + +如果你同我一样热爱数据结构、算法、LeetCode,可以关注我 GitHub 上的 LeetCode 题解:[awesome-golang-algorithm][me] + +[title]: https://leetcode.com/problems/maximum-number-of-operations-with-the-same-score-i/ +[me]: https://github.com/kylesliu/awesome-golang-algorithm diff --git a/leetcode/3001-3100/3038.Maximum-Number-of-Operations-With-the-Same-Score-I/Solution.go b/leetcode/3001-3100/3038.Maximum-Number-of-Operations-With-the-Same-Score-I/Solution.go new file mode 100644 index 00000000..d115ccf5 --- /dev/null +++ b/leetcode/3001-3100/3038.Maximum-Number-of-Operations-With-the-Same-Score-I/Solution.go @@ -0,0 +1,5 @@ +package Solution + +func Solution(x bool) bool { + return x +} diff --git a/leetcode/3001-3100/3038.Maximum-Number-of-Operations-With-the-Same-Score-I/Solution_test.go b/leetcode/3001-3100/3038.Maximum-Number-of-Operations-With-the-Same-Score-I/Solution_test.go new file mode 100644 index 00000000..14ff50eb --- /dev/null +++ b/leetcode/3001-3100/3038.Maximum-Number-of-Operations-With-the-Same-Score-I/Solution_test.go @@ -0,0 +1,39 @@ +package Solution + +import ( + "reflect" + "strconv" + "testing" +) + +func TestSolution(t *testing.T) { + // 测试用例 + cases := []struct { + name string + inputs bool + expect bool + }{ + {"TestCase", true, true}, + {"TestCase", true, true}, + {"TestCase", false, false}, + } + + // 开始测试 + for i, c := range cases { + t.Run(c.name+" "+strconv.Itoa(i), func(t *testing.T) { + got := Solution(c.inputs) + if !reflect.DeepEqual(got, c.expect) { + t.Fatalf("expected: %v, but got: %v, with inputs: %v", + c.expect, got, c.inputs) + } + }) + } +} + +// 压力测试 +func BenchmarkSolution(b *testing.B) { +} + +// 使用案列 +func ExampleSolution() { +} diff --git a/leetcode/3001-3100/3039.Apply-Operations-to-Make-String-Empty/README.md b/leetcode/3001-3100/3039.Apply-Operations-to-Make-String-Empty/README.md new file mode 100755 index 00000000..96bb467a --- /dev/null +++ b/leetcode/3001-3100/3039.Apply-Operations-to-Make-String-Empty/README.md @@ -0,0 +1,32 @@ +# [3039.Apply Operations to Make String Empty][title] + +> [!WARNING|style:flat] +> This question is temporarily unanswered if you have good ideas. Welcome to [Create Pull Request PR](https://github.com/kylesliu/awesome-golang-algorithm) + +## Description + +**Example 1:** + +``` +Input: a = "11", b = "1" +Output: "100" +``` + +## 题意 +> ... + +## 题解 + +### 思路1 +> ... +Apply Operations to Make String Empty +```go +``` + + +## 结语 + +如果你同我一样热爱数据结构、算法、LeetCode,可以关注我 GitHub 上的 LeetCode 题解:[awesome-golang-algorithm][me] + +[title]: https://leetcode.com/problems/apply-operations-to-make-string-empty/ +[me]: https://github.com/kylesliu/awesome-golang-algorithm diff --git a/leetcode/3001-3100/3039.Apply-Operations-to-Make-String-Empty/Solution.go b/leetcode/3001-3100/3039.Apply-Operations-to-Make-String-Empty/Solution.go new file mode 100644 index 00000000..d115ccf5 --- /dev/null +++ b/leetcode/3001-3100/3039.Apply-Operations-to-Make-String-Empty/Solution.go @@ -0,0 +1,5 @@ +package Solution + +func Solution(x bool) bool { + return x +} diff --git a/leetcode/3001-3100/3039.Apply-Operations-to-Make-String-Empty/Solution_test.go b/leetcode/3001-3100/3039.Apply-Operations-to-Make-String-Empty/Solution_test.go new file mode 100644 index 00000000..14ff50eb --- /dev/null +++ b/leetcode/3001-3100/3039.Apply-Operations-to-Make-String-Empty/Solution_test.go @@ -0,0 +1,39 @@ +package Solution + +import ( + "reflect" + "strconv" + "testing" +) + +func TestSolution(t *testing.T) { + // 测试用例 + cases := []struct { + name string + inputs bool + expect bool + }{ + {"TestCase", true, true}, + {"TestCase", true, true}, + {"TestCase", false, false}, + } + + // 开始测试 + for i, c := range cases { + t.Run(c.name+" "+strconv.Itoa(i), func(t *testing.T) { + got := Solution(c.inputs) + if !reflect.DeepEqual(got, c.expect) { + t.Fatalf("expected: %v, but got: %v, with inputs: %v", + c.expect, got, c.inputs) + } + }) + } +} + +// 压力测试 +func BenchmarkSolution(b *testing.B) { +} + +// 使用案列 +func ExampleSolution() { +} diff --git a/leetcode/3001-3100/3040.Maximum-Number-of-Operations-With-the-Same-Score-II/README.md b/leetcode/3001-3100/3040.Maximum-Number-of-Operations-With-the-Same-Score-II/README.md new file mode 100755 index 00000000..bfaf9a2d --- /dev/null +++ b/leetcode/3001-3100/3040.Maximum-Number-of-Operations-With-the-Same-Score-II/README.md @@ -0,0 +1,32 @@ +# [3040.Maximum Number of Operations With the Same Score II][title] + +> [!WARNING|style:flat] +> This question is temporarily unanswered if you have good ideas. Welcome to [Create Pull Request PR](https://github.com/kylesliu/awesome-golang-algorithm) + +## Description + +**Example 1:** + +``` +Input: a = "11", b = "1" +Output: "100" +``` + +## 题意 +> ... + +## 题解 + +### 思路1 +> ... +Maximum Number of Operations With the Same Score II +```go +``` + + +## 结语 + +如果你同我一样热爱数据结构、算法、LeetCode,可以关注我 GitHub 上的 LeetCode 题解:[awesome-golang-algorithm][me] + +[title]: https://leetcode.com/problems/maximum-number-of-operations-with-the-same-score-ii/ +[me]: https://github.com/kylesliu/awesome-golang-algorithm diff --git a/leetcode/3001-3100/3040.Maximum-Number-of-Operations-With-the-Same-Score-II/Solution.go b/leetcode/3001-3100/3040.Maximum-Number-of-Operations-With-the-Same-Score-II/Solution.go new file mode 100644 index 00000000..d115ccf5 --- /dev/null +++ b/leetcode/3001-3100/3040.Maximum-Number-of-Operations-With-the-Same-Score-II/Solution.go @@ -0,0 +1,5 @@ +package Solution + +func Solution(x bool) bool { + return x +} diff --git a/leetcode/3001-3100/3040.Maximum-Number-of-Operations-With-the-Same-Score-II/Solution_test.go b/leetcode/3001-3100/3040.Maximum-Number-of-Operations-With-the-Same-Score-II/Solution_test.go new file mode 100644 index 00000000..14ff50eb --- /dev/null +++ b/leetcode/3001-3100/3040.Maximum-Number-of-Operations-With-the-Same-Score-II/Solution_test.go @@ -0,0 +1,39 @@ +package Solution + +import ( + "reflect" + "strconv" + "testing" +) + +func TestSolution(t *testing.T) { + // 测试用例 + cases := []struct { + name string + inputs bool + expect bool + }{ + {"TestCase", true, true}, + {"TestCase", true, true}, + {"TestCase", false, false}, + } + + // 开始测试 + for i, c := range cases { + t.Run(c.name+" "+strconv.Itoa(i), func(t *testing.T) { + got := Solution(c.inputs) + if !reflect.DeepEqual(got, c.expect) { + t.Fatalf("expected: %v, but got: %v, with inputs: %v", + c.expect, got, c.inputs) + } + }) + } +} + +// 压力测试 +func BenchmarkSolution(b *testing.B) { +} + +// 使用案列 +func ExampleSolution() { +} diff --git a/leetcode/3001-3100/3041.Maximize-Consecutive-Elements-in-an-Array-After-Modification/README.md b/leetcode/3001-3100/3041.Maximize-Consecutive-Elements-in-an-Array-After-Modification/README.md new file mode 100755 index 00000000..0b105d98 --- /dev/null +++ b/leetcode/3001-3100/3041.Maximize-Consecutive-Elements-in-an-Array-After-Modification/README.md @@ -0,0 +1,32 @@ +# [3041.Maximize Consecutive Elements in an Array After Modification][title] + +> [!WARNING|style:flat] +> This question is temporarily unanswered if you have good ideas. Welcome to [Create Pull Request PR](https://github.com/kylesliu/awesome-golang-algorithm) + +## Description + +**Example 1:** + +``` +Input: a = "11", b = "1" +Output: "100" +``` + +## 题意 +> ... + +## 题解 + +### 思路1 +> ... +Maximize Consecutive Elements in an Array After Modification +```go +``` + + +## 结语 + +如果你同我一样热爱数据结构、算法、LeetCode,可以关注我 GitHub 上的 LeetCode 题解:[awesome-golang-algorithm][me] + +[title]: https://leetcode.com/problems/maximize-consecutive-elements-in-an-array-after-modification/ +[me]: https://github.com/kylesliu/awesome-golang-algorithm diff --git a/leetcode/3001-3100/3041.Maximize-Consecutive-Elements-in-an-Array-After-Modification/Solution.go b/leetcode/3001-3100/3041.Maximize-Consecutive-Elements-in-an-Array-After-Modification/Solution.go new file mode 100644 index 00000000..d115ccf5 --- /dev/null +++ b/leetcode/3001-3100/3041.Maximize-Consecutive-Elements-in-an-Array-After-Modification/Solution.go @@ -0,0 +1,5 @@ +package Solution + +func Solution(x bool) bool { + return x +} diff --git a/leetcode/3001-3100/3041.Maximize-Consecutive-Elements-in-an-Array-After-Modification/Solution_test.go b/leetcode/3001-3100/3041.Maximize-Consecutive-Elements-in-an-Array-After-Modification/Solution_test.go new file mode 100644 index 00000000..14ff50eb --- /dev/null +++ b/leetcode/3001-3100/3041.Maximize-Consecutive-Elements-in-an-Array-After-Modification/Solution_test.go @@ -0,0 +1,39 @@ +package Solution + +import ( + "reflect" + "strconv" + "testing" +) + +func TestSolution(t *testing.T) { + // 测试用例 + cases := []struct { + name string + inputs bool + expect bool + }{ + {"TestCase", true, true}, + {"TestCase", true, true}, + {"TestCase", false, false}, + } + + // 开始测试 + for i, c := range cases { + t.Run(c.name+" "+strconv.Itoa(i), func(t *testing.T) { + got := Solution(c.inputs) + if !reflect.DeepEqual(got, c.expect) { + t.Fatalf("expected: %v, but got: %v, with inputs: %v", + c.expect, got, c.inputs) + } + }) + } +} + +// 压力测试 +func BenchmarkSolution(b *testing.B) { +} + +// 使用案列 +func ExampleSolution() { +} diff --git a/leetcode/3001-3100/3042.Count-Prefix-and-Suffix-Pairs-I/README.md b/leetcode/3001-3100/3042.Count-Prefix-and-Suffix-Pairs-I/README.md new file mode 100755 index 00000000..6fdb7b9f --- /dev/null +++ b/leetcode/3001-3100/3042.Count-Prefix-and-Suffix-Pairs-I/README.md @@ -0,0 +1,32 @@ +# [3042.Count Prefix and Suffix Pairs I][title] + +> [!WARNING|style:flat] +> This question is temporarily unanswered if you have good ideas. Welcome to [Create Pull Request PR](https://github.com/kylesliu/awesome-golang-algorithm) + +## Description + +**Example 1:** + +``` +Input: a = "11", b = "1" +Output: "100" +``` + +## 题意 +> ... + +## 题解 + +### 思路1 +> ... +Count Prefix and Suffix Pairs I +```go +``` + + +## 结语 + +如果你同我一样热爱数据结构、算法、LeetCode,可以关注我 GitHub 上的 LeetCode 题解:[awesome-golang-algorithm][me] + +[title]: https://leetcode.com/problems/count-prefix-and-suffix-pairs-i/ +[me]: https://github.com/kylesliu/awesome-golang-algorithm diff --git a/leetcode/3001-3100/3042.Count-Prefix-and-Suffix-Pairs-I/Solution.go b/leetcode/3001-3100/3042.Count-Prefix-and-Suffix-Pairs-I/Solution.go new file mode 100644 index 00000000..d115ccf5 --- /dev/null +++ b/leetcode/3001-3100/3042.Count-Prefix-and-Suffix-Pairs-I/Solution.go @@ -0,0 +1,5 @@ +package Solution + +func Solution(x bool) bool { + return x +} diff --git a/leetcode/3001-3100/3042.Count-Prefix-and-Suffix-Pairs-I/Solution_test.go b/leetcode/3001-3100/3042.Count-Prefix-and-Suffix-Pairs-I/Solution_test.go new file mode 100644 index 00000000..14ff50eb --- /dev/null +++ b/leetcode/3001-3100/3042.Count-Prefix-and-Suffix-Pairs-I/Solution_test.go @@ -0,0 +1,39 @@ +package Solution + +import ( + "reflect" + "strconv" + "testing" +) + +func TestSolution(t *testing.T) { + // 测试用例 + cases := []struct { + name string + inputs bool + expect bool + }{ + {"TestCase", true, true}, + {"TestCase", true, true}, + {"TestCase", false, false}, + } + + // 开始测试 + for i, c := range cases { + t.Run(c.name+" "+strconv.Itoa(i), func(t *testing.T) { + got := Solution(c.inputs) + if !reflect.DeepEqual(got, c.expect) { + t.Fatalf("expected: %v, but got: %v, with inputs: %v", + c.expect, got, c.inputs) + } + }) + } +} + +// 压力测试 +func BenchmarkSolution(b *testing.B) { +} + +// 使用案列 +func ExampleSolution() { +} diff --git a/leetcode/3001-3100/3043.Find-the-Length-of-the-Longest-Common-Prefix/README.md b/leetcode/3001-3100/3043.Find-the-Length-of-the-Longest-Common-Prefix/README.md new file mode 100755 index 00000000..a0c08717 --- /dev/null +++ b/leetcode/3001-3100/3043.Find-the-Length-of-the-Longest-Common-Prefix/README.md @@ -0,0 +1,32 @@ +# [3043.Find the Length of the Longest Common Prefix][title] + +> [!WARNING|style:flat] +> This question is temporarily unanswered if you have good ideas. Welcome to [Create Pull Request PR](https://github.com/kylesliu/awesome-golang-algorithm) + +## Description + +**Example 1:** + +``` +Input: a = "11", b = "1" +Output: "100" +``` + +## 题意 +> ... + +## 题解 + +### 思路1 +> ... +Find the Length of the Longest Common Prefix +```go +``` + + +## 结语 + +如果你同我一样热爱数据结构、算法、LeetCode,可以关注我 GitHub 上的 LeetCode 题解:[awesome-golang-algorithm][me] + +[title]: https://leetcode.com/problems/find-the-length-of-the-longest-common-prefix/ +[me]: https://github.com/kylesliu/awesome-golang-algorithm diff --git a/leetcode/3001-3100/3043.Find-the-Length-of-the-Longest-Common-Prefix/Solution.go b/leetcode/3001-3100/3043.Find-the-Length-of-the-Longest-Common-Prefix/Solution.go new file mode 100644 index 00000000..d115ccf5 --- /dev/null +++ b/leetcode/3001-3100/3043.Find-the-Length-of-the-Longest-Common-Prefix/Solution.go @@ -0,0 +1,5 @@ +package Solution + +func Solution(x bool) bool { + return x +} diff --git a/leetcode/3001-3100/3043.Find-the-Length-of-the-Longest-Common-Prefix/Solution_test.go b/leetcode/3001-3100/3043.Find-the-Length-of-the-Longest-Common-Prefix/Solution_test.go new file mode 100644 index 00000000..14ff50eb --- /dev/null +++ b/leetcode/3001-3100/3043.Find-the-Length-of-the-Longest-Common-Prefix/Solution_test.go @@ -0,0 +1,39 @@ +package Solution + +import ( + "reflect" + "strconv" + "testing" +) + +func TestSolution(t *testing.T) { + // 测试用例 + cases := []struct { + name string + inputs bool + expect bool + }{ + {"TestCase", true, true}, + {"TestCase", true, true}, + {"TestCase", false, false}, + } + + // 开始测试 + for i, c := range cases { + t.Run(c.name+" "+strconv.Itoa(i), func(t *testing.T) { + got := Solution(c.inputs) + if !reflect.DeepEqual(got, c.expect) { + t.Fatalf("expected: %v, but got: %v, with inputs: %v", + c.expect, got, c.inputs) + } + }) + } +} + +// 压力测试 +func BenchmarkSolution(b *testing.B) { +} + +// 使用案列 +func ExampleSolution() { +} diff --git a/leetcode/3001-3100/3044.Most-Frequent-Prime/README.md b/leetcode/3001-3100/3044.Most-Frequent-Prime/README.md new file mode 100755 index 00000000..74bc451c --- /dev/null +++ b/leetcode/3001-3100/3044.Most-Frequent-Prime/README.md @@ -0,0 +1,32 @@ +# [3044.Most Frequent Prime][title] + +> [!WARNING|style:flat] +> This question is temporarily unanswered if you have good ideas. Welcome to [Create Pull Request PR](https://github.com/kylesliu/awesome-golang-algorithm) + +## Description + +**Example 1:** + +``` +Input: a = "11", b = "1" +Output: "100" +``` + +## 题意 +> ... + +## 题解 + +### 思路1 +> ... +Most Frequent Prime +```go +``` + + +## 结语 + +如果你同我一样热爱数据结构、算法、LeetCode,可以关注我 GitHub 上的 LeetCode 题解:[awesome-golang-algorithm][me] + +[title]: https://leetcode.com/problems/most-frequent-prime/ +[me]: https://github.com/kylesliu/awesome-golang-algorithm diff --git a/leetcode/3001-3100/3044.Most-Frequent-Prime/Solution.go b/leetcode/3001-3100/3044.Most-Frequent-Prime/Solution.go new file mode 100644 index 00000000..d115ccf5 --- /dev/null +++ b/leetcode/3001-3100/3044.Most-Frequent-Prime/Solution.go @@ -0,0 +1,5 @@ +package Solution + +func Solution(x bool) bool { + return x +} diff --git a/leetcode/3001-3100/3044.Most-Frequent-Prime/Solution_test.go b/leetcode/3001-3100/3044.Most-Frequent-Prime/Solution_test.go new file mode 100644 index 00000000..14ff50eb --- /dev/null +++ b/leetcode/3001-3100/3044.Most-Frequent-Prime/Solution_test.go @@ -0,0 +1,39 @@ +package Solution + +import ( + "reflect" + "strconv" + "testing" +) + +func TestSolution(t *testing.T) { + // 测试用例 + cases := []struct { + name string + inputs bool + expect bool + }{ + {"TestCase", true, true}, + {"TestCase", true, true}, + {"TestCase", false, false}, + } + + // 开始测试 + for i, c := range cases { + t.Run(c.name+" "+strconv.Itoa(i), func(t *testing.T) { + got := Solution(c.inputs) + if !reflect.DeepEqual(got, c.expect) { + t.Fatalf("expected: %v, but got: %v, with inputs: %v", + c.expect, got, c.inputs) + } + }) + } +} + +// 压力测试 +func BenchmarkSolution(b *testing.B) { +} + +// 使用案列 +func ExampleSolution() { +} diff --git a/leetcode/3001-3100/3045.Count-Prefix-and-Suffix-Pairs-II/README.md b/leetcode/3001-3100/3045.Count-Prefix-and-Suffix-Pairs-II/README.md new file mode 100755 index 00000000..5a1bd8be --- /dev/null +++ b/leetcode/3001-3100/3045.Count-Prefix-and-Suffix-Pairs-II/README.md @@ -0,0 +1,32 @@ +# [3045.Count Prefix and Suffix Pairs II][title] + +> [!WARNING|style:flat] +> This question is temporarily unanswered if you have good ideas. Welcome to [Create Pull Request PR](https://github.com/kylesliu/awesome-golang-algorithm) + +## Description + +**Example 1:** + +``` +Input: a = "11", b = "1" +Output: "100" +``` + +## 题意 +> ... + +## 题解 + +### 思路1 +> ... +Count Prefix and Suffix Pairs II +```go +``` + + +## 结语 + +如果你同我一样热爱数据结构、算法、LeetCode,可以关注我 GitHub 上的 LeetCode 题解:[awesome-golang-algorithm][me] + +[title]: https://leetcode.com/problems/count-prefix-and-suffix-pairs-ii/ +[me]: https://github.com/kylesliu/awesome-golang-algorithm diff --git a/leetcode/3001-3100/3045.Count-Prefix-and-Suffix-Pairs-II/Solution.go b/leetcode/3001-3100/3045.Count-Prefix-and-Suffix-Pairs-II/Solution.go new file mode 100644 index 00000000..d115ccf5 --- /dev/null +++ b/leetcode/3001-3100/3045.Count-Prefix-and-Suffix-Pairs-II/Solution.go @@ -0,0 +1,5 @@ +package Solution + +func Solution(x bool) bool { + return x +} diff --git a/leetcode/3001-3100/3045.Count-Prefix-and-Suffix-Pairs-II/Solution_test.go b/leetcode/3001-3100/3045.Count-Prefix-and-Suffix-Pairs-II/Solution_test.go new file mode 100644 index 00000000..14ff50eb --- /dev/null +++ b/leetcode/3001-3100/3045.Count-Prefix-and-Suffix-Pairs-II/Solution_test.go @@ -0,0 +1,39 @@ +package Solution + +import ( + "reflect" + "strconv" + "testing" +) + +func TestSolution(t *testing.T) { + // 测试用例 + cases := []struct { + name string + inputs bool + expect bool + }{ + {"TestCase", true, true}, + {"TestCase", true, true}, + {"TestCase", false, false}, + } + + // 开始测试 + for i, c := range cases { + t.Run(c.name+" "+strconv.Itoa(i), func(t *testing.T) { + got := Solution(c.inputs) + if !reflect.DeepEqual(got, c.expect) { + t.Fatalf("expected: %v, but got: %v, with inputs: %v", + c.expect, got, c.inputs) + } + }) + } +} + +// 压力测试 +func BenchmarkSolution(b *testing.B) { +} + +// 使用案列 +func ExampleSolution() { +} diff --git a/leetcode/3001-3100/3046.Split-the-Array/README.md b/leetcode/3001-3100/3046.Split-the-Array/README.md new file mode 100755 index 00000000..164c4def --- /dev/null +++ b/leetcode/3001-3100/3046.Split-the-Array/README.md @@ -0,0 +1,32 @@ +# [3046.Split the Array][title] + +> [!WARNING|style:flat] +> This question is temporarily unanswered if you have good ideas. Welcome to [Create Pull Request PR](https://github.com/kylesliu/awesome-golang-algorithm) + +## Description + +**Example 1:** + +``` +Input: a = "11", b = "1" +Output: "100" +``` + +## 题意 +> ... + +## 题解 + +### 思路1 +> ... +Split the Array +```go +``` + + +## 结语 + +如果你同我一样热爱数据结构、算法、LeetCode,可以关注我 GitHub 上的 LeetCode 题解:[awesome-golang-algorithm][me] + +[title]: https://leetcode.com/problems/split-the-array/ +[me]: https://github.com/kylesliu/awesome-golang-algorithm diff --git a/leetcode/3001-3100/3046.Split-the-Array/Solution.go b/leetcode/3001-3100/3046.Split-the-Array/Solution.go new file mode 100644 index 00000000..d115ccf5 --- /dev/null +++ b/leetcode/3001-3100/3046.Split-the-Array/Solution.go @@ -0,0 +1,5 @@ +package Solution + +func Solution(x bool) bool { + return x +} diff --git a/leetcode/3001-3100/3046.Split-the-Array/Solution_test.go b/leetcode/3001-3100/3046.Split-the-Array/Solution_test.go new file mode 100644 index 00000000..14ff50eb --- /dev/null +++ b/leetcode/3001-3100/3046.Split-the-Array/Solution_test.go @@ -0,0 +1,39 @@ +package Solution + +import ( + "reflect" + "strconv" + "testing" +) + +func TestSolution(t *testing.T) { + // 测试用例 + cases := []struct { + name string + inputs bool + expect bool + }{ + {"TestCase", true, true}, + {"TestCase", true, true}, + {"TestCase", false, false}, + } + + // 开始测试 + for i, c := range cases { + t.Run(c.name+" "+strconv.Itoa(i), func(t *testing.T) { + got := Solution(c.inputs) + if !reflect.DeepEqual(got, c.expect) { + t.Fatalf("expected: %v, but got: %v, with inputs: %v", + c.expect, got, c.inputs) + } + }) + } +} + +// 压力测试 +func BenchmarkSolution(b *testing.B) { +} + +// 使用案列 +func ExampleSolution() { +} diff --git a/leetcode/3001-3100/3047.Find-the-Largest-Area-of-Square-Inside-Two-Rectangles/README.md b/leetcode/3001-3100/3047.Find-the-Largest-Area-of-Square-Inside-Two-Rectangles/README.md new file mode 100755 index 00000000..bd3dc6f8 --- /dev/null +++ b/leetcode/3001-3100/3047.Find-the-Largest-Area-of-Square-Inside-Two-Rectangles/README.md @@ -0,0 +1,32 @@ +# [3047.Find the Largest Area of Square Inside Two Rectangles][title] + +> [!WARNING|style:flat] +> This question is temporarily unanswered if you have good ideas. Welcome to [Create Pull Request PR](https://github.com/kylesliu/awesome-golang-algorithm) + +## Description + +**Example 1:** + +``` +Input: a = "11", b = "1" +Output: "100" +``` + +## 题意 +> ... + +## 题解 + +### 思路1 +> ... +Find the Largest Area of Square Inside Two Rectangles +```go +``` + + +## 结语 + +如果你同我一样热爱数据结构、算法、LeetCode,可以关注我 GitHub 上的 LeetCode 题解:[awesome-golang-algorithm][me] + +[title]: https://leetcode.com/problems/find-the-largest-area-of-square-inside-two-rectangles/ +[me]: https://github.com/kylesliu/awesome-golang-algorithm diff --git a/leetcode/3001-3100/3047.Find-the-Largest-Area-of-Square-Inside-Two-Rectangles/Solution.go b/leetcode/3001-3100/3047.Find-the-Largest-Area-of-Square-Inside-Two-Rectangles/Solution.go new file mode 100644 index 00000000..d115ccf5 --- /dev/null +++ b/leetcode/3001-3100/3047.Find-the-Largest-Area-of-Square-Inside-Two-Rectangles/Solution.go @@ -0,0 +1,5 @@ +package Solution + +func Solution(x bool) bool { + return x +} diff --git a/leetcode/3001-3100/3047.Find-the-Largest-Area-of-Square-Inside-Two-Rectangles/Solution_test.go b/leetcode/3001-3100/3047.Find-the-Largest-Area-of-Square-Inside-Two-Rectangles/Solution_test.go new file mode 100644 index 00000000..14ff50eb --- /dev/null +++ b/leetcode/3001-3100/3047.Find-the-Largest-Area-of-Square-Inside-Two-Rectangles/Solution_test.go @@ -0,0 +1,39 @@ +package Solution + +import ( + "reflect" + "strconv" + "testing" +) + +func TestSolution(t *testing.T) { + // 测试用例 + cases := []struct { + name string + inputs bool + expect bool + }{ + {"TestCase", true, true}, + {"TestCase", true, true}, + {"TestCase", false, false}, + } + + // 开始测试 + for i, c := range cases { + t.Run(c.name+" "+strconv.Itoa(i), func(t *testing.T) { + got := Solution(c.inputs) + if !reflect.DeepEqual(got, c.expect) { + t.Fatalf("expected: %v, but got: %v, with inputs: %v", + c.expect, got, c.inputs) + } + }) + } +} + +// 压力测试 +func BenchmarkSolution(b *testing.B) { +} + +// 使用案列 +func ExampleSolution() { +} diff --git a/leetcode/3001-3100/3048.Earliest-Second-to-Mark-Indices-I/README.md b/leetcode/3001-3100/3048.Earliest-Second-to-Mark-Indices-I/README.md new file mode 100755 index 00000000..bb44cb05 --- /dev/null +++ b/leetcode/3001-3100/3048.Earliest-Second-to-Mark-Indices-I/README.md @@ -0,0 +1,32 @@ +# [3048.Earliest Second to Mark Indices I][title] + +> [!WARNING|style:flat] +> This question is temporarily unanswered if you have good ideas. Welcome to [Create Pull Request PR](https://github.com/kylesliu/awesome-golang-algorithm) + +## Description + +**Example 1:** + +``` +Input: a = "11", b = "1" +Output: "100" +``` + +## 题意 +> ... + +## 题解 + +### 思路1 +> ... +Earliest Second to Mark Indices I +```go +``` + + +## 结语 + +如果你同我一样热爱数据结构、算法、LeetCode,可以关注我 GitHub 上的 LeetCode 题解:[awesome-golang-algorithm][me] + +[title]: https://leetcode.com/problems/earliest-second-to-mark-indices-i/ +[me]: https://github.com/kylesliu/awesome-golang-algorithm diff --git a/leetcode/3001-3100/3048.Earliest-Second-to-Mark-Indices-I/Solution.go b/leetcode/3001-3100/3048.Earliest-Second-to-Mark-Indices-I/Solution.go new file mode 100644 index 00000000..d115ccf5 --- /dev/null +++ b/leetcode/3001-3100/3048.Earliest-Second-to-Mark-Indices-I/Solution.go @@ -0,0 +1,5 @@ +package Solution + +func Solution(x bool) bool { + return x +} diff --git a/leetcode/3001-3100/3048.Earliest-Second-to-Mark-Indices-I/Solution_test.go b/leetcode/3001-3100/3048.Earliest-Second-to-Mark-Indices-I/Solution_test.go new file mode 100644 index 00000000..14ff50eb --- /dev/null +++ b/leetcode/3001-3100/3048.Earliest-Second-to-Mark-Indices-I/Solution_test.go @@ -0,0 +1,39 @@ +package Solution + +import ( + "reflect" + "strconv" + "testing" +) + +func TestSolution(t *testing.T) { + // 测试用例 + cases := []struct { + name string + inputs bool + expect bool + }{ + {"TestCase", true, true}, + {"TestCase", true, true}, + {"TestCase", false, false}, + } + + // 开始测试 + for i, c := range cases { + t.Run(c.name+" "+strconv.Itoa(i), func(t *testing.T) { + got := Solution(c.inputs) + if !reflect.DeepEqual(got, c.expect) { + t.Fatalf("expected: %v, but got: %v, with inputs: %v", + c.expect, got, c.inputs) + } + }) + } +} + +// 压力测试 +func BenchmarkSolution(b *testing.B) { +} + +// 使用案列 +func ExampleSolution() { +} diff --git a/leetcode/3001-3100/3049.Earliest-Second-to-Mark-Indices-II/README.md b/leetcode/3001-3100/3049.Earliest-Second-to-Mark-Indices-II/README.md new file mode 100755 index 00000000..c8581967 --- /dev/null +++ b/leetcode/3001-3100/3049.Earliest-Second-to-Mark-Indices-II/README.md @@ -0,0 +1,32 @@ +# [3049.Earliest Second to Mark Indices II][title] + +> [!WARNING|style:flat] +> This question is temporarily unanswered if you have good ideas. Welcome to [Create Pull Request PR](https://github.com/kylesliu/awesome-golang-algorithm) + +## Description + +**Example 1:** + +``` +Input: a = "11", b = "1" +Output: "100" +``` + +## 题意 +> ... + +## 题解 + +### 思路1 +> ... +Earliest Second to Mark Indices II +```go +``` + + +## 结语 + +如果你同我一样热爱数据结构、算法、LeetCode,可以关注我 GitHub 上的 LeetCode 题解:[awesome-golang-algorithm][me] + +[title]: https://leetcode.com/problems/earliest-second-to-mark-indices-ii/ +[me]: https://github.com/kylesliu/awesome-golang-algorithm diff --git a/leetcode/3001-3100/3049.Earliest-Second-to-Mark-Indices-II/Solution.go b/leetcode/3001-3100/3049.Earliest-Second-to-Mark-Indices-II/Solution.go new file mode 100644 index 00000000..d115ccf5 --- /dev/null +++ b/leetcode/3001-3100/3049.Earliest-Second-to-Mark-Indices-II/Solution.go @@ -0,0 +1,5 @@ +package Solution + +func Solution(x bool) bool { + return x +} diff --git a/leetcode/3001-3100/3049.Earliest-Second-to-Mark-Indices-II/Solution_test.go b/leetcode/3001-3100/3049.Earliest-Second-to-Mark-Indices-II/Solution_test.go new file mode 100644 index 00000000..14ff50eb --- /dev/null +++ b/leetcode/3001-3100/3049.Earliest-Second-to-Mark-Indices-II/Solution_test.go @@ -0,0 +1,39 @@ +package Solution + +import ( + "reflect" + "strconv" + "testing" +) + +func TestSolution(t *testing.T) { + // 测试用例 + cases := []struct { + name string + inputs bool + expect bool + }{ + {"TestCase", true, true}, + {"TestCase", true, true}, + {"TestCase", false, false}, + } + + // 开始测试 + for i, c := range cases { + t.Run(c.name+" "+strconv.Itoa(i), func(t *testing.T) { + got := Solution(c.inputs) + if !reflect.DeepEqual(got, c.expect) { + t.Fatalf("expected: %v, but got: %v, with inputs: %v", + c.expect, got, c.inputs) + } + }) + } +} + +// 压力测试 +func BenchmarkSolution(b *testing.B) { +} + +// 使用案列 +func ExampleSolution() { +} diff --git a/leetcode/3001-3100/3065.Minimum-Operations-to-Exceed-Threshold-Value-I/README.md b/leetcode/3001-3100/3065.Minimum-Operations-to-Exceed-Threshold-Value-I/README.md new file mode 100755 index 00000000..0c7c447e --- /dev/null +++ b/leetcode/3001-3100/3065.Minimum-Operations-to-Exceed-Threshold-Value-I/README.md @@ -0,0 +1,32 @@ +# [3065.Minimum Operations to Exceed Threshold Value I][title] + +> [!WARNING|style:flat] +> This question is temporarily unanswered if you have good ideas. Welcome to [Create Pull Request PR](https://github.com/kylesliu/awesome-golang-algorithm) + +## Description + +**Example 1:** + +``` +Input: a = "11", b = "1" +Output: "100" +``` + +## 题意 +> ... + +## 题解 + +### 思路1 +> ... +Minimum Operations to Exceed Threshold Value I +```go +``` + + +## 结语 + +如果你同我一样热爱数据结构、算法、LeetCode,可以关注我 GitHub 上的 LeetCode 题解:[awesome-golang-algorithm][me] + +[title]: https://leetcode.com/problems/minimum-operations-to-exceed-threshold-value-i/ +[me]: https://github.com/kylesliu/awesome-golang-algorithm diff --git a/leetcode/3001-3100/3065.Minimum-Operations-to-Exceed-Threshold-Value-I/Solution.go b/leetcode/3001-3100/3065.Minimum-Operations-to-Exceed-Threshold-Value-I/Solution.go new file mode 100644 index 00000000..d115ccf5 --- /dev/null +++ b/leetcode/3001-3100/3065.Minimum-Operations-to-Exceed-Threshold-Value-I/Solution.go @@ -0,0 +1,5 @@ +package Solution + +func Solution(x bool) bool { + return x +} diff --git a/leetcode/3001-3100/3065.Minimum-Operations-to-Exceed-Threshold-Value-I/Solution_test.go b/leetcode/3001-3100/3065.Minimum-Operations-to-Exceed-Threshold-Value-I/Solution_test.go new file mode 100644 index 00000000..14ff50eb --- /dev/null +++ b/leetcode/3001-3100/3065.Minimum-Operations-to-Exceed-Threshold-Value-I/Solution_test.go @@ -0,0 +1,39 @@ +package Solution + +import ( + "reflect" + "strconv" + "testing" +) + +func TestSolution(t *testing.T) { + // 测试用例 + cases := []struct { + name string + inputs bool + expect bool + }{ + {"TestCase", true, true}, + {"TestCase", true, true}, + {"TestCase", false, false}, + } + + // 开始测试 + for i, c := range cases { + t.Run(c.name+" "+strconv.Itoa(i), func(t *testing.T) { + got := Solution(c.inputs) + if !reflect.DeepEqual(got, c.expect) { + t.Fatalf("expected: %v, but got: %v, with inputs: %v", + c.expect, got, c.inputs) + } + }) + } +} + +// 压力测试 +func BenchmarkSolution(b *testing.B) { +} + +// 使用案列 +func ExampleSolution() { +} diff --git a/leetcode/3001-3100/3066.Minimum-Operations-to-Exceed-Threshold-Value-II/README.md b/leetcode/3001-3100/3066.Minimum-Operations-to-Exceed-Threshold-Value-II/README.md new file mode 100755 index 00000000..91c74019 --- /dev/null +++ b/leetcode/3001-3100/3066.Minimum-Operations-to-Exceed-Threshold-Value-II/README.md @@ -0,0 +1,32 @@ +# [3066.Minimum Operations to Exceed Threshold Value II][title] + +> [!WARNING|style:flat] +> This question is temporarily unanswered if you have good ideas. Welcome to [Create Pull Request PR](https://github.com/kylesliu/awesome-golang-algorithm) + +## Description + +**Example 1:** + +``` +Input: a = "11", b = "1" +Output: "100" +``` + +## 题意 +> ... + +## 题解 + +### 思路1 +> ... +Minimum Operations to Exceed Threshold Value II +```go +``` + + +## 结语 + +如果你同我一样热爱数据结构、算法、LeetCode,可以关注我 GitHub 上的 LeetCode 题解:[awesome-golang-algorithm][me] + +[title]: https://leetcode.com/problems/minimum-operations-to-exceed-threshold-value-ii/ +[me]: https://github.com/kylesliu/awesome-golang-algorithm diff --git a/leetcode/3001-3100/3066.Minimum-Operations-to-Exceed-Threshold-Value-II/Solution.go b/leetcode/3001-3100/3066.Minimum-Operations-to-Exceed-Threshold-Value-II/Solution.go new file mode 100644 index 00000000..d115ccf5 --- /dev/null +++ b/leetcode/3001-3100/3066.Minimum-Operations-to-Exceed-Threshold-Value-II/Solution.go @@ -0,0 +1,5 @@ +package Solution + +func Solution(x bool) bool { + return x +} diff --git a/leetcode/3001-3100/3066.Minimum-Operations-to-Exceed-Threshold-Value-II/Solution_test.go b/leetcode/3001-3100/3066.Minimum-Operations-to-Exceed-Threshold-Value-II/Solution_test.go new file mode 100644 index 00000000..14ff50eb --- /dev/null +++ b/leetcode/3001-3100/3066.Minimum-Operations-to-Exceed-Threshold-Value-II/Solution_test.go @@ -0,0 +1,39 @@ +package Solution + +import ( + "reflect" + "strconv" + "testing" +) + +func TestSolution(t *testing.T) { + // 测试用例 + cases := []struct { + name string + inputs bool + expect bool + }{ + {"TestCase", true, true}, + {"TestCase", true, true}, + {"TestCase", false, false}, + } + + // 开始测试 + for i, c := range cases { + t.Run(c.name+" "+strconv.Itoa(i), func(t *testing.T) { + got := Solution(c.inputs) + if !reflect.DeepEqual(got, c.expect) { + t.Fatalf("expected: %v, but got: %v, with inputs: %v", + c.expect, got, c.inputs) + } + }) + } +} + +// 压力测试 +func BenchmarkSolution(b *testing.B) { +} + +// 使用案列 +func ExampleSolution() { +} diff --git a/leetcode/3001-3100/3067.Count-Pairs-of-Connectable-Servers-in-a-Weighted-Tree-Network/README.md b/leetcode/3001-3100/3067.Count-Pairs-of-Connectable-Servers-in-a-Weighted-Tree-Network/README.md new file mode 100755 index 00000000..94f3ec2d --- /dev/null +++ b/leetcode/3001-3100/3067.Count-Pairs-of-Connectable-Servers-in-a-Weighted-Tree-Network/README.md @@ -0,0 +1,32 @@ +# [3067.Count Pairs of Connectable Servers in a Weighted Tree Network][title] + +> [!WARNING|style:flat] +> This question is temporarily unanswered if you have good ideas. Welcome to [Create Pull Request PR](https://github.com/kylesliu/awesome-golang-algorithm) + +## Description + +**Example 1:** + +``` +Input: a = "11", b = "1" +Output: "100" +``` + +## 题意 +> ... + +## 题解 + +### 思路1 +> ... +Count Pairs of Connectable Servers in a Weighted Tree Network +```go +``` + + +## 结语 + +如果你同我一样热爱数据结构、算法、LeetCode,可以关注我 GitHub 上的 LeetCode 题解:[awesome-golang-algorithm][me] + +[title]: https://leetcode.com/problems/count-pairs-of-connectable-servers-in-a-weighted-tree-network/ +[me]: https://github.com/kylesliu/awesome-golang-algorithm diff --git a/leetcode/3001-3100/3067.Count-Pairs-of-Connectable-Servers-in-a-Weighted-Tree-Network/Solution.go b/leetcode/3001-3100/3067.Count-Pairs-of-Connectable-Servers-in-a-Weighted-Tree-Network/Solution.go new file mode 100644 index 00000000..d115ccf5 --- /dev/null +++ b/leetcode/3001-3100/3067.Count-Pairs-of-Connectable-Servers-in-a-Weighted-Tree-Network/Solution.go @@ -0,0 +1,5 @@ +package Solution + +func Solution(x bool) bool { + return x +} diff --git a/leetcode/3001-3100/3067.Count-Pairs-of-Connectable-Servers-in-a-Weighted-Tree-Network/Solution_test.go b/leetcode/3001-3100/3067.Count-Pairs-of-Connectable-Servers-in-a-Weighted-Tree-Network/Solution_test.go new file mode 100644 index 00000000..14ff50eb --- /dev/null +++ b/leetcode/3001-3100/3067.Count-Pairs-of-Connectable-Servers-in-a-Weighted-Tree-Network/Solution_test.go @@ -0,0 +1,39 @@ +package Solution + +import ( + "reflect" + "strconv" + "testing" +) + +func TestSolution(t *testing.T) { + // 测试用例 + cases := []struct { + name string + inputs bool + expect bool + }{ + {"TestCase", true, true}, + {"TestCase", true, true}, + {"TestCase", false, false}, + } + + // 开始测试 + for i, c := range cases { + t.Run(c.name+" "+strconv.Itoa(i), func(t *testing.T) { + got := Solution(c.inputs) + if !reflect.DeepEqual(got, c.expect) { + t.Fatalf("expected: %v, but got: %v, with inputs: %v", + c.expect, got, c.inputs) + } + }) + } +} + +// 压力测试 +func BenchmarkSolution(b *testing.B) { +} + +// 使用案列 +func ExampleSolution() { +} diff --git a/leetcode/3001-3100/3068.Find-the-Maximum-Sum-of-Node-Values/README.md b/leetcode/3001-3100/3068.Find-the-Maximum-Sum-of-Node-Values/README.md new file mode 100755 index 00000000..72c175ba --- /dev/null +++ b/leetcode/3001-3100/3068.Find-the-Maximum-Sum-of-Node-Values/README.md @@ -0,0 +1,32 @@ +# [3068.Find the Maximum Sum of Node Values][title] + +> [!WARNING|style:flat] +> This question is temporarily unanswered if you have good ideas. Welcome to [Create Pull Request PR](https://github.com/kylesliu/awesome-golang-algorithm) + +## Description + +**Example 1:** + +``` +Input: a = "11", b = "1" +Output: "100" +``` + +## 题意 +> ... + +## 题解 + +### 思路1 +> ... +Find the Maximum Sum of Node Values +```go +``` + + +## 结语 + +如果你同我一样热爱数据结构、算法、LeetCode,可以关注我 GitHub 上的 LeetCode 题解:[awesome-golang-algorithm][me] + +[title]: https://leetcode.com/problems/find-the-maximum-sum-of-node-values/ +[me]: https://github.com/kylesliu/awesome-golang-algorithm diff --git a/leetcode/3001-3100/3068.Find-the-Maximum-Sum-of-Node-Values/Solution.go b/leetcode/3001-3100/3068.Find-the-Maximum-Sum-of-Node-Values/Solution.go new file mode 100644 index 00000000..d115ccf5 --- /dev/null +++ b/leetcode/3001-3100/3068.Find-the-Maximum-Sum-of-Node-Values/Solution.go @@ -0,0 +1,5 @@ +package Solution + +func Solution(x bool) bool { + return x +} diff --git a/leetcode/3001-3100/3068.Find-the-Maximum-Sum-of-Node-Values/Solution_test.go b/leetcode/3001-3100/3068.Find-the-Maximum-Sum-of-Node-Values/Solution_test.go new file mode 100644 index 00000000..14ff50eb --- /dev/null +++ b/leetcode/3001-3100/3068.Find-the-Maximum-Sum-of-Node-Values/Solution_test.go @@ -0,0 +1,39 @@ +package Solution + +import ( + "reflect" + "strconv" + "testing" +) + +func TestSolution(t *testing.T) { + // 测试用例 + cases := []struct { + name string + inputs bool + expect bool + }{ + {"TestCase", true, true}, + {"TestCase", true, true}, + {"TestCase", false, false}, + } + + // 开始测试 + for i, c := range cases { + t.Run(c.name+" "+strconv.Itoa(i), func(t *testing.T) { + got := Solution(c.inputs) + if !reflect.DeepEqual(got, c.expect) { + t.Fatalf("expected: %v, but got: %v, with inputs: %v", + c.expect, got, c.inputs) + } + }) + } +} + +// 压力测试 +func BenchmarkSolution(b *testing.B) { +} + +// 使用案列 +func ExampleSolution() { +} diff --git a/leetcode/3001-3100/3069.Distribute-Elements-Into-Two-Arrays-I/README.md b/leetcode/3001-3100/3069.Distribute-Elements-Into-Two-Arrays-I/README.md new file mode 100755 index 00000000..f0b7cce2 --- /dev/null +++ b/leetcode/3001-3100/3069.Distribute-Elements-Into-Two-Arrays-I/README.md @@ -0,0 +1,32 @@ +# [3069.Distribute Elements Into Two Arrays I][title] + +> [!WARNING|style:flat] +> This question is temporarily unanswered if you have good ideas. Welcome to [Create Pull Request PR](https://github.com/kylesliu/awesome-golang-algorithm) + +## Description + +**Example 1:** + +``` +Input: a = "11", b = "1" +Output: "100" +``` + +## 题意 +> ... + +## 题解 + +### 思路1 +> ... +Distribute Elements Into Two Arrays I +```go +``` + + +## 结语 + +如果你同我一样热爱数据结构、算法、LeetCode,可以关注我 GitHub 上的 LeetCode 题解:[awesome-golang-algorithm][me] + +[title]: https://leetcode.com/problems/distribute-elements-into-two-arrays-i/ +[me]: https://github.com/kylesliu/awesome-golang-algorithm diff --git a/leetcode/3001-3100/3069.Distribute-Elements-Into-Two-Arrays-I/Solution.go b/leetcode/3001-3100/3069.Distribute-Elements-Into-Two-Arrays-I/Solution.go new file mode 100644 index 00000000..d115ccf5 --- /dev/null +++ b/leetcode/3001-3100/3069.Distribute-Elements-Into-Two-Arrays-I/Solution.go @@ -0,0 +1,5 @@ +package Solution + +func Solution(x bool) bool { + return x +} diff --git a/leetcode/3001-3100/3069.Distribute-Elements-Into-Two-Arrays-I/Solution_test.go b/leetcode/3001-3100/3069.Distribute-Elements-Into-Two-Arrays-I/Solution_test.go new file mode 100644 index 00000000..14ff50eb --- /dev/null +++ b/leetcode/3001-3100/3069.Distribute-Elements-Into-Two-Arrays-I/Solution_test.go @@ -0,0 +1,39 @@ +package Solution + +import ( + "reflect" + "strconv" + "testing" +) + +func TestSolution(t *testing.T) { + // 测试用例 + cases := []struct { + name string + inputs bool + expect bool + }{ + {"TestCase", true, true}, + {"TestCase", true, true}, + {"TestCase", false, false}, + } + + // 开始测试 + for i, c := range cases { + t.Run(c.name+" "+strconv.Itoa(i), func(t *testing.T) { + got := Solution(c.inputs) + if !reflect.DeepEqual(got, c.expect) { + t.Fatalf("expected: %v, but got: %v, with inputs: %v", + c.expect, got, c.inputs) + } + }) + } +} + +// 压力测试 +func BenchmarkSolution(b *testing.B) { +} + +// 使用案列 +func ExampleSolution() { +} diff --git a/leetcode/3001-3100/3070.Count-Submatrices-with-Top-Left-Element-and-Sum-Less-Than-k/README.md b/leetcode/3001-3100/3070.Count-Submatrices-with-Top-Left-Element-and-Sum-Less-Than-k/README.md new file mode 100755 index 00000000..ce1fe6da --- /dev/null +++ b/leetcode/3001-3100/3070.Count-Submatrices-with-Top-Left-Element-and-Sum-Less-Than-k/README.md @@ -0,0 +1,32 @@ +# [3070.Count Submatrices with Top-Left Element and Sum Less Than k][title] + +> [!WARNING|style:flat] +> This question is temporarily unanswered if you have good ideas. Welcome to [Create Pull Request PR](https://github.com/kylesliu/awesome-golang-algorithm) + +## Description + +**Example 1:** + +``` +Input: a = "11", b = "1" +Output: "100" +``` + +## 题意 +> ... + +## 题解 + +### 思路1 +> ... +Count Submatrices with Top-Left Element and Sum Less Than k +```go +``` + + +## 结语 + +如果你同我一样热爱数据结构、算法、LeetCode,可以关注我 GitHub 上的 LeetCode 题解:[awesome-golang-algorithm][me] + +[title]: https://leetcode.com/problems/count-submatrices-with-top-left-element-and-sum-less-than-k/ +[me]: https://github.com/kylesliu/awesome-golang-algorithm diff --git a/leetcode/3001-3100/3070.Count-Submatrices-with-Top-Left-Element-and-Sum-Less-Than-k/Solution.go b/leetcode/3001-3100/3070.Count-Submatrices-with-Top-Left-Element-and-Sum-Less-Than-k/Solution.go new file mode 100644 index 00000000..d115ccf5 --- /dev/null +++ b/leetcode/3001-3100/3070.Count-Submatrices-with-Top-Left-Element-and-Sum-Less-Than-k/Solution.go @@ -0,0 +1,5 @@ +package Solution + +func Solution(x bool) bool { + return x +} diff --git a/leetcode/3001-3100/3070.Count-Submatrices-with-Top-Left-Element-and-Sum-Less-Than-k/Solution_test.go b/leetcode/3001-3100/3070.Count-Submatrices-with-Top-Left-Element-and-Sum-Less-Than-k/Solution_test.go new file mode 100644 index 00000000..14ff50eb --- /dev/null +++ b/leetcode/3001-3100/3070.Count-Submatrices-with-Top-Left-Element-and-Sum-Less-Than-k/Solution_test.go @@ -0,0 +1,39 @@ +package Solution + +import ( + "reflect" + "strconv" + "testing" +) + +func TestSolution(t *testing.T) { + // 测试用例 + cases := []struct { + name string + inputs bool + expect bool + }{ + {"TestCase", true, true}, + {"TestCase", true, true}, + {"TestCase", false, false}, + } + + // 开始测试 + for i, c := range cases { + t.Run(c.name+" "+strconv.Itoa(i), func(t *testing.T) { + got := Solution(c.inputs) + if !reflect.DeepEqual(got, c.expect) { + t.Fatalf("expected: %v, but got: %v, with inputs: %v", + c.expect, got, c.inputs) + } + }) + } +} + +// 压力测试 +func BenchmarkSolution(b *testing.B) { +} + +// 使用案列 +func ExampleSolution() { +} diff --git a/leetcode/3001-3100/3071.Minimum-Operations-to-Write-the-Letter-Y-on-a-Grid/README.md b/leetcode/3001-3100/3071.Minimum-Operations-to-Write-the-Letter-Y-on-a-Grid/README.md new file mode 100755 index 00000000..d6316fc2 --- /dev/null +++ b/leetcode/3001-3100/3071.Minimum-Operations-to-Write-the-Letter-Y-on-a-Grid/README.md @@ -0,0 +1,32 @@ +# [3071.Minimum Operations to Write the Letter Y on a Grid][title] + +> [!WARNING|style:flat] +> This question is temporarily unanswered if you have good ideas. Welcome to [Create Pull Request PR](https://github.com/kylesliu/awesome-golang-algorithm) + +## Description + +**Example 1:** + +``` +Input: a = "11", b = "1" +Output: "100" +``` + +## 题意 +> ... + +## 题解 + +### 思路1 +> ... +Minimum Operations to Write the Letter Y on a Grid +```go +``` + + +## 结语 + +如果你同我一样热爱数据结构、算法、LeetCode,可以关注我 GitHub 上的 LeetCode 题解:[awesome-golang-algorithm][me] + +[title]: https://leetcode.com/problems/minimum-operations-to-write-the-letter-y-on-a-grid/ +[me]: https://github.com/kylesliu/awesome-golang-algorithm diff --git a/leetcode/3001-3100/3071.Minimum-Operations-to-Write-the-Letter-Y-on-a-Grid/Solution.go b/leetcode/3001-3100/3071.Minimum-Operations-to-Write-the-Letter-Y-on-a-Grid/Solution.go new file mode 100644 index 00000000..d115ccf5 --- /dev/null +++ b/leetcode/3001-3100/3071.Minimum-Operations-to-Write-the-Letter-Y-on-a-Grid/Solution.go @@ -0,0 +1,5 @@ +package Solution + +func Solution(x bool) bool { + return x +} diff --git a/leetcode/3001-3100/3071.Minimum-Operations-to-Write-the-Letter-Y-on-a-Grid/Solution_test.go b/leetcode/3001-3100/3071.Minimum-Operations-to-Write-the-Letter-Y-on-a-Grid/Solution_test.go new file mode 100644 index 00000000..14ff50eb --- /dev/null +++ b/leetcode/3001-3100/3071.Minimum-Operations-to-Write-the-Letter-Y-on-a-Grid/Solution_test.go @@ -0,0 +1,39 @@ +package Solution + +import ( + "reflect" + "strconv" + "testing" +) + +func TestSolution(t *testing.T) { + // 测试用例 + cases := []struct { + name string + inputs bool + expect bool + }{ + {"TestCase", true, true}, + {"TestCase", true, true}, + {"TestCase", false, false}, + } + + // 开始测试 + for i, c := range cases { + t.Run(c.name+" "+strconv.Itoa(i), func(t *testing.T) { + got := Solution(c.inputs) + if !reflect.DeepEqual(got, c.expect) { + t.Fatalf("expected: %v, but got: %v, with inputs: %v", + c.expect, got, c.inputs) + } + }) + } +} + +// 压力测试 +func BenchmarkSolution(b *testing.B) { +} + +// 使用案列 +func ExampleSolution() { +} diff --git a/leetcode/3001-3100/3072.Distribute-Elements-Into-Two-Arrays-II/README.md b/leetcode/3001-3100/3072.Distribute-Elements-Into-Two-Arrays-II/README.md new file mode 100755 index 00000000..4f8adc28 --- /dev/null +++ b/leetcode/3001-3100/3072.Distribute-Elements-Into-Two-Arrays-II/README.md @@ -0,0 +1,32 @@ +# [3072.Distribute Elements Into Two Arrays II][title] + +> [!WARNING|style:flat] +> This question is temporarily unanswered if you have good ideas. Welcome to [Create Pull Request PR](https://github.com/kylesliu/awesome-golang-algorithm) + +## Description + +**Example 1:** + +``` +Input: a = "11", b = "1" +Output: "100" +``` + +## 题意 +> ... + +## 题解 + +### 思路1 +> ... +Distribute Elements Into Two Arrays II +```go +``` + + +## 结语 + +如果你同我一样热爱数据结构、算法、LeetCode,可以关注我 GitHub 上的 LeetCode 题解:[awesome-golang-algorithm][me] + +[title]: https://leetcode.com/problems/distribute-elements-into-two-arrays-ii/ +[me]: https://github.com/kylesliu/awesome-golang-algorithm diff --git a/leetcode/3001-3100/3072.Distribute-Elements-Into-Two-Arrays-II/Solution.go b/leetcode/3001-3100/3072.Distribute-Elements-Into-Two-Arrays-II/Solution.go new file mode 100644 index 00000000..d115ccf5 --- /dev/null +++ b/leetcode/3001-3100/3072.Distribute-Elements-Into-Two-Arrays-II/Solution.go @@ -0,0 +1,5 @@ +package Solution + +func Solution(x bool) bool { + return x +} diff --git a/leetcode/3001-3100/3072.Distribute-Elements-Into-Two-Arrays-II/Solution_test.go b/leetcode/3001-3100/3072.Distribute-Elements-Into-Two-Arrays-II/Solution_test.go new file mode 100644 index 00000000..14ff50eb --- /dev/null +++ b/leetcode/3001-3100/3072.Distribute-Elements-Into-Two-Arrays-II/Solution_test.go @@ -0,0 +1,39 @@ +package Solution + +import ( + "reflect" + "strconv" + "testing" +) + +func TestSolution(t *testing.T) { + // 测试用例 + cases := []struct { + name string + inputs bool + expect bool + }{ + {"TestCase", true, true}, + {"TestCase", true, true}, + {"TestCase", false, false}, + } + + // 开始测试 + for i, c := range cases { + t.Run(c.name+" "+strconv.Itoa(i), func(t *testing.T) { + got := Solution(c.inputs) + if !reflect.DeepEqual(got, c.expect) { + t.Fatalf("expected: %v, but got: %v, with inputs: %v", + c.expect, got, c.inputs) + } + }) + } +} + +// 压力测试 +func BenchmarkSolution(b *testing.B) { +} + +// 使用案列 +func ExampleSolution() { +} diff --git a/leetcode/3001-3100/3074.Apple-Redistribution-into-Boxes/README.md b/leetcode/3001-3100/3074.Apple-Redistribution-into-Boxes/README.md new file mode 100755 index 00000000..2afabe17 --- /dev/null +++ b/leetcode/3001-3100/3074.Apple-Redistribution-into-Boxes/README.md @@ -0,0 +1,32 @@ +# [3074.Apple Redistribution into Boxes][title] + +> [!WARNING|style:flat] +> This question is temporarily unanswered if you have good ideas. Welcome to [Create Pull Request PR](https://github.com/kylesliu/awesome-golang-algorithm) + +## Description + +**Example 1:** + +``` +Input: a = "11", b = "1" +Output: "100" +``` + +## 题意 +> ... + +## 题解 + +### 思路1 +> ... +Apple Redistribution into Boxes +```go +``` + + +## 结语 + +如果你同我一样热爱数据结构、算法、LeetCode,可以关注我 GitHub 上的 LeetCode 题解:[awesome-golang-algorithm][me] + +[title]: https://leetcode.com/problems/apple-redistribution-into-boxes/ +[me]: https://github.com/kylesliu/awesome-golang-algorithm diff --git a/leetcode/3001-3100/3074.Apple-Redistribution-into-Boxes/Solution.go b/leetcode/3001-3100/3074.Apple-Redistribution-into-Boxes/Solution.go new file mode 100644 index 00000000..d115ccf5 --- /dev/null +++ b/leetcode/3001-3100/3074.Apple-Redistribution-into-Boxes/Solution.go @@ -0,0 +1,5 @@ +package Solution + +func Solution(x bool) bool { + return x +} diff --git a/leetcode/3001-3100/3074.Apple-Redistribution-into-Boxes/Solution_test.go b/leetcode/3001-3100/3074.Apple-Redistribution-into-Boxes/Solution_test.go new file mode 100644 index 00000000..14ff50eb --- /dev/null +++ b/leetcode/3001-3100/3074.Apple-Redistribution-into-Boxes/Solution_test.go @@ -0,0 +1,39 @@ +package Solution + +import ( + "reflect" + "strconv" + "testing" +) + +func TestSolution(t *testing.T) { + // 测试用例 + cases := []struct { + name string + inputs bool + expect bool + }{ + {"TestCase", true, true}, + {"TestCase", true, true}, + {"TestCase", false, false}, + } + + // 开始测试 + for i, c := range cases { + t.Run(c.name+" "+strconv.Itoa(i), func(t *testing.T) { + got := Solution(c.inputs) + if !reflect.DeepEqual(got, c.expect) { + t.Fatalf("expected: %v, but got: %v, with inputs: %v", + c.expect, got, c.inputs) + } + }) + } +} + +// 压力测试 +func BenchmarkSolution(b *testing.B) { +} + +// 使用案列 +func ExampleSolution() { +} diff --git a/leetcode/3001-3100/3075.Maximize-Happiness-of-Selected-Children/README.md b/leetcode/3001-3100/3075.Maximize-Happiness-of-Selected-Children/README.md new file mode 100755 index 00000000..1d178e30 --- /dev/null +++ b/leetcode/3001-3100/3075.Maximize-Happiness-of-Selected-Children/README.md @@ -0,0 +1,32 @@ +# [3075.Maximize Happiness of Selected Children][title] + +> [!WARNING|style:flat] +> This question is temporarily unanswered if you have good ideas. Welcome to [Create Pull Request PR](https://github.com/kylesliu/awesome-golang-algorithm) + +## Description + +**Example 1:** + +``` +Input: a = "11", b = "1" +Output: "100" +``` + +## 题意 +> ... + +## 题解 + +### 思路1 +> ... +Maximize Happiness of Selected Children +```go +``` + + +## 结语 + +如果你同我一样热爱数据结构、算法、LeetCode,可以关注我 GitHub 上的 LeetCode 题解:[awesome-golang-algorithm][me] + +[title]: https://leetcode.com/problems/maximize-happiness-of-selected-children/ +[me]: https://github.com/kylesliu/awesome-golang-algorithm diff --git a/leetcode/3001-3100/3075.Maximize-Happiness-of-Selected-Children/Solution.go b/leetcode/3001-3100/3075.Maximize-Happiness-of-Selected-Children/Solution.go new file mode 100644 index 00000000..d115ccf5 --- /dev/null +++ b/leetcode/3001-3100/3075.Maximize-Happiness-of-Selected-Children/Solution.go @@ -0,0 +1,5 @@ +package Solution + +func Solution(x bool) bool { + return x +} diff --git a/leetcode/3001-3100/3075.Maximize-Happiness-of-Selected-Children/Solution_test.go b/leetcode/3001-3100/3075.Maximize-Happiness-of-Selected-Children/Solution_test.go new file mode 100644 index 00000000..14ff50eb --- /dev/null +++ b/leetcode/3001-3100/3075.Maximize-Happiness-of-Selected-Children/Solution_test.go @@ -0,0 +1,39 @@ +package Solution + +import ( + "reflect" + "strconv" + "testing" +) + +func TestSolution(t *testing.T) { + // 测试用例 + cases := []struct { + name string + inputs bool + expect bool + }{ + {"TestCase", true, true}, + {"TestCase", true, true}, + {"TestCase", false, false}, + } + + // 开始测试 + for i, c := range cases { + t.Run(c.name+" "+strconv.Itoa(i), func(t *testing.T) { + got := Solution(c.inputs) + if !reflect.DeepEqual(got, c.expect) { + t.Fatalf("expected: %v, but got: %v, with inputs: %v", + c.expect, got, c.inputs) + } + }) + } +} + +// 压力测试 +func BenchmarkSolution(b *testing.B) { +} + +// 使用案列 +func ExampleSolution() { +} diff --git a/leetcode/3001-3100/3076.Shortest-Uncommon-Substring-in-an-Array/README.md b/leetcode/3001-3100/3076.Shortest-Uncommon-Substring-in-an-Array/README.md new file mode 100755 index 00000000..05424564 --- /dev/null +++ b/leetcode/3001-3100/3076.Shortest-Uncommon-Substring-in-an-Array/README.md @@ -0,0 +1,32 @@ +# [3076.Shortest Uncommon Substring in an Array][title] + +> [!WARNING|style:flat] +> This question is temporarily unanswered if you have good ideas. Welcome to [Create Pull Request PR](https://github.com/kylesliu/awesome-golang-algorithm) + +## Description + +**Example 1:** + +``` +Input: a = "11", b = "1" +Output: "100" +``` + +## 题意 +> ... + +## 题解 + +### 思路1 +> ... +Shortest Uncommon Substring in an Array +```go +``` + + +## 结语 + +如果你同我一样热爱数据结构、算法、LeetCode,可以关注我 GitHub 上的 LeetCode 题解:[awesome-golang-algorithm][me] + +[title]: https://leetcode.com/problems/shortest-uncommon-substring-in-an-array/ +[me]: https://github.com/kylesliu/awesome-golang-algorithm diff --git a/leetcode/3001-3100/3076.Shortest-Uncommon-Substring-in-an-Array/Solution.go b/leetcode/3001-3100/3076.Shortest-Uncommon-Substring-in-an-Array/Solution.go new file mode 100644 index 00000000..d115ccf5 --- /dev/null +++ b/leetcode/3001-3100/3076.Shortest-Uncommon-Substring-in-an-Array/Solution.go @@ -0,0 +1,5 @@ +package Solution + +func Solution(x bool) bool { + return x +} diff --git a/leetcode/3001-3100/3076.Shortest-Uncommon-Substring-in-an-Array/Solution_test.go b/leetcode/3001-3100/3076.Shortest-Uncommon-Substring-in-an-Array/Solution_test.go new file mode 100644 index 00000000..14ff50eb --- /dev/null +++ b/leetcode/3001-3100/3076.Shortest-Uncommon-Substring-in-an-Array/Solution_test.go @@ -0,0 +1,39 @@ +package Solution + +import ( + "reflect" + "strconv" + "testing" +) + +func TestSolution(t *testing.T) { + // 测试用例 + cases := []struct { + name string + inputs bool + expect bool + }{ + {"TestCase", true, true}, + {"TestCase", true, true}, + {"TestCase", false, false}, + } + + // 开始测试 + for i, c := range cases { + t.Run(c.name+" "+strconv.Itoa(i), func(t *testing.T) { + got := Solution(c.inputs) + if !reflect.DeepEqual(got, c.expect) { + t.Fatalf("expected: %v, but got: %v, with inputs: %v", + c.expect, got, c.inputs) + } + }) + } +} + +// 压力测试 +func BenchmarkSolution(b *testing.B) { +} + +// 使用案列 +func ExampleSolution() { +} diff --git a/leetcode/3001-3100/3077.Maximum-Strength-of-K-Disjoint-Subarrays/README.md b/leetcode/3001-3100/3077.Maximum-Strength-of-K-Disjoint-Subarrays/README.md new file mode 100755 index 00000000..a2e27949 --- /dev/null +++ b/leetcode/3001-3100/3077.Maximum-Strength-of-K-Disjoint-Subarrays/README.md @@ -0,0 +1,32 @@ +# [3077.Maximum Strength of K Disjoint Subarrays][title] + +> [!WARNING|style:flat] +> This question is temporarily unanswered if you have good ideas. Welcome to [Create Pull Request PR](https://github.com/kylesliu/awesome-golang-algorithm) + +## Description + +**Example 1:** + +``` +Input: a = "11", b = "1" +Output: "100" +``` + +## 题意 +> ... + +## 题解 + +### 思路1 +> ... +Maximum Strength of K Disjoint Subarrays +```go +``` + + +## 结语 + +如果你同我一样热爱数据结构、算法、LeetCode,可以关注我 GitHub 上的 LeetCode 题解:[awesome-golang-algorithm][me] + +[title]: https://leetcode.com/problems/maximum-strength-of-k-disjoint-subarrays/ +[me]: https://github.com/kylesliu/awesome-golang-algorithm diff --git a/leetcode/3001-3100/3077.Maximum-Strength-of-K-Disjoint-Subarrays/Solution.go b/leetcode/3001-3100/3077.Maximum-Strength-of-K-Disjoint-Subarrays/Solution.go new file mode 100644 index 00000000..d115ccf5 --- /dev/null +++ b/leetcode/3001-3100/3077.Maximum-Strength-of-K-Disjoint-Subarrays/Solution.go @@ -0,0 +1,5 @@ +package Solution + +func Solution(x bool) bool { + return x +} diff --git a/leetcode/3001-3100/3077.Maximum-Strength-of-K-Disjoint-Subarrays/Solution_test.go b/leetcode/3001-3100/3077.Maximum-Strength-of-K-Disjoint-Subarrays/Solution_test.go new file mode 100644 index 00000000..14ff50eb --- /dev/null +++ b/leetcode/3001-3100/3077.Maximum-Strength-of-K-Disjoint-Subarrays/Solution_test.go @@ -0,0 +1,39 @@ +package Solution + +import ( + "reflect" + "strconv" + "testing" +) + +func TestSolution(t *testing.T) { + // 测试用例 + cases := []struct { + name string + inputs bool + expect bool + }{ + {"TestCase", true, true}, + {"TestCase", true, true}, + {"TestCase", false, false}, + } + + // 开始测试 + for i, c := range cases { + t.Run(c.name+" "+strconv.Itoa(i), func(t *testing.T) { + got := Solution(c.inputs) + if !reflect.DeepEqual(got, c.expect) { + t.Fatalf("expected: %v, but got: %v, with inputs: %v", + c.expect, got, c.inputs) + } + }) + } +} + +// 压力测试 +func BenchmarkSolution(b *testing.B) { +} + +// 使用案列 +func ExampleSolution() { +} diff --git a/leetcode/3001-3100/3079.Find-the-Sum-of-Encrypted-Integers/README.md b/leetcode/3001-3100/3079.Find-the-Sum-of-Encrypted-Integers/README.md new file mode 100755 index 00000000..3b8436ad --- /dev/null +++ b/leetcode/3001-3100/3079.Find-the-Sum-of-Encrypted-Integers/README.md @@ -0,0 +1,32 @@ +# [3079.Find the Sum of Encrypted Integers][title] + +> [!WARNING|style:flat] +> This question is temporarily unanswered if you have good ideas. Welcome to [Create Pull Request PR](https://github.com/kylesliu/awesome-golang-algorithm) + +## Description + +**Example 1:** + +``` +Input: a = "11", b = "1" +Output: "100" +``` + +## 题意 +> ... + +## 题解 + +### 思路1 +> ... +Find the Sum of Encrypted Integers +```go +``` + + +## 结语 + +如果你同我一样热爱数据结构、算法、LeetCode,可以关注我 GitHub 上的 LeetCode 题解:[awesome-golang-algorithm][me] + +[title]: https://leetcode.com/problems/find-the-sum-of-encrypted-integers/ +[me]: https://github.com/kylesliu/awesome-golang-algorithm diff --git a/leetcode/3001-3100/3079.Find-the-Sum-of-Encrypted-Integers/Solution.go b/leetcode/3001-3100/3079.Find-the-Sum-of-Encrypted-Integers/Solution.go new file mode 100644 index 00000000..d115ccf5 --- /dev/null +++ b/leetcode/3001-3100/3079.Find-the-Sum-of-Encrypted-Integers/Solution.go @@ -0,0 +1,5 @@ +package Solution + +func Solution(x bool) bool { + return x +} diff --git a/leetcode/3001-3100/3079.Find-the-Sum-of-Encrypted-Integers/Solution_test.go b/leetcode/3001-3100/3079.Find-the-Sum-of-Encrypted-Integers/Solution_test.go new file mode 100644 index 00000000..14ff50eb --- /dev/null +++ b/leetcode/3001-3100/3079.Find-the-Sum-of-Encrypted-Integers/Solution_test.go @@ -0,0 +1,39 @@ +package Solution + +import ( + "reflect" + "strconv" + "testing" +) + +func TestSolution(t *testing.T) { + // 测试用例 + cases := []struct { + name string + inputs bool + expect bool + }{ + {"TestCase", true, true}, + {"TestCase", true, true}, + {"TestCase", false, false}, + } + + // 开始测试 + for i, c := range cases { + t.Run(c.name+" "+strconv.Itoa(i), func(t *testing.T) { + got := Solution(c.inputs) + if !reflect.DeepEqual(got, c.expect) { + t.Fatalf("expected: %v, but got: %v, with inputs: %v", + c.expect, got, c.inputs) + } + }) + } +} + +// 压力测试 +func BenchmarkSolution(b *testing.B) { +} + +// 使用案列 +func ExampleSolution() { +} diff --git a/leetcode/3001-3100/3080.Mark-Elements-on-Array-by-Performing-Queries/README.md b/leetcode/3001-3100/3080.Mark-Elements-on-Array-by-Performing-Queries/README.md new file mode 100755 index 00000000..28d17f8f --- /dev/null +++ b/leetcode/3001-3100/3080.Mark-Elements-on-Array-by-Performing-Queries/README.md @@ -0,0 +1,32 @@ +# [3080.Mark Elements on Array by Performing Queries][title] + +> [!WARNING|style:flat] +> This question is temporarily unanswered if you have good ideas. Welcome to [Create Pull Request PR](https://github.com/kylesliu/awesome-golang-algorithm) + +## Description + +**Example 1:** + +``` +Input: a = "11", b = "1" +Output: "100" +``` + +## 题意 +> ... + +## 题解 + +### 思路1 +> ... +Mark Elements on Array by Performing Queries +```go +``` + + +## 结语 + +如果你同我一样热爱数据结构、算法、LeetCode,可以关注我 GitHub 上的 LeetCode 题解:[awesome-golang-algorithm][me] + +[title]: https://leetcode.com/problems/mark-elements-on-array-by-performing-queries/ +[me]: https://github.com/kylesliu/awesome-golang-algorithm diff --git a/leetcode/3001-3100/3080.Mark-Elements-on-Array-by-Performing-Queries/Solution.go b/leetcode/3001-3100/3080.Mark-Elements-on-Array-by-Performing-Queries/Solution.go new file mode 100644 index 00000000..d115ccf5 --- /dev/null +++ b/leetcode/3001-3100/3080.Mark-Elements-on-Array-by-Performing-Queries/Solution.go @@ -0,0 +1,5 @@ +package Solution + +func Solution(x bool) bool { + return x +} diff --git a/leetcode/3001-3100/3080.Mark-Elements-on-Array-by-Performing-Queries/Solution_test.go b/leetcode/3001-3100/3080.Mark-Elements-on-Array-by-Performing-Queries/Solution_test.go new file mode 100644 index 00000000..14ff50eb --- /dev/null +++ b/leetcode/3001-3100/3080.Mark-Elements-on-Array-by-Performing-Queries/Solution_test.go @@ -0,0 +1,39 @@ +package Solution + +import ( + "reflect" + "strconv" + "testing" +) + +func TestSolution(t *testing.T) { + // 测试用例 + cases := []struct { + name string + inputs bool + expect bool + }{ + {"TestCase", true, true}, + {"TestCase", true, true}, + {"TestCase", false, false}, + } + + // 开始测试 + for i, c := range cases { + t.Run(c.name+" "+strconv.Itoa(i), func(t *testing.T) { + got := Solution(c.inputs) + if !reflect.DeepEqual(got, c.expect) { + t.Fatalf("expected: %v, but got: %v, with inputs: %v", + c.expect, got, c.inputs) + } + }) + } +} + +// 压力测试 +func BenchmarkSolution(b *testing.B) { +} + +// 使用案列 +func ExampleSolution() { +} diff --git a/leetcode/3001-3100/3081.Replace-Question-Marks-in-String-to-Minimize-Its-Value/README.md b/leetcode/3001-3100/3081.Replace-Question-Marks-in-String-to-Minimize-Its-Value/README.md new file mode 100755 index 00000000..3c3f0a8a --- /dev/null +++ b/leetcode/3001-3100/3081.Replace-Question-Marks-in-String-to-Minimize-Its-Value/README.md @@ -0,0 +1,32 @@ +# [3081.Replace Question Marks in String to Minimize Its Value][title] + +> [!WARNING|style:flat] +> This question is temporarily unanswered if you have good ideas. Welcome to [Create Pull Request PR](https://github.com/kylesliu/awesome-golang-algorithm) + +## Description + +**Example 1:** + +``` +Input: a = "11", b = "1" +Output: "100" +``` + +## 题意 +> ... + +## 题解 + +### 思路1 +> ... +Replace Question Marks in String to Minimize Its Value +```go +``` + + +## 结语 + +如果你同我一样热爱数据结构、算法、LeetCode,可以关注我 GitHub 上的 LeetCode 题解:[awesome-golang-algorithm][me] + +[title]: https://leetcode.com/problems/replace-question-marks-in-string-to-minimize-its-value/ +[me]: https://github.com/kylesliu/awesome-golang-algorithm diff --git a/leetcode/3001-3100/3081.Replace-Question-Marks-in-String-to-Minimize-Its-Value/Solution.go b/leetcode/3001-3100/3081.Replace-Question-Marks-in-String-to-Minimize-Its-Value/Solution.go new file mode 100644 index 00000000..d115ccf5 --- /dev/null +++ b/leetcode/3001-3100/3081.Replace-Question-Marks-in-String-to-Minimize-Its-Value/Solution.go @@ -0,0 +1,5 @@ +package Solution + +func Solution(x bool) bool { + return x +} diff --git a/leetcode/3001-3100/3081.Replace-Question-Marks-in-String-to-Minimize-Its-Value/Solution_test.go b/leetcode/3001-3100/3081.Replace-Question-Marks-in-String-to-Minimize-Its-Value/Solution_test.go new file mode 100644 index 00000000..14ff50eb --- /dev/null +++ b/leetcode/3001-3100/3081.Replace-Question-Marks-in-String-to-Minimize-Its-Value/Solution_test.go @@ -0,0 +1,39 @@ +package Solution + +import ( + "reflect" + "strconv" + "testing" +) + +func TestSolution(t *testing.T) { + // 测试用例 + cases := []struct { + name string + inputs bool + expect bool + }{ + {"TestCase", true, true}, + {"TestCase", true, true}, + {"TestCase", false, false}, + } + + // 开始测试 + for i, c := range cases { + t.Run(c.name+" "+strconv.Itoa(i), func(t *testing.T) { + got := Solution(c.inputs) + if !reflect.DeepEqual(got, c.expect) { + t.Fatalf("expected: %v, but got: %v, with inputs: %v", + c.expect, got, c.inputs) + } + }) + } +} + +// 压力测试 +func BenchmarkSolution(b *testing.B) { +} + +// 使用案列 +func ExampleSolution() { +} diff --git a/leetcode/3001-3100/3082.Find-the-Sum-of-the-Power-of-All-Subsequences/README.md b/leetcode/3001-3100/3082.Find-the-Sum-of-the-Power-of-All-Subsequences/README.md new file mode 100755 index 00000000..3b14fdb6 --- /dev/null +++ b/leetcode/3001-3100/3082.Find-the-Sum-of-the-Power-of-All-Subsequences/README.md @@ -0,0 +1,32 @@ +# [3082.Find the Sum of the Power of All Subsequences][title] + +> [!WARNING|style:flat] +> This question is temporarily unanswered if you have good ideas. Welcome to [Create Pull Request PR](https://github.com/kylesliu/awesome-golang-algorithm) + +## Description + +**Example 1:** + +``` +Input: a = "11", b = "1" +Output: "100" +``` + +## 题意 +> ... + +## 题解 + +### 思路1 +> ... +Find the Sum of the Power of All Subsequences +```go +``` + + +## 结语 + +如果你同我一样热爱数据结构、算法、LeetCode,可以关注我 GitHub 上的 LeetCode 题解:[awesome-golang-algorithm][me] + +[title]: https://leetcode.com/problems/find-the-sum-of-the-power-of-all-subsequences/ +[me]: https://github.com/kylesliu/awesome-golang-algorithm diff --git a/leetcode/3001-3100/3082.Find-the-Sum-of-the-Power-of-All-Subsequences/Solution.go b/leetcode/3001-3100/3082.Find-the-Sum-of-the-Power-of-All-Subsequences/Solution.go new file mode 100644 index 00000000..d115ccf5 --- /dev/null +++ b/leetcode/3001-3100/3082.Find-the-Sum-of-the-Power-of-All-Subsequences/Solution.go @@ -0,0 +1,5 @@ +package Solution + +func Solution(x bool) bool { + return x +} diff --git a/leetcode/3001-3100/3082.Find-the-Sum-of-the-Power-of-All-Subsequences/Solution_test.go b/leetcode/3001-3100/3082.Find-the-Sum-of-the-Power-of-All-Subsequences/Solution_test.go new file mode 100644 index 00000000..14ff50eb --- /dev/null +++ b/leetcode/3001-3100/3082.Find-the-Sum-of-the-Power-of-All-Subsequences/Solution_test.go @@ -0,0 +1,39 @@ +package Solution + +import ( + "reflect" + "strconv" + "testing" +) + +func TestSolution(t *testing.T) { + // 测试用例 + cases := []struct { + name string + inputs bool + expect bool + }{ + {"TestCase", true, true}, + {"TestCase", true, true}, + {"TestCase", false, false}, + } + + // 开始测试 + for i, c := range cases { + t.Run(c.name+" "+strconv.Itoa(i), func(t *testing.T) { + got := Solution(c.inputs) + if !reflect.DeepEqual(got, c.expect) { + t.Fatalf("expected: %v, but got: %v, with inputs: %v", + c.expect, got, c.inputs) + } + }) + } +} + +// 压力测试 +func BenchmarkSolution(b *testing.B) { +} + +// 使用案列 +func ExampleSolution() { +} diff --git a/leetcode/3001-3100/3083.Existence-of-a-Substring-in-a-String-and-Its-Reverse/README.md b/leetcode/3001-3100/3083.Existence-of-a-Substring-in-a-String-and-Its-Reverse/README.md new file mode 100755 index 00000000..935ebed2 --- /dev/null +++ b/leetcode/3001-3100/3083.Existence-of-a-Substring-in-a-String-and-Its-Reverse/README.md @@ -0,0 +1,32 @@ +# [3083.Existence of a Substring in a String and Its Reverse][title] + +> [!WARNING|style:flat] +> This question is temporarily unanswered if you have good ideas. Welcome to [Create Pull Request PR](https://github.com/kylesliu/awesome-golang-algorithm) + +## Description + +**Example 1:** + +``` +Input: a = "11", b = "1" +Output: "100" +``` + +## 题意 +> ... + +## 题解 + +### 思路1 +> ... +Existence of a Substring in a String and Its Reverse +```go +``` + + +## 结语 + +如果你同我一样热爱数据结构、算法、LeetCode,可以关注我 GitHub 上的 LeetCode 题解:[awesome-golang-algorithm][me] + +[title]: https://leetcode.com/problems/existence-of-a-substring-in-a-string-and-its-reverse/ +[me]: https://github.com/kylesliu/awesome-golang-algorithm diff --git a/leetcode/3001-3100/3083.Existence-of-a-Substring-in-a-String-and-Its-Reverse/Solution.go b/leetcode/3001-3100/3083.Existence-of-a-Substring-in-a-String-and-Its-Reverse/Solution.go new file mode 100644 index 00000000..d115ccf5 --- /dev/null +++ b/leetcode/3001-3100/3083.Existence-of-a-Substring-in-a-String-and-Its-Reverse/Solution.go @@ -0,0 +1,5 @@ +package Solution + +func Solution(x bool) bool { + return x +} diff --git a/leetcode/3001-3100/3083.Existence-of-a-Substring-in-a-String-and-Its-Reverse/Solution_test.go b/leetcode/3001-3100/3083.Existence-of-a-Substring-in-a-String-and-Its-Reverse/Solution_test.go new file mode 100644 index 00000000..14ff50eb --- /dev/null +++ b/leetcode/3001-3100/3083.Existence-of-a-Substring-in-a-String-and-Its-Reverse/Solution_test.go @@ -0,0 +1,39 @@ +package Solution + +import ( + "reflect" + "strconv" + "testing" +) + +func TestSolution(t *testing.T) { + // 测试用例 + cases := []struct { + name string + inputs bool + expect bool + }{ + {"TestCase", true, true}, + {"TestCase", true, true}, + {"TestCase", false, false}, + } + + // 开始测试 + for i, c := range cases { + t.Run(c.name+" "+strconv.Itoa(i), func(t *testing.T) { + got := Solution(c.inputs) + if !reflect.DeepEqual(got, c.expect) { + t.Fatalf("expected: %v, but got: %v, with inputs: %v", + c.expect, got, c.inputs) + } + }) + } +} + +// 压力测试 +func BenchmarkSolution(b *testing.B) { +} + +// 使用案列 +func ExampleSolution() { +} diff --git a/leetcode/3001-3100/3084.Count-Substrings-Starting-and-Ending-with-Given-Character/README.md b/leetcode/3001-3100/3084.Count-Substrings-Starting-and-Ending-with-Given-Character/README.md new file mode 100755 index 00000000..a46dfe84 --- /dev/null +++ b/leetcode/3001-3100/3084.Count-Substrings-Starting-and-Ending-with-Given-Character/README.md @@ -0,0 +1,32 @@ +# [3084.Count Substrings Starting and Ending with Given Character][title] + +> [!WARNING|style:flat] +> This question is temporarily unanswered if you have good ideas. Welcome to [Create Pull Request PR](https://github.com/kylesliu/awesome-golang-algorithm) + +## Description + +**Example 1:** + +``` +Input: a = "11", b = "1" +Output: "100" +``` + +## 题意 +> ... + +## 题解 + +### 思路1 +> ... +Count Substrings Starting and Ending with Given Character +```go +``` + + +## 结语 + +如果你同我一样热爱数据结构、算法、LeetCode,可以关注我 GitHub 上的 LeetCode 题解:[awesome-golang-algorithm][me] + +[title]: https://leetcode.com/problems/count-substrings-starting-and-ending-with-given-character/ +[me]: https://github.com/kylesliu/awesome-golang-algorithm diff --git a/leetcode/3001-3100/3084.Count-Substrings-Starting-and-Ending-with-Given-Character/Solution.go b/leetcode/3001-3100/3084.Count-Substrings-Starting-and-Ending-with-Given-Character/Solution.go new file mode 100644 index 00000000..d115ccf5 --- /dev/null +++ b/leetcode/3001-3100/3084.Count-Substrings-Starting-and-Ending-with-Given-Character/Solution.go @@ -0,0 +1,5 @@ +package Solution + +func Solution(x bool) bool { + return x +} diff --git a/leetcode/3001-3100/3084.Count-Substrings-Starting-and-Ending-with-Given-Character/Solution_test.go b/leetcode/3001-3100/3084.Count-Substrings-Starting-and-Ending-with-Given-Character/Solution_test.go new file mode 100644 index 00000000..14ff50eb --- /dev/null +++ b/leetcode/3001-3100/3084.Count-Substrings-Starting-and-Ending-with-Given-Character/Solution_test.go @@ -0,0 +1,39 @@ +package Solution + +import ( + "reflect" + "strconv" + "testing" +) + +func TestSolution(t *testing.T) { + // 测试用例 + cases := []struct { + name string + inputs bool + expect bool + }{ + {"TestCase", true, true}, + {"TestCase", true, true}, + {"TestCase", false, false}, + } + + // 开始测试 + for i, c := range cases { + t.Run(c.name+" "+strconv.Itoa(i), func(t *testing.T) { + got := Solution(c.inputs) + if !reflect.DeepEqual(got, c.expect) { + t.Fatalf("expected: %v, but got: %v, with inputs: %v", + c.expect, got, c.inputs) + } + }) + } +} + +// 压力测试 +func BenchmarkSolution(b *testing.B) { +} + +// 使用案列 +func ExampleSolution() { +} diff --git a/leetcode/3001-3100/3085.Minimum-Deletions-to-Make-String-K-Special/README.md b/leetcode/3001-3100/3085.Minimum-Deletions-to-Make-String-K-Special/README.md new file mode 100755 index 00000000..a406ed1b --- /dev/null +++ b/leetcode/3001-3100/3085.Minimum-Deletions-to-Make-String-K-Special/README.md @@ -0,0 +1,47 @@ +# [3085.Minimum Deletions to Make String K-Special][title] + +## Description +You are given a string `word` and an integer `k`. + +We consider `word` to be **k-special** if `|freq(word[i]) - freq(word[j])| <= k` for all indices `i` and `j` in the string. + +Here, `freq(x)` denotes the `frequency` of the character `x` in `word`, and `|y|` denotes the absolute value of `y`. + +Return the **minimum** number of characters you need to delete to make `word` **k-special**. + +**Example 1:** + +``` +Input: word = "aabcaba", k = 0 + +Output: 3 + +Explanation: We can make word 0-special by deleting 2 occurrences of "a" and 1 occurrence of "c". Therefore, word becomes equal to "baba" where freq('a') == freq('b') == 2. +``` + +**Example 2:** + +``` +Input: word = "dabdcbdcdcd", k = 2 + +Output: 2 + +Explanation: We can make word 2-special by deleting 1 occurrence of "a" and 1 occurrence of "d". Therefore, word becomes equal to "bdcbdcdcd" where freq('b') == 2, freq('c') == 3, and freq('d') == 4. +``` + +**Example 3:** + +``` +Input: word = "aaabaaa", k = 2 + +Output: 1 + +Explanation: We can make word 2-special by deleting 1 occurrence of "b". Therefore, word becomes equal to "aaaaaa" where each letter's frequency is now uniformly 6. +``` + +## 结语 + +如果你同我一样热爱数据结构、算法、LeetCode,可以关注我 GitHub 上的 LeetCode 题解:[awesome-golang-algorithm][me] + +[title]: https://leetcode.com/problems/minimum-deletions-to-make-string-k-special/ +[me]: https://github.com/kylesliu/awesome-golang-algorithm diff --git a/leetcode/3001-3100/3085.Minimum-Deletions-to-Make-String-K-Special/Solution.go b/leetcode/3001-3100/3085.Minimum-Deletions-to-Make-String-K-Special/Solution.go new file mode 100644 index 00000000..e339a3b0 --- /dev/null +++ b/leetcode/3001-3100/3085.Minimum-Deletions-to-Make-String-K-Special/Solution.go @@ -0,0 +1,50 @@ +package Solution + +import "sort" + +func Solution(word string, k int) int { + count := [26]int{} + for _, b := range word { + count[b-'a']++ + } + + list := make([]int, 0) + for i := 0; i < 26; i++ { + if count[i] != 0 { + list = append(list, count[i]) + } + } + ll := len(list) + + sum := make([]int, ll) + sort.Slice(list, func(i, j int) bool { + return list[i] < list[j] + }) + sum[0] = list[0] + for i := 1; i < ll; i++ { + sum[i] = sum[i-1] + list[i] + } + + ans := -1 + //26*26 N^2 ojbk + for start := 0; start < ll; start++ { + leftRemove := 0 + if start > 0 { + leftRemove = sum[start-1] + } + + for end := 0; end < ll; end++ { + rightRemove := sum[ll-1] - sum[end] + used := 0 + + for try := end; try > start && list[try]-list[start] > k; try-- { + used += list[try] - list[start] - k + } + if ans == -1 || rightRemove+leftRemove+used < ans { + ans = rightRemove + leftRemove + used + } + } + } + + return ans +} diff --git a/leetcode/3001-3100/3085.Minimum-Deletions-to-Make-String-K-Special/Solution_test.go b/leetcode/3001-3100/3085.Minimum-Deletions-to-Make-String-K-Special/Solution_test.go new file mode 100644 index 00000000..5138423b --- /dev/null +++ b/leetcode/3001-3100/3085.Minimum-Deletions-to-Make-String-K-Special/Solution_test.go @@ -0,0 +1,40 @@ +package Solution + +import ( + "reflect" + "strconv" + "testing" +) + +func TestSolution(t *testing.T) { + // 测试用例 + cases := []struct { + name string + word string + k int + expect int + }{ + {"TestCase1", "aabcaba", 0, 3}, + {"TestCase2", "dabdcbdcdcd", 2, 2}, + {"TestCase3", "aaabaaa", 2, 1}, + } + + // 开始测试 + for i, c := range cases { + t.Run(c.name+" "+strconv.Itoa(i), func(t *testing.T) { + got := Solution(c.word, c.k) + if !reflect.DeepEqual(got, c.expect) { + t.Fatalf("expected: %v, but got: %v, with inputs: %v %v", + c.expect, got, c.word, c.k) + } + }) + } +} + +// 压力测试 +func BenchmarkSolution(b *testing.B) { +} + +// 使用案列 +func ExampleSolution() { +} diff --git a/leetcode/3001-3100/3086.Minimum-Moves-to-Pick-K-Ones/README.md b/leetcode/3001-3100/3086.Minimum-Moves-to-Pick-K-Ones/README.md new file mode 100755 index 00000000..649c8eb7 --- /dev/null +++ b/leetcode/3001-3100/3086.Minimum-Moves-to-Pick-K-Ones/README.md @@ -0,0 +1,32 @@ +# [3086.Minimum Moves to Pick K Ones][title] + +> [!WARNING|style:flat] +> This question is temporarily unanswered if you have good ideas. Welcome to [Create Pull Request PR](https://github.com/kylesliu/awesome-golang-algorithm) + +## Description + +**Example 1:** + +``` +Input: a = "11", b = "1" +Output: "100" +``` + +## 题意 +> ... + +## 题解 + +### 思路1 +> ... +Minimum Moves to Pick K Ones +```go +``` + + +## 结语 + +如果你同我一样热爱数据结构、算法、LeetCode,可以关注我 GitHub 上的 LeetCode 题解:[awesome-golang-algorithm][me] + +[title]: https://leetcode.com/problems/minimum-moves-to-pick-k-ones/ +[me]: https://github.com/kylesliu/awesome-golang-algorithm diff --git a/leetcode/3001-3100/3086.Minimum-Moves-to-Pick-K-Ones/Solution.go b/leetcode/3001-3100/3086.Minimum-Moves-to-Pick-K-Ones/Solution.go new file mode 100644 index 00000000..d115ccf5 --- /dev/null +++ b/leetcode/3001-3100/3086.Minimum-Moves-to-Pick-K-Ones/Solution.go @@ -0,0 +1,5 @@ +package Solution + +func Solution(x bool) bool { + return x +} diff --git a/leetcode/3001-3100/3086.Minimum-Moves-to-Pick-K-Ones/Solution_test.go b/leetcode/3001-3100/3086.Minimum-Moves-to-Pick-K-Ones/Solution_test.go new file mode 100644 index 00000000..14ff50eb --- /dev/null +++ b/leetcode/3001-3100/3086.Minimum-Moves-to-Pick-K-Ones/Solution_test.go @@ -0,0 +1,39 @@ +package Solution + +import ( + "reflect" + "strconv" + "testing" +) + +func TestSolution(t *testing.T) { + // 测试用例 + cases := []struct { + name string + inputs bool + expect bool + }{ + {"TestCase", true, true}, + {"TestCase", true, true}, + {"TestCase", false, false}, + } + + // 开始测试 + for i, c := range cases { + t.Run(c.name+" "+strconv.Itoa(i), func(t *testing.T) { + got := Solution(c.inputs) + if !reflect.DeepEqual(got, c.expect) { + t.Fatalf("expected: %v, but got: %v, with inputs: %v", + c.expect, got, c.inputs) + } + }) + } +} + +// 压力测试 +func BenchmarkSolution(b *testing.B) { +} + +// 使用案列 +func ExampleSolution() { +} diff --git a/leetcode/3001-3100/3090.Maximum-Length-Substring-With-Two-Occurrences/README.md b/leetcode/3001-3100/3090.Maximum-Length-Substring-With-Two-Occurrences/README.md new file mode 100755 index 00000000..14480123 --- /dev/null +++ b/leetcode/3001-3100/3090.Maximum-Length-Substring-With-Two-Occurrences/README.md @@ -0,0 +1,32 @@ +# [3090.Maximum Length Substring With Two Occurrences][title] + +> [!WARNING|style:flat] +> This question is temporarily unanswered if you have good ideas. Welcome to [Create Pull Request PR](https://github.com/kylesliu/awesome-golang-algorithm) + +## Description + +**Example 1:** + +``` +Input: a = "11", b = "1" +Output: "100" +``` + +## 题意 +> ... + +## 题解 + +### 思路1 +> ... +Maximum Length Substring With Two Occurrences +```go +``` + + +## 结语 + +如果你同我一样热爱数据结构、算法、LeetCode,可以关注我 GitHub 上的 LeetCode 题解:[awesome-golang-algorithm][me] + +[title]: https://leetcode.com/problems/maximum-length-substring-with-two-occurrences/ +[me]: https://github.com/kylesliu/awesome-golang-algorithm diff --git a/leetcode/3001-3100/3090.Maximum-Length-Substring-With-Two-Occurrences/Solution.go b/leetcode/3001-3100/3090.Maximum-Length-Substring-With-Two-Occurrences/Solution.go new file mode 100644 index 00000000..d115ccf5 --- /dev/null +++ b/leetcode/3001-3100/3090.Maximum-Length-Substring-With-Two-Occurrences/Solution.go @@ -0,0 +1,5 @@ +package Solution + +func Solution(x bool) bool { + return x +} diff --git a/leetcode/3001-3100/3090.Maximum-Length-Substring-With-Two-Occurrences/Solution_test.go b/leetcode/3001-3100/3090.Maximum-Length-Substring-With-Two-Occurrences/Solution_test.go new file mode 100644 index 00000000..14ff50eb --- /dev/null +++ b/leetcode/3001-3100/3090.Maximum-Length-Substring-With-Two-Occurrences/Solution_test.go @@ -0,0 +1,39 @@ +package Solution + +import ( + "reflect" + "strconv" + "testing" +) + +func TestSolution(t *testing.T) { + // 测试用例 + cases := []struct { + name string + inputs bool + expect bool + }{ + {"TestCase", true, true}, + {"TestCase", true, true}, + {"TestCase", false, false}, + } + + // 开始测试 + for i, c := range cases { + t.Run(c.name+" "+strconv.Itoa(i), func(t *testing.T) { + got := Solution(c.inputs) + if !reflect.DeepEqual(got, c.expect) { + t.Fatalf("expected: %v, but got: %v, with inputs: %v", + c.expect, got, c.inputs) + } + }) + } +} + +// 压力测试 +func BenchmarkSolution(b *testing.B) { +} + +// 使用案列 +func ExampleSolution() { +} diff --git a/leetcode/3001-3100/3091.Apply-Operations-to-Make-Sum-of-Array-Greater-Than-or-Equal-to-k/README.md b/leetcode/3001-3100/3091.Apply-Operations-to-Make-Sum-of-Array-Greater-Than-or-Equal-to-k/README.md new file mode 100755 index 00000000..0a3df019 --- /dev/null +++ b/leetcode/3001-3100/3091.Apply-Operations-to-Make-Sum-of-Array-Greater-Than-or-Equal-to-k/README.md @@ -0,0 +1,32 @@ +# [3091.Apply Operations to Make Sum of Array Greater Than or Equal to k][title] + +> [!WARNING|style:flat] +> This question is temporarily unanswered if you have good ideas. Welcome to [Create Pull Request PR](https://github.com/kylesliu/awesome-golang-algorithm) + +## Description + +**Example 1:** + +``` +Input: a = "11", b = "1" +Output: "100" +``` + +## 题意 +> ... + +## 题解 + +### 思路1 +> ... +Apply Operations to Make Sum of Array Greater Than or Equal to k +```go +``` + + +## 结语 + +如果你同我一样热爱数据结构、算法、LeetCode,可以关注我 GitHub 上的 LeetCode 题解:[awesome-golang-algorithm][me] + +[title]: https://leetcode.com/problems/apply-operations-to-make-sum-of-array-greater-than-or-equal-to-k/ +[me]: https://github.com/kylesliu/awesome-golang-algorithm diff --git a/leetcode/3001-3100/3091.Apply-Operations-to-Make-Sum-of-Array-Greater-Than-or-Equal-to-k/Solution.go b/leetcode/3001-3100/3091.Apply-Operations-to-Make-Sum-of-Array-Greater-Than-or-Equal-to-k/Solution.go new file mode 100644 index 00000000..d115ccf5 --- /dev/null +++ b/leetcode/3001-3100/3091.Apply-Operations-to-Make-Sum-of-Array-Greater-Than-or-Equal-to-k/Solution.go @@ -0,0 +1,5 @@ +package Solution + +func Solution(x bool) bool { + return x +} diff --git a/leetcode/3001-3100/3091.Apply-Operations-to-Make-Sum-of-Array-Greater-Than-or-Equal-to-k/Solution_test.go b/leetcode/3001-3100/3091.Apply-Operations-to-Make-Sum-of-Array-Greater-Than-or-Equal-to-k/Solution_test.go new file mode 100644 index 00000000..14ff50eb --- /dev/null +++ b/leetcode/3001-3100/3091.Apply-Operations-to-Make-Sum-of-Array-Greater-Than-or-Equal-to-k/Solution_test.go @@ -0,0 +1,39 @@ +package Solution + +import ( + "reflect" + "strconv" + "testing" +) + +func TestSolution(t *testing.T) { + // 测试用例 + cases := []struct { + name string + inputs bool + expect bool + }{ + {"TestCase", true, true}, + {"TestCase", true, true}, + {"TestCase", false, false}, + } + + // 开始测试 + for i, c := range cases { + t.Run(c.name+" "+strconv.Itoa(i), func(t *testing.T) { + got := Solution(c.inputs) + if !reflect.DeepEqual(got, c.expect) { + t.Fatalf("expected: %v, but got: %v, with inputs: %v", + c.expect, got, c.inputs) + } + }) + } +} + +// 压力测试 +func BenchmarkSolution(b *testing.B) { +} + +// 使用案列 +func ExampleSolution() { +} diff --git a/leetcode/3001-3100/3092.Most-Frequent-IDs/README.md b/leetcode/3001-3100/3092.Most-Frequent-IDs/README.md new file mode 100755 index 00000000..a157ab9b --- /dev/null +++ b/leetcode/3001-3100/3092.Most-Frequent-IDs/README.md @@ -0,0 +1,32 @@ +# [3092.Most Frequent IDs][title] + +> [!WARNING|style:flat] +> This question is temporarily unanswered if you have good ideas. Welcome to [Create Pull Request PR](https://github.com/kylesliu/awesome-golang-algorithm) + +## Description + +**Example 1:** + +``` +Input: a = "11", b = "1" +Output: "100" +``` + +## 题意 +> ... + +## 题解 + +### 思路1 +> ... +Most Frequent IDs +```go +``` + + +## 结语 + +如果你同我一样热爱数据结构、算法、LeetCode,可以关注我 GitHub 上的 LeetCode 题解:[awesome-golang-algorithm][me] + +[title]: https://leetcode.com/problems/most-frequent-ids/ +[me]: https://github.com/kylesliu/awesome-golang-algorithm diff --git a/leetcode/3001-3100/3092.Most-Frequent-IDs/Solution.go b/leetcode/3001-3100/3092.Most-Frequent-IDs/Solution.go new file mode 100644 index 00000000..d115ccf5 --- /dev/null +++ b/leetcode/3001-3100/3092.Most-Frequent-IDs/Solution.go @@ -0,0 +1,5 @@ +package Solution + +func Solution(x bool) bool { + return x +} diff --git a/leetcode/3001-3100/3092.Most-Frequent-IDs/Solution_test.go b/leetcode/3001-3100/3092.Most-Frequent-IDs/Solution_test.go new file mode 100644 index 00000000..14ff50eb --- /dev/null +++ b/leetcode/3001-3100/3092.Most-Frequent-IDs/Solution_test.go @@ -0,0 +1,39 @@ +package Solution + +import ( + "reflect" + "strconv" + "testing" +) + +func TestSolution(t *testing.T) { + // 测试用例 + cases := []struct { + name string + inputs bool + expect bool + }{ + {"TestCase", true, true}, + {"TestCase", true, true}, + {"TestCase", false, false}, + } + + // 开始测试 + for i, c := range cases { + t.Run(c.name+" "+strconv.Itoa(i), func(t *testing.T) { + got := Solution(c.inputs) + if !reflect.DeepEqual(got, c.expect) { + t.Fatalf("expected: %v, but got: %v, with inputs: %v", + c.expect, got, c.inputs) + } + }) + } +} + +// 压力测试 +func BenchmarkSolution(b *testing.B) { +} + +// 使用案列 +func ExampleSolution() { +} diff --git a/leetcode/3001-3100/3093.Longest-Common-Suffix-Queries/README.md b/leetcode/3001-3100/3093.Longest-Common-Suffix-Queries/README.md new file mode 100755 index 00000000..a5d880de --- /dev/null +++ b/leetcode/3001-3100/3093.Longest-Common-Suffix-Queries/README.md @@ -0,0 +1,32 @@ +# [3093.Longest Common Suffix Queries][title] + +> [!WARNING|style:flat] +> This question is temporarily unanswered if you have good ideas. Welcome to [Create Pull Request PR](https://github.com/kylesliu/awesome-golang-algorithm) + +## Description + +**Example 1:** + +``` +Input: a = "11", b = "1" +Output: "100" +``` + +## 题意 +> ... + +## 题解 + +### 思路1 +> ... +Longest Common Suffix Queries +```go +``` + + +## 结语 + +如果你同我一样热爱数据结构、算法、LeetCode,可以关注我 GitHub 上的 LeetCode 题解:[awesome-golang-algorithm][me] + +[title]: https://leetcode.com/problems/longest-common-suffix-queries/ +[me]: https://github.com/kylesliu/awesome-golang-algorithm diff --git a/leetcode/3001-3100/3093.Longest-Common-Suffix-Queries/Solution.go b/leetcode/3001-3100/3093.Longest-Common-Suffix-Queries/Solution.go new file mode 100644 index 00000000..d115ccf5 --- /dev/null +++ b/leetcode/3001-3100/3093.Longest-Common-Suffix-Queries/Solution.go @@ -0,0 +1,5 @@ +package Solution + +func Solution(x bool) bool { + return x +} diff --git a/leetcode/3001-3100/3093.Longest-Common-Suffix-Queries/Solution_test.go b/leetcode/3001-3100/3093.Longest-Common-Suffix-Queries/Solution_test.go new file mode 100644 index 00000000..14ff50eb --- /dev/null +++ b/leetcode/3001-3100/3093.Longest-Common-Suffix-Queries/Solution_test.go @@ -0,0 +1,39 @@ +package Solution + +import ( + "reflect" + "strconv" + "testing" +) + +func TestSolution(t *testing.T) { + // 测试用例 + cases := []struct { + name string + inputs bool + expect bool + }{ + {"TestCase", true, true}, + {"TestCase", true, true}, + {"TestCase", false, false}, + } + + // 开始测试 + for i, c := range cases { + t.Run(c.name+" "+strconv.Itoa(i), func(t *testing.T) { + got := Solution(c.inputs) + if !reflect.DeepEqual(got, c.expect) { + t.Fatalf("expected: %v, but got: %v, with inputs: %v", + c.expect, got, c.inputs) + } + }) + } +} + +// 压力测试 +func BenchmarkSolution(b *testing.B) { +} + +// 使用案列 +func ExampleSolution() { +} diff --git a/leetcode/3001-3100/3095.Shortest-Subarray-With-OR-at-Least-K-I/README.md b/leetcode/3001-3100/3095.Shortest-Subarray-With-OR-at-Least-K-I/README.md new file mode 100755 index 00000000..380dfa1b --- /dev/null +++ b/leetcode/3001-3100/3095.Shortest-Subarray-With-OR-at-Least-K-I/README.md @@ -0,0 +1,32 @@ +# [3095.Shortest Subarray With OR at Least K I][title] + +> [!WARNING|style:flat] +> This question is temporarily unanswered if you have good ideas. Welcome to [Create Pull Request PR](https://github.com/kylesliu/awesome-golang-algorithm) + +## Description + +**Example 1:** + +``` +Input: a = "11", b = "1" +Output: "100" +``` + +## 题意 +> ... + +## 题解 + +### 思路1 +> ... +Shortest Subarray With OR at Least K I +```go +``` + + +## 结语 + +如果你同我一样热爱数据结构、算法、LeetCode,可以关注我 GitHub 上的 LeetCode 题解:[awesome-golang-algorithm][me] + +[title]: https://leetcode.com/problems/shortest-subarray-with-or-at-least-k-i/ +[me]: https://github.com/kylesliu/awesome-golang-algorithm diff --git a/leetcode/3001-3100/3095.Shortest-Subarray-With-OR-at-Least-K-I/Solution.go b/leetcode/3001-3100/3095.Shortest-Subarray-With-OR-at-Least-K-I/Solution.go new file mode 100644 index 00000000..d115ccf5 --- /dev/null +++ b/leetcode/3001-3100/3095.Shortest-Subarray-With-OR-at-Least-K-I/Solution.go @@ -0,0 +1,5 @@ +package Solution + +func Solution(x bool) bool { + return x +} diff --git a/leetcode/3001-3100/3095.Shortest-Subarray-With-OR-at-Least-K-I/Solution_test.go b/leetcode/3001-3100/3095.Shortest-Subarray-With-OR-at-Least-K-I/Solution_test.go new file mode 100644 index 00000000..14ff50eb --- /dev/null +++ b/leetcode/3001-3100/3095.Shortest-Subarray-With-OR-at-Least-K-I/Solution_test.go @@ -0,0 +1,39 @@ +package Solution + +import ( + "reflect" + "strconv" + "testing" +) + +func TestSolution(t *testing.T) { + // 测试用例 + cases := []struct { + name string + inputs bool + expect bool + }{ + {"TestCase", true, true}, + {"TestCase", true, true}, + {"TestCase", false, false}, + } + + // 开始测试 + for i, c := range cases { + t.Run(c.name+" "+strconv.Itoa(i), func(t *testing.T) { + got := Solution(c.inputs) + if !reflect.DeepEqual(got, c.expect) { + t.Fatalf("expected: %v, but got: %v, with inputs: %v", + c.expect, got, c.inputs) + } + }) + } +} + +// 压力测试 +func BenchmarkSolution(b *testing.B) { +} + +// 使用案列 +func ExampleSolution() { +} diff --git a/leetcode/3001-3100/3096.Minimum-Levels-to-Gain-More-Points/README.md b/leetcode/3001-3100/3096.Minimum-Levels-to-Gain-More-Points/README.md new file mode 100755 index 00000000..8fb97134 --- /dev/null +++ b/leetcode/3001-3100/3096.Minimum-Levels-to-Gain-More-Points/README.md @@ -0,0 +1,32 @@ +# [3096.Minimum Levels to Gain More Points][title] + +> [!WARNING|style:flat] +> This question is temporarily unanswered if you have good ideas. Welcome to [Create Pull Request PR](https://github.com/kylesliu/awesome-golang-algorithm) + +## Description + +**Example 1:** + +``` +Input: a = "11", b = "1" +Output: "100" +``` + +## 题意 +> ... + +## 题解 + +### 思路1 +> ... +Minimum Levels to Gain More Points +```go +``` + + +## 结语 + +如果你同我一样热爱数据结构、算法、LeetCode,可以关注我 GitHub 上的 LeetCode 题解:[awesome-golang-algorithm][me] + +[title]: https://leetcode.com/problems/minimum-levels-to-gain-more-points/ +[me]: https://github.com/kylesliu/awesome-golang-algorithm diff --git a/leetcode/3001-3100/3096.Minimum-Levels-to-Gain-More-Points/Solution.go b/leetcode/3001-3100/3096.Minimum-Levels-to-Gain-More-Points/Solution.go new file mode 100644 index 00000000..d115ccf5 --- /dev/null +++ b/leetcode/3001-3100/3096.Minimum-Levels-to-Gain-More-Points/Solution.go @@ -0,0 +1,5 @@ +package Solution + +func Solution(x bool) bool { + return x +} diff --git a/leetcode/3001-3100/3096.Minimum-Levels-to-Gain-More-Points/Solution_test.go b/leetcode/3001-3100/3096.Minimum-Levels-to-Gain-More-Points/Solution_test.go new file mode 100644 index 00000000..14ff50eb --- /dev/null +++ b/leetcode/3001-3100/3096.Minimum-Levels-to-Gain-More-Points/Solution_test.go @@ -0,0 +1,39 @@ +package Solution + +import ( + "reflect" + "strconv" + "testing" +) + +func TestSolution(t *testing.T) { + // 测试用例 + cases := []struct { + name string + inputs bool + expect bool + }{ + {"TestCase", true, true}, + {"TestCase", true, true}, + {"TestCase", false, false}, + } + + // 开始测试 + for i, c := range cases { + t.Run(c.name+" "+strconv.Itoa(i), func(t *testing.T) { + got := Solution(c.inputs) + if !reflect.DeepEqual(got, c.expect) { + t.Fatalf("expected: %v, but got: %v, with inputs: %v", + c.expect, got, c.inputs) + } + }) + } +} + +// 压力测试 +func BenchmarkSolution(b *testing.B) { +} + +// 使用案列 +func ExampleSolution() { +} diff --git a/leetcode/3001-3100/3097.Shortest-Subarray-With-OR-at-Least-K-II/README.md b/leetcode/3001-3100/3097.Shortest-Subarray-With-OR-at-Least-K-II/README.md new file mode 100755 index 00000000..d6f546b1 --- /dev/null +++ b/leetcode/3001-3100/3097.Shortest-Subarray-With-OR-at-Least-K-II/README.md @@ -0,0 +1,32 @@ +# [3097.Shortest Subarray With OR at Least K II][title] + +> [!WARNING|style:flat] +> This question is temporarily unanswered if you have good ideas. Welcome to [Create Pull Request PR](https://github.com/kylesliu/awesome-golang-algorithm) + +## Description + +**Example 1:** + +``` +Input: a = "11", b = "1" +Output: "100" +``` + +## 题意 +> ... + +## 题解 + +### 思路1 +> ... +Shortest Subarray With OR at Least K II +```go +``` + + +## 结语 + +如果你同我一样热爱数据结构、算法、LeetCode,可以关注我 GitHub 上的 LeetCode 题解:[awesome-golang-algorithm][me] + +[title]: https://leetcode.com/problems/shortest-subarray-with-or-at-least-k-ii/ +[me]: https://github.com/kylesliu/awesome-golang-algorithm diff --git a/leetcode/3001-3100/3097.Shortest-Subarray-With-OR-at-Least-K-II/Solution.go b/leetcode/3001-3100/3097.Shortest-Subarray-With-OR-at-Least-K-II/Solution.go new file mode 100644 index 00000000..d115ccf5 --- /dev/null +++ b/leetcode/3001-3100/3097.Shortest-Subarray-With-OR-at-Least-K-II/Solution.go @@ -0,0 +1,5 @@ +package Solution + +func Solution(x bool) bool { + return x +} diff --git a/leetcode/3001-3100/3097.Shortest-Subarray-With-OR-at-Least-K-II/Solution_test.go b/leetcode/3001-3100/3097.Shortest-Subarray-With-OR-at-Least-K-II/Solution_test.go new file mode 100644 index 00000000..14ff50eb --- /dev/null +++ b/leetcode/3001-3100/3097.Shortest-Subarray-With-OR-at-Least-K-II/Solution_test.go @@ -0,0 +1,39 @@ +package Solution + +import ( + "reflect" + "strconv" + "testing" +) + +func TestSolution(t *testing.T) { + // 测试用例 + cases := []struct { + name string + inputs bool + expect bool + }{ + {"TestCase", true, true}, + {"TestCase", true, true}, + {"TestCase", false, false}, + } + + // 开始测试 + for i, c := range cases { + t.Run(c.name+" "+strconv.Itoa(i), func(t *testing.T) { + got := Solution(c.inputs) + if !reflect.DeepEqual(got, c.expect) { + t.Fatalf("expected: %v, but got: %v, with inputs: %v", + c.expect, got, c.inputs) + } + }) + } +} + +// 压力测试 +func BenchmarkSolution(b *testing.B) { +} + +// 使用案列 +func ExampleSolution() { +} diff --git a/leetcode/3001-3100/3098.Find-the-Sum-of-Subsequence-Powers/README.md b/leetcode/3001-3100/3098.Find-the-Sum-of-Subsequence-Powers/README.md new file mode 100755 index 00000000..61173bda --- /dev/null +++ b/leetcode/3001-3100/3098.Find-the-Sum-of-Subsequence-Powers/README.md @@ -0,0 +1,32 @@ +# [3098.Find the Sum of Subsequence Powers][title] + +> [!WARNING|style:flat] +> This question is temporarily unanswered if you have good ideas. Welcome to [Create Pull Request PR](https://github.com/kylesliu/awesome-golang-algorithm) + +## Description + +**Example 1:** + +``` +Input: a = "11", b = "1" +Output: "100" +``` + +## 题意 +> ... + +## 题解 + +### 思路1 +> ... +Find the Sum of Subsequence Powers +```go +``` + + +## 结语 + +如果你同我一样热爱数据结构、算法、LeetCode,可以关注我 GitHub 上的 LeetCode 题解:[awesome-golang-algorithm][me] + +[title]: https://leetcode.com/problems/find-the-sum-of-subsequence-powers/ +[me]: https://github.com/kylesliu/awesome-golang-algorithm diff --git a/leetcode/3001-3100/3098.Find-the-Sum-of-Subsequence-Powers/Solution.go b/leetcode/3001-3100/3098.Find-the-Sum-of-Subsequence-Powers/Solution.go new file mode 100644 index 00000000..d115ccf5 --- /dev/null +++ b/leetcode/3001-3100/3098.Find-the-Sum-of-Subsequence-Powers/Solution.go @@ -0,0 +1,5 @@ +package Solution + +func Solution(x bool) bool { + return x +} diff --git a/leetcode/3001-3100/3098.Find-the-Sum-of-Subsequence-Powers/Solution_test.go b/leetcode/3001-3100/3098.Find-the-Sum-of-Subsequence-Powers/Solution_test.go new file mode 100644 index 00000000..14ff50eb --- /dev/null +++ b/leetcode/3001-3100/3098.Find-the-Sum-of-Subsequence-Powers/Solution_test.go @@ -0,0 +1,39 @@ +package Solution + +import ( + "reflect" + "strconv" + "testing" +) + +func TestSolution(t *testing.T) { + // 测试用例 + cases := []struct { + name string + inputs bool + expect bool + }{ + {"TestCase", true, true}, + {"TestCase", true, true}, + {"TestCase", false, false}, + } + + // 开始测试 + for i, c := range cases { + t.Run(c.name+" "+strconv.Itoa(i), func(t *testing.T) { + got := Solution(c.inputs) + if !reflect.DeepEqual(got, c.expect) { + t.Fatalf("expected: %v, but got: %v, with inputs: %v", + c.expect, got, c.inputs) + } + }) + } +} + +// 压力测试 +func BenchmarkSolution(b *testing.B) { +} + +// 使用案列 +func ExampleSolution() { +} diff --git a/leetcode/3001-3100/3099.Harshad-Number/README.md b/leetcode/3001-3100/3099.Harshad-Number/README.md new file mode 100755 index 00000000..cf39c488 --- /dev/null +++ b/leetcode/3001-3100/3099.Harshad-Number/README.md @@ -0,0 +1,32 @@ +# [3099.Harshad Number][title] + +> [!WARNING|style:flat] +> This question is temporarily unanswered if you have good ideas. Welcome to [Create Pull Request PR](https://github.com/kylesliu/awesome-golang-algorithm) + +## Description + +**Example 1:** + +``` +Input: a = "11", b = "1" +Output: "100" +``` + +## 题意 +> ... + +## 题解 + +### 思路1 +> ... +Harshad Number +```go +``` + + +## 结语 + +如果你同我一样热爱数据结构、算法、LeetCode,可以关注我 GitHub 上的 LeetCode 题解:[awesome-golang-algorithm][me] + +[title]: https://leetcode.com/problems/harshad-number/ +[me]: https://github.com/kylesliu/awesome-golang-algorithm diff --git a/leetcode/3001-3100/3099.Harshad-Number/Solution.go b/leetcode/3001-3100/3099.Harshad-Number/Solution.go new file mode 100644 index 00000000..d115ccf5 --- /dev/null +++ b/leetcode/3001-3100/3099.Harshad-Number/Solution.go @@ -0,0 +1,5 @@ +package Solution + +func Solution(x bool) bool { + return x +} diff --git a/leetcode/3001-3100/3099.Harshad-Number/Solution_test.go b/leetcode/3001-3100/3099.Harshad-Number/Solution_test.go new file mode 100644 index 00000000..14ff50eb --- /dev/null +++ b/leetcode/3001-3100/3099.Harshad-Number/Solution_test.go @@ -0,0 +1,39 @@ +package Solution + +import ( + "reflect" + "strconv" + "testing" +) + +func TestSolution(t *testing.T) { + // 测试用例 + cases := []struct { + name string + inputs bool + expect bool + }{ + {"TestCase", true, true}, + {"TestCase", true, true}, + {"TestCase", false, false}, + } + + // 开始测试 + for i, c := range cases { + t.Run(c.name+" "+strconv.Itoa(i), func(t *testing.T) { + got := Solution(c.inputs) + if !reflect.DeepEqual(got, c.expect) { + t.Fatalf("expected: %v, but got: %v, with inputs: %v", + c.expect, got, c.inputs) + } + }) + } +} + +// 压力测试 +func BenchmarkSolution(b *testing.B) { +} + +// 使用案列 +func ExampleSolution() { +} diff --git a/leetcode/3001-3100/3100.Water-Bottles-II/README.md b/leetcode/3001-3100/3100.Water-Bottles-II/README.md new file mode 100755 index 00000000..6030cf59 --- /dev/null +++ b/leetcode/3001-3100/3100.Water-Bottles-II/README.md @@ -0,0 +1,32 @@ +# [3100.Water Bottles II][title] + +> [!WARNING|style:flat] +> This question is temporarily unanswered if you have good ideas. Welcome to [Create Pull Request PR](https://github.com/kylesliu/awesome-golang-algorithm) + +## Description + +**Example 1:** + +``` +Input: a = "11", b = "1" +Output: "100" +``` + +## 题意 +> ... + +## 题解 + +### 思路1 +> ... +Water Bottles II +```go +``` + + +## 结语 + +如果你同我一样热爱数据结构、算法、LeetCode,可以关注我 GitHub 上的 LeetCode 题解:[awesome-golang-algorithm][me] + +[title]: https://leetcode.com/problems/water-bottles-ii/ +[me]: https://github.com/kylesliu/awesome-golang-algorithm diff --git a/leetcode/3001-3100/3100.Water-Bottles-II/Solution.go b/leetcode/3001-3100/3100.Water-Bottles-II/Solution.go new file mode 100644 index 00000000..d115ccf5 --- /dev/null +++ b/leetcode/3001-3100/3100.Water-Bottles-II/Solution.go @@ -0,0 +1,5 @@ +package Solution + +func Solution(x bool) bool { + return x +} diff --git a/leetcode/3001-3100/3100.Water-Bottles-II/Solution_test.go b/leetcode/3001-3100/3100.Water-Bottles-II/Solution_test.go new file mode 100644 index 00000000..14ff50eb --- /dev/null +++ b/leetcode/3001-3100/3100.Water-Bottles-II/Solution_test.go @@ -0,0 +1,39 @@ +package Solution + +import ( + "reflect" + "strconv" + "testing" +) + +func TestSolution(t *testing.T) { + // 测试用例 + cases := []struct { + name string + inputs bool + expect bool + }{ + {"TestCase", true, true}, + {"TestCase", true, true}, + {"TestCase", false, false}, + } + + // 开始测试 + for i, c := range cases { + t.Run(c.name+" "+strconv.Itoa(i), func(t *testing.T) { + got := Solution(c.inputs) + if !reflect.DeepEqual(got, c.expect) { + t.Fatalf("expected: %v, but got: %v, with inputs: %v", + c.expect, got, c.inputs) + } + }) + } +} + +// 压力测试 +func BenchmarkSolution(b *testing.B) { +} + +// 使用案列 +func ExampleSolution() { +}