2 test cases not working pls check

I don’t understand why you are using trie for this question. This is just a simple brute force question in n squared time complexity. Just iterate over all the subarrays and calculate the xor of each and print the maximum xor.

can you pls send me a code for reference

int ans = 0;
for(int i=0;i<n;i++)
{
int xor = 0;
for(int j=i;j<n;j++)
{
xor ^= A[j];
ans = Math.max(ans, xor);
}
}

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.

We use Trie to reduce the time complexity to O(N).