Ad
  • Custom User Avatar

    中文解释:你不能修改测试提供的原始数组。
    这个测试的过程应该是:在你的函数运行后,检查原始数组的值是否发生改变。
    也就是说:你应该创建一个新的数组(或者复制原数组)来完成接下来的工作。

  • Default User Avatar

    Your code should not modify/change values from the input array.
    So you have to copy the array or find another way that does not change values in the array.

  • Default User Avatar

    I met the same problem,can U explain it?Thx!

  • Default User Avatar

    The problem is said in the error message: "You should not modify the input array!" But you did! :-) So the test for checking, that the user-solution does not change the input array, fails correctly!

  • Default User Avatar

    Hi, I am passing all the tests except this one:

    UnchangedArrayTest
    ✔ Test Passed: Value == '[2, 7, 4, 3, 9]'
    ✘ You should not modify the input array! - Expected: '[9, 2, 4, 7, 3]', instead got: '[2, 7, 4, 3, 9]'

    Not sure why is happening, seems like [2, 7, 4, 3, 9] is the right result that should be expected.

    Will appreciate your help!