Skip to content

Commit

Permalink
Merge pull request #871 from 0xff-dev/add-3001-3100
Browse files Browse the repository at this point in the history
add 3001-3100 problems. add solution and test-cases for problem 3085
  • Loading branch information
6boris committed Jun 6, 2024
2 parents 9f7f475 + d3d3a8d commit 061eba5
Show file tree
Hide file tree
Showing 219 changed files with 5,609 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package Solution

func Solution(x bool) bool {
return x
}
Original file line number Diff line number Diff line change
@@ -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() {
}
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package Solution

func Solution(x bool) bool {
return x
}
Original file line number Diff line number Diff line change
@@ -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() {
}
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package Solution

func Solution(x bool) bool {
return x
}
Original file line number Diff line number Diff line change
@@ -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() {
}
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package Solution

func Solution(x bool) bool {
return x
}
Original file line number Diff line number Diff line change
@@ -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() {
}
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package Solution

func Solution(x bool) bool {
return x
}
Original file line number Diff line number Diff line change
@@ -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() {
}
Loading

0 comments on commit 061eba5

Please sign in to comment.