From 43b15751544ae6d6044faad4847e3a7e11614af2 Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Tue, 17 Oct 2023 14:35:41 +0100 Subject: Better comment on puzzle-6.lisp --- 2022/puzzle-6.lisp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to '2022') diff --git a/2022/puzzle-6.lisp b/2022/puzzle-6.lisp index 7aed004..e26f723 100644 --- a/2022/puzzle-6.lisp +++ b/2022/puzzle-6.lisp @@ -17,7 +17,11 @@ nil)) (let* ((char-list (string-to-clist input)) - (unique-check (mapcar (lambda (x y z w) (is-unique (list x y z w))) char-list (cdr char-list) (cdr (cdr char-list)) (cdr (cdr (cdr char-list)))))) + ;; List of is-unique on 4 character subsequences of input + (unique-check (mapcar (lambda (x y z w) (is-unique (list x y z w))) + char-list (cdr char-list) + (cdr (cdr char-list)) + (cdr (cdr (cdr char-list)))))) (calculate-position (position t unique-check)))) (format t "First round: ~a~%" (first-round input)) -- cgit v1.2.3-13-gbd6f