Pergunta de entrevista da empresa Uber

Write code to recursively replace the repeated characters in a string of numbers with their sum.