Given n, return the n-th Fibonacci number where F(0)=0 and F(1)=1. Pattern focus: Climbing stairs. The same recurrence appears in many staircase counting problems, making this a pure linear DP warm-up.
n = Fibonacci index
the n-th Fibonacci number
Example 1:
Input:
n = 0
Output:
0
Explanation:
F(0) is defined as 0.
Example 2:
Input:
n = 7
Output:
13
Explanation:
The sequence is 0,1,1,2,3,5,8,13.