JPMorganChase interview question

2 dimensional dynamic programming . .