From 9bbd9d80887f2dd9c67d2adb9e128f89a201faaf Mon Sep 17 00:00:00 2001 From: thornAvery Date: Tue, 14 Dec 2021 03:19:18 +0000 Subject: [PATCH] cleanup --- code/src/07/Main.hs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/code/src/07/Main.hs b/code/src/07/Main.hs index fe7b62e..a9e5aee 100644 --- a/code/src/07/Main.hs +++ b/code/src/07/Main.hs @@ -9,10 +9,6 @@ main = do putStrLn $ "day7a: " ++ (show $ solveA input) putStrLn $ "day7b: " ++ (show $ solveB input) -repCom :: String -> String -repCom = map f - where f c = if c == ',' then ' ' else c - solveA :: [Int] -> Int solveA is = minimum $ map f us where @@ -32,3 +28,8 @@ absdiff x y = abs (x - y) expdiff :: Int -> Int -> Int expdiff x y = sum $ take (absdiff x y) [1..] + +repCom :: String -> String +repCom = map f + where f c = if c == ',' then ' ' else c +