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 fbfabd0

Browse files
Create maximum-performance-of-a-team_test.go
1 parent d7337bd commit fbfabd0

File tree

1 file changed

+35
-0
lines changed

1 file changed

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

0 commit comments

Comments
(0)

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