Open evantianx opened 6 years ago
Examples:
accum "abcd" -- "A-Bb-Ccc-Dddd" accum "RqaEzty" -- "R-Qq-Aaa-Eeee-Zzzzz-Tttttt-Yyyyyyy" accum "cwAt" -- "C-Ww-Aaa-Tttt"
The parameter of accum is a string which includes only letters from a..z and A..Z.
import Data.Char import Data.List accum :: String -> String accum = intercalate "-" . zipWith f [0..] where f n c = toUpper c : replicate n (toLower c)
Examples:
The parameter of accum is a string which includes only letters from a..z and A..Z.