View Problem

Create a histogram map from a list

Given the list [a,b,a,c,b,b], produce a map {a:2, b:3, c:1} which contains the count of each unique item in the list
ExpandDiskEdit
perl
foreach(@list) {
$histogram{$_}++;
}
DiskEdit
perl
$histogram{$_}++ for @list;

Submit a new solution for perl
There are 37 other solutions in additional languages (clojure, cpp, csharp, erlang ...)