Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
This has already been raised as an issue, but in Python some methods time out. The test cases should be made smaller.
edit
Hey, that only means the large array test is a better performance test! :P
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 a2000 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).
OK, I've fixed this issue, the output isn't printed any more.
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.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.
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.
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.Note that this method would fail for certain arrays, for example an array of ones of length 200.