RCKR Software interview question

String reverse and string compression