Pergunta de entrevista da empresa Amazon

A dynamic programming question rated "hard" on leetcode.