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.
Mann, spent much time writing it in C++ then realized C++ is not supported :(
This comment is hidden because it contains spoiler information about the solution
yep you are right, I just added the floor for understanding, didn't mean it to be added in actual code.
Run the loop only till i < n/2 instead of n (strictly speaking should be only till square root of n but this works too) . That way, in case the number is prime, your loop will only run half as many times (again, this could be improved further by running it floor(sqrt(n)) many times). Just making it more efficient.