Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 226579a

Browse files
Create delete-and-earn_test.go
1 parent 707f6f8 commit 226579a

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package delete_and_earn
2+
3+
import "testing"
4+
5+
func Test_deleteAndEarn(t *testing.T) {
6+
type args struct {
7+
nums []int
8+
}
9+
tests := []struct {
10+
name string
11+
args args
12+
want int
13+
}{
14+
{
15+
name: "test case 1",
16+
args: args{
17+
nums: []int{1, 1, 1, 1, 1, 2, 2, 7, 7, 8, 2, 2, 3, 3, 4, 4, 5},
18+
},
19+
want: 30,
20+
},
21+
}
22+
for _, tt := range tests {
23+
t.Run(tt.name, func(t *testing.T) {
24+
if got := deleteAndEarn(tt.args.nums); got != tt.want {
25+
t.Errorf("deleteAndEarn() = %v, want %v", got, tt.want)
26+
}
27+
})
28+
}
29+
}

0 commit comments

Comments
(0)

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