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 +