Ad
  • Custom User Avatar

    Not an issue. The string length is the same, but using diagonals, the path length is bigger.

    Nothing is mentioned about preferring straight lines over diagonals.

    That's exactly what the specification is saying, though:

    The shortest path is defined as the path with the shortest euclidiean distance going from one node to the next.

  • Custom User Avatar

    That doesn't matter. Just passing the test matters.

  • Custom User Avatar

    Your solution has a bug, it fails following test case: [TestCase(new [] {2, 1, 2}, ExpectedResult = 1)].

    While you are right that not presenting inputs is not a good thing, you can still Console.WriteLine them yourself. You owuld see that your solution fails for arrays where the unique number is on the second position.

    Bugs in your solution are not a kata issue.