This commit is contained in:
Adam Jeniski 2025-12-08 14:01:45 -10:00
parent da7b893c37
commit 4eae354f25

View File

@ -4,7 +4,7 @@
(def input (->> (input-manager/get-input 2025 8)
(mapv (comp (partial mapv parse-long)
(partial re-seq #"\d+")))))
(def circuits (into #{} (map hash-set input)))
(def initial-circuits (into #{} (map hash-set input)))
(defn square [x] (* x x))
(defn dist-squared [[ax ay az] [bx by bz]]
@ -32,7 +32,7 @@
(disj circuit-a)
(disj circuit-b)
(conj combined))))))
circuits)
initial-circuits)
(sort-by count)
(take-last 3)
(map count)
@ -50,7 +50,7 @@
(if (= 1 (count circuits'))
(reduced [a b])
circuits')))))
circuits)
initial-circuits)
(map first)
(apply *))