import Data.Char (toLower)
compare_xos :: String -> Bool
compare_xos = same . foldl kevin (0, 0)
kevin (x, o) c
| toLower c == 'x' = (x + 1, o)
| toLower c == 'o' = (x, o + 1)
| otherwise = (x, o)
same (x, o) = x == o
Just being able to use Haskell impresses me lol
I can't do anything useful with it yet, but it's fun to solve coding katas :D.
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.