Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 3152. Special Array II
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.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.