Pregunta de entrevista de Ancestry

Dynamic programming problem related to strings