How would I reverse the elements in the hash, keeping the same values and keys, but reversing their order in the hash.
Like so:
{ \"4\" => \"happiness
if need:
hash = {:a => :x, :b => :y, :c => :y, :d => :z}
to:
{:x => [:a], :y => [:b, c], :z => [:d] }
can:
h={};hash.to_a.each{|e|h[e[1]]||=[];h[e[1]]<