Partition Array Into Two Parts Leetcode Javascript 30