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.
I already have updated the tests, so they will (hopefully) not time out. As I already mentioned the
test_wild_monkey
functioncalls
send
andreceive
pretty often with pretty big loads of data, so it is no wonder that it is slow.The bonus section is about the transmitted data size, not the code performance. Very slow code will time out and this has nothing to do with the task.
But I realize that my tests have exaggerated a bit.
Why should I care about that now? The part about performance (minimizing data transmitted) is a bonus section, so it's not mandatory. My solution is still
O(n)
, albert with a large constant factor because I was writing the simplest possible solution. Still,10^6
is a perfectly reasonable size, and there are no reasons something that should operate inO(n)
times out at10^6
.Let me repeat this again: The time out comes from your wild monkey function. My functions can process the same data very quickly. You need to look at why your function is so slow.
I just found that I can look at your solution. You could still save quite a bit of time by saving up some allocations.
I'm not sure what you mean by "can't handle". Do you mean that it is extremely slow or that it is not doing its job properly?
And is the 10⁶ bytes the length of the return vector of a
send
call bytest_wild_monkey
?Anyway, I have now slimmed down the
test_wild_monkey
test a bit.Your question doesn't even make any sense... I already pointed out your wild monkey function can't handle 10^6 bytes or more reliably, which you can easily verify. Your code needs to be O(n).
the wild monkey function performs some load tests, including tests with rather large input vectors.
Could it be that you are outputting a vector that has a size of O(n^2) relative to the input vector, or even larger?
That would explain the timeout for me.
It'd appear that your wild monkey function might actually be kinda slow and can't handle anything more than 10^6 bytes.
;-)
This is my first kata so I don't have any knowledge about the test system.
The timeout is not reproducible for me. Do the tests run on client side?
Oh, yeah, thanks, this will be a quick fix sweatsmile
tests::test_wild_monkey
seems to always time out.Failing the sample test do not generate failed test assertions, so they still display as success.
You can't, but you can infer it based on the number of mines.
Let's take a test case where you have 6 mines.
If you solve the puzzle and use your second solution and
get minimum 7 mines, your second solution is impossible.
In your reply, this exactly is the case!