+ 1
Any tips on this?
I couldn't understand the Fibonacci because I couldn't find a way to add it. If the input was 5 And the output is like this >>> 0 1 1 2 3 How can I use recursion function in this one?
1 Answer
+ 1
Your function:
f(n) = f(n-1) + f(n-2)
base cases:
if n == 0: return 0
if n == 1: return 1
Hope this helps.