template :D

This commit is contained in:
KoenDR06 2025-12-01 13:44:35 +01:00
parent f2c4afd7b4
commit 1f5b785b06
4 changed files with 26 additions and 2 deletions

View file

@ -6,7 +6,6 @@ part1 = length . dropNonZero . scanl (+) 50 . convertToInts . lines
convertToInts = map (\it -> (if head it == 'L' then -1 else 1) * read (drop 1 it))
dropNonZero = filter ((0==) . (`mod` 100))
part2 :: String -> Int
part2 = length . dropNonZero . scanl (+) 50 . makeSingleSteps . convertToInts . lines
where
@ -16,7 +15,7 @@ part2 = length . dropNonZero . scanl (+) 50 . makeSingleSteps . convertToInts .
main :: IO ()
main = do
str <- readFile "inputs/2025-1"
str <- getContents
print $ part1 str
print $ part2 str