blob: 3c1ce9053d344d2b4068b3b618aab9076a5b81cf (
plain) (
tree)
|
|
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
|