Domanda di colloquio di HSBC

count repeated characters and replace these characters in a string