RosettaCodeData/Task/Remove-duplicate-elements/Ruby/remove-duplicate-elements.rb

4 lines
112 B
Ruby

ary = [1,1,2,1,'redundant',[1,2,3],[1,2,3],'redundant']
uniq_ary = ary.uniq
# => [1, 2, "redundant", [1, 2, 3]]