On 6/28/07, Robert Klemme <shortcutter / googlemail.com> wrote:

> Btw, thanks for leaving the inject solution to me. :-)
Shame on you!!! ;)
But that is not what OP asked for <G>

(a|[]).map{|e|a.grep(e).size} ### I know it might not work as we use #=== here

More generally we have therefore

(a|[]).map{|e|a.select{|x|x==e}.size}

Maybe OP preferred
...).sort.map{...

and sorry OP, I just needed this working break.

Robert
-- 
You see things; and you say Why?
But I dream things that never were; and I say Why not?
-- George Bernard Shaw