recursive fib func with memoization *ONE LINER* (1 line series)[no4]
rafrafraf (1389)

This is my implementation of the fibonacci function using recursion and memoization in one line!

if you wanna learn how it works and what memoization/recursion is check out this post i made which covers that and more!

I struggled with this one liner mainly because of how memoization requires a global variable, in this case a dict called cache, but it came together in the end.

let me know if you have an idea for what i should attempt to make in one line next :)

You are viewing a single comment. View All