Squarepoint Capital interview question

-> Leetcode Medium on Dynamic programming