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.
Your's is probably a bit faster without the need to copy the list. I tend to not modify the data I'm given just in case the test cases are written in such a way as to depend on the same data after my function is called (it's bitten me in the past).
There's plenty of cleverness on this solution and others, but what I most appreciate about this one are the comments and organization. Enough comments to get a high level overview of what's going on without distracting from the code. Thank you.
Concur but I am so thankful to the author. It's one of those gems that, if you put in the work, you'll learn something.
The spec says to find a positive integer.
return s/n
returns a float. Use integer divisions//n
. Good answer though.