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.
I'm new to programming and if I'm wrong please someone correct me!
I believe it's because it's being considered to be null terminated strings.
Therefore the last character of these strings are '\0', but in a empty string this would be the only character
and when we compare it with a string that isn't empty it would return true since '\0' is present in both.
But as far as I understand it isn't something that will be printed in the screen, just something that will be
considered by the machine.
How could this pass the test while my first try failed?
This should report an error with empty input of s2,
when you try scramble('r',''), this code return True while it should be False.
Thank you for your kindly reminding and reply. I figured it out eventually and passed the test.
Again is it really an issue? From this text it doesn't seems so. But anyway, it's your post, I won't mark it as resolved (but I can't say someone else won't either).
I see what you're saying, but I think that the inability to fix the issue because of rules imposed by factors outside of the katas control doesn't mean the issue has gone away or should be marked resolved. It helps to inform subsequent users that there is something amiss.
Once a kata is solved more than 500 times in a language the tests are locked in that language. It's been discussed if this can be changed in the future but right now, that's how it is.
True, but other comments allude to more thorough testing in other languages this kata is available in. I think one comment even mentioned random tests. I've only completed in JS so cannot verify how far true that is though.
It seems to me this should be a suggestion, not an issue. See the kata creation date, it's from 2013, so old katas are probably overrated.
I guess you're talking about Python (always state the language when the kata has more than one). We need to see your code formatted in a post marked as having spoiler content to help you. More than 1900 persons passed in Python so it's more likely your code what's wrong.
I copy the code to my computer and works well:
My code test:
solution("apples, pears # and bananas\ngrapes\nbananas !apples",['#','!'])
'apples, pears\ngrapes\nbananas'
However, failed in here with the exactly same input arguments, which reported:
'apples, pears\ngrapes\nbananas !' should be 'apples, pears\ngrapes\nbananas'
Apparently, there exists an error caused this. Please check!