From ad5dd89ea90c3198d41a3b35250b4d8cd7af564d Mon Sep 17 00:00:00 2001 From: Leah Neukirchen Date: Sun, 6 Dec 2020 15:04:11 +0100 Subject: day05 --- day05.clj | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 day05.clj (limited to 'day05.clj') diff --git a/day05.clj b/day05.clj new file mode 100644 index 0000000..f165d11 --- /dev/null +++ b/day05.clj @@ -0,0 +1,8 @@ +(def data + (->> (slurp "day05") + (clojure.string/split-lines) + (map (fn [x] (reduce #(+ (* 2 %1) %2) + (map {\F 0, \B 1, \L 0, \R 1} x)))))) + +(apply max data) ; => 818 +(apply min (remove (set data) (map inc data))) ; => 559 -- cgit 1.4.1