Ad
  • Custom User Avatar

    I get it now. Thank you!

  • Custom User Avatar

    The "[100, 150, 350, 400] should equal [100, 200, 300, 400]" means that you solution returned [100, 150, 350, 400], while the answer expected by tests is [100, 200, 300, 400]. It does not say anything about whether the test case is valid or not, because we do not know what was the input of the test case. All we know is that the answer returned by your solution has two incorrect elements.

  • Custom User Avatar

    Hello,

    I noticed that some of the test cases in the task seem to be incorrect based on the problem description. Specifically:

    [100, 150, 350, 400] should equal [100, 200, 300, 400] – however, this sequence has two incorrect elements, which contradicts the task's rule that only one element can be incorrect.
    [200, 250, 300, 350] should equal [100, 200, 300, 400] – this seems to be an issue where the sequence is correct, but the test case expects it to be fixed, which isn't in line with the problem's requirements.
    Test case 88 failed: [2, 10, 12, 17] => [2, 10, 18, 26], expected [2, 7, 12, 17] – the difference in the sequence is not consistent with the expected progression.
    These tests seem to contradict the condition that only one element in the sequence can be corrupted. I believe these test cases need to be corrected to ensure they align with the problem statement.

    Thank you!

  • Custom User Avatar

    Thank you! I see now what I was missing... 🤦‍♂️

  • Custom User Avatar

    I believe you are seeing only the output results. That is, [100, 250, 400, 550] is not the input you were given. Rather, it's saying that your function returned [100, 250, 400, 550] when it should have returned [100, 200, 300, 400].

    If you are having trouble figuring out why this is happening, you can try printing the test inputs on your attempts in order to see what was passed into your function. So, depending on the language you are using, you can add something like console.log(sequence) or print(sequence) as the first line of your function and that will show you exactly what your function is being passed on each iteration. This should help you nail down the problem and modify your function accordingly.

  • Custom User Avatar

    Apologies if I am being stupid...

    [100, 250, 400, 550] should equal [100, 200, 300, 400]
    

    Why is this so when the difference between each int is already 150?

    (Marked as having spoiler content to be safe)

  • Custom User Avatar

    For Python, at least, you need more random cases for length == 4.
    This solution
    cannot handle such case, but still passes the random tests, given enough tries.

  • Custom User Avatar

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

  • Custom User Avatar

    Java: There are no tests with 4 elements.

  • Custom User Avatar

    Random tests increased to 100 and sequences with 4 elements are generated in random tests as well.

  • Custom User Avatar

    Thanks for the feedback. I have fixed the issues you have pointed out. Please do not hesitate to point out any other issues.

  • Custom User Avatar

    Hi,

    • The tests shouldn't be written in a class. See the docs about authoring python kata.

    • The case with len(seq)==3 is not discussed in the description. Is it tested ?

    • This sentence is misleading:

      One number in this pristine pattern has been swapped, tampered with, or corrupted.

      Strictly speaking, it's incorrect: there are no swaps at all, it's only one single value that is not following the pattern. Talking about swap implies 2 values would be wrong, which is not the case.
      cheers

  • Custom User Avatar

    isn't that a duplicate? (I'm pretty sure it is...)

  • Custom User Avatar
    • There should be more random tests (100).
    • Sequences with 4 elements should be generated in random tests. Right now, several solutions hardcode answers for existing 4-element sequences.
  • Custom User Avatar
    • The input has to be mutated or not ? This is not mentioned.
    • If the input's length is 3, the problem is ambiguous ([0, 3, 4] could lead to [0, 2, 4], [2, 3, 4] or [0, 3, 6]
    • Number of random tests could be bumped up...
  • Loading more items...