A solution in Ruby to boggle