Pergunta de entrevista da empresa Amazon

dynamic programming question from leetcode