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 see an optimization in your solution that can take it to another level when hitting composite numbers.
Not gonna spoil you more ;-)
Prime numbers is one of my favorite playground.
Now that I come back to this solution, I see that it is unnecessary complicated.
Don't hesitate if you have some questions while you dig into it.
Edit: see this fork for a cleaner and even faster code ;-)
thank you sm!