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.
Hey there, sorry it took so long to get back to you. Your issue is that you are editing the variable n. The random tests are then taking your solution's n and running it back through the algorithm. Instead of doing this, try duplicating n to some other variable and your solution should work fine. You will have issues with many other solutions if you continue editing the variable passed to you, so I would recommend never doing it.
If you wouldn't mind, could you post your solution here with spoiler tags? I would like to see what you are seeing with the random tests.
Slightly modified, thanks!
Try to avoid sorting.