Return to Snippet

Revision: 1274
at September 27, 2006 10:00 by gdonald


Updated Code
#!/usr/bin/env ruby

a = [0,1,2,3,4,5,2,3]
p a.select{|e| a.index(e) != a.rindex(e)}.uniq

Revision: 1273
at September 27, 2006 10:00 by gdonald


Initial Code
#!/usr/bin/ruby

a = [0,1,2,3,4,5,2,3]
p a.select{|e| a.index(e) != a.rindex(e)}.uniq

Initial URL

                                

Initial Description

                                

Initial Title
ruby array unique

Initial Tags
array

Initial Language
Ruby