Leetcode Dynamic Programming Patterns In Python