human
Write me a code to minimum sum of absolute difference of pairs of two arrays and the other steps required given the following:
Minimum sum of absolute difference of pairs of two arrays | Python3 program to find minimum sum of absolute differences of two arrays ..
Sort both arrays.
Find sum of absolute differences.
Both a [ ] and b [ ] must be of same size ."
How can the above be solved in Python?
assistant
#Here is code to minimum sum of absolute difference of pairs of two arrays and the other steps required.
 def findMinSum ( a , b , n ) :
	a . sort ( )
	b . sort ( )
	sum = 0
	for i in range ( n ) :
		sum = sum + abs ( a [ i ] - b [ i ] )
	return sum
a = [ 4 , 1 , 8 , 7 ]
b = [ 2 , 3 , 6 , 5 ]
n = len ( a )
print ( findMinSum ( a , b , n ) )