• "If you get back to beginning, return an empty array." - there is wrong test written in Sample Tests. It assumes that when you go to the beggining, you return not an empty array but an empty string so that the array length is = 1... Please correct that.

  • Fixed.

    I also prevented input modification changing the test results and made the random tests into a loop (the author wrote really crappy Python code there).

  • Python test results seem reversed. ['S'] should equal [] should equal [] should equal ['S']...

  • sorry the issue is when I run this code in my com it's give the right output
    but here it gave me wrong output
    and every time I try it gives another output
    the wrong output exactly in the sorting of the list

  • That's a question, not an issue.

    Don't mutate the input object. If you must, copy it first.

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

  • Closed the previous issue while I shouldn"t have, so here it goes again...:

    Java tests are not consistent with the python version:

    For python:
    goal=["N","W","S","E"]
    test.assert_equals(directions(goal), [])
    
    For java:
    String[] goal3 = {"N","W","S","E"};
    assertArrayEquals(new String[] {""}, ShortestPath.directions(goal3));
    

    Python does the right move, here. Should be new String[0] for java.

    And same problem for the inverted test: the input with new String[] {""} is not an empty array so is invalid. Python sends a real empty list [] instead.

    And DM comments:

    Agree. Irrespective of python, it is just not sensible

    • it means all solutions have to code for a special case of 0.
    • if means the size of the array does not always mean the number of steps
  • Damn me!! Not corrected. Reopening, so... :/

  • corrected in the meantime, thx!

  • Agree. Irrespective of python, it is just not sensible

    • it means all solutions have to code for a special case of 0.
    • if means the size of the array does not always mean the number of steps
  • Hi,

    Java tests are not consistent with the python version:

    For python:
    goal=["N","W","S","E"]
    test.assert_equals(directions(goal), [])
    
    For java:
    String[] goal3 = {"N","W","S","E"};
    assertArrayEquals(new String[] {""}, ShortestPath.directions(goal3));
    

    Python does the right move, here. Should be new String[0] for java.

    And same problem for the inverted test: the input with new String[] {""} is not an empty array so is invalid. Python sends a real empty list [] instead.

  • Not an issue.

    Read the descriptions ;-)

  • Fixed

  • Looks fixed

  • Loading more items...