Question DSA-SRCH-0044
MediumWhat is the output of this code?
def isqrt(n):
lo, hi = 0, n
while lo < hi:
mid = (lo + hi + 1) // 2
if mid * mid <= n:
lo = mid
else:
hi = mid - 1
return lo
print(isqrt(80), isqrt(81), isqrt(82))
- A.
8 9 9
- B.
9 9 9
- C.
Sign up free to see the answer and a step-by-step explanation.