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.
Python 3.11 fork
This kata should be ranked as 3 or even 2 kyu imo. The test cases make it way more challenging performance wise than what the description suggests. Additionally, it would be very helpful to include the harder test cases in the description.
No, I did not use this one. The one you linked describes Round Robin, the ones I used listed three or so other algorithms and did not involve round robin.
I cannot find it now tho.
@hobovsky could you please share a link to those algorithms?
inefficient but readable. For readable improvement use
stone.includes(curstone - 2)instead
stones.indexOf(curstone-2) > -1
Thanks for this! I'll have to have a look at those Zombie solutions that pass here.
I've tried some RR solutions from Zombie apocalypse kata here, and it managed to pass in ~10 seconds, so on a verge of timing out, but still doable. Maybe you need to improve your implementation?
My solution is slightly faster than RR, runs in ~8.5s, and is based on another algorithm found in some scientific paper on the topic. The paper contained a couple of more algorithms, but I could not get them working, only the most basic one (but, apparently, still sometimes better than RR).
Generally, there's quite a few materials and papers online with various approaches to the problem, up to some insanely high values (and equally insane algorithms).
About ranks, you are right, they cannot be changed in an easy way. But since this kata has not many solutions yet, maybe something could be done. It would hjust have to be decided which kata shold be taken in what direction.
This comment is hidden because it contains spoiler information about the solution
simple "return coins" takes 5 seconds, so we're left with 7 sec to run the solution
perfect example of how potentially great kata is ruined by a couple of super experienced programmers who only think about themselves
With new perfomance requirements you need to be lechevalier to solve this) I think this kata deserves 3kyu, you can see it by amount of people who solved it.
Now the most efficient solution (lechevalier's solution) is required for this kata. ;-)
Thanks for your remarks, I've refactored my code and added some more tests
Also, the benchmark tests isn't even performance heavy. My solution runs through them in a blaze :P I suspect you might have the
not aware of the relevant algorithmic approachproblem.
My solution can run through lists of numbers of range
10000 to 20000in around 0.2 seconds. Maybe you can use my solution as a reference to write your own solution, and make the tests harder.
Loading more items...