Explain me with the help of test cases

sir help me with the help of 2-3 test cases

sir plzz help me to understand the question

hello @singh.pankhil40
what is not clear to u in this question?

like how to approach the question like we can xor 1 with 8 also to get max xor but we have xor it with 2 in the sample case

so have u solved max xor subarray problem?

yes in that we have taken cumulative xor and we have taken pair of xor which give max xor subarray

ok then this will be very easy for u.

what u need to do is u need to iterate to each index i and then simply find
max xor subarray in [0,i] and [i+1,n-1] , add both sum check if it greater than ur previous sum , if it is then update ur sum.

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.