Subject: Re: How to remove duplicate elements in a 2D array
From: pharrington <xenogenesis gmail.com>
Date: Sun, 27 Sep 2009 01:15:04 +0900
References: 347193347223347227347231
> r.map {|x| x.first if x.first == e.first}.compact.size == 0
I'm an idiot, Ruby likes to call this pile of silliness "detect":
arry.reverse.inject([]) {|r, e| r.unshift(e) unless r.detect {|x|
x.first == e.first}; r}