MathWorks interview question

Very hard dp leetcode type of question