69. Sqrt(x)
Intuition
We are asked to compute the square root of a non-negative integer x
, rounded down to the nearest integer, without using any built-in functions.
Since the square root function is monotonically increasing, we can use binary search to efficiently find the answer.
Complexity
Space Complexity
Time Complexity
Code
Last updated