Maximum Product Subarray
viaLeetCode
Given an integer array, find the contiguous subarray with the largest product and return that product. Handle negative numbers and zeros by tracking both the running maximum and minimum products.
asked …
Given an integer array, find the contiguous subarray with the largest product and return that product. Handle negative numbers and zeros by tracking both the running maximum and minimum products.