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.
?
Can you not just print out the inputs in the function to see them?
This comment is hidden because it contains spoiler information about the solution
That worked like a charm! I made a copy of "names" as you said. Thank you very much for your time! I learned something today, cheers
Your code also fails in repl.it. It's a problem on how you're sorting, you're mutating the names array at the same time you use it to get the original order, use a shallow copy.
This comment is hidden because it contains spoiler information about the solution
Thanks for your reply. Sorry it was my first question on the site and I don't know why I thought everybody could see my code. I will post a more complete question with the label and use the spoiler flag.
Use
Question
label for things like this:With so little detail, it's only guesswork and it's very hard to help you.
Any clues why my code returns the correct result when checking it on the local console and the wrong one when trying to pass the test on CodeWars? It happens in the Basic test (the first one) and in several of the random ones.