Pregunta de entrevista de Amazon

String manipulation and dynamic programming questions