Minimum Sum Partition Leetcode Python Beginner