Range queries: is the subarray parity-alternating

0
Remix

Call an array special when every pair of neighbouring elements has different parity (one odd, one even). Given an integer array and many queries [from, to], answer for each query whether that subarray is special. Precompute so each query takes constant time.

GoogleTechnical phone screenLast asked Jan 2026
No answer yet. Write the first one; the best answer gets endorsed.