It’s actually sufficient to memoize only smaller numbers, since that’s where most of the overlap work occurs. A common array holding the smallest 10^5 values is enough.
It’s actually sufficient to memoize only smaller numbers, since that’s where most of the overlap work occurs. A common array holding the smallest 10^5 values is enough.