Pregunta de entrevista de CEVA

SW question: convert string of letters to "short format". For example: "aaabbccccaa" would be "3a2b4c2a"