list.group_by(&:capitalize).map {|k,v| [k, v.length]} #=> [["Master of puppets", 3], ["Enter sandman", 2], ["Nothing else matters", 1]]