Dupclicate_elements Jan 14th, 2017 5:11 pm http://stackoverflow.com/questions/569694/count-duplicate-elements-in-ruby-array 1 2 3 4 array = ["aa","bb","cc","bb","bb","cc"] array.each_with_object(Hash.new(0)){|w,c|c[w]+=1}.each do |w,c| puts "#{w} #{c} times" end