class Solution: # @param x, an integer # @return an integer def sqrt(self, x): a=1000.0#guess new_a=(a*1.0+x/a)/2 while int(new_a)!=int(a): a=new_a new_a=(a*1.0+x/a)/2 return int(a)
Subscribe to:
Post Comments
(
Atom
)
No comments :
Post a Comment