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:25

>>4
If the triangle is called triangle, and is a list of lists:
((a) (b c) (d e f)), that code does this: (+ (max a) (max b c) (max d e f)), where (+ x y ... z) = x+y+...+z, and (max x y ... z) returns its biggest argument.

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