rename var
This commit is contained in:
parent
37c2786336
commit
055a37a089
@ -7,7 +7,7 @@
|
||||
(defn area [[ax ay] [bx by]]
|
||||
(* (inc (abs (- ax bx)))
|
||||
(inc (abs (- ay by)))))
|
||||
(def furthest-points
|
||||
(def largest-squares
|
||||
(->> (for [a input
|
||||
b input
|
||||
:when (not= a b)]
|
||||
@ -17,7 +17,7 @@
|
||||
(sort-by #(apply area %))))
|
||||
|
||||
;; part 1
|
||||
(->> furthest-points
|
||||
(->> largest-squares
|
||||
last
|
||||
(apply area))
|
||||
|
||||
@ -40,7 +40,7 @@
|
||||
|
||||
;; part 2
|
||||
(def line-segments (map vector input (conj (vec (rest input)) (first input))))
|
||||
(->> furthest-points
|
||||
(->> largest-squares
|
||||
(filter (fn [[a b]]
|
||||
(let [segments (filter (fn [[seg-a seg-b]] (and (not= a seg-a)
|
||||
(not= a seg-b)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user