Given an array a that contains n integers (may be positive, negative or zero). Find the product of the maximum product subarray
Answers
Answered by
0
Answer:
Explanation:
1 <= n <= 10^5
1 <= k <= n
Examples:
Input : A[] = {1, 2, 0, 3},
k = 2
Output : 6
Explanation : Subsequence containing elements
{2, 3} gives maximum product : 2*3 = 6
Input : A[] = {1, 2, -1, -3, -6, 4},
k = 4
Output : 144
Explanation : Subsequence containing {2, -3,
-6, 4} gives maximum product : 2*(-3)*(-6)*4
= 144
Similar questions
Physics,
6 months ago
Computer Science,
6 months ago
Math,
6 months ago
Computer Science,
1 year ago
Computer Science,
1 year ago
Chemistry,
1 year ago