Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Square Root of Integer

https://www.interviewbit.com/problems/square-root-of-integer/

Leetcode 69 - https://leetcode.com/problems/sqrtx/description/

Given an integar A.

Compute and return the square root of A.

If A is not a perfect square, return floor(sqrt(A)).

DO NOT USE SQRT FUNCTION FROM STANDARD LIBRARY

Input Format

The first and only argument given is the integer A. Output Format

Return floor(sqrt(A)) Constraints

1 <= A <= 10^9 For Example

Input 1: A = 11 Output 1: 3

Input 2: A = 9 Output 2: 3