A fun programming problem from 4clojure:

"Write a function which calculates the sum of the minimal path through a triangle. The triangle is represented as a collection of vectors. The path should start at the top of the triangle and move to an adjacent number on the next row until the bottom of the triangle is reached."

  (= 7 (__  '([1]
          [2 4]
         [5 1 4]
        [2 3 4 5]))) ; 1->2->1->3

Note that this effectively the same as Project Euler #67 [2], and can be answered efficiently in any language, though it took me a bit of head scratching before getting it.

My own answer linked in the comments (don't click unless you want a spoiler). Feel free to discuss your ideas and techniques below.

[1] http://www.4clojure.com/problem/79
[2] http://projecteuler.net/problem=67
Shared publiclyView activity