Find the position following the peak condition and have maximum leftIncreasing [ i ] + rightIncreasing [ i ]
for i in range ( len ( arr ) ) : NEW_LINE INDENT if ( leftIncreasing [ i ] != 0 and rightIncreasing [ i ] != 0 ) : NEW_LINE INDENT result = max ( result , leftIncreasing [ i ] + rightIncreasing [ i ] ) ; NEW_LINE DEDENT DEDENT return len ( arr ) - ( result + 1 ) NEW_LINE