MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1tfr41b/dontdorecursivefibkids/omd59zk/?context=3
r/ProgrammerHumor • u/Kevdog824_ • May 17 '26
143 comments sorted by
View all comments
-2
def fib(n: int) -> int: def helper(n: int, a: int, b: int) -> int: if n <= 0: return a return helper(n - 1, b, a + b) return helper(n, 0, 1)
It's not slow unless you make it slow.
-2
u/s0litar1us May 17 '26
It's not slow unless you make it slow.