human
Minimum sum of values subtracted from array elements to make all array elements equal | Function to find the sum of values removed to make all array elements equal.
Stores the minimum of the array.
Stores required sum.
Traverse the array.
Add the value subtracted from the current element.
Return the total sum.
Driver Code.
Function Call"
How can the above be solved in Python?
 ... Write me a code to minimum sum of values subtracted from array elements to make all array elements equal and the other steps required?
assistant
#Here is code to minimum sum of values subtracted from array elements to make all array elements equal and the other steps required.
 def minValue ( arr , n ) :
	minimum = min ( arr )
	sum = 0
	for i in range ( n ) :
		sum = sum + ( arr [ i ] - minimum )
	return sum
if __name__ == ' _ _ main _ _ ' :
	arr = [ 1 , 2 , 3 ]
	N = len ( arr )
	print ( minValue ( arr , N ) )