mykatas/haskell/2_counting_duplicates.hs

5 lines
166 B
Haskell
Raw Normal View History

2021-10-28 23:50:42 +03:00
import Data.List(group, sort)
import Data.Char(toLower)
duplicateCount :: String -> Int
duplicateCount = length . filter ((>1) . length) . group . sort . map toLower