human
What is a code to shortest Un and the other steps required given the following:
Shortest Un | Bool function for checking an array elements are in increasing.
Bool function for checking an array elements are in decreasing.
increasing and decreasing are two functions . if function return True value then print 0 otherwise 3..
Driver code"
How can the above be solved in Python?
assistant
#Here is code to shortest Un and the other steps required.
 def increasing ( a , n ) :
	for i in range ( 0 , n - 1 ) :
		if ( a [ i ] >= a [ i + 1 ] ) :
			return False
	return True
def decreasing ( a , n ) :
	for i in range ( 0 , n - 1 ) :
		if ( a [ i ] < a [ i + 1 ] ) :
			return False
	return True
def shortestUnsorted ( a , n ) :
	if ( increasing ( a , n ) == True or decreasing ( a , n ) == True ) :
		return 0
	else :
		return 3
ar = [ 7 , 9 , 10 , 8 , 11 ]
n = len ( ar )
print ( shortestUnsorted ( ar , n ) )