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 problem asks to return the whole number of years it takes. If it does not converge, how can you return an integer?
If the description specified "Return -1 if population does not reach p in 32767 years" or something, then you could write such a test, but it doesn't.
Yes, however the description says that there will be only one.
Lmao what?
This comment is hidden because it contains spoiler information about the solution
Yeah, you're right. At some point this kumite changed into testing whether or not the number is even.
As for the power_of_two, I think that the first solution was the best one:
return n & ( n - 1 ) == 0