Split Array Largest Sum Leetcode Javascript