We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b6b5f8d commit 8ae924dCopy full SHA for 8ae924d
solution/0069.sqrt-x/Solution2.py
@@ -0,0 +1,9 @@
1
+# Newton's Method [python2] - 28ms
2
+
3
+class Solution(object):
4
+ def mySqrt(self, x):
5
+ r = x
6
+ while r * r > x:
7
+ r = (r + x/r)/2
8
9
+ return r
0 commit comments