Binary Search
it = bisect_left ( Ans , maximumIndexReached - B ) NEW_LINE if ( it not in Ans ) : NEW_LINE INDENT break NEW_LINE DEDENT if ( it == maximumIndexReached - B ) : NEW_LINE INDENT maximumIndexReached -= 1 NEW_LINE DEDENT else : NEW_LINE INDENT break NEW_LINE DEDENT return maximumIndexReached NEW_LINE