From 6bd2a4f48c7c44ffa7c246cd75e3013a2cab44ba Mon Sep 17 00:00:00 2001 From: Jacopo De Simoi Date: Fri, 5 Dec 2025 11:25:19 -0500 Subject: [PATCH] [p5] Whoops, part of the code for part 1 was missing --- p5/p5.org | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/p5/p5.org b/p5/p5.org index 8b42aa1..cb9dec0 100644 --- a/p5/p5.org +++ b/p5/p5.org @@ -17,12 +17,16 @@ First load the data as a list of cons cells (start . end) This is for part 1 #+begin_src emacs-lisp - (length - (-filter (lambda (id) - (--any (and (>= id (car it)) - (<= id (cdr it))) + (-count (lambda (id) + (--any (and (>= id (car it)) + (<= id (cdr it))) + ranges)) + ids) #+end_src +#+RESULTS: +: 744 + For part 2, sort and merge the ranges (when they are overlapping or adjacent), then sum their lengths #+begin_src emacs-lisp