Solution 1: Recursive version
decodeModified list = case list of [] -> [] Single x :: xs -> x :: decodeModified xs Multiple n x :: xs -> List.repeat n x ++ decodeModified xs