-- Advent of Code
---- Day 10: Elves look, Elves say

module AOC2015.Day10 where

lookandsay :: String -> String
lookandsay [] = []
lookandsay (x:xs) = show (length xss) ++ [x] ++ lookandsay rest
  where
    (xss,rest) = span (==x) (x:xs)

answers :: IO ()
answers = do
  let i = "1113122113"

  let part1 = length $ last . take 41 $ iterate lookandsay i
  putStrLn $ "Part One: " ++ show part1

  let part2 = length $ last . take 51 $ iterate lookandsay i
  putStrLn $ "Part Two: " ++ show part2
