Return the zero-indexed Fibonacci number F(n), where F(0)=0, F(1)=1, and F(n)=F(n-1)+F(n-2).
Input / output
n: integerF(n)Examples
n = 2 returns 1.n = 10 returns 55.Constraints
0 <= n <= 30Follow-up Compare iteration, memoized recursion, fast doubling, and matrix exponentiation.