Pergunta de entrevista da empresa Sony

Given a string ("aaaabbbccc") print out how many times each character appears in the string.