# HG changeset patch # User Steve Losh # Date 1487154254 0 # Node ID 9d7ea7bf528b79d1727214439a9f69dc06be7551 # Parent 1ae69146e0e2b739fff67db7552d6117478e2005 `reduce` has a `:from-end` arg diff -r 1ae69146e0e2 -r 9d7ea7bf528b src/euler.lisp --- a/src/euler.lisp Mon Feb 13 18:58:19 2017 +0000 +++ b/src/euler.lisp Wed Feb 15 10:24:14 2017 +0000 @@ -507,11 +507,12 @@ (91 71 52 38 17 14 91 43 58 50 27 29 48) (63 66 04 68 89 53 67 30 73 16 69 87 40 31) (04 62 98 27 23 09 70 98 73 93 38 53 60 04 23)))) - (car (reduce (lambda (last next) + (car (reduce (lambda (prev last) (mapcar #'+ - (mapcar #'max last (rest last)) - next)) - (reverse triangle))))) + prev + (mapcar #'max last (rest last)))) + triangle + :from-end t)))) ;;;; Tests --------------------------------------------------------------------