human
Maximum sum of difference of adjacent elements | To find max sum of permutation.
Base case.
Otherwise max sum will be ( n * ( n - 1 ) / 2 ) - 1 + n / 2.
Driver program to test maxSum ( )"
How can the above be solved in Python?

=====
Give me a code to maximum sum of difference of adjacent elements and the other steps required?
assistant
#Here is code to maximum sum of difference of adjacent elements and the other steps required.
 def maxSum ( n ) :
	if ( n == 1 ) :
		return 1
	else :
		return int ( ( n * ( n - 1 ) / 2 ) - 1 + n / 2 )
n = 3
print ( maxSum ( n ) )