Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Project Euler

Name: Anonymous 2011-12-29 17:50

Hi /prog/,
I'm currently improving my fairly rudimentary programming skills by doing Project Euler exercises.
Problem 18 (http://projecteuler.net/problem=18) had me stuck for a while today, and now that I've solved it, I still can't help but feel that my way of doing it is awfully odd.
Here's a link to my solution: http://pastebin.com/YX4kW3dA
How would you have solved this problem?

Name: Anonymous 2011-12-29 18:38

>>5
I don't think that's right, you have to follow a "path" through the triangle. If you have
    05
  10  06
07  09  11

the solution would not be 5 + 10 + 11 = 26 because you can't "reach" the 11 once you've gone to the 10. 5 + 10 + 9 = 24 would be the solution here.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List