Fibonacci Membership Check

Given an integer N, determine if it is a member of the Fibonacci series. Return true if the number is a member of the Fibonacci series, otherwise return false.

Fibonacci Series Definition:

F(n) = F(n-1) + F(n-2)

Where F(0) = 0 and F(1) = 1.

Input:

Integer N

Output:

true or false

Example:

Input:
8
Output:
true
Explanation:

8 is a Fibonacci number (as F(6) = 8).

Constraints:

  • 0 <= n <= 10^4
Be the first one to answer
Add answer anonymously...
Raja Software Labs Software Developer Intern 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