Cutting Rod Dynamic Programming Leetcode Question