3)

totals = []

boards = [
   [
      [1,1,1],
      [1,1,1],
      [1,1,1]
   ],

   [
      [2,2,2],
      [2,2,2],
      [2,2,2]
   ]
]

board_totals = []

boards.each do |this_board|
  this_board_totals = Hash.new(0)

  this_board.each do |row|
    row.each do |val|
      this_board_totals[val] += 1
    end
  end

  board_totals << this_board_totals
end

p board_totals

--output:--
[{1=>9}, {2=>9}]

-- 
Posted via http://www.ruby-forum.com/.