Array Partition Leetcode Solution 1984