Intuit interview question

Dynamic programming related coding question