commit 7a47c795fe3202aaf521b547c482e9d98ff837aa parent 35c946e7d5e16c208c621d362897e660a52d3ff0 Author: Lukas Henkel <lh@entf.net> Date: Sun, 1 Dec 2024 12:50:28 +0100 Parse input in same loop Diffstat:
M | src/day-1.lisp | | | 5 | +++-- |
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/day-1.lisp b/src/day-1.lisp @@ -7,8 +7,9 @@ (let ((right-counts (make-hash-table)) left right) - (loop with input = (mapcar #'read-number-list (read-input input)) - for row in input + (loop for line = (read-line input nil) + until (null line) + for row = (read-number-list line) for right-num = (cadr row) do (push (car row) left) (push right-num right)