Calculate the nth Fibonacci number.
Given n, return f where f = fib(n) and f(1) = 1, f(2) = 1, f(3) = 2, ...
Examples:
Input n = 5 Output f is 5
Input n = 7 Output f is 13
3 players like this solution
1 player likes this solution
2 players like this solution
1 player likes this solution
7 players like this solution
1 player likes this solution
1 player likes this solution
7 players like this solution
4 players like this solution
4 players like this solution
6 players like this solution
Tags
Win cash prizes and have your live script featured on our website
Learn more
50 players like this problem
50 players like this problem