about summary refs log tree commit diff
path: root/day05.clj
blob: f165d114127bb5519d6f4d9e5fecc8cd297f339e (plain) (blame)
1
2
3
4
5
6
7
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