Intel Corporation Interview Question

dynamic programming problem was a 2d one.