Condition if the column contains the 1 at this position of matrix
if ( mat [ i ] [ mid ] == 1 ) : NEW_LINE INDENT if ( mid == 0 ) : NEW_LINE INDENT ans = 0 NEW_LINE break NEW_LINE DEDENT elif ( mat [ i ] [ mid - 1 ] == 0 ) : NEW_LINE INDENT ans = mid NEW_LINE break NEW_LINE DEDENT DEDENT if ( mat [ i ] [ mid ] == 1 ) : NEW_LINE INDENT high = mid - 1 NEW_LINE DEDENT else : NEW_LINE INDENT low = mid + 1 NEW_LINE DEDENT