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.
Even simpler than I thought :)
Sure:
r = 1000000000
. Think about how your approach will ever not timeout/run out of memory.xrange
issue is due to choosing the wrong Python version. You can choose the language version at the trainer, next to the language selection.It's okay! Keep trying :)
First, while definitely not being a power-user, the code I wrote is simple, and is really primitive. It appends the 0'th element of the list to this list twice, then pops its 0'th element. It returns the list[0] value after iterating r times. I actually use two list - I do not modify the original, I work on its copy.
Second, while printing I have observed that the list from which I return the first position as a result for test case #X is then used as input list for test case #X+1. In the description, the list is predefined to 5 names. Its not my code who does that transferring of values between the test cases, it's something within the test cases themselves. It's an abbreviation from the definition of the exercise - and its not an abbreviation that I made. When I hard-coded the original list of names, I actually passed that TC I have described as broken. Input error, and not one from my side.
Third, the xrange function does not work for this particular Kata, while it works everywhere else. It returns "name xrange is not defined" error.
Finally, it is not the only error I have spotted in TC's in different Katas - its just the first one I had encountered. When I have started using CodeWards, I didn't knew Katas were available in different languages, and are translated between them. If I'd knew that, my comment would be different. It would say "Python test cases for this Kata are broken" instead of "This Kata is broken".
I am not a power-programmer, but I am a power-tester. I've just spent hour making sure that I am justified in my judgement and I stand by my opinion, the Python TC's are broken.
Please prove me wrong.
Just like in Python version, tests in Ruby version reuse the same list for all test cases for some reasons, so don't mutate the input.
I am sorry. I didn't mean to come across that way. It is hard when I can't use my voice. I will keep trying. Edit: Also I clearly need to learn to read the "total times completed" part before I post an issue.
Python tests reuse the same list for all test cases for some reasons, so don't mutate the input.
Python tests reuse the same list for all test cases for some reasons, so don't mutate the input.
Also, the python version is a pretty bad kata translation (it doesn't even have random tests), so blame the translator, not the poor creator who already has to take the flak of people who're unaware of algorithmic complexity :)
Python tests reuse the same list for all test cases for some reasons, so don't mutate the input.
Python tests reuse the same list for all test cases for some reasons, so don't mutate the input.
Looks like an occasional problem of CW platform.
There are test cases with a very huge
r
. You don't want to generate that many objects.???
The phrase "simple to the point of being primitive" is usually reserved for power users.
Anyways, CW is not known for having lots of people experienced in coding and algorithms solving katas, so it's not surprised that people blaming their oversight/ignorance/incompetence on the kata happens every day. And it's definitely not the kind of attitude one wants to have.
537 people have already solved this kata in C#.
At least if you want to put the "I'm not an experienced programmer" part you don't want to be also so arrogant for the other half of your post.
Anyways, there are test cases with
r = 1000000000
. Think about how to handle that.Loading more items...