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.
Nice and quite intuitive kata to have some fun with.
Thanks, I adjusted tests and solution
Oh dear this is strange. I've never seen a wall clock to work like this.
...nor like this.
See this article for some ideas.
I can remove round from tests and solution, however what exactly wrong with rounding results?
Don't round float results!
Thanks! :)
approval time then :)
Fixed it
Fixed test error messages are wrong and inconsistent.
The first error message says the initial number is
7
but it is-7
. Tests 2 and 5 only provide the results and not the initial conditions.Okay so I re-read the description more carefully and I see that I initially misunderstood the task. I thought that it's just another case of "spray randomly to get any useful inputs". I'm sorry for the confusion!
All 100 tests are testing something though, lopsided distribution or not; even if 80% of the tests are returning 0, you still have to solve the problem (or one of its subproblems, including, granted, more trivial ones like contradictions between
must_avoid
andmust_include
) to know which ones do.I think monadius's suggestion is a good, practical way to improve the random tests though. There are probably other properties that could be used to generate random tests with a nonzero result but that's a kata in itself. The test suite could also just run a reference solution against the randomly generated params and discard all above a certain quota that result in zeros, but I'm not convinced there's value in that.
EDIT: Annnnd the point is moot.
Slightly chaged tests, so they should be better now
Half of them (150) are completly random and half have non-zero solution. Also
must_include
andmust_avoid
don't intersect nowThe problem is that it is difficult to generate meaningful tests (I don't know how to do that without increasing
target_num
). So the easiest strategy is to generate many of them and hope that some tests will be good enough to catch incorrect solutions. I also don't see any potential mistakes which can be undetected by current tests.I propose to increase the number of random tests to
300
and also generate non-overlappingmust_avoid
andmust_include
(it does not help a lot but it removes trivial tests).If out of 100 tests only 20 tests test anything, then how many of them test something interesting? With only 20 effective tests, it's possible that solutions which have a hole in one place, or another, or another one, will never get detected.
Another thing is that if you think that 20 tests is enough, then why have 100 of them? Just... run 20 tests. Is there really a need to run 80 no-tests?
Loading more items...