human
Sum of minimum element of all subarrays of a sorted array | Function to find the sum of minimum of all subarrays.
Driver code"
How can the above be solved in Python?
assistant
#Here is code to sum of minimum element of all subarrays of a sorted array and the other steps required.
 def findMinSum ( arr , n ) :
	sum = 0
	for i in range ( 0 , n ) :
		sum += arr [ i ] * ( n - i )
	return sum
arr = [ 3 , 5 , 7 , 8 ]
n = len ( arr )
print ( findMinSum ( arr , n ) )