You are given an array of size N. you are also given M queries with each query Qi having a number k. you can perform the following operation during each query: XOR each element of A with k. Now,the answer to the query is the mex of A.
let R be an array of size M.the with element in R must be the answer to the ith query. your task is to return R. Note:-> A returns to its original state after each query. Constraints:-> 1<=N<=10^5 1<=M<=10^5