import qualified Data.Map as Map frequencies = Map.toList . foldr (flip (Map.insertWith (+)) 1) Map.empty main = print $ frequencies "huipizdadjigurda"
Standard input is empty
[('a',2),('d',3),('g',1),('h',1),('i',3),('j',1),('p',1),('r',1),('u',2),('z',1)]
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!