From: "Peña, Botp" Date: 2007-08-21T17:16:52+09:00 Subject: Re: Detecting duplicates in an array, anything in the standa From: Jimmy Kofler [mailto:koflerjim@mailinator.com] # uniq.map {|v| (self - [v]).size < (self.size - 1) ? v : nil}.compact cool. could we simplify it like, irb(main):014:0> a => [1, 1, 2, 2, 2, 4, 3] irb(main):015:0> a.select{|e| (a-[e]).size < a.size - 1}.uniq => [1, 2] kind regards -botp