2 TEST CASE FAILED. AND IN THE RANGE XOR PDF THERE IS A MISTAKE.
while calculating the maxXOR function if we got (b==1 )i.e. in the else part and after checking that we have curr->left !=NULL and the index is valid then we should directly update the curr_xor in that. IN PDF it is written in the else part of the same condition.