if i am given an array ,how to find maximum pair xor or maiximum subarray xor etc
Array xor problems
@royprincejmp You can follow the simplest approach by checking the XOR result of all sub arrays and maintaining a variable to store the maximum subarray xor result. This would require 2 loops as below.
for(int i=0;i<n;i++)
{
res=0;
for(int j=i;j<n;j++)
{
res=res^arr[j];
maxxor=max(maxxor,res);
}
}
At the end, value stored in maxxor will be the maximum subarray xor.
Hope this helps 
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.