From: 7stud -- Date: 2011-03-22T08:50:43+09:00 Subject: Re: Counting values in an array, storing in a hash then making an array of hashes? totals = Hash.new(0) arr = [1, 1, 2, 2, 3, 3, 1, 3] arr.each do |val| totals[val] += 1 end p totals --output:-- {1=>3, 2=>2, 3=>3} -- Posted via http://www.ruby-forum.com/.