Updating arr1 [ ] which will now store the next sequence of elements At this time , arr1 [ ] stores the remaining ' m ' on which XOR was not performed and arr2 [ ] stores the frequency of ' m ^ x ' i . e . those ' m ' on which operation was performed Updating arr1 [ ] with frequency of remaining ' m ' & frequency of ' m ^ x ' from arr2 [ ] With help of arr2 [ ] , we prevent sorting of the array again and again
for ( int i = 0 ; i <= MAX ; i ++ ) { arr1 [ i ] = arr1 [ i ] + arr2 [ i ] ;