Search
⌘K

Leetcode 1310. XOR Queries of a Subarray

Given an array and many queries [left, right], return the XOR of elements in each subarray arr[left..right]. Precompute a prefix-xor array to answer each query in O(1) after O(n) preprocessing, suitable for large inputs.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.