Partition Array Into Two Parts Leetcode Problems Js