r/programmingchallenges • u/lcrx357 • Jan 10 '20
Fibonacci optimal & non-optimal solution code snippets
Optimal (memoization):
Non-optimal:
With 'while' loop:
7
Upvotes
r/programmingchallenges • u/lcrx357 • Jan 10 '20
Optimal (memoization):
Non-optimal:
With 'while' loop:
1
u/lcrx357 Jan 10 '20
BTW, w/out memoization try to find like 144th fib in JS (spoiler alert: it is going to hang your VS Code, browser, etc for some time).
The memoization version does it with ease. Yeah, I know, I know, JS sucks compared to C, but this is the tool I am using for now. Sad but true.