RetailMeNot interview question

Lots of dynamic programming