feat(haskell): add split string kata
This commit is contained in:
parent
a7f05aa3c7
commit
2a6c53e075
1 changed files with 8 additions and 0 deletions
8
haskell/10_split_strings.hs
Normal file
8
haskell/10_split_strings.hs
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
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
|
Loading…
Reference in a new issue