mirror of
https://github.com/halfrost/LeetCode-Go.git
synced 2025-07-19 21:31:22 +08:00
48 lines
640 B
Go
48 lines
640 B
Go
package leetcode
|
|
|
|
import (
|
|
"fmt"
|
|
"testing"
|
|
)
|
|
|
|
type question910 struct {
|
|
para910
|
|
ans910
|
|
}
|
|
|
|
type para910 struct {
|
|
A []int
|
|
K int
|
|
}
|
|
|
|
type ans910 struct {
|
|
one int
|
|
}
|
|
|
|
func Test_Problem910(t *testing.T) {
|
|
|
|
qs := []question910{
|
|
|
|
{
|
|
para910{[]int{1}, 0},
|
|
ans910{0},
|
|
},
|
|
{
|
|
para910{[]int{0, 10}, 2},
|
|
ans910{6},
|
|
},
|
|
{
|
|
para910{[]int{1, 3, 6}, 3},
|
|
ans910{3},
|
|
},
|
|
}
|
|
|
|
fmt.Printf("------------------------Leetcode Problem 910------------------------\n")
|
|
|
|
for _, q := range qs {
|
|
_, p := q.ans910, q.para910
|
|
fmt.Printf("【input】:%v 【output】:%v\n", p, SmallestRangeII(p.A, p.K))
|
|
}
|
|
fmt.Printf("\n\n\n")
|
|
}
|