human
Sum of array elements that is first continuously increasing then decreasing | Efficient python method to find sum of the elements of array that is halfway increasing and then halfway decreassing.
Driver code"
How can the above be solved in Python?
 What is a code to sum of array elements that is first continuously increasing then decreasing and the other steps required?
assistant
#Here is code to sum of array elements that is first continuously increasing then decreasing and the other steps required.
 def arraySum ( arr , n ) :
	x = ( n + 1 ) / 2
	return ( arr [ 0 ] - 1 ) * n + x * x
arr = [ 10 , 11 , 12 , 13 , 12 , 11 , 10 ]
n = len ( arr )
print ( arraySum ( arr , n ) )