Min Path Sum Leetcode Solution Python