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.
Oh, thank you very much. I finally saw what the problem was.
Yes, i used the exactly examples from the 'sample tests'.
But i accidentally deleted the empty line, when i was copying the strings. And that's why everything was ok in my IDE.
After your comment i've changed my code and it works now. And it's even shorter.
Thank you again!
Just to be sure, did you run your solution in your IDE with exactly the same examples as the ones in the "Sample tests" box? Specifically, did you test your solution in your IDE with inputs which have empty lines? Your solution has a bug and handles empty lines incorrectly.
I'll say it a third time: you need to debug the failing test case. Not a succeeding one, you won't find the problem in a case that doesn't have the problem. You're not seeing the error in your local environment because you're not running the failing test case.
There's nothing abnormal about that. Got a failing test case? Debug that test case.
This comment is hidden because it contains spoiler information about the solution
No, your reasoning is not correct. It is perfectly possible that your code has an error which is visible on Codewars, but not in your IDE.
To be able to find the error in your code, we have to know your code.
The problem is - i don't understand why i get TypeError: item.join is not a function. But in my IDE i do not get such an error. As you understand if the code has an error it has it everywhere - both in IDE or in Codewars.
Then there is a problem in something else, but not in the code.
But why do you need help? What's the problem? Failing tests is normal when your code is wrong. When you say it works correctly in VS Code, that sounds to me like you didn't test the case that your code does not work correctly for.
I'll try to explain widely.
In my code i use such a method as join().
My code works correctly in VS Code. I receive required results.
But here, when i push TEST button i get - TypeError: item.join is not a function.
If i push ATTEMPT button i got the same error in the basic tests, but i can also see my code passed the random test.
I hope my explanation is more clearly now)
debug that your code for that test then? I don't understand the question.
sometimes people use the fact that some tests pass as proof that the code is correct. but it's the other way around, that if some tests fail, then the code is incorrect.
Can anyone help please! My code passed the random test, and in my IDE it works correctly too.
But in the basic test i've got - TypeError: item.join is not a function.
What did you find confusing about the description? I thought it was pretty easy to understand.
The hardest thing in this kata is its description. It's unclear.
Gentlemen, please, when you make your katas, be merciful. Don't make users feel confusing.
I don't want to look rude, but...
It was a really annoying kata.
It doesn't teach of anything, just wasted your time on little things
Thanks a lot!
I fully agree with you. I thought the same, when i was resolving this task. And i think the most part of programmers thought the same.
Loading more items...