Ad
  • Custom User Avatar

    Your problem comes from the concept of proximity. The description says that we sould return the pair with the lowest last element's index. It means that in [10, 5, 2, 3, 7, 5] the answer is [3,7]. In [10, 5, 2, 3, 5, 7] the answer is [5,5] because the last 5 has an index lower than 7.

  • Custom User Avatar

    I think I didn't understand what I had to do in this Kata because if this is the solution you're only checking the next and guesses the answer but it doesn't really check if that was the best or correct answer.

    In the example:

    [10, 5, 2, 3, 7, 5], 10

    If I move the last five one step back the result is [5,5].

    But the real answer is still [3,7] because the difference in proximinity is (5 - 4) = 1 vs (5 - 1) = 4.

    Not convinced by this answer at all it just hacks the tester.

  • Custom User Avatar

    I had to lookup an algorithm for this, a mind bender for sure

  • Custom User Avatar

    I cannot get the values in JS for some reason, so I don't understand exactly what I have to do :S

  • Custom User Avatar

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

  • Custom User Avatar

    Example button in Python just throw a error. But the other button works well.

  • Custom User Avatar

    You're right, I was doesn't understanding how to use the buttons.

    My bad.

  • Custom User Avatar

    works perfectly fine for me (python) !

    You should say what is the language you work on.

  • Custom User Avatar

    The test doesn't work.