blob: 3c1ce9053d344d2b4068b3b618aab9076a5b81cf (
plain) (
blame)
1
2
3
4
5
6
|
data ListItem a = Single a | Multiple Int a deriving Show
decodeModified :: [ListItem a] -> [a]
decodeModified [] = []
decodeModified (Single x:xs) = x:(decodeModified xs)
decodeModified (Multiple l x:xs) = replicate l x ++ decodeModified xs
|