Google Interview Question

Dynamic Programming Question from Leetcode