ENGXOR TLE?

CodeChef: Practical coding for everyone (is my edited solution)
can anyone please tell me why I am having TLE in the second case and how to fix it?
I made changes to the code, but I am still getting TLE :frowning:

bro you have applied the naive/brute approach…Just try some testcases on notebook by taking an array and applied 10 to 20 querries on that array and observe the answers in notebook then you get it easily…In this question observation is important…if you get the answers in notebook then after observe the answers carefully you will get it…And i also get TLE in both subtask 1 and subtask2 in contest then after spending time i get it…

For every query you don’t need to compute xor for all elements and check number of set bits.
You can refer to below link:

I made edits to the code using the link you suggested but still not yet there :frowning:

Hi, here is my solution:
https://www.codechef.com/viewsolution/30230132