Goldman Sachs interview question

5. Hackerrank questions on dynamic programming