Question d’entretien chez Happen Bank

Algorithm question: compressing the String. e.g. aaabbb->a3b3