Dynamic Programming Questions Leetcode Two