Getting wrong answer in two test cases
Here is the code: https://ide.codingblocks.com/s/124214
Range Xor Wrong answer
you have miss a case:
there may be two no whose xor with x give same ans you have to choose max of them
if ((x^v[i])==max_XOR){
max_XOR =max(max_XOR,x^v[i]);
if(max_XOR==x*v[i])max_index=i;
}
Replacing my if condition with your’s is giving a garbage value as ouput.