Playing with data structures in Ruby
Sorting I’ve been trying to sort a mixed array in Ruby the shortest way. Each element of the array by itself is a mixed array of a number and and a hash: a = [ [0, {:a=>”31″, :b=>”21″}], [1, {:a=>”32″, :b=>”11″}], [1, {:a=>”25″, :b=>”19″}], [0, {:a=>”12″, :b=>”10″}] ] #sort by first item of each row (number) a.sort{|x,y|…