human
Split array into two subarrays such that difference of their maximum is minimum | Python3 Program to split a given array such that the difference between their maximums is minimized ..
Sort the array.
Return the difference between two highest elements.
Driver Program"
How can the above be solved in Python?
 ... Can you provide a code to split array into two subarrays such that difference of their maximum is minimum and the other steps required?
assistant
#Here is code to split array into two subarrays such that difference of their maximum is minimum and the other steps required.
 def findMinDif ( arr , N ) :
	arr . sort ( )
	return ( arr [ N - 1 ] - arr [ N - 2 ] )
arr = [ 7 , 9 , 5 , 10 ]
N = len ( arr )
print ( findMinDif ( arr , N ) )