Compare commits
No commits in common. "9e57a7dffb6508ea5237c7d9e43f42cf2ced07c0" and "f70ba6d543b6126df48e7f9896dfef8e222e59a6" have entirely different histories.
9e57a7dffb
...
f70ba6d543
@ -5,6 +5,7 @@
|
|||||||
(mapv (comp (partial mapv parse-long)
|
(mapv (comp (partial mapv parse-long)
|
||||||
(partial re-seq #"\d+")))))
|
(partial re-seq #"\d+")))))
|
||||||
(def initial-circuits (into #{} (map hash-set input)))
|
(def initial-circuits (into #{} (map hash-set input)))
|
||||||
|
|
||||||
(defn square [x] (* x x))
|
(defn square [x] (* x x))
|
||||||
(defn dist-squared [[ax ay az] [bx by bz]]
|
(defn dist-squared [[ax ay az] [bx by bz]]
|
||||||
(+ (square (- ax bx))
|
(+ (square (- ax bx))
|
||||||
@ -26,7 +27,10 @@
|
|||||||
(if (= circuit-a circuit-b)
|
(if (= circuit-a circuit-b)
|
||||||
circuits
|
circuits
|
||||||
(let [combined (clojure.set/union circuit-a circuit-b)]
|
(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)
|
initial-circuits)
|
||||||
(sort-by count)
|
(sort-by count)
|
||||||
(take-last 3)
|
(take-last 3)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user