hactoberfest_contribution_2022
hactoberfest_contribution_2022 copied to clipboard
Find Index of given fibonacci number in constant time
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