AdventOfCode/2022/day1-minimised.clj

3 lines
255 B
Clojure
Raw Permalink Normal View History

2022-12-03 17:22:53 +10:30
(def sorted-totals (sort (map #(reduce + %) (map #(map read-string %) (map clojure.string/split-lines (clojure.string/split (slurp "input/1") #"\n\n"))))))
2022-12-01 20:52:29 +10:30
(println (last sorted-totals)) ; Part 1
(println (reduce + (take-last 3 sorted-totals))) ; Part 2