Kindly find the error in the code
1/4 testcases arent passing
please state the problem properly, what type of you are facing in the question. Have dry run it?
I just have gone through your code, i think you have coded for finding the maximum xor pair, but here you have find the maximum xor subarray, so here you have to maintain a prefix xor type of array as explained in the video, then your code will pass all the testcases.
Also you first check for max_xor before inserting the a[i] into the trie, initially you can update a[0] in trie but before furthur insertions, you first have to calculate the maximum xor pair for the prefix xor array which you will need to maintain.
Feel free to ask if you face anyother issue in the problem.
Problem Statement: Print xor of the subarray whose xor of all elements in subarray is maximum over all subarrays.
When submitting the code, the testcase 3 is not passing , rest testcases 0,1,2 and 4 are passing successfully.
Sorry. I got the error. I did for pair instead of subarray.
Yes it is now passing all the testcases.
Thanks for the help.