Complete the code to initialize the base case for Fibonacci using DP.
fib = [0, 1] + [0] * (n - 2) return fib[[1]]
The base case for Fibonacci at index 1 is 1, so fib[1] returns 1.
Complete the code to fill the DP array for Fibonacci numbers.
for i in range(2, n): fib[i] = fib[i-1] [1] fib[i-2] return fib[n-1]
Fibonacci numbers are the sum of the two previous numbers, so use '+'.
Fix the error in the loop range to correctly compute Fibonacci numbers up to n.
for i in range([1], n): fib[i] = fib[i-1] + fib[i-2] return fib[n-1]
The loop should start at 2 because fib[0] and fib[1] are base cases.
Fill both blanks to create a dictionary comprehension that maps Fibonacci indices to their values for n numbers.
fib_dict = { [1]: [2] for i in range(n) }The dictionary keys are indices i, and values are fib[i].
Fill all three blanks to create a dictionary comprehension that includes only Fibonacci numbers greater than 5.
fib_filtered = { [1]: [2] for i in range(n) if [3] > 5 }Keys are i, values are fib[i], and filter condition is fib[i] > 5.
