human
Check whether an array can be made strictly increasing by removing at most one element | Function to find if is it possible to make the array strictly increasing by removing at most one element.
Stores the count of numbers that are needed to be removed.
Store the index of the element that needs to be removed.
Traverse the range [ 1 , N - 1 ].
If arr [ i - 1 ] is greater than or equal to arr [ i ].
Increment the count by 1.
Update index.
If count is greater than one.
If no element is removed.
If only the last or the first element is removed.
If a [ index ] is removed.
If a [ index - 1 ] is removed.
Driver Code"
Solution in Python:
assistant
#Here is code to check whether an array can be made strictly increasing by removing at most one element and the other steps required.
 def check ( arr , n ) :
	count = 0
	index = - 1
	for i in range ( 1 , n ) :
		if ( arr [ i - 1 ] >= arr [ i ] ) :
			count += 1
			index = i
	if ( count > 1 ) :
		return False
	if ( count == 0 ) :
		return True
	if ( index == n - 1 or index == 1 ) :
		return True
	if ( arr [ index - 1 ] < arr [ index + 1 ] ) :
		return True
	if ( arr [ index - 2 ] < arr [ index ] ) :
		return True
	return False
if __name__ == ' _ _ main _ _ ' :
	arr = [ 1 , 2 , 5 , 3 , 5 ]
	N = len ( arr )
	if ( check ( arr , N ) ) :
		print ( " Yes " )
	else :
		print ( " No " )