From: Sylvain Joyeux Date: 2005-10-19T08:11:14+09:00 Subject: Re: How to get non-unique elements from an array? > � � � �run_benchmark(bx, 'jegII', iterations) { seen = > Hash.new(0);a.select { |e| (seen[e] += 1) > 1 }.uniq } I think you could improve this one a bit by simply doing { seen = Hash.new(0); a.select { |e| (seen[e] += 1) == 2 } } Regards Sylvain