Leetcode Partition Array According To Given