This commit is contained in:
Gattix 2021-12-05 19:47:42 +01:00
parent 4e87850e53
commit bf2354d2ee
2 changed files with 2009 additions and 0 deletions

9
2021/day01/day01.hs Normal file

@ -0,0 +1,9 @@
main :: IO ()
main = do
input <- map read . lines <$> readFile "input"
print $ day1 input
print $ day1 $ zipWith3 (\x y z->x+y+z) input (tail input) (tail $ tail input)
day1 :: [Int] -> Int
day1 a = sum $ map fromEnum $ zipWith (<) a (tail a)

2000
2021/day01/input Normal file

File diff suppressed because it is too large Load Diff