2022 Day 1 Clojure meme

This commit is contained in:
Luke Hubmayer-Werner 2022-12-01 20:52:29 +10:30
parent bcef26b1e1
commit 277fcf31b4
1 changed files with 3 additions and 0 deletions

3
2022/day1-minimised.clj Normal file
View File

@ -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