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.
This basically gives the answer ...
Thanks a lot for the tip. Number theory is not something I knew anything about. I would have been stuck for a long time!
Not a kata suggestion, but a useful one ~~
Any solution which is not O(1) will timeout depending on the input size. While approving this I was not sure what to do with that limit, since author had just 1 fixed solution of size 690. Now, I've updated the description to have bound of 690.
That was the required time complexity.
Ok I kinda solved the kata, so now I have access to the solutions, and I agree with you that ice1000's solution is quite unreadable =P I'll try to make sense of it tomorrow.
EDIT: aaand I give up.
I'm not bothered by it; just clarifying the intended purpose of the tags.
Suggestion tags are for suggestions on changes to the kata. If you just want to provide a suggestion on an approach to solving the challenge, there's no need for the tag.
This comment is hidden because it contains spoiler information about the solution
O(n√n) whatever the input? What is this witchcraft.