Function to print the number of characters having odd frequencies for each query
static void queryResult ( int prefix [ ] , pair Q ) { int l = Q . first ; int r = Q . second ; if ( l == 0 ) { int xorval = prefix [ r ] ; System . out . print ( Integer . bitCount ( xorval ) + "NEW_LINE"); } else { int xorval = prefix [ r ] ^ prefix [ l - 1 ] ; System . out . print ( Integer . bitCount ( xorval ) + "NEW_LINE"); } }