1567. Maximum Length of Subarray With Positive Product
https://leetcode.com/problems/maximum-length-of-subarray-with-positive-product
Description
Given an array of integers nums
, find the maximum length of a subarray where the product of all its elements is positive.
A subarray of an array is a consecutive sequence of zero or more values taken out of that array.
Return the maximum length of a subarray with positive product.
Example 1:
Example 2:
Example 3:
Example 4:
Example 5:
Constraints:
1 <= nums.length <= 10^5
-10^9 <= nums[i] <= 10^9
ac
Previous1566. Detect Pattern of Length M Repeated K or More TimesNext1568. Minimum Number of Days to Disconnect Island
Last updated