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.
It makes a copy of "key". It's the same as key[::]; when dealing with lists (or other mutable types) it prevents alterations affectiong the original list, as far as I know this isn't a problem with the immutable strings in python so it's probably just habit.
I've tested a couple of solutions, and this one was surprisingly fast, as long as the length of the consecutive count remained below 1000. After that, its apparent O(n^2) complexity really becomes noticable.
This comment is hidden because it contains spoiler information about the solution
it does not matter, because the test case sorts our results using sorted() method which returns a list.
This comment is hidden because it contains spoiler information about the solution