frequencies

Returns a map of each distinct element to the number of times it occurs.

Keys are ordered by first occurrence. An empty receiver yields an empty map.