diff --git a/leetcode/0846.Hand-of-Straights/846.Hand of Straights_test.go b/leetcode/0846.Hand-of-Straights/846.Hand of Straights_test.go new file mode 100644 index 00000000..2a172eb0 --- /dev/null +++ b/leetcode/0846.Hand-of-Straights/846.Hand of Straights_test.go @@ -0,0 +1,46 @@ +package leetcode + +import ( + "fmt" + "testing" +) + +type question846 struct { + para846 + ans846 +} + +// para 是参数 +type para846 struct { + hand []int + groupSize int +} + +// ans 是答案 +type ans846 struct { + ans bool +} + +func Test_Problem846(t *testing.T) { + + qs := []question846{ + + { + para846{[]int{1, 2, 3, 6, 2, 3, 4, 7, 8}, 3}, + ans846{true}, + }, + + { + para846{[]int{1, 2, 3, 4, 5}, 4}, + ans846{false}, + }, + } + + fmt.Printf("------------------------Leetcode Problem 846------------------------\n") + + for _, q := range qs { + _, p := q.ans846, q.para846 + fmt.Printf("【input】:%v 【output】:%v\n", p, isNStraightHand(p.hand, p.groupSize)) + } + fmt.Printf("\n\n\n") +}