Integer square root

Write codeEasy15 min

Your task

Given a non-negative integer n, return the floor of its square root (the largest integer r with r*r <= n) without using any floating-point square-root function. Handle n = 0 and n = 1.

Examples

isqrt_floor(n: int) -> int
Example 1
Inputisqrt_floor(8)
Output2