You are viewing a single comment's thread. Return to all comments →
Haskell
import Data.List solve :: String -> String solve = foldr (\x acc -> if (length x) == 1 then (head x):acc else [head x] ++ (show $ length x) ++ acc) "" . group main = interact $ solve
Seems like cookies are disabled on this browser, please enable them to open this website
String Compression
You are viewing a single comment's thread. Return to all comments →
Haskell