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 timed out error occurs because the code has an infinite loop. The line n = n//2 is outside the while loop, so it never gets executed. This means the value of n never changes inside the loop, causing the loop to run indefinitely.
This comment is hidden because it contains spoiler information about the solution
In reality it's more efficient and better use libraries but to improve your algorithms coding skills, this solution is worst. Shouldn't be on the top practices
Quite hard idea to solve for me in short time.