Ad
  • Default User Avatar

    ok thanks all, I will move global variables inside the function, thanks.

  • Custom User Avatar

    The answer to previous test is [ 1, 2, 1, 1, 3, 1, 0, 0, 0, 0 ], so I think we know what's going on here :>

    @pchan2: Move your global variables inside the function.

  • Custom User Avatar

    Read comment(s) below, additionaly make sure you don't mutate input anywhere as it will be reflected by logs, also refrain from using issue tag (it refers to kata's problem, use question instead) unless you're sure fault is not on your side.

  • Custom User Avatar

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

  • Custom User Avatar

    The tests are fine. What B1ts was trying to point out is that you probably have a bug in your code.
    Just to be clear:

    expected '[1,2,1,1,3,1,9,9,1,2,1,1,3,1,9,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0]' to equal '[9,9,1,2,1,1,3,1,9,9,0,0,0,0,0,0,0,0,0,0]'
                  ^ this is what your solution produced                                    ^ this is the expected, correct answer
    

    You have [1,2,1,1,3,1] at the beginning of your result; where did those digits come from? A likely case is that you are using global variables and one test is polluting the next test.

  • Default User Avatar

    I am not sure if there's a misunderstanding.
    When I click the ATTEMPT button, on the left hand panel, the system runs a test and the array of numbers above is from that test.
    I'm just trying to let Kata know their testing has an error. But I don't know how to report it, if you know how to report the error, please advise, thanks.

  • Custom User Avatar

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

  • Default User Avatar

    there's a mistake in the Kata test because the order of array items should be preserved, instead, the Kata's test below changes the order.

    expected '[1,2,1,1,3,1,9,9,1,2,1,1,3,1,9,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0]' to equal '[9,9,1,2,1,1,3,1,9,9,0,0,0,0,0,0,0,0,0,0]'