Leetcode Dynamic Programming Grandmaster Caz