Files
vRp.CD2g_test/utils/maths/compare_example_test.go
kercylan98 0ab38c7023 feat: maths 包支持比较一组数是否连续
可以通过 maths.Continuity 和 math.IsContinuityWithSort 比较一组数是否连续
2023-06-30 09:15:28 +08:00

15 lines
269 B
Go

package maths_test
import (
"fmt"
"github.com/kercylan98/minotaur/utils/maths"
)
func ExampleIsContinuity() {
fmt.Println(maths.IsContinuity([]int{1, 2, 3, 4, 5, 6, 7}))
fmt.Println(maths.IsContinuity([]int{1, 2, 3, 5, 5, 6, 7}))
// Output:
// true
// false
}