東摸摸西摸摸就這個鬼時間了
恨恨恨恨恨
def xorQueries(self, arr: List[int], queries: List[List[int]]) -> List[int]:
cur = 0
prefix = []
for num in arr:
cur = cur^num
prefix.append(cur)
prefix.append(0) # prefix[-1]=0
ans = []
for q in queries:
ans.append(prefix[q[1]]^prefix[q[0]-1])
return ans