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.
It depends on what your goals are. This is a constant time solution, so it doesn't take longer to run as the number gets large. Efficient algorithms are the goal of the Project Euler site from which this problem was taken. Also, I'd rather the coder that comes after me have to figure something out than write code in such a way that neither of us learns anything. :) I would certainly be disappointed to learn the coder in front of me chose a less appropriate algorithm out of fear it would be too hard for me.