Comment

Comment by tomchuk

Can't mention Fibonacci and memoization in the same sentence without me breaking out my favorite Python party trick:

    def fib(n, cache = {0: 0, 1: 1}):
        if n not in cache:
            cache[n] = fib(n-1) + fib(n-2)
        return cache[n]
parent tomchuk 1 year ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton