human
XOR of all subarray XORs | Set 2 | Returns XOR of all subarray xors.
if even number of terms are there , all numbers will appear even number of times . So result is 0..
else initialize result by 0 as ( a xor 0 = a ).
Driver code"
Solution in Python:
assistant
#Here is code to xOR of all subarray XORs and the other steps required.
 def getTotalXorOfSubarrayXors ( arr , N ) :
	if ( N % 2 == 0 ) :
		return 0
	res = 0
	for i in range ( 0 , N , 2 ) :
		res ^= arr [ i ]
	return res
if __name__ == " _ _ main _ _ " :
	arr = [ 3 , 5 , 2 , 4 , 6 ]
	N = len ( arr )
	print ( getTotalXorOfSubarrayXors ( arr , N ) )