Minimum Sum Partition Leetcode Sql