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