-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsolution_test.go
66 lines (64 loc) · 1.06 KB
/
solution_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
package lc0502
import "testing"
func Test_findMaximizedCapital(t *testing.T) {
t.Parallel()
type args struct {
k int
w int
profits []int
capital []int
}
tests := []struct {
name string
args args
want int
}{
{
name: ``,
args: args{
k: 2,
w: 0,
profits: []int{1, 2, 3},
capital: []int{0, 1, 1},
},
want: 4,
},
{
name: ``,
args: args{
k: 3,
w: 0,
profits: []int{1, 2, 3},
capital: []int{0, 1, 2},
},
want: 6,
},
{
name: ``,
args: args{
k: 1,
w: 10,
profits: []int{1, 2, 3},
capital: []int{0, 0, 0},
},
want: 13,
},
{
name: ``,
args: args{
k: 11,
w: 11,
profits: []int{1, 2, 3},
capital: []int{11, 12, 13},
},
want: 17,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := findMaximizedCapital(tt.args.k, tt.args.w, tt.args.profits, tt.args.capital); got != tt.want {
t.Errorf("findMaximizedCapital() = %v, want %v", got, tt.want)
}
})
}
}