99 个 Elm 问题/第 12 个问题/解决方案
外观
< 99 个 Elm 问题 | 第 12 个问题
解决方案 1:递归版本
decodeModified list =
case list of
[] -> []
Single x :: xs -> x :: decodeModified xs
Multiple n x :: xs -> List.repeat n x ++ decodeModified xs
解决方案 1:递归版本
decodeModified list =
case list of
[] -> []
Single x :: xs -> x :: decodeModified xs
Multiple n x :: xs -> List.repeat n x ++ decodeModified xs