loading...

re: Daily Challenge #259 - Duplicate Encoder VIEW POST

FULL DISCUSSION
 

My Haskell solution:

import Data.Char (toLower)

encode str = (\n -> if n > 1 then ')' else '(' )
        <$> fmap (\c -> length $ filter ((==) c) str') str'
    where str' = fmap toLower str
Code of Conduct Report abuse