From 5eb58ad076f2cd435b11b140820da224b60b73d5 Mon Sep 17 00:00:00 2001 From: Aria Date: Mon, 2 Jan 2023 21:58:56 +0000 Subject: initial commit --- 2020/01b.hs | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 2020/01b.hs (limited to '2020/01b.hs') diff --git a/2020/01b.hs b/2020/01b.hs new file mode 100644 index 0000000..17d6e02 --- /dev/null +++ b/2020/01b.hs @@ -0,0 +1,13 @@ +module Day1B where + +import System.Environment (getArgs) + +main :: IO () +main = do + args <- getArgs; + c <- readFile $ head args; + let ns = map read $ lines c; + + print $ head [a * b * c| a <- ns, b <- ns, c <- ns, a + b + c == 2020]; + + return (); \ No newline at end of file -- cgit v1.2.3