Frage im Vorstellungsgespräch bei Bazaarvoice

Phone Screen: write a simple compression algorithm to change aaabbbcccaabbbbc into: a3b3c3a2b4c1