add: leetcode 1104 solution

This commit is contained in:
tphyhFighting
2021-07-29 11:58:29 +08:00
parent 02999e422e
commit 28add7d729
3 changed files with 135 additions and 0 deletions

View File

@ -0,0 +1,45 @@
package leetcode
import (
"fmt"
"testing"
)
type question1104 struct {
para1104
ans1104
}
// para 是参数
type para1104 struct {
label int
}
// ans 是答案
type ans1104 struct {
ans []int
}
func Test_Problem1104(t *testing.T) {
qs := []question1104{
{
para1104{14},
ans1104{[]int{1, 3, 4, 14}},
},
{
para1104{26},
ans1104{[]int{1, 2, 6, 10, 26}},
},
}
fmt.Printf("------------------------Leetcode Problem 1104------------------------\n")
for _, q := range qs {
_, p := q.ans1104, q.para1104
fmt.Printf("【input】:%v 【output】:%v \n", p, pathInZigZagTree(p.label))
}
fmt.Printf("\n\n\n")
}