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/.