Pergunta de entrevista da empresa Lyft

Medium dynamic programming question from leetcode.