Complete the code to return the base case value for n equals 0.
if (n == 0) return [1];
The Fibonacci sequence starts with 0 at position 0, so the function should return 0 when n is 0.
Complete the code to return the base case value for n equals 1.
if (n == 1) return [1];
The Fibonacci sequence has 1 at position 1, so the function should return 1 when n is 1.
Fix the error in the recursive call to calculate Fibonacci for n-1.
return Fibonacci([1]) + Fibonacci(n - 2);
The Fibonacci number at position n is the sum of Fibonacci numbers at positions n-1 and n-2, so the first recursive call must be Fibonacci(n - 1).
Fill both blanks to complete the recursive Fibonacci function correctly.
if (n == [1]) return 0; if (n == [2]) return 1;
The base cases for Fibonacci are n == 0 returning 0, and n == 1 returning 1.
Fill all three blanks to complete the recursive Fibonacci function with correct base cases and recursive calls.
if (n == [1]) return 0; if (n == [2]) return 1; return Fibonacci(n [3]) + Fibonacci(n - 2);
The function returns 0 when n is 0, 1 when n is 1, and for other n it returns Fibonacci(n-1) + Fibonacci(n-2).
