Now check if array becomes sorted for cases like { 4 , 1 , 2 , 3 }
for i in range ( 1 , n ) : NEW_LINE INDENT if arr [ i ] < arr [ i - 1 ] : NEW_LINE INDENT return False NEW_LINE DEDENT DEDENT return True NEW_LINE