educative.io

Why do we create array length as n + 1 instead of n?

I noticed that in both methods, we use n+1 as the length of the array.

Do you guys have any ideas?

@Franklin
As array started with index 0.
so if we are going to find Fibonacci series for 6 (n = 6) we should return array[6] ( so length of array is 7 which is n+1).