day 13 - part 2, now SORT with that ORDER
This commit is contained in:
@@ -45,3 +45,10 @@
|
||||
when (< (nest-2-< (nth i *day13-lefts*) (nth i *day13-rights*)) 0)
|
||||
collect (1+ i)))
|
||||
(apply #'+ *day13-indices*))
|
||||
|
||||
;;; PART 2
|
||||
(let ((sorted (sort (copy-list *day13-all-list*) (lambda (left right)
|
||||
(< (nest-2-< left right) 0)))))
|
||||
(* (1+ (position '((2)) sorted :test #'equal))
|
||||
(1+ (position '((6)) sorted :test #'equal))))
|
||||
;; 24477 yay
|
||||
|
||||
Reference in New Issue
Block a user