Dynamic Programming Questions Leetcode 752