human
Minimum cost to empty Array where cost of removing an element is 2 ^ ( removed_count ) * arr [ i ] | Function to find the minimum cost of removing elements from the array.
Sorting in Increasing order.
Loop to find the minimum cost of removing elements.
Driver Code.
Function call"
How can the above be solved in Python?
 Give me a code to minimum cost to empty Array where cost of removing an element is 2 ^ ( removed_count ) * arr [ i ] and the other steps required?
assistant
#Here is code to minimum cost to empty Array where cost of removing an element is 2 ^ ( removed_count ) * arr [ i ] and the other steps required.
 def removeElements ( arr , n ) :
	arr . sort ( reverse = True )
	ans = 0
	for i in range ( n ) :
		ans += arr [ i ] * pow ( 2 , i )
	return ans
if __name__ == " _ _ main _ _ " :
	n = 4
	arr = [ 3 , 1 , 2 , 3 ]
	print ( removeElements ( arr , n ) )