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.
Why would you assume that? If test cases were wrong, the kata wouldn't be approved. The problem comes from the fact that:
1: you're mutating the input string (rarely a good idea)
2: the tests do not guard against this. First, your function is run with the mentioned string, which you mutate, and then the reference solution is run with what's left of the string, leading to unexpected results.
#2 is actually an issue, and should be fixed. I already see some issues raised below about it, and I'm amazed that this issue hasn't been fixed for 4 years or something?!
Still, I have to close it as duplicate (for now). Try to avoid mutating input where possible.
Wrong in what way?
7kyu seems reasonable for most high-level languages (one of which you seem to be programming in).
I sort of rushed it, but if this changes the description in any way, maybe you could just add the line in question manually @g964 and resolve it that way.
So apparently my Prolog translation was generating random atoms, not strings. I published a quick fix here https://www.codewars.com/kumite/5e1c9fea42473c00300e516e?sel=667d9531de35874b97fcff8d
Oh, my mistake. I misread the first part of your code as I just read it as in English, not code :facepalm:
You're right that it shouldn't pass, and I'm not sure how there isn't 1 test against that...
Feel free to re-raise the suggestion (which should actually be an issue IMO), and sorry for closing it too early.
The description is very old and poor. Translations should've modified the description, but no one did...
Still, for python it's quite obvious when you look at initial code and sample tests: it expects a regular function.
As for the failing test, did you see which input fails? See https://docs.codewars.com/training/troubleshooting/#print-input
Here's a basic template:
Should do the trick. But make sure to return something that the function expects (you could just "return names" to avoid errors).
I know, and I don't doubt that :D But if x/y could go into double digits, this kata may have been ranked 7kyu. I'm not sure :P
Maybe check this article: https://docs.codewars.com/training/troubleshooting/#print-input
Notes:
I literally just opened up C++ trainer and I clearly see 2 sample tests. Care to explain what you mean? Did you delete "sample tests" code by mistake?
But then you could take a look at the "notes" section of the description and realize that this scenario would never happen. Specification > realism.
That may be subjecive, but given that there are mentions in description of constraints that include arrays of length ~100_000, that in itself should suggest "performance".
But... it doesn't? I ran this solution on sample tests and it failed 3 of them, and also 20+ random tests on attempt.
There already are a few fixed tests like the one you're suggesting, so I don't think it's a valid suggestion (especially when the original premise is flawed).
Loading more items...