Can you give me a sort of hint or an approach to start with as i m not able to understand …
moreover can is it necessary to transverse the whole array while computing
Not able to think of an approach to go with
hello @J20APPPP0006
break this problem into two parts.
part 1) find maximum xor subarray from 0 to i.
maintain an array say left[n]
from i = 0 to n-1.
compute max xor subarray possible from 0 to i and store it at left[i]. ( u have already solved this problem i.e max xor subarray in given array from 0 to n-1 but this time it is 0 to i)
part b) find maximum xor subarray from i to n-1.
do the same but from right to left
maintain an array say right[n]
from i = n-1 to 0
compute max xor subarray possible from i to n-1 and store it at right[i]. ( u have already solved this problem i.e max xor subarray in given array from 0 to n-1 but this time it is i to n-1).
now after computing left and right array.
simply compute maximum of left[i] + right[i+1]
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.