Ad
  • Default User Avatar

    Sure, go ahead. I am not a proper sensei yet, I guess.

  • Default User Avatar

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

  • Default User Avatar

    It still seems to have an issue with random tests (in Ruby)
    The checking code (as someone suggested already) is using the target twice. But the function is being feed with the correct start value.

    Rand test 1

    [[0, 4], [4, -6]]

    wrong route from [4, -6] to [4, -6]

    Expected: [[4, -6]],

    instead got: [[0, 4], [1, 3], [2, 2], [3, 1], [4, 0], [4, -1], [4, -2], [4, -3], [4, -4], [4, -5], [4, -6]]

    Rand test 2

    [[1, -6], [4, 2]]

    wrong route from [4, 2] to [4, 2]

    Expected: [[4, 2]],

    instead got: [[1, -6], [2, -5], [3, -4], [4, -3], [4, -2], [4, -1], [4, 0], [4, 1], [4, 2]]

  • Default User Avatar

    Thank you for your input

  • Default User Avatar

    Yes, it is indeed reversed. Embarrassing.