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 comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
The aim is to have the most cards at the end. Not take the most of them each turn.
Sometimes it's better to just take one.
Remember the instructions : Bob also tries to play optimally.
In your case, Bob could take 9 cards by playing it smarter so Alice would be able to only take 4 cards.
n = 69 : expected 30n to equal 8n - is too little number
n = 85853 : expected 42906n to equal 26n - is too little number
For n = 428708124794396147 : expected 107177031198598953n to equal 88n - is too little number
even for optimal game
Next time, please use the question label for a question, the issue label is reserved for problems with the kata itself.
And to answer your question : keep in mind that both players play optimally. For example, with
n = 69
, Bob can constrain Alice to take only one card each time it is her turn. The beginning of that game is:Random Tests
Small Tests
For n = 69 : expected 30n to equal 8n
Completed in 1ms
Medium Tests
For n = 85853 : expected 42906n to equal 26n
Completed in 1ms
Performance Tests
For n = 428708124794396147 : expected 107177031198598953n to equal 88n
how is it possible?
It tells you right in the second sentence that the number of cards goes up to
10**18
though?Edit: I've added the
performance
tag to be even more clear.Putting a performance test at the end trully is a dick move. At least it should be announced in the instructions.
Impressive, but absolutely unreadable =)
This comment is hidden because it contains spoiler information about the solution
This is a great example of "this works but please never do that".
Damn, forgot my console.log... worst practice guys !
Neither did I. It's nice !
Simple, clear and readable. Nice one !
Loading more items...