← All problemsSign in

Binary Query Array

Some problems appear hard though they are very easy. Today Shreyas is stuck in a range query problem. He has been given an array with only numbers 0 and 1. There are two types of queries - **0 L R** : Check whether the number formed from the array elements L to R, when converted from its binary to decimal number, is even or odd and print EVEN or ODD respectively. Number formation is the binary

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start