Pregunta de entrevista de Amazon

String manipulation that need to decode