Company: Arcesium_18oct
Difficulty: medium
Positive Product Problem Description You are given a sequence of `n` integers, and your task is to find the longest contiguous segment whose product comes out positive. Complete the `maxLength` function in your editor. It has 1 parameter: 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. Examples Example 1: Input: 4 1 -2 -3 4 Output: 4 Explanation: Taking the whole sequence gives 1 * -2 * -3 * 4 = 24, which is positive, so the full length of 4 works. Example 2: Input: 2 -3 5 Output: 1 Explanation: Multiplying both entries gives -3 * 5 = -15, which is negative, so the full segment fails. Taking just the 5 by itself keeps the product positive, giving the best achievable length. Constraints `1 Absolute value of each number is greater than 0 and less than or equal to 1000 (i.e., `0 The locked stub code in your editor reads the following Input from stdin and passes it to your function: F