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.
Ou, now I got that part of the task right :) Then it's easier than I expected. Thanks!
That's the error message, the first value is what your function wrongly returned and the other one is the expected value, print the input to debug your code.
You forgot that.
I am not sure if this test case is explained in the desription:
['EAST', 'EAST', 'NORTH', 'WEST'] should equal ['EAST', 'NORTH']
I will post exact text from the Details
*Write a function dirReduc which will take an array of strings and returns an array of strings with the needless directions removed (W<->E or S<->N side by side)
----Side BY Side is the main ingredient----
*In ["NORTH", "EAST", "WEST", "SOUTH", "WEST", "WEST"], "NORTH" and "SOUTH" are not directly opposite but they become directly opposite after the reduction of "EAST" and "WEST" so the whole path is reducible to ["WEST", "WEST"].
----Again North and South were cancelled, because East and West are Side By Side----
There are no Side By Side cancellations in ['EAST', 'EAST', 'NORTH', 'WEST'].
Please copy and paste the text from the Details that explains this test case
"Write a function dirReduc which will take an array of strings and returns an array of strings with the needless directions removed"
Because that's not what the kata asks.
This comment is hidden because it contains spoiler information about the solution
It does, the path is not the same. Not a kata issue. Only remove the ones you can reduce, keep the order of the others.
Hey, my code doesn't pass the tests because, sometimes, my commands aren't ordered as in the solution: instead of ["NORTH", "EAST"] my output is ["EAST", "NORTH"]. That shouldn't make any difference though, right?