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.
The idea of splitting this kata to easy and hard versions was the assumption that the easy version can be brute forced, but the hard version is not. For example, here exist kata about prime numbers, which have a simple and more difficult version. If follow your logic, harder version must be removed too, because user which completed easy version can be smart enough for publish solution capable to pass more harder variant. I think not all users have enough experience to solve more difficult variant of kata and beginners deserve to have their own simplified version. In case if you keep insisting to delete I preffer to remove simple version and keep that, fully functional, more complex version.
Random test starts from 2^8 now. Lesser values can be easy calculated by naive solution.
7 teams will start tournament directly from part 2 (7 is odd number, part 1 will be skipped), were they must play each with other, thus 21 games will be played instead of 7, meanwhile 8 teams will 4 quadfinals, play 2 semifinals, 1 final = 7 games, just much as you need. So, here only one correct answer: 8 teams.
Second case is the same, 67108863 teams will play 2_251_799_713_021_953 games, instead of 67108863.
This comment is hidden because it contains spoiler information about the solution
I understand what you mean, but let me give some explanations about this kata. This (simple version) kata was designed especially so, what any bruteforce solution can give correct answer without timeout. You really need no to deep understand how to calc answer, just realize idea about "combinations" for part 2 and how calc knockout tournament rounds. I deliberately split this (easy) and hard version, where N was increased to 2 to the power of 1024 and random test splitted by ranges 2 ^ 60 < N < 2^ 64, 2 ^ 120 < N < 2^ 128 ... 2 ^ 960 < N < 2^ 1024, thus naive solutions can't solve even test where N = 2^64, and user must found way how to narrow down count of possible solutions, what require understanding how both part 1 and part 2 can be combined between themselves. Try out harder version and leave your feedback, I really interested how to improve these katas. It's my first experience of kata creating and greater part of comments is a issues :/
Reference solution for the previous kata has been replaced by bruteforce version before publish this kata, and here it's get timeout after N goes bigger then 2 ^ 60.
This problem can be avoided if we will use array of strings as required output. But, should we do it? Probably, if Chai will not be updated soon it will be a compromise solutuion.
Typo when rewrite to BigInt :/
Random tests has been reworked for get meaningful values.
-1 changed to empty array.
My bad, i didn't update base test for Chai.
Now kata re-published, reset solution.