Thursday, June 25, 2015

find numbers that are same in an array ruby

a = [0,1,2,2,3,3]
x = a.find_all { |e| a.count(e) > 1 }
   
p x