From: "Thairuby ->a, b {a + b}" Date: 2009-09-26T02:57:24+09:00 Subject: Re: How to remove duplicate elements in a 2D array I think you want an array with unique member. If the member is not unique then return the last occur of it. arr=[[ 'a',1,2,3], ['b',4,5,6], ['c',3,2,1], ['a',1.3,2.2,3,3], ['a', 2,1,3], ['a',2.1,1.5,3]] result = arr.inject({}){|x,y| x[y[0]]=y[1..-1]; x}.map(&:flatten) p result # [["a", 2.1, 1.5, 3], ["b", 4, 5, 6], ["c", 3, 2, 1]] -- Posted via http://www.ruby-forum.com/.