mirror of
https://github.com/halfrost/LeetCode-Go.git
synced 2025-07-13 07:14:17 +08:00
1. Add solution 1091、1614、1619、1624、1629、1636、1704
2. ctl strings.TrimSpace question.Title
This commit is contained in:
@ -5,48 +5,48 @@ import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
type question1690 struct {
|
||||
para1690
|
||||
ans1690
|
||||
type question1696 struct {
|
||||
para1696
|
||||
ans1696
|
||||
}
|
||||
|
||||
// para 是参数
|
||||
// one 代表第一个参数
|
||||
type para1690 struct {
|
||||
type para1696 struct {
|
||||
nums []int
|
||||
k int
|
||||
}
|
||||
|
||||
// ans 是答案
|
||||
// one 代表第一个答案
|
||||
type ans1690 struct {
|
||||
type ans1696 struct {
|
||||
one int
|
||||
}
|
||||
|
||||
func Test_Problem1690(t *testing.T) {
|
||||
func Test_Problem1696(t *testing.T) {
|
||||
|
||||
qs := []question1690{
|
||||
|
||||
// {
|
||||
// para1690{[]int{1, -1, -2, 4, -7, 3}, 2},
|
||||
// ans1690{7},
|
||||
// },
|
||||
|
||||
// {
|
||||
// para1690{[]int{10, -5, -2, 4, 0, 3}, 3},
|
||||
// ans1690{17},
|
||||
// },
|
||||
qs := []question1696{
|
||||
|
||||
{
|
||||
para1690{[]int{1, -5, -20, 4, -1, 3, -6, -3}, 2},
|
||||
ans1690{0},
|
||||
para1696{[]int{1, -1, -2, 4, -7, 3}, 2},
|
||||
ans1696{7},
|
||||
},
|
||||
|
||||
{
|
||||
para1696{[]int{10, -5, -2, 4, 0, 3}, 3},
|
||||
ans1696{17},
|
||||
},
|
||||
|
||||
{
|
||||
para1696{[]int{1, -5, -20, 4, -1, 3, -6, -3}, 2},
|
||||
ans1696{0},
|
||||
},
|
||||
}
|
||||
|
||||
fmt.Printf("------------------------Leetcode Problem 1690------------------------\n")
|
||||
fmt.Printf("------------------------Leetcode Problem 1696------------------------\n")
|
||||
|
||||
for _, q := range qs {
|
||||
_, p := q.ans1690, q.para1690
|
||||
_, p := q.ans1696, q.para1696
|
||||
fmt.Printf("【input】:%v 【output】:%v\n", p, maxResult(p.nums, p.k))
|
||||
}
|
||||
fmt.Printf("\n\n\n")
|
||||
|
Reference in New Issue
Block a user