diff options
-rw-r--r-- | 2024/01/puzzle-1.el | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/2024/01/puzzle-1.el b/2024/01/puzzle-1.el index caf359b..622e9e5 100644 --- a/2024/01/puzzle-1.el +++ b/2024/01/puzzle-1.el @@ -8,10 +8,11 @@ (insert ?\])) (read (current-buffer))))) (cl-loop for i from 0 below (length nums) + for x = (aref nums i) if (cl-evenp i) - collect (aref nums i) into xs + collect x into xs else - collect (aref nums i) into ys + collect x into ys finally return (thread-last (seq-mapn #'- (sort xs) (sort ys)) (mapcar #'abs) |