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 would suggest the log template being
You should 'pig' "{input_str}": '{output}' should equal '{expected}'
You are missing a zero in the actual result, check if you if-else branch left that condition unhandled.
Most likely it indicates that your code runs out of time, as the input n is in range [0, 10e6] and (10e6)! has more than 50e7 digits. Both computing n! (multiplying for big integer is expensive too) and extracting digits from n! by dividing 10 forms performance bottleneck.
See https://en.wikipedia.org/wiki/Node_(computer_science).
As for "why don't we speak 'Node' much when using python", I would suggest u read a similar question on so, it answered my similar concern.
The above recursion terminates at
n+1
whensum (Σ(i^3) for i in [0, n+1))
equalsm
, returningn+1
, which is not actually accumulated tosum
.