This is a common problem asked in companies like Amazon, Flipkart, VMWare, Accolite and Microsoft. Problem: Given an integer x, find the square root of x. If x is not a perfect square, then return floor(√x). Example 1: Input:
x = 5
Output: 2
Explanation: Since, 5 is not a perfect
square, floor of square_root of…