feat(haskell): add counting duplicates
This commit is contained in:
parent
2e43ff0c6b
commit
069972f5d5
1 changed files with 5 additions and 0 deletions
5
haskell/2_counting_duplicates.hs
Normal file
5
haskell/2_counting_duplicates.hs
Normal 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
|
Loading…
Reference in a new issue