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
Read every interview problem free. Ten rooms need no account. A token opens a problem in full — Pro never counts.