Skip to content

Commit

Permalink
too lazy to think
Browse files Browse the repository at this point in the history
give it a few hours see if we can just bruteforce this, since there's
no really memory pressure that we can run this as long as we want.
  • Loading branch information
Javran committed Jan 8, 2024
1 parent ef222fa commit a70fbe8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Javran/AdventOfCode/Y2023/Day5.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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]

0 comments on commit a70fbe8

Please sign in to comment.