I recently came across a very interesting problem solving site. It’s called Project Euler (usually pronounced Oiler) and it looks like it has been around for several years. The concept is simple. The administrators post problems to solve. The problems are typically math/science based and most require some type of programming language to solve. Users try to solve problems (in their language of choice) and are credited when they post a correct answer.
The site keeps track of the basic stats – like which problems and how many you have answered, as well as how many other users have successfully answered each problem. Also interesting is the number of users and what languages they are using. It was interesting to see that C/C++ seems to be the language of choice (with over 14,000 users as of this posting). The next most popular were Python (13,000 users), Java (8,600) and C# (4,600). MATLAB and Octave had about 1,000 users.
One of the coolest features of the site is that once you’ve solved a problem, you get access to their solution (in pdf) and the bulletin board to see many of the other solvers’ solutions. For example, if you’re a C++ programmer, you can learn several other approaches on how to solve the same problem. Since there aren’t too many users of MATLAB or Octave on the site, I didn’t see any other users’ code for solving the problems in these languages. So I’ve decided it might be beneficial to post my code here.
One last note, if you’re participating in the project, don’t worry about me revealing the answers here. I’ll try my best not to. If I do on occasion, don’t get all worked up, just try not to violate the spirit of the project. The site exists for fun – to practice coding, learn from others, and perhaps share your own knowledge. I realize that most of us in this game are in it because we find it interesting. We like seeing a problem, figuring out a way to solve it, and then coding a solution to solve it.
If you haven’t seen the site, I encourage you to check out Project Euler. It’s pretty fun, but be careful. For true geeks, it can be addictive. Good luck and happy coding!