Amazon Interview Question

String manipulation and String decode