Day 19: Forgot to revert experimental changes.
This commit is contained in:
parent
8e6e0dcfcd
commit
e5c9bddeb3
|
@ -26,11 +26,6 @@
|
|||
(match-let ([(list x y z) change])
|
||||
(+ (abs x) (abs y) (abs z))))
|
||||
|
||||
(define (deltas region)
|
||||
(for*/set ([beacon1 region]
|
||||
[beacon2 region])
|
||||
(abs (magnitude (delta beacon1 beacon2)))))
|
||||
|
||||
(define rotations
|
||||
(for*/fold ([rotations '()])
|
||||
([dx '(1 -1)]
|
||||
|
@ -51,7 +46,6 @@
|
|||
(values region (map #{set-map region %} rotations))))
|
||||
|
||||
(define (combine region1 region2)
|
||||
(and (>= (set-count (set-intersect (deltas region1) (deltas region2))) 66)
|
||||
(for*/or ([beacon1 region1]
|
||||
[beacon2 region2])
|
||||
(define change (delta beacon1 beacon2))
|
||||
|
@ -59,7 +53,7 @@
|
|||
(set-map region2 #{shift % (delta beacon1 beacon2)}))
|
||||
(and (>= (set-count (set-intersect region1 shifted-region2)) 12)
|
||||
(cons (set-union region1 shifted-region2)
|
||||
change)))))
|
||||
change))))
|
||||
|
||||
(define-values (part1 part2)
|
||||
(time
|
||||
|
|
Loading…
Reference in New Issue