From 277fcf31b49fdc5c61510058071aa0c94ad6ceb7 Mon Sep 17 00:00:00 2001 From: Luke Hubmayer-Werner Date: Thu, 1 Dec 2022 20:52:29 +1030 Subject: [PATCH] 2022 Day 1 Clojure meme --- 2022/day1-minimised.clj | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 2022/day1-minimised.clj diff --git a/2022/day1-minimised.clj b/2022/day1-minimised.clj new file mode 100644 index 0000000..57dd93b --- /dev/null +++ b/2022/day1-minimised.clj @@ -0,0 +1,3 @@ +(def sorted-totals (sort (map #(reduce + %) (map #(map read-string %) (map clojure.string/split-lines (clojure.string/split (slurp "day1-input") #"\n\n")))))) +(println (last sorted-totals)) ; Part 1 +(println (reduce + (take-last 3 sorted-totals))) ; Part 2 \ No newline at end of file