Solve each query in Q
for ( int i = 0 ; i < q . length ; i ++ ) { int id = q [ i ] [ 0 ] ; if ( id == 1 ) { int L = q [ i ] [ 1 ] ; int R = q [ i ] [ 2 ] ; System . out . print ( " XOR ▁ of ▁ elements ▁ " + " in ▁ given ▁ range ▁ is ▁ " + rangeXor ( BITree , L , R ) + "NEW_LINE"); } else { int idx = q [ i ] [ 1 ] ; int val = q [ i ] [ 2 ] ; A [ idx ] ^= val ;