Please tell what’s the meaning of int*arr=new intn; and I think first x should be found via the findMaxXorPair and then x should be inserted as discussed in the approach and also tell the use of curr_xor+=pow(2,j);
Please tell the errors in this one
hello @cbcao263
this is standard syntax for dynamic allocation of memory to n size array.( search on internet -> how to dynamically allocate memory to array.)
both are correct,In ur approach u might need to workout for last element of array after the loop end.
curr_xor+=pow(2,j);
if we find that jth bit is going to remain set in the resultant xor,then we are add 2^j to our answer i,e curr_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.