MathWorks Interview Question

Dynamic programming and array manipulation questions.