Microsoft Interview Question

A dynamic programming question was asked