feat(haskell): add counting duplicates

This commit is contained in:
Dmitriy Pleshevskiy 2021-10-28 23:50:42 +03:00
parent 2e43ff0c6b
commit 069972f5d5

View file

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