Computer Science, asked by snlchandra2381, 1 year ago

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 Anonymous
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