From: "Peña, Botp" Date: 2007-08-21T17:22:26+09:00 Subject: Re: Detecting duplicates in an array, anything in the standa From: Peña, Botp [mailto:botp@delmonte-phil.com] # irb(main):015:0> a.select{|e| (a-[e]).size < a.size - 1}.uniq # => [1, 2] oops, irb(main):014:0> a => [1, 1, 2, 2, 2, 4, 3] irb(main):015:0> a.uniq.select{|e| (a-[e]).size < a.size - 1} => [1, 2]