human
Sum of minimum element of all sub | Function to find the sum of minimum of all subsequence.
Driver code"
How can the above be solved in Python?
assistant
#Here is code to sum of minimum element of all sub and the other steps required.
 def findMinSum ( arr , n ) :
	occ = n - 1
	Sum = 0
	for i in range ( n ) :
		Sum += arr [ i ] * pow ( 2 , occ )
		occ -= 1
	return Sum
arr = [ 1 , 2 , 4 , 5 ]
n = len ( arr )
print ( findMinSum ( arr , n ) )