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'd recommend having some larger values of n and m in the test cases to avoid a brute force approach.
like it
I think you misunderstood the problem. The one asked isn't the result on the last iteration but the
total number of iterations
before reaching the last one. In essence:Which gives you a total depth of 4.
I see. I was only looking at the execution speed and didn't really take floating point accuracy into consideration when doing so. Thanks for pointing it out. I edited it out and now use lambda directly instead of defining a function. There's only a slight increase in speed now though.
I prefere mine. Doing so, you have a bit more computations each time (creation of complex number, then an internal square root when doing the abs. Note that your version is subject to floating point troubles, while mine isn't, specifically because I avoid float operations.)
This is just notes for those who use python and encounters this problem (Just like I did):
list
and atuple
as argument forgame.check
.tuple
earns you alist
of four "Black" if you managed to guess correctly.set
returns atuple
.I tried modifying the error messge to include the target array length as clue. Is this fine?
Pardon, since this is my first kata, I think I misunderstood that preloaded stuff isn't included in the whole code run time. Thanks for pointing it out. I moved it now to the Test Cases tab. Thanks.
Sorry, my mistake, I probably forgot to check the example results. Thanks for pointing it out!
In the example in description: why (3,0) isn't in returned_values?
Such error messages are completely useless.
All the preloaded stuff should be moved to fixture.