class Solution {
public:
vector<int> xorQueries(vector<int>& arr, vector<vector<int>>& queries) {
int N = arr.size();
vector<int> pre(N+1,0);
for(int i=1;i<=N;i++){
pre[i] = pre[i-1] ^ arr[i-1];
}
vector<int> ans;
for(int i=0;i<queries.size();i++){
int L = queries[i][0];
int R = queries[i][1];
ans.push_back(pre[R+1]^pre[L]);
}
return ans;
}
};