human
Sum of the updated array after performing the given operation | Utility function to return the sum of the array.
Function to return the sum of the modified array.
Find the sum of the subarray arr [ i + 1. . . n - 1 ].
Subtract the subarray sum.
Return the sum of the modified array.
Driver code"
How can the above be solved in Python?
 What is a code to sum of the updated array after performing the given operation and the other steps required?
assistant
#Here is code to sum of the updated array after performing the given operation and the other steps required.
 def sumArr ( arr , n ) :
	sum = 0
	for i in range ( n ) :
		sum += arr [ i ]
	return sum
def sumModArr ( arr , n ) :
	for i in range ( n - 1 ) :
		subSum = 0
		for j in range ( i + 1 , n ) :
			subSum += arr [ j ]
		arr [ i ] -= subSum
	return sumArr ( arr , n )
arr = [ 40 , 25 , 12 , 10 ]
n = len ( arr )
print ( sumModArr ( arr , n ) )