WhiteHat Jr interview question

compress a given string