2007/10/28, Sean O'Halpin <sean.ohalpin / gmail.com>:
> On 10/28/07, Robert Klemme <shortcutter / googlemail.com> wrote:
> >
> > irb(main):007:0> array = %w{apple banana apple orange}
> > => ["apple", "banana", "apple", "orange"]
> > irb(main):008:0> array.inject(Hash.new(0)) {|ha,e|
> > ha[e]+=1;ha}.delete_if {|k,v| v==1}.keys
> > => ["apple"]
> >
> Succint ~and~ efficient!

Thanks!

> Do you have a mail filter checking for any posts
> containing 'inject'? :)

I don't need that since most of them were written by me. :-) (slight
exaggeration)
*chuckle*

Kind regards

robert