添加 problem 44

This commit is contained in:
YDZ
2018-04-15 15:41:30 +08:00
parent 8b519f0e1d
commit 3bbde758cf
5 changed files with 124 additions and 15 deletions

View File

@@ -5,14 +5,14 @@ import (
"testing"
)
type question struct {
para
ans
type question88 struct {
para88
ans88
}
// para 是参数
// one 代表第一个参数
type para struct {
type para88 struct {
one []int
m int
two []int
@@ -21,13 +21,13 @@ type para struct {
// ans 是答案
// one 代表第一个答案
type ans struct {
type ans88 struct {
one []int
}
func Test_Problem0088(t *testing.T) {
func Test_Problem88(t *testing.T) {
qs := []question{
qs := []question88{
// question{
// para{[]int{0}, 0, []int{1}, 1},
@@ -44,16 +44,17 @@ func Test_Problem0088(t *testing.T) {
// ans{[]int{1, 2, 2, 3}},
// },
question{
para{[]int{1, 2, 3, 0, 0, 0}, 3, []int{2, 5, 6}, 3},
ans{[]int{1, 2, 2, 3}},
question88{
para88{[]int{1, 2, 3, 0, 0, 0}, 3, []int{2, 5, 6}, 3},
ans88{[]int{1, 2, 2, 3, 5, 6}},
},
}
fmt.Printf("------------------------Leetcode Problem 88------------------------\n")
for _, q := range qs {
_, p := q.ans, q.para
_, p := q.ans88, q.para88
fmt.Printf("【intput】:%v,%v,%v,%v ", p.one, p.m, p.two, p.n)
merge(p.one, p.m, p.two, p.n)
fmt.Printf("~~%v~~\n", p)
fmt.Printf("【output】:%v\n", p)
}
fmt.Printf("\n\n\n")
}