Amazon Interview Question

String manipulation that need to decode