Skip to content

Commit

Permalink
back to ||
Browse files Browse the repository at this point in the history
  • Loading branch information
mdr committed Dec 2, 2024
1 parent 2c31a30 commit 08f4dcb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Aoc2024/Day02/Solve.lean
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ private def decreasingSlowly: HashSet Int := [-1, -2, -3].toSet

private def isSafe (report : Report) : Bool :=
let diffs := report.differences.toSet
diffs.isSubsetOf increasingSlowly diffs.isSubsetOf decreasingSlowly
diffs.isSubsetOf increasingSlowly || diffs.isSubsetOf decreasingSlowly

#guard isSafe [7, 6, 4, 2, 1] == true
#guard isSafe [1, 2, 7, 8, 9] == false
Expand Down

0 comments on commit 08f4dcb

Please sign in to comment.