Divide Array Into Equal Parts Leetcode Javascript Interview