Files
LeetCode-Go/leetcode/0077.Combinations/77. Combinations_test.go
2020-08-27 00:58:22 +08:00

44 lines
656 B
Go

package leetcode
import (
"fmt"
"testing"
)
type question77 struct {
para77
ans77
}
// para 是参数
// one 代表第一个参数
type para77 struct {
n int
k int
}
// ans 是答案
// one 代表第一个答案
type ans77 struct {
one [][]int
}
func Test_Problem77(t *testing.T) {
qs := []question77{
{
para77{4, 2},
ans77{[][]int{{2, 4}, {3, 4}, {2, 3}, {1, 2}, {1, 3}, {1, 4}}},
},
}
fmt.Printf("------------------------Leetcode Problem 77------------------------\n")
for _, q := range qs {
_, p := q.ans77, q.para77
fmt.Printf("【input】:%v 【output】:%v\n", p, combine(p.n, p.k))
}
fmt.Printf("\n\n\n")
}