Medium · Arrays
Max product of subarray
Given a non-empty integer array nums, return the largest product of any non-empty contiguous subarray.
Examples
Example 1
[2,3,-2,4]Output: 6
Example 2
[-2,3,-4]Output: 24
Rebuild it in the studio
Open every published interview problem, solution, scene, and memory room free, with no account.