WD interview question

Compress string