Pergunta de entrevista da empresa Contentsquare

transform a string "aaabbacc" to a list[(a,3),(b,2),(a,1),(c,2)]