Citadel Securities Interview Question

leetcode coding problem. 2D dynamic programming.