From 46e48b5f4bd88a489f4c22089122cf7048e8ea0f Mon Sep 17 00:00:00 2001 From: Adam Jeniski Date: Sat, 9 Dec 2023 09:56:12 -0500 Subject: [PATCH] golf --- 2023/src/day09.clj | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/2023/src/day09.clj b/2023/src/day09.clj index 12712a4..12eecf9 100644 --- a/2023/src/day09.clj +++ b/2023/src/day09.clj @@ -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)))