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.
alr raised as issue
Agreed. These tests are very brittle.
Thinking of a good algorithm does not depend on the language you implement it in. If you can come up with a good algorithm, you can implement it in any language you like ;-)
This comment is hidden because it contains spoiler information about the solution
As usual, rule 0 of algorithm katas: don't micro-optimize an algorithm with the wrong complexity ;-)
The input range should give you a good idea what the requred complexity is like.
You are mutating the input array: you can see it here
myNames = names
doesn't make a copy of it. Try googling how to make a copy so you can work with it without mutating the input array or build a new one and work with that.Post your code then, mark the post as having spoiler content. The tests aren't random in Python, I've tried my code and worked and 1333 other warriors passed, so I doubt the kata is at fault here.
Are you mutating the list/array? It's not true there are a lot of Penny in the original list (the list is constant in all tests unlike another languages), only one and if r is 2, the second person to drink a cola is Leonard. Not a kata issue.