mirror of
https://codeberg.org/JasterV/aoc2024-haskell.git
synced 2026-04-26 18:10:05 +00:00
Update Day1.hs
This commit is contained in:
parent
fa57343a1c
commit
0721ec8c1f
1 changed files with 1 additions and 1 deletions
|
|
@ -22,7 +22,7 @@ partOne filepath = do
|
|||
return score
|
||||
where
|
||||
-- To calculate the overall score we just need to
|
||||
-- sort the lists and calculate the distances of each element
|
||||
-- sort the lists and calculate the distances between each element
|
||||
calculateScore (left, right) =
|
||||
sum $ zipWith distance (sort left) (sort right)
|
||||
distance a b = abs (a - b)
|
||||
|
|
|
|||
Loading…
Reference in a new issue