day 13 - part 2, now SORT with that ORDER

This commit is contained in:
efim
2022-12-14 20:41:44 +00:00
parent 1457992342
commit 16cb2be49b
4 changed files with 30 additions and 0 deletions

View File

@@ -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