2022 Day 1 Clojure meme
This commit is contained in:
parent
bcef26b1e1
commit
277fcf31b4
|
@ -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
|
Loading…
Reference in New Issue