Integer Square Root

TCS NQT Coding Easy Go Ad-Free - ₹20/mo

Given a non-negative integer `n`, compute and return the integer square root of `n`. The integer square root is the largest integer `x` such that `x*x <= n`.

Examples:

Input: 4

Output: 2

Input: 8

Output: 2

Input: 6096

Output: 78

Constraints

  • `0 <= n <= 2^31 - 1`