Available question text
Find the longest contiguous subarray whose product is positive. The array can be split by zeros into independent segments, and within each segment the parity of negative numbers (or tracking lengths of subarrays with positive/negative product) determines whether the whole segment or a trimmed prefix/suffix gives the maximum length.
Related questions
Continue with questions that share topics or the same question type.
- Maximum Length of Repeated Subarray
Coding
- Maximum Product of the Length of Two Palindromic Subsequences
Coding
- Maximum Product of the Length of Two Palindromic Substrings
Coding
- Maximum Product Subarray
Coding · Array · Dynamic Programming
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
No company association
Leetcode 1567. Maximum Length of Subarray With Positive Product
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source