solve2 :: [Code] -> Int
solve2 = sum . map runCode
  where
    runCode (Raw s) = length s
    runCode (Repeat n s) = n * (solve2 $ parse s)
solve2 :: [Code] -> Int
solve2 = sum . map runCode
  where
    runCode (Raw s) = length s
    runCode (Repeat n s) = n * (solve2 $ parse s)
solve2 = sum . map runCode
  where
    runCode (Raw s) = length s
    runCode (Repeat n s) = n * (solve2 $ parse s)