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.
I looked at your code and you're using
return
on its own - this will return "None" as a default value. You need to return 0 instead.However, this Kata cannot be solved using recursion since the input parameter can go as high as
n=50000
, meaning it needs 50000 recursion calls, which uses too much memory and will lead to a memory error.I tried to do this recursively (as thought in Python course)
but it gives 1 error:
None should be 125......