human
Minimum cost to merge numbers from 1 to N | Function returns the minimum cost.
Min Heap representation.
Add all elements to heap.
First minimum.
Second minimum.
Multiply them.
Add to the cost.
Push the product into the heap again.
Return the optimal cost.
Driver code"
How can the above be solved in Python?

Write me a code to minimum cost to merge numbers from 1 to N and the other steps required?
assistant
#Here is code to minimum cost to merge numbers from 1 to N and the other steps required.
 def GetMinCost ( N ) :
	pq = [ ]
	for i in range ( 1 , N + 1 , 1 ) :
		pq . append ( i )
	pq . sort ( reverse = False )
	cost = 0
	while ( len ( pq ) > 1 ) :
		mini = pq [ 0 ]
		pq . remove ( pq [ 0 ] )
		secondmini = pq [ 0 ]
		pq . remove ( pq [ 0 ] )
		current = mini * secondmini
		cost += current
		pq . append ( current )
		pq . sort ( reverse = False )
	return cost
if __name__ == ' _ _ main _ _ ' :
	N = 5
	print ( GetMinCost ( N ) )