Beyond Limits interview question

An Easier Dynamic Programming question