class Solution:
def xorQueries(self, arr: List[int], queries: List[List[int]]) -> List[int]:
dp = [0]
for a in arr:
dp.append(dp[-1]^a)
ans = []
for q in queries:
ans.append(dp[q[0]]^dp[q[1]+1])
return ans