Subject: Re: Returning a duplicate from an Array
From: Pierre Pat <theyojimbo gmail.com>
Date: Thu, 15 Jan 2009 11:35:27 +0900
References: 324793324794324797324829
In-reply-to: 324829
I'd do like this:
a.select{|x| a.index(x) != a.rindex(x)}.uniq
Now, I wouldn't know which one is more efficient, but coding wise, I
like that way :-)
--
Posted via http://www.ruby-forum.com/.