1function maxSubArray(nums) {2 // Your code here3}
Solve the problem first before reviewing the solution!