From 0035682fc6b1c48c8b3e496379fa3b413697fcad Mon Sep 17 00:00:00 2001 From: Matteo Landi Date: Sat, 27 Jan 2024 15:45:28 +0100 Subject: [PATCH] Use memo function from utils --- src/2023/day12.lisp | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/src/2023/day12.lisp b/src/2023/day12.lisp index fe19409..7dd9571 100644 --- a/src/2023/day12.lisp +++ b/src/2023/day12.lisp @@ -6,18 +6,6 @@ (list springs (extract-positive-integers groups)))) -(defmacro memoizing ((ht &rest key-parts) &body body) - (with-gensyms (memo key) - `(let ((,memo ,ht) - (,key (list ,@key-parts))) - (multiple-value-bind (res res?) (gethash ,key ,memo) - (if res? - res - (setf (gethash ,key ,memo) - (block memo - ,@body))))))) - - (defun count-valid-arrangements (s) (destructuring-bind (springs groups) (parse-condition-record s) (bnd1 (memo (make-hash-table :test 'equal))