Available question text
For each query, determine whether the subarray's adjacent elements strictly alternate parity (no two consecutive numbers share the same parity). With up to 1e5 elements and queries, the core challenge is to preprocess adjacent same-parity markers so each query can be answered in O(1) by checking if any same-parity adjacent pair exists in the range.
Related questions
Continue with questions that share topics or the same question type.
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 3152. Special Array II
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source