Ad
  • Default User Avatar

    These tests are checking whether the input list was modified. The kata requires that the original data remains intact and you create a new list.

  • Default User Avatar

    does your addition change the description on Python, C, Haskell, etc.? or does it appear only on the LC description?

  • Default User Avatar

    this tests check that you haven't changed the input data. are you returning a new array?

  • Default User Avatar

    yes, good call. i've added these.

  • Default User Avatar

    i added a second test for each sample in the random section.

    should i add checking for a non-mutated array for all tests?

  • Default User Avatar
  • Default User Avatar

    ah, my apologies for prematurely resolving. thanks for working with me and giving great feedback on my first submitted kata.

    i added a clear feedback message for this test.

    will not resolve until you validate

  • Default User Avatar
  • Default User Avatar

    ah, i was wondering what the highlighting meant.

    thank you, ready to review

  • Default User Avatar

    good catch, fixed now

  • Default User Avatar

    added this test case

    @test.it("should return a new array")
    def return_new():
        input = [10, 11, 10]
        cleaned_counts(input)
        test.assert_equals(input,[10,11,10])
    

    i also checked that this test catches a mutated list

  • Default User Avatar

    changed description language to:

    Your task is to create a new non-decreasing array that is minimally different from the data array. For example, if the data = [1, 1, 2, 2, 1, 2, 2, 2, 2] then the returned array should be [1, 1, 2, 2, 2, 2, 2, 2, 2] because data[4] < data[3] is clearly an error.

    i'm still not sure how to modify the tests to check that the user returned a new array. do you mean to include a test like the following?

    @test.it("should return a new array")
    def test_diff_array():
        input1 = [4, 5, 6, 7]
        test.assert_not_equals(cleaned_counts(input1), input1)
    
  • Default User Avatar

    Thanks for your suggestion. I agree with you, but I'm not sure how to impose that the returned array is not mutated in the submission test. Would you please advise?