day 9: fix bug that didn't change the answer
This commit is contained in:
parent
4e2ea7d641
commit
fd0c7a36d0
2
9.rkt
2
9.rkt
|
@ -21,7 +21,7 @@
|
||||||
;; continuously sort the part of the vector below the iterator, and call contains-sum?
|
;; continuously sort the part of the vector below the iterator, and call contains-sum?
|
||||||
(define (part1 vec)
|
(define (part1 vec)
|
||||||
(for*/first ([i (in-range 25 (vector-length vec))] [x (in-value (vector-ref vec i))]
|
(for*/first ([i (in-range 25 (vector-length vec))] [x (in-value (vector-ref vec i))]
|
||||||
#:unless (contains-sum? vec 0 i x))
|
#:unless (contains-sum? (vector-copy vec (- i 25) i) 0 25 x))
|
||||||
(cons i x)))
|
(cons i x)))
|
||||||
|
|
||||||
(define (part2 vec pt1-ans)
|
(define (part2 vec pt1-ans)
|
||||||
|
|
Loading…
Reference in New Issue