nums
, find a contiguous non-empty subarray within the array that has the largest product and return the product.
maximumProduct([2, 3, -2, 4]) → 6
maximumProduct([-2, 0, -1]) → 0
maximumProduct([-1, -1, -2, -4]) → 8
😳 TIME LEFT: seconds 😳
function maximumProduct(nums) {
}
⏰ TOTAL TIME: seconds ⏰