JPMorganChase Interview Question

2 dimensional dynamic programming . .