Achieving level two on the Project Euler web site

This is the second of the series on achieving different levels on the Project Euler web site. The web site provides 300+ interesting math/computer programming problems and any problem should be solved by a program within one minute. We have talked about achieving level one before, now you just need to solve another 25 problems to upgrade to level two. :)

Still at this level, it doesn't require much mathematical sophistication. Most problems can still be solved with brute force with some simple optimization, such as pruning the obvious impossibles.

You may also come to realize that the running time of within one minute is quite generous and this allows you to try very different languages. If you follow the forum which allows you to see the discussions on a certain problem only after you have solved it, you can find that people even use assembly language and some other less-known but interesting languages including the J programming language and and the K programming language which seem to be very suitable for solving many of the problems.

Now you also don't necessarily need to solve the problems in the order by the most number of people having solved them. In fact, depending on your background, some problems that come later may actually be easier. You can do "problem shopping" and may be able to work on some problems that have been solved by less than ten thousand people. However, don't venture too far yet. :) At least I myself am more interested in achieving level two faster than trying to solve harder problems at this time.

For certain problems, you may know how to solve them. However, it may be quite hard to describe the solution programmatically. In that case, you may be able to get the answer faster by doing it manually with pen and paper. The good thing is that once you know the answer you can check how other people solve it. Some very good code is there for you to explore.

I think if you can spend 2-3 hours during weekday and 5-6 hours during weekend, 7-10 days should be enough to achieve level two, assuming that you still have life other than solving problems at the Project Euler web site. :)

Following are some problems from the second 25 ones that I find are more interesting.

Back to articles on development