fmt
This commit is contained in:
Alan Daniels 2025-12-08 22:04:58 +11:00
parent 88fa4fed05
commit e48ca63881

View file

@ -20,18 +20,14 @@
(cl-heap:enqueue *queue* (list "" bank depth) 0)
(loop
do (defparameter *candidate* (apply #'bank-max-joltage-step (cl-heap:dequeue *queue*)))
when (integerp *candidate*)
do (return *candidate*)
when (integerp *candidate*) do (return *candidate*)
do (loop for branch in (reverse *candidate*)
do (cl-heap:enqueue *queue* (cdr branch) (car branch)))
)
)
do (cl-heap:enqueue *queue* (cdr branch) (car branch)))))
(bank-max-joltage "234234234234278" 2)
(bank-max-joltage "234234234234278" 12)
(defun bank-max-joltage12 (bank)
(bank-max-joltage bank 12)
)
(bank-max-joltage bank 12))
(defun array-total-joltage (bank-list depth)
(reduce #'+
(mapcar #'bank-max-joltage12 bank-list)))