Question d’entretien chez Goldman Sachs

Dynamic Programming question on strings