152_Maximum Product Subarray
Question
Find the contiguous subarray within an array (containing at least one number) which has the largest product.Example 1
Input: nums = [2,3,-2,4]
Output: 6Example 2
Input: nums = [2,3,-2,4,-2]
Output: 96Idea (dynamic programing)
Complexity
Solution
Last updated