Ad
  • Default User Avatar

    This has already been raised as an issue, but in Python some methods time out. The test cases should be made smaller.

  • Default User Avatar
  • Custom User Avatar

    Hey, that only means the large array test is a better performance test! :P

  • Custom User Avatar

    Author solution is not performant, it runs more than 6 seconds on a 300 x 300 matrix unlike the two existing solutions (which can handle a 2000 x 2000 matrix in under 6 seconds!).

    So the "large array" test is not actually a performance test.

    It also means that the test themselves are inherently slow (because the author solution is used as the reference solution).

  • Default User Avatar

    OK, I've fixed this issue, the output isn't printed any more.

  • Custom User Avatar

    The test with the large array should not print the value. It's overflowing some buffer. That probably means you should do the comparison yourself, and Test.expect something.

  • Custom User Avatar

    No, a false positive is unlikely. A false negative, however, is not.

    Rounding floating point number is an inexact science in JavaScript.

    Please go and read the comments on other kata that deal with floating point numbers.

  • Default User Avatar

    I'm not sure what you are saying tbh. If you're trying to say that a wrong solution will pass the tests, I think that's quite unlikely, as there are many tests, and a test with a large array.
    Remember that the rounding is taken after calculation of the average, and that it has to match exactly with the expected average, to 2 d.p.

  • Custom User Avatar

    Please do not round floating point numbers, and use assertApproxEquals. You'll have to map this over the array, of course. Rounding is not fullproof against errors.

  • Default User Avatar

    Note that this method would fail for certain arrays, for example an array of ones of length 200.