Leetcode 561 Array Partition Algorithm