hactoberfest_contribution_2022 icon indicating copy to clipboard operation
hactoberfest_contribution_2022 copied to clipboard

Find Index of given fibonacci number in constant time

Open Sachindrck opened this issue 2 years ago • 0 comments

We are given a Fibonacci number. The first few Fibonacci numbers are 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, ….. We have to find the index of the given Fibonacci number, i.e. like Fibonacci number 8 is at index 6.

Examples :

Input: 13 Output: 7

Input: 34 Output: 9

Sachindrck avatar Oct 07 '22 16:10 Sachindrck