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.
It would be better if you post using Markdown formatting, to preserve indendation:
https://github.com/Codewars/codewars.com/wiki/Markdown-Formatting#block-code-formatting
You should be able to print the input that is causing your code to fail. That would be helpful.
No problem, and instead of using global vars, try refactoring using default values.
Oooh I see it now. Thank you, I have passed all the tests :)
The last line of the function, where you call the function again with different parameters should be returned too, so the result comes back when recursion ends.
What do you mean with returning the function call?
Don't use global vars, they keep their values between tests. You've fixed that inside your function, so that's not the real problem here (but still, that's a bad practice). The problem is you're doing recursion wrong, you should return the function call too.
This comment is hidden because it contains spoiler information about the solution
Post your code using markdown formatting here and mark your post as having spoiler content.
returning
Is your code printing or returning the result?
So, I finally resolved the problem and my program does what it's intended, but for some reason I cannot pass the sample tests on codewars.
I can pass them in visual code or any other IDE
It's another list that differs of the original in one value. You shouldn't change the original list/array (this is in red in the instructions).
I read it, but I can't understand what the outcome should be. The exercise asks to delete one value and return that list, or another list without that value, like the example shows.
No, the tests are ok, it's your code that's mutating the input. Please read the previous posts where it's been already explained.
Loading more items...