← All problemsSign in

The tricky gift

Steve Jobs like to play with numbers. Bill Gates gifted him an array of numbers of size N consisting of non-negative integers only and having indexes from 1 to N. Bill asked Steve to find xor of these N numbers. But the problem was too easy. To make it tricky, Bill added two simple terms Low(i) and High(i) which are defined as :- - Low(i): The minimum-possible index j from i, where 1 ≤ j ≤ i suc

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