Compare commits
2 Commits
f70ba6d543
...
9e57a7dffb
| Author | SHA1 | Date | |
|---|---|---|---|
| 9e57a7dffb | |||
| 4e5cba07bf |
@ -5,7 +5,6 @@
|
||||
(mapv (comp (partial mapv parse-long)
|
||||
(partial re-seq #"\d+")))))
|
||||
(def initial-circuits (into #{} (map hash-set input)))
|
||||
|
||||
(defn square [x] (* x x))
|
||||
(defn dist-squared [[ax ay az] [bx by bz]]
|
||||
(+ (square (- ax bx))
|
||||
@ -27,10 +26,7 @@
|
||||
(if (= circuit-a circuit-b)
|
||||
circuits
|
||||
(let [combined (clojure.set/union circuit-a circuit-b)]
|
||||
(-> circuits
|
||||
(disj circuit-a)
|
||||
(disj circuit-b)
|
||||
(conj combined))))))
|
||||
(-> circuits (disj circuit-a) (disj circuit-b) (conj combined))))))
|
||||
initial-circuits)
|
||||
(sort-by count)
|
||||
(take-last 3)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user