XOR Queries of a Subarray at Microsoft
Medium78.2% acceptance
This problem has 12.5% frequency at Microsoft.
Problem Description
You are given an array `arr` of positive integers. You are also given the array `queries` where `queries[i] = [lefti, righti]`. For each query `i` compute the **XOR** of elements from `lefti` to `righti` (that is, `arr[lefti] XOR arr[lefti + 1] XOR ... XOR arr[righti]` ). Return an array `answer`...
Read full problem and hintsTopics
Also asked at 4 companies
More Microsoft Questions
Two SumEasyMedian of Two Sorted ArraysHardContainer With Most WaterMediumLongest Common PrefixEasy3SumMedium
View all Microsoft questions