Company: Arcesium_17oct
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: The segment `[1, -2, -3, 4]` has a product of `1 * -2 * -3 * 4 = 24`, which is positive. Its length is 4. No other segment has a greater