Maximize Subarray Product
ARRAY
DYNAMIC PROGRAMMING
Problem
Given an integer array nums
, implement a function to find the subarray that yields the largest product and return this maximum product.
Examples
maxSubarray([-2, 3, -4, 1]) // return 24 // Why? Largest subarray is [-2, 3, -4] which is 24
Loading...
Loading...Loading...