The method I'm using is under assumption that we are returning the floor(integer) of the actual squareroot value. The idea is from 1 to x/2, I test if i * i > x, if so, return i-1;

Time should be: O(m), m is the value I need to scan, but since m^2 <= x, m <= log(x), so time is: O(log(x)).

But I still got TLE error when x is large, could someone help?

```
if(x <= 0) return 0;
if(x == 1) return 1;
int i = 1;
for(; i <= x/2; i++){
if(i*i > x){
return i-1;
}
}
return i; // It should never run into this line;
```