Solution related Problem

why do we need to create two arrays LBest and RBest in order to find the solution …

hello @Pramod123
basically we need to calculate maximum sum of xor of two subarrays right?
so the idea is .to split given array into two parts.and find first max xor subarray in one part and second max xor subarray in another part and calculate their sum.

the reason of partition is to ensure that the considered subarray do not intersect.
and this reason why we have lbest and rbest.

lbest[i] = will tell u max xor subarray when array [0…i] is considered
lbest[i] = will tell u max xor subarray when array [i…n-1] is considered

ok …then size of the array always be in even or in odd while
what if the size is 5 and how can i divide it and plzz… explain alsso for 6.

we can divide 5 in following ways.

{1,4}
{2,3}
{3,2}
{4,1}

do similar with 6.
no point of odd and even.