Ad
  • Custom User Avatar

    Ou, now I got that part of the task right :) Then it's easier than I expected. Thanks!

  • Custom User Avatar

    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.

  • Custom User Avatar

    (W<->E or S<->N side by side).

    You forgot that.

  • Default User Avatar

    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

  • Custom User Avatar

    "Write a function dirReduc which will take an array of strings and returns an array of strings with the needless directions removed"

  • Custom User Avatar

    Because that's not what the kata asks.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    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.

  • Custom User Avatar

    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?