This commit is contained in:
2023-12-06 07:50:50 +01:00
parent 0ead7dd768
commit 05de161249
5 changed files with 81 additions and 0 deletions

13
day06/Part2.hs Normal file
View File

@@ -0,0 +1,13 @@
module Part2 where
import Commons
getSingleRace :: [Race] -> Race
getSingleRace [race] = race
getSingleRace (rh: t) = let otherRace = getSingleRace t
in Race {time = read $ show (time rh) ++ show (time otherRace),
distance = read $ show (distance rh) ++ show (distance otherRace)}
getRange :: [Race] -> Int
getRange = getRaceRange . getSingleRace