Given a non-negative integer x, return the square root of x rounded down to the nearest integer. You cannot use any built-in exponent function or operator.
For example, if x=8, return 2 because 8=2.828..., which rounds down to 2.
Hint: use binary search to find the largest integer k such that k2≤x. This is similar to the perfect square problem.