mirror of
https://github.com/Ajetski/advent-of-code.git
synced 2025-09-30 07:23:18 -09:00
golf
This commit is contained in:
parent
943936a4e5
commit
46e48b5f4b
@ -12,13 +12,12 @@
|
||||
pyramid
|
||||
(recur (conj pyramid (mapv - (rest last-line) last-line)))))))
|
||||
|
||||
(defn solve [reduction]
|
||||
(->> (get-puzzle-input 9)
|
||||
(map parse-line)
|
||||
(map generate-pyramid)
|
||||
(map reverse)
|
||||
(map #(reduce reduction 0 %))
|
||||
(reduce +)))
|
||||
(defn solve [reduction] (->> (get-puzzle-input 9)
|
||||
(map parse-line)
|
||||
(map generate-pyramid)
|
||||
(map reverse)
|
||||
(map #(reduce reduction 0 %))
|
||||
(reduce +)))
|
||||
|
||||
;; part 1
|
||||
(solve (fn [num line] (+ (peek line) num)))
|
||||
|
Loading…
x
Reference in New Issue
Block a user