Pregunta de entrevista de Ticketfly

Given string write code that generate the output aaaabbb -> b aaabbbcccdd -> abc abc -> abc aabbbccdda -> ba