Ad
  • Default User Avatar

    @MattZ306 you said that "you could simplify it because the opposite directions are next to each other" but the example given in the instructions is contradicting you

    For the path ["NORTH", "SOUTH", "SOUTH", "EAST", "WEST", "NORTH", "WEST"] in the example inside the instructions the solution is said to be ["WEST"]

    But if you can simplify only if opposite directions are next to each other the solution should be ["SOUTH", "NORTH", "WEST"] because the second SOUTH is not closer to the second NORTH

  • Default User Avatar

    There are problems on the solution paths.
    If the original path is [NORTH, WEST, SOUTH, EAST] the right minimal path is an empty array and not the array [NORTH, WEST, SOUTH, EAST]

    And if the original path is [SOUTH NORTH NORTH SOUTH EAST SOUTH WEST EAST SOUTH WEST] the minimal path is [SOUTH SOUTH] but I receive the error array lengths differed, expected.length=2 actual.length=4

    Additional it is a not sense that the solution [NORTH, EAST] can be valid, but the solution [EAST, NORTH] is not equivalent and so not valid