Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
If this is a joke it's a really clever one
No need for "{0:b}", "{:b}" will work also.
Clever kind but impractical
Making the cache private is a bizzare "extra challenge". I can't see how that provides any better functionality/encapsulation, if anything it just makes it harder to understand.
f'Maybe you\'d want to try new {string_formatting} that has been available since Python 3.6'
format function,got it
The calls to fibonacci(n-1) and fibonacci(n-2) will store the value in memo, no reason to do this multiple times.
relax bud
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
n is either fib(n-1) and fib(n-2)
In this solution, only fibonacci(n) is stored in the memo. But since fibonacci(n - 1) and fibonacci(n - 2) are called, they can also be stored in the memo, so if the next test is fibonacci(n - 2) for example, the result will already be in the memo.
which is exactly what is done here... Or are you talking about the base cases?
You should store the fibonacci(n - 1) in memo[n - 1] and the fibonacci(n - 2) in memo[n - 2]...
solved above
Loading more items...