Integer Square Root

Given a non-negative integer x, return the integer part of its square root, i.e. ⌊√x⌋.

The result must be a non-negative integer. Do not call built-in square-root functions or use an exponent...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: