You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Mind product in the current contiguous array. We need this value in case we encounter 2 negative numbers whose product could potentially give us the max product of the entire array
let currentMin = nums[0];
// Max product of a contiguous array
let finalMax = nums[0];
for(let i = 1; i < nums.length; i++){
let temp = currentMax
// Because we are looking for a contiguous subarray product, the current max must contain the current number in the array.