Painters Partition Problem Leetcode