mirror of
https://github.com/onyx-and-iris/aoc2024.git
synced 2026-04-08 18:13:36 +00:00
rename withComparator to withDampener. We're using comparators regardless...
add type definition dampener
This commit is contained in:
@@ -2,9 +2,9 @@ package one
|
||||
|
||||
import "math"
|
||||
|
||||
func check(nums []int, comparator comparator) bool {
|
||||
func check(nums []int, cmp comparator) bool {
|
||||
for i := 1; i < len(nums); i++ {
|
||||
if comparator(nums, i) || !isSafe(nums[i-1], nums[i]) {
|
||||
if cmp(nums, i) || !isSafe(nums[i-1], nums[i]) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user