Problems 18: Maximum path sum I and 67: Maximum path sum II are the same puzzle, just at different scales. It is possible (but needlessly slow) to brute-force problem 18 by checking all 16384 paths. However, problem 67 has 2^99 possible routes, making it completely infeasible to take the brute-force approach. Of course, both problems have very efficient solutions that should run within a fraction of a second on any basic PC.
I didn’t remember exactly how I solved them at first, but I think I got it now after thinking for some minutes. No idea yet how it will generalize to the last one though!
I do wonder how seriously they would take their message
Please do not deprive others of going through the same process by publishing your solution outside of Project Euler. Members found to be spoiling problems beyond the first one-hundred problems will have their accounts locked.
If one covers a solution with a spoiler tag, can it really be said to be spoiling the experience of other solvers? but idk yeah if it’s really #100 where the rule comes into effect, I guess we’ll get to that when (or if) we get to it haha
After skimming through most of the first 100 problems, I think that #15 Lattice Paths seems like the “most mathematical” problem in the sense that the correct approach should not require any real programming. Of course, there is a naive, brute-force programming solution that could be feasible (with complexity of roughly 2^37 iterations), but the correct approach is trivial:
Solution to problem 15
Since each path must make exactly 40 steps, with 20 “rights” and 20 “downs”, the total number of possible paths can be found as “40 choose 20” (see Combination - Wikipedia). Computing that is fairly straightforward, and can even be done by just typing “40 choose 20” into Google.
On the other hand, it seems like #54 Poker hands is the “most programmatic” problem. I don’t think there are any clever mathematical shortcuts, but it is fairly straightforward, albeit a bit tedious, to program a poker hand comparison function. Instead of comparing two hands directly, one could first write a function that converts each hand to a number, where comparing the numbers corresponding to any hands is equivalent to comparing the hands. Making this trickier would be to require that the numbers produced by the function must be integers that range from 1 to the total number of hand equivalence classes. Of course, all of that is just making the problem needlessly more complex just to add more meat to it. Another thing that could be interesting is to compose a regular expression that would precisely match the lines where player 1 has the winning hand.
I think it might be an attempt by them to dissuade people from just looking for a repository with all the solutions, making an account and submitting all the answers.
Of course there’s no reason to think that that is the current or official stance of anything to do with project Euler.
I do get the idea, they want their little flair to mean something, “I solved this many problems myself”. It probably does mean that for a lot of people.
I’m not sure I see a reason to be so strict otherwise.
I think it’s nice to try to be respectful of the “no sharing solutions” rule. But of course there are already solution repositories available to be found if you go looking for them. So keeping solutions behind spoiler tags and not sharing any solutions beyond 100 seems a good compromise.
(We’ll have plenty of material for this thread without going beyond the first 100, I think)
Okay this may be me being too lazy to look it up, but can someone tell me real quick what the issue is? I haven’t made an account on Project Euler and don’t intend to as I don’t see any point to it, I can easily work on the tasks that people share in this thread. Is there any form of competition going on? Is there anything to gain from submitting a solution?
But then I really see no issue with sharing solutions. In what way is anyone’s experience compromised by being able to look up a solution somewhere online for a problem they voluntarily try to solve?
Yes I agree though, no-one’s experience is compromised unless you buy into the whole “you have to try it yourself or you’re not learning”. I think it’s fine to do the fun ones, read others and discuss others solutions. I don’t see anything inherently wrong with being given a solution or not attempting every problem solely by oneself. At the end of the day time is finite, and one shouldn’t expect everyone to reinvent every bit of mathematics or programming knowledge needed.
However
also a reasonable point of view. If they don’t want discussion/solutions past problem 100 (which is probably a compromise I’d say on their side) then one could choose to be respectful of it.
It’s so sad that the challenges are discontinued, I spent so much time building ants, almost lost a job because boss saw me writing Java during work time