mykatas/haskell/10_split_strings.hs

9 lines
225 B
Haskell
Raw Normal View History

2022-04-19 23:06:08 +03:00
module Codewars.Kata.SplitStrings where
import qualified Data.Char as Char
solution :: String -> [String]
solution [] = []
solution [c1] = [c1 : "_"]
solution (c1:c2:rest) = (c1 : c2 : "") : solution rest