481. Maximum Length of Subarray with Positive Product
Given an array of integers nums, determine the maximum length of a subarray where the product of all its elements is positive. A subarray is a contiguous sequence of zero or more values taken from the array. Return the maximum length of a subarray with a positive product. Note that the product value cannot be zero.
The first line contains a single integer N, representing the length of the array. The second line contains N space-separated integers, representing the elements of the array.
An integer denoting the maximum length of a subarray with a positive product.
5 0 1 -2 -3 -9
1 <= N < 10^5 -10^5 <= nums[i] <= 10^5