Monotonic search

Why was it set end=n and not n-1.

Also he set condition as ansans<n. Shouldn’t it be ansans < = n as explained?

@sonalbera
1 sq root is 1 so better to do end =n
Also if mid into mid == n then we return the ans and if less than n then make s mid+1 else e mid -1