human
Find pair with maximum ratio in an Array | Function to find the maximum pair possible for the array.
Loop to iterate over every possible pair in the array.
Check pair ( x , y ) as well as ( y , x ) for maximum value.
Update the answer.
Driver Code"
How can the above be solved in Python?
assistant
#Here is code to find pair with maximum ratio in an Array and the other steps required.
 def computeMaxValue ( arr , n ) :
	ans = 0
	for i in range ( n - 1 ) :
		for j in range ( i + 1 , n ) :
			val = max ( arr [ i ] / arr [ j ] , arr [ j ] / arr [ i ] )
			ans = max ( ans , val )
	return ans
if __name__ == " _ _ main _ _ " :
	arr = [ 15 , 10 , 3 , 2 ]
	n = len ( arr )
	print ( computeMaxValue ( arr , n ) )