diff --git a/src/Javran/AdventOfCode/Y2023/Day5.hs b/src/Javran/AdventOfCode/Y2023/Day5.hs index 83d559b8..1447af6f 100644 --- a/src/Javran/AdventOfCode/Y2023/Day5.hs +++ b/src/Javran/AdventOfCode/Y2023/Day5.hs @@ -69,6 +69,8 @@ instance Solution Day5 where solutionSolved _ = False solutionRun _ SolutionContext {getInputS, answerShow} = do (seeds, maps) <- consumeOrDie almanacP <$> getInputS - let fs = fmap mkMapper maps - locs = foldl' (\xs f -> fmap f xs) seeds fs - answerShow (minimum locs) + let ff = foldl' (\r m -> mkMapper m . r) id maps + answerShow (minimum $ fmap ff seeds) + answerShow $ minimum do + [l, rng] <- chunksOf 2 seeds + fmap ff [l .. l + rng-1]