Ad
  • Custom User Avatar

    Yes, that was not clearly specifified and could only be derived from the example. To make sense as an outlier-rejection algorithm the order of evaluation must not matter. We therefore only consider the original data as a whole.

  • Custom User Avatar

    Specs are still incomplete. How does cutting an outlier influence earlier values? ( They may now be outliers. ) Is cutting outliers strictly left-to-right, iterative, right-to-left, or does it only happen in original windows?

    How can the example still have the outlier 3 in it?

  • Custom User Avatar

    Oops, there was an off-by-one error that is fixed now. So the 3 is cut now correctly.
    Thanks for raising this issue!

  • Custom User Avatar

    I have the exact same question. My code passes all other tests execpt this one.

  • Custom User Avatar
        @test.it("Cut one value")
        def cut_one_value():
            arr = [1,1,2,2,1,7,0,1,3,0,1]
            test.assert_equals(lawnmower(arr, 5, 2), [1,1,2,2,1,0,1,3,0,1])
    

    I have a question about this example.

    With a lawnmower of length 5, it will consider the range [0,1,3,0,1]. In this range, the median is 1. However, 3 is more than 2 times the median in this range. So why is 3 not cut?

  • Custom User Avatar

    Thank you for the feedback on the beta of this Kata! The initical code was indeed necessary as part of the specification, so I changed the description now that it can stand alone.

  • Custom User Avatar

    Description is incomplete. Examples are not specifications; the description should be complete without them. Even the values that the example introduces ( threshold, window ) are, again, unspecified. They might be function arguments, but, again, the description does not specify that. Initial code is not specs either!

  • Custom User Avatar

    The explanation for this one was give 5 yrs ago in my reply to @Zed. See the discourse below. Basically you are only cut pasting from the original text - not from the resulting text so that is why there is "BBBB!BBBB!" instead of just "BBBB!", because one of those "BBBB!" was something you just pasted before.

    The kata rule "Pasting occurs strictly left-to-right only appending to your current text" is meant to help with understanding this. If you have some better description idea please suggest it.

  • Custom User Avatar

    I find the description still confusing. If I naively think of paste errors why can the output still contain "BBBB!BBBB!"?

  • Custom User Avatar
  • Custom User Avatar

    there's some description conflict fix it (in histogram diagram)

  • Custom User Avatar

    spoiler flag ;)

    yes, that was rather a general note. Considering the size of the problem, there are very little chances that you see any difference. For instance, my solution is slow because of the z.. thing (among other stuff).

    (I posted some forks to my solution of you wanna see other possible approaches)

    cheers

  • Custom User Avatar

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

  • Custom User Avatar

    note: you should avoid string concatenation

  • Custom User Avatar

    Approved. Thanks.

  • Loading more items...