Skip to content

Commit

Permalink
tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
mdr committed Dec 5, 2024
1 parent 3f5e869 commit f279bbf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Aoc2024/Day05/Solve.lean
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ open Std (HashSet)

private def middleElement {α} (l : List α) : Option α := l.get? (l.length / 2)

private def middlePageNumber (update : Update) : Int := middleElement update.pages |>.getD 0
private def middlePageNumber (update : Update) : Page := middleElement update.pages |>.getD 0

private def isCorrectlyOrdered (rules : List OrderingRule) (update : Update) : Bool :=
let allowedPairs := rules.map (·.toPair) |>.toSet
Expand Down

0 comments on commit f279bbf

Please sign in to comment.