Skip to content

Commit e24018c

Browse files
committed
add: leetcode 1296 test
1 parent 2f6128c commit e24018c

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
package leetcode
2+
3+
import (
4+
"fmt"
5+
"testing"
6+
)
7+
8+
type question1296 struct {
9+
para1296
10+
ans1296
11+
}
12+
13+
// para 是参数
14+
type para1296 struct {
15+
nums []int
16+
k int
17+
}
18+
19+
// ans 是答案
20+
type ans1296 struct {
21+
ans bool
22+
}
23+
24+
func Test_Problem1296(t *testing.T) {
25+
26+
qs := []question1296{
27+
28+
{
29+
para1296{[]int{1, 2, 3, 3, 4, 4, 5, 6}, 4},
30+
ans1296{true},
31+
},
32+
33+
{
34+
para1296{[]int{3, 2, 1, 2, 3, 4, 3, 4, 5, 9, 10, 11}, 3},
35+
ans1296{true},
36+
},
37+
38+
{
39+
para1296{[]int{1, 2, 3, 4}, 3},
40+
ans1296{false},
41+
},
42+
}
43+
44+
fmt.Printf("------------------------Leetcode Problem 1296------------------------\n")
45+
46+
for _, q := range qs {
47+
_, p := q.ans1296, q.para1296
48+
fmt.Printf("【input】:%v 【output】:%v\n", p, isPossibleDivide(p.nums, p.k))
49+
}
50+
fmt.Printf("\n\n\n")
51+
}

0 commit comments

Comments
 (0)