mykatas/haskell/10_split_strings.hs

8 lines
236 B
Haskell

module Codewars.Kata.SplitStrings (solution) where
import qualified Data.Char as Char
solution :: String -> [String]
solution [] = []
solution [c1] = [c1 : "_"]
solution (c1:c2:rest) = (c1 : c2 : "") : solution rest