112. Sqrt(x)

Return the integer part of the square root of a non-negative number x.
Example 1
Input: x = 4
Output: 2
Explanation: The square root of 4 is 2.
Example 2
Input: x = 8
Output: 2
Explanation: The integer part of the square root of 8 is 2.
binary searcheasy
JavaScript
Loading...
Line 1, Char 1