module Days.Day01 where
import AOCUtil
import Data.List

runA :: IO()
runA = interactF "data/day01.txt" (show. solve . lines) 

runB :: IO()
runB = interactF "data/day01.txt" (show. solveB . lines)

solve :: [String]-> Int 
solve = maximum .  map (sum . (map read)) . splitOn "" 

solveB :: [String] -> Int
solveB = sum. take 3 .reverse. sort .  map (sum . (map read)) . splitOn "" 
