RepUp interview question

Coding question was on dynamic programming