move comparator functions into util

This commit is contained in:
2024-12-02 22:48:19 +00:00
parent 4416dab080
commit 417266c838
3 changed files with 10 additions and 16 deletions

View File

@@ -20,3 +20,11 @@ func IntsFromString(s string) []int {
}
return nums
}
var CmpIncrease = func(nums []int, i int) bool {
return nums[i-1] >= nums[i]
}
var CmpDecrease = func(nums []int, i int) bool {
return nums[i-1] <= nums[i]
}