Question DSA-SRCH-0011
MediumWhat is the output of this code?
n = 30
lo, hi = 0, n
while lo < hi:
mid = (lo + hi + 1) // 2
if mid * mid <= n:
lo = mid
else:
hi = mid - 1
print(lo)
- A.
4
- B.
25
- C.
Sign up free to see the answer and a step-by-step explanation.