Block interview question

Standard Leetcode Problems. Dynamic Programming