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's a problem with your code, CodeWars doesn't do anything special about global vars, it works the same everywhere. Try calling your function more than once in other place and the result will be the same.
I had the same problem. Is it reallly a problem with our code or with the way codewars keeps track of global variables?
Kata has been retired
This comment is hidden because it contains spoiler information about the solution
Just glancing at your code, it looks to me that you remove opposite directions, no matter where they are in the array. That's not correct, because for this kata the rule is to only remove opposite directions if they are next to each other (adjacent).
This is why, for example: for ["NORTH", "WEST", "SOUTH", "EAST"]: the result is the same, and not [].
Glad to hear you found the problem. It's always best to see how many users solved a kata in your language. If the number is high, it's almost always problem with your code, and not kata tests :P
Maybe you use some global variable that keeps values throughout tests? It could explain why it works for 1 test, but not a few in a row.
How is that a kata issue? It's not, rather a question (so I'm closing it). We can't read your code or your mind to know why it's returning incorrect results, so you should provide more information.
This article has some answers to similar questions like yours: https://github.com/codewars/codewars.com/wiki/Troubleshooting-your-solution