Goldman Sachs interview question

Dynamic Programming question on strings