day 1

#301
Raw
Author
Anonymous
Created
Dec. 1, 2020, 8:26 a.m.
Expires
Never
Size
234 bytes
Hits
63
Syntax
Haskell
module Main where

main :: IO ()
main = do
    h <- readFile "input"
    let n = map read (lines h)
    print $ head [a * b | a <- n, b <- n, a + b == 2020]
    print $ head [a * b * c | a <- n, b <- n, c <- n, a + b + c == 2020]