题目:
题解:
class Solution:
def isPerfectSquare(self, num: int) -> bool:
x0 = num
while True:
x1 = (x0 + num / x0) / 2
if x0 - x1 < 1e-6:
break
x0 = x1
x0 = int(x0)
return x0 * x0 == num