Hi there leetcoders,
I can't digest why the expected output of the testcase [-2, 3 -4] is 24? The numbers aren't contiguous!!
And how do you obtain 24? |-2| * |3| * |-4| ???? Weird! Haaallppp!!!
I don't understand your question. -2 * 3 * -4 is indeed equal to 24. And it is a contiguous subarray (which happens to be the array itself).
Hmm, actually I had the same understanding with you. I thought that a continuous subarray should be like [2,3,4] or [4,3,2], or [-2,-3,-4], and like that.
But a continuous subarray means that the indice are continuous not the actually numbers. So, [-2,3,-4] is actually a continuous subarray which has the maximum product of 24.
Sub array contiguous, not meaning that the numbers are contiguous.
That means, for example you have Array called a, contiguous sub array means that : a,a,a or a,a,a or a,a,a
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.