Array Partition Leetcode Solution 862