Add solution 0097、0523、0525、1465、1744

This commit is contained in:
YDZ
2021-06-04 16:22:35 +08:00
parent c0191c235d
commit cc78fdd0ef
42 changed files with 1447 additions and 173 deletions

View File

@ -0,0 +1,53 @@
package leetcode
import (
"fmt"
"testing"
)
type question523 struct {
para523
ans523
}
// para 是参数
// one 代表第一个参数
type para523 struct {
nums []int
k int
}
// ans 是答案
// one 代表第一个答案
type ans523 struct {
one bool
}
func Test_Problem523(t *testing.T) {
qs := []question523{
{
para523{[]int{23, 2, 4, 6, 7}, 6},
ans523{true},
},
{
para523{[]int{23, 2, 6, 4, 7}, 6},
ans523{true},
},
{
para523{[]int{23, 2, 6, 4, 7}, 13},
ans523{false},
},
}
fmt.Printf("------------------------Leetcode Problem 523------------------------\n")
for _, q := range qs {
_, p := q.ans523, q.para523
fmt.Printf("【input】:%v 【output】:%v\n", p, checkSubarraySum(p.nums, p.k))
}
fmt.Printf("\n\n\n")
}