Intuit Interview Question

it was a dynamic programming question