Back to the Problem
XOR is its own inverse: with prefix XORs P, the range XOR is P[R] ⊕ P[L−1].
Complexity: O(N + Q)