human
Largest gap in an array | function to solve the given problem.
finding maximum and minimum of an array.
Driver code"
How can the above be solved in Python?
 Write me a code to largest gap in an array and the other steps required?
assistant
#Here is code to largest gap in an array and the other steps required.
 def solve ( a , n ) :
	min1 = a [ 0 ]
	max1 = a [ 0 ]
	for i in range ( n ) :
		if ( a [ i ] > max1 ) :
			max1 = a [ i ]
		if ( a [ i ] < min1 ) :
			min1 = a [ i ]
	return abs ( min1 - max1 )
if __name__ == " _ _ main _ _ " :
	arr = [ - 1 , 2 , 3 , 4 , - 10 ]
	size = len ( arr )
	print ( " Largest ▁ gap ▁ is ▁ : ▁ " , solve ( arr , size ) )