Pocket Gems interview question

Online Assessment: Dynamic Programming question