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.
I wrote almost the same but the last cycle used enumerate
Could you please explain the following line: "for j in range(1,int(i**.5)+1):" ?
I just wanna say this is a beautiful and clever implementation , 100x faster than mine lol.
I love it how you came up with the range for the 2nd for loop to be up to i**0.5 this is so efficient.
So, if i is 1024, you only loop from 1 to 32 and then you get the other numbers by dividing 1024 by (1,32).
In my case I would go all the way to 1024 in the loop, lol.
When i tested my solution for (1,30 000 ) it takes 44s, lol, where as yours takes 0.4s :D
This comment is hidden because it contains spoiler information about the solution