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 am confused if we dont have to return the list and if I try assigning the list in the function body it will become a local variable and if I try accessing the global statement that also leads to an error and the changes from indexing won't work as its a parameter so How the reversed list is to be given as in not print or return no global variable to change it in so what is to be done I am confused?:(???
Simple task, simple solution.
OP solved it, closing
Debugging depending on 'switch' concept. o~O
Please don't post solution in discourse. Do read the community's Code of Conduct for more info
This comment is hidden because it contains spoiler information about the solution
Multithreading will not help when you use inefficient algorithm, because multithreading can make your code only two- or four- or eight- times faster or so, and this will not help if your algorithm is 1000 times too slow for large arrays.
You most probably need to think of a better idea. But it's difficult to give any specific hints without knowing what is your current approach.
I've checked the multithreading code for this one,and still got the timeout error!
Any suggestion for optimizing that better?
Your solution is wrong, and tests are not at fault of your problem. If it's not the first time you encounter such issues, it would be a good idea to review your method, and not just blame tests. The "I. wrote. my. solution. first. in. VS. Code. The. results. were. all. correct." does not mean that your tests were correct, because, appparently, they were not. You did not tests whether your solution can be used more than once, and as it turns out, it does not and it breaks after a single use. You need to fix it, and reconsider the attitude of "EVERYTHING IS BROKEN!!1!1!".
Thank you!
I appreciate the heads up, and I'll try to fix the code.
You asked for a glib remark when you blamed the tests before having understood what happened ;)
Your code doesn't pass the example tests, and you can find those below the editor.
"Works on my machine" just means you didn't test the thing that failed.
If you still fail to reproduce those tests locally, then debug it in the codewars environment. I did look at your code and it is your code that is the problem, not the tests. Write it a little better please.
Have you actually read my entire comment, or have you just read the first few words and decided to be a wise guy?
I'll explain it slowly.
I. wrote. my. solution. first. in. VS. Code. The. results. were. all. correct.
So now explain to me please - how come the code works correctly in one place, but not in another? Does that even make sense?
Maybe I'm missing something here.
Now's your chance to actually be helpful instead of being smart alec.
Ain't a great look to blame tests when your code is wrong xD
The tests for this task aren't written correctly.
I wrote my code for this in VS Code, called the function with the test data from the kata and some other inputs as well,
and the return value was exactly what's expected.
This was not my first task in which it happened, by the way.
Write your tests a little better, please.
Thank you!
done
Loading more items...