Files
LeetCode-Go/leetcode/0995.Minimum-Number-of-K-Consecutive-Bit-Flips/995. Minimum Number of K Consecutive Bit Flips_test.go
2020-08-27 00:58:22 +08:00

54 lines
762 B
Go

package leetcode
import (
"fmt"
"testing"
)
type question995 struct {
para995
ans995
}
// para 是参数
// one 代表第一个参数
type para995 struct {
one []int
k int
}
// ans 是答案
// one 代表第一个答案
type ans995 struct {
one int
}
func Test_Problem995(t *testing.T) {
qs := []question995{
{
para995{[]int{0, 1, 0}, 1},
ans995{2},
},
{
para995{[]int{1, 1, 0}, 2},
ans995{-1},
},
{
para995{[]int{0, 0, 0, 1, 0, 1, 1, 0}, 3},
ans995{3},
},
}
fmt.Printf("------------------------Leetcode Problem 995------------------------\n")
for _, q := range qs {
_, p := q.ans995, q.para995
fmt.Printf("【input】:%v 【output】:%v\n", p, minKBitFlips(p.one, p.k))
}
fmt.Printf("\n\n\n")
}