Frage im Vorstellungsgespräch bei Happen Bank

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