Question DSA-REC-0018
HardWhat is the output of this code?
calls = 0
def fib(n):
global calls
calls += 1
return n if n < 2 else fib(n - 1) + fib(n - 2)
fib(5)
print(calls)
- A.
5
- B.
10
- C.
Sign up free to see the answer and a step-by-step explanation.