We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 72259d2 commit c10aa94Copy full SHA for c10aa94
Text/count_vowels.hs
@@ -1,7 +1,8 @@
1
+import Data.Map
2
+
3
main = do
4
string <- getLine
- let vowels = only_vowels string
- putStrLn $ show (length (only_vowels string))
5
+ putStrLn $ show (toList $ fromListWith (+) [ (c,1) | c <- (only_vowels string) ] )
6
7
vowels = "aeiou"
8
only_vowels x = [ c | c <- x, c `elem` vowels ]
0 commit comments