From 4c6a711b39da4f567583a1f60bb1c6e79d61ff02 Mon Sep 17 00:00:00 2001 From: Jacopo De Simoi Date: Sat, 6 Dec 2025 08:53:11 -0500 Subject: [PATCH] [p6] part 1 --- p6/p6.org | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 p6/p6.org diff --git a/p6/p6.org b/p6/p6.org new file mode 100644 index 0000000..9eaa9ee --- /dev/null +++ b/p6/p6.org @@ -0,0 +1,29 @@ +#+title: Solution to p6 + +First load the data as a list of cons cells (start . end) +#+begin_src emacs-lisp :results none + (with-temp-buffer + (insert-file-contents "input") + (advent/replace-multiple-regex-buffer + '( + ("^" . "(") + ("$" . ")") + )) + (goto-char (point-min)) + (insert "(setq data '(") + (goto-char (point-max)) + (insert "))") + (eval-buffer)) +#+end_src + +This is for part 1. Quite straightforward +#+begin_src emacs-lisp + (-sum (--map (apply (car it) (cdr it)) + (apply #'-zip-lists (-rotate 1 data)))) +#+end_src + +#+begin_src emacs-lisp + +#+end_src + +