set indexes for bottom left element
i , j = m - 1 , 0 NEW_LINE INDENT while ( i >= 0 and j < n ) : NEW_LINE INDENT if ( mat [ i ] [ j ] == x ) : NEW_LINE INDENT return True ; NEW_LINE DEDENT if ( mat [ i ] [ j ] > x ) : NEW_LINE INDENT i -= 1 NEW_LINE DEDENT DEDENT DEDENT