mykatas/haskell/2_counting_duplicates.hs

5 lines
No EOL
166 B
Haskell

import Data.List(group, sort)
import Data.Char(toLower)
duplicateCount :: String -> Int
duplicateCount = length . filter ((>1) . length) . group . sort . map toLower