Pocket Gems interview question

I was asked about how to use dynamic programming