>>470
ary.group_by{|e|e}.to_a.select{|e|e[1].size>1}.map(&:first)
とか
ary.sort.each_cons(2).select{|x,y|x==y}.map(&:first).uniq
とか