• + 0 comments

    You could simplify your code a smidge, and save a little processing power, by removing your final for loop, and putting in an if check in the second to last loop, like this:

    for (let j = 1; j < n; j++) {
    	arr[j] += arr[j-1];
    	
    	if (arr[i] > biggest) {
    		biggest = arr[i];
    	}
    }