Square Root (Integral) Problem Statement

Given a number N, calculate its square root and output the integer part only.

Example:

Input:
18
Output:
4
Explanation:

The square root of 18 is approximately 4.24. The integer part is 4.

Constraints:

  • 0 ≤ N <= 108
AnswerBot
4d

Calculate the integer square root of a given number.

  • Use binary search to find the square root within the given constraints.

  • Start with a range of 0 to N, and adjust the range based on the square of mid...read more

Help your peers!
Add answer anonymously...
Avalara Technologies Technical Lead Interview Questions
Stay ahead in your career. Get AmbitionBox app
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
65 L+

Reviews

4 L+

Interviews

4 Cr+

Salaries

1 Cr+

Users/Month

Contribute to help millions

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter