Rod Cutting Problem Leetcode