From 05af31c14d2ae7379db54c981505562cc6f569d7 Mon Sep 17 00:00:00 2001 From: nikolas Date: Tue, 2 Dec 2025 12:03:55 +0200 Subject: day 1 --- 1.hs | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 1.hs diff --git a/1.hs b/1.hs new file mode 100644 index 0000000..39893d0 --- /dev/null +++ b/1.hs @@ -0,0 +1,11 @@ +parse ('L':n) = -(read n) +parse ('R':n) = read n + +clicks x = replicate (abs x) (signum x) + +isOnZero n = (n `mod` 100 == 0) || (n == 0) + +main = do + input <- getContents + print (length (filter isOnZero (scanl (+) 50 (concat (map (clicks) (map parse (lines input))))))) + -- cgit v1.2.3