Synactive interview question

Write a program to compress a string. If input is "aabbb" expected output is "a2b3"