Cutting Rod Dynamic Programming Leetcode