Minimum Sum Partition Leetcode Javascript Interview