human
Can you provide a code to minimum cost to make array size 1 by removing larger of pairs and the other steps required given the following:
Minimum cost to make array size 1 by removing larger of pairs | function to calculate the minimum cost.
Minimum cost is n - 1 multiplied with minimum element ..
driver code"
How can the above be solved in Python?
assistant
#Here is code to minimum cost to make array size 1 by removing larger of pairs and the other steps required.
 def cost ( a , n ) :
	return ( ( n - 1 ) * min ( a ) )
a = [ 4 , 3 , 2 ]
n = len ( a )
print ( cost ( a , n ) )