C++ solutions for more than 300 Project Euler problems
This is a mirror of my C++ solutions for about half of the Project Euler problems
You can find the code along with in-depth explanations and live demos at https://euler.stephan-brumme.com
Below is an excerpt from https://euler.stephan-brumme.com/why/ :
Almost always the solutions for problems at Project Euler consist of two parts:
I strive to:
Let's not forget that it helps me, too: only if I can explain a solution to someone else then I can be sure that I truly understood it in the first place. And practicing some of the lesser used features of C++ (such as algorithms hidden inside STL, like std::next_permutation) improves my overall coding skills as well.
Sounds like a win-win situation ...
Project Euler encourages you NOT to publish solutions.
I have a different point of view:
So it boils down to:
If someone visits my website/repository then he/she already realized that he/she can't solve that problem and is doing the right thing: ask someone. That's the only way how knowledge can be spread - all famous scientists wrote books. Leonhard Euler was one of the most productive mathematicians and he published 866 papers/books/etc. He shared his knowledge. And a substantial number of my solutions is based on some of his formulas, I only solved them because I could look up his works.
Admittedly, there is no use in publishing lists of the results to Project Euler problems. In my opinion, these numbers don't matter at all: noone really cares whether the result of problem 1 is 233167, 233168 or 233169. That's why you find algorithms, explanations, links, code, ..., basically everything on my website - but not the results. Because these numbers don't teach you anything.