3 ms·
You could do that in python as well: def fib(a, b, n): return a if n == 0 else fib(b, a+b, n-1) You'll get x300 speed. The test cases are much more re
by avip 8y ago
You could do that in python as well:
def fib(a, b, n):
return a if n == 0 else fib(b, a+b, n-1)
You'll get x300 speed. The test cases are much more revealing without such constructions.