human
Maximum AND value of a pair in an array | Function for finding maximum and value pair.
Driver function"
How can the above be solved in Python?

Give me a code to maximum AND value of a pair in an array and the other steps required?
assistant
#Here is code to maximum AND value of a pair in an array and the other steps required.
 def maxAND ( arr , n ) :
	res = 0
	for i in range ( 0 , n ) :
		for j in range ( i + 1 , n ) :
			res = max ( res , arr [ i ] & arr [ j ] )
	return res
arr = [ 4 , 8 , 6 , 2 ]
n = len ( arr )
print ( " Maximum ▁ AND ▁ Value ▁ = ▁ " , maxAND ( arr , n ) )