Leetcode 69 Solution
This article provides solution to leetcode question 69 (sqrtx)
Access this page by simply typing in "lcs 69" in your browser address bar if you have bunnylol configured.
Leetcode Question Link
https://leetcode.com/problems/sqrtx
Solution
class Solution:
def mySqrt(self, x: int) -> int:
l = 0
r = x
while l < r:
m = (l + r + 1) // 2
if m * m > x:
r = m - 1
else:
l = m
return l