diff --git a/haskell/2_counting_duplicates.hs b/haskell/2_counting_duplicates.hs new file mode 100644 index 0000000..868e195 --- /dev/null +++ b/haskell/2_counting_duplicates.hs @@ -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 \ No newline at end of file