Integer square root
Given a non-negative integer x, return its square root rounded down: the largest integer r with r * r <= x. For example, 8 gives 2, because 2 * 2 <= 8 but 3 * 3 > 8.
Use integer arithmetic only: no math.sqrt, math.isqrt or ** 0.5, since the search is the exercise. Constraints: 0 <= x <= 10^15. Aim for O(log x).
Besides the tests, one large input (x around 4 · 10^13) with a ~100 ms limit (scaled to your device's speed): brute force won't pass.
Examples
floor_sqrt(8)→2floor_sqrt(16)→4floor_sqrt(26)→5