human
Maximum XOR of Two Numbers in an Array | Function to return the maximum xor.
Calculating xor of each pair.
Driver Code"
How can the above be solved in Python?
assistant
#Here is code to maximum XOR of Two Numbers in an Array and the other steps required.
 def max_xor ( arr , n ) :
	maxXor = 0 ;
	for i in range ( n ) :
		for j in range ( i + 1 , n ) :
			maxXor = max ( maxXor , \ arr [ i ] ^ arr [ j ] ) ;
	return maxXor ;
if __name__ == ' _ _ main _ _ ' :
	arr = [ 25 , 10 , 2 , 8 , 5 , 3 ] ;
	n = len ( arr ) ;
	print ( max_xor ( arr , n ) ) ;