Sqrt(x)

Easy
Math Math Binary Search

Compute and return the integer part of the square root of x.

Constraints

0 ≤ x ≤ 2^31 - 1

Examples

Example 1:
Input: 4
Output: 2
Example 2:
Input: 8
Output: 2
Explanation: √8 = 2.828, integer part is 2
▲ Console

Install Talent Arabia

Get instant access to jobs and career tools on your device.