Day 6
This commit is contained in:
13
day06/Part2.hs
Normal file
13
day06/Part2.hs
Normal 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
|
||||
Reference in New Issue
Block a user