You are given an array A containing N integers. The special product of each ith integer in this array is defined as the product of the following:
Write a program to find the maximum special product of any integer in the array.
NOTE: As the answer can be large, output your answer modulo 109 + 7.
1 <= N <= 105
1 <= A[i] <= 109
First and only argument is an integer array A.
Return an integer denoting the maximum special product of any integer.
A = [1, 4, 3, 4]
A = [10, 7, 100]
For A = 3, LeftSpecialValue is 1 and RightSpecialValue is 3. So, the ans is 1*3 = 3.
There is not any integer having maximum special product > 0. So, the ans is 0.
NOTE: You only need to implement the given function. Do not read input, instead use the arguments to the function. Do not print the output, instead return values as specified. Still have a question? Checkout Sample Codes for more details.