Company: Arcesium_16oct
Difficulty: medium
Positive Product Problem Description You are given a sequence of n integers and you have to find the maximum length of a segment which gives positive product. Complete the maxLength function in your editor. It has 1 parameters: An array, arr , containing n elements of the sequence. It must return an integer denoting the maximum length of a segment which gives positive product. Input Format The locked stub code in your editor reads the following input from stdin and passes it to your function: First line contains number of integers n in the sequence. Followed by n lines each contains an element. Output Format Your function must return an integer denoting the maximum length of a segment which gives positive product. This is printed to stdout by the locked stub code in your editor. Examples Example 1: Input: 4 1 -2 -3 4 Output: 4 Explanation: Here maximum product is 1 x -2 x -3 x 4 = 24. Example 2: Input: 2 -3 5 Output: 1 Explanation: Here if we multiply both the two numbers then our prod