You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
possible other option:
def fibonacci(n):
if n==0:
return 0
if n==1:
return [1]
if n == 2:
return [1,1]
else:
prev = fibonacci (n-1)
return prev + [prev[-1]+prev[-2]]
re write exercise Fibonacci recursion in Practical 4 so that it only returns the ith Element of the Sequence not the full sequence - O2 complexity
The text was updated successfully, but these errors were encountered: