human
Maximum length of Strictly Increasing Sub | Function to return the maximum length of strictly increasing subarray after removing atmost one element.
Create two arrays pre and pos.
Find out the contribution of the current element in array [ 0 , i ] and update pre [ i ].
Find out the contribution of the current element in array [ N - 1 , i ] and update pos [ i ].
Calculate the maximum length of the stricly increasing subarray without removing any element.
Calculate the maximum length of the strictly increasing subarray after removing the current element.
Driver code"
How can the above be solved in Python?

=====
Can you provide a code to maximum length of Strictly Increasing Sub and the other steps required?
assistant
#Here is code to maximum length of Strictly Increasing Sub and the other steps required.
 def maxIncSubarr ( a , n ) :
	pre = [ 0 ] * n ;
	pos = [ 0 ] * n ;
	pre [ 0 ] = 1 ;
	pos [ n - 1 ] = 1 ;
	l = 0 ;
	for i in range ( 1 , n ) :
		if ( a [ i ] > a [ i - 1 ] ) :
			pre [ i ] = pre [ i - 1 ] + 1 ;
		else :
			pre [ i ] = 1 ;
	l = 1 ;
	for i in range ( n - 2 , - 1 , - 1 ) :
		if ( a [ i ] < a [ i + 1 ] ) :
			pos [ i ] = pos [ i + 1 ] + 1 ;
		else :
			pos [ i ] = 1 ;
	ans = 0 ;
	l = 1 ;
	for i in range ( 1 , n ) :
		if ( a [ i ] > a [ i - 1 ] ) :
			l += 1 ;
		else :
			l = 1 ;
		ans = max ( ans , l ) ;
	for i in range ( 1 , n - 1 ) :
		if ( a [ i - 1 ] < a [ i + 1 ] ) :
			ans = max ( pre [ i - 1 ] + pos [ i + 1 ] , ans ) ;
	return ans ;
if __name__ == ' _ _ main _ _ ' :
	arr = [ 1 , 2 ] ;
	n = len ( arr ) ;
	print ( maxIncSubarr ( arr , n ) ) ;