Algorithm · Oracle · Medium
Given an integer array, identify the non-empty contiguous segment whose elements produce the greatest possible product. Your solution must run in O(n) time. Input An integer array nums with 1 <= nums.length <= 2 * 10^4 and -10 <= nums[i] <= 10. Output Return an integer equal to the largest product obtainable from any contiguous subarray. Example Example
Checking your access…