Amazon interview question

String manipulation that need to decode