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.
Yes, it seems is shorter code but the operation every cycle could make it slowest.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
I tried this code in my vscode, and took one of the inputs of the test '86399' and the output was '23.99972222222222:59.98333333333335:59'
So I guess this code is not working right.
I made this just for check the outcomes in a range between 0 and 49:
for i in range(50):
print("For ", i, "Digital root: ", digital_root(i))
if you just leave the "or n" and don't put there the "and 9", the numbers that are divisible by 9 greater than 9 (18, 27, 36,...) will return themselves without adding their digits. Do the excercise and check it for yourself.
I took me some google searches about precedence and read other users replies to understand how the code works.