Fibonacci Number - I
You are given a non-negative integer N. Find the N-th Fibonacci number.
The Fibonacci sequence is defined as:
F(0) = 0
F(1) = 1
F(N) = F(N - 1) + F(N - 2) for N > 1
Input
The input contains only one integer N.
Output
Print F(N), the Nth Fibonacci number, without labels or trailing spaces.
Example 1:
Input:
1
Output:
1
Explanation:
F(1) = 1.
Example 2:
Input:
10
Output:
55
Explanation:
The tenth Fibonacci number is 55.
Now Your Turn!
Pick the correct output for the given inputInput:
4
Still unsure what the problem is asking ?
Let’s go through a few more examples, step by step, to make it clearer.
Constraints:
- 0 <= N <= 10