Microsoft interview question

A dynamic programming question was asked