Nokia interview question

Given a string a = 'aabcccdeaaa' output '2b3de3'