From: Robert Dober Date: 2007-06-28T19:56:14+09:00 Subject: Re: Can i calculate the data number in array? On 6/28/07, Robert Klemme wrote: > Btw, thanks for leaving the inject solution to me. :-) Shame on you!!! ;) But that is not what OP asked for (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