Class assignment

why do we put fib(n+2) what is the reason

hi @Somith please be more elaborate what is your doubt?

in the editorial it is given fib(n+2) what is the reason why do we pass N+2

@Somith please share the editorial, i cannot tell what is going on without looking at the code

hi @Somith
the recurrance relation is f(n) = f(n-1) + f(n-2) for n-2>=0
it can also be written as f(n+2) = f(n+1) + f(n) for n>=0

You can write it however you want

i did not understand

@Somith just taking argument as n+2 instead of n will change nothing but the base case

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.