```
class Solution {
public:
int sqrt(int n) {
double x = n;
double y = 1;
double e = 0.0000000001; /* e decides the accuracy level*/
while(x - y >= e)
{
x = y + (x - y)/2;
y = n/x;
}
return (int)(x);
}
};
```

I have an accepted C++ solution for using babylonian method. Any clue what's the complexity? I see different results everywhere.