提交尝试但未通过的题

This commit is contained in:
YDZ
2020-08-07 17:33:00 +08:00
parent 4e11f4028a
commit f918be35eb
18 changed files with 900 additions and 0 deletions

View File

@ -0,0 +1,48 @@
package leetcode
import (
"fmt"
"testing"
)
type question377 struct {
para377
ans377
}
// para 是参数
// one 代表第一个参数
type para377 struct {
n []int
k int
}
// ans 是答案
// one 代表第一个答案
type ans377 struct {
one int
}
func Test_Problem377(t *testing.T) {
qs := []question377{
question377{
para377{[]int{1, 2, 3}, 4},
ans377{7},
},
question377{
para377{[]int{1, 2, 3}, 32},
ans377{7},
},
}
fmt.Printf("------------------------Leetcode Problem 377------------------------\n")
for _, q := range qs {
_, p := q.ans377, q.para377
fmt.Printf("【input】:%v 【output】:%v\n", p, combinationSum4(p.n, p.k))
}
fmt.Printf("\n\n\n")
}