Let me try to give some explanations for this solution. Case 1: If there's no zero in the array Then the subarray with maximum product must start with the first element or end with the last element.
Intuition : We can get max product by either multiplying two large positive numbers or by multiplying two small negative numbers -> so we need to store the maximum as well as minimum ...
Some results have been hidden because they may be inaccessible to you
Show inaccessible results