Ad
  • Custom User Avatar
  • Custom User Avatar

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

  • Custom User Avatar

    Because of this:

    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).

    While both paths take you to the same end, the paths are different and you should treat them that way too.

  • Custom User Avatar

    Asking a question about the details of the problem. Why would this be a legitimate list of directions ["NORTH", "WEST", "SOUTH", "EAST"] and any different from this ["NORTH", "SOUTH", "WEST", "EAST"], in both instances you end up in the same spot. But the latter of the 2 returns [] while the other returns ["NORTH", "WEST", "SOUTH", "EAST"]. I would expect to want to return [] for both.