Codcor interview question

Compress and decompress the string