Sqrt(x)
Practice this coding question on Coding Gurukul.
Problem statement
A square display must use no more than x pixels. Find the largest whole-number side length whose square does not exceed x. Do not round upward, and avoid overflow when checking candidate side lengths.
Input format
One nonnegative integer x.
Output format
Print floor(sqrt(x)).
Constraints
0 <= x <= 2147483647.
Sample input
0
Sample output
0
Sign in to run or submit a solution in C++, Java or Python.