add 0910 smallest-range-ii

This commit is contained in:
Alexander Chernikov
2020-12-21 13:58:49 +03:00
parent e3fd0d2671
commit 65d2fd668b
3 changed files with 112 additions and 0 deletions

View File

@ -0,0 +1,47 @@
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")
}