Minimum Sum Partition Leetcode Sql Window