If the current Mid Value is an optimal value , then try to maximize it
if canBeOptimalValue ( mid , arr , N , B ) : NEW_LINE INDENT ans = mid NEW_LINE start = mid + 1 NEW_LINE DEDENT else : NEW_LINE INDENT end = mid - 1 NEW_LINE DEDENT