Array Partition Leetcode Solution 330