Returns XOR of arr [ 0. . index ] . This function assumes that the array is preprocessed and partial XORs of array elements are stored in BITree [ ] .
function getXOR ( BITree , index ) { let ans = 0 ; index += 1 ;