Pregunta de entrevista de Lyft

Medium dynamic programming question from leetcode.