(defun int-list-from (str)
(mapcar #'parse-integer (list-from str)))
+(defun list-list-from (str)
+ (split-sequence "" (list-from str) :test #'string=))
+
(defun cartesian-product (A B &rest C)
(let ((helper (lambda (X Y)
(if Y (loop for x in X
(wrap-A (mapcar #'list A)))
(reduce helper C :initial-value (funcall helper wrap-A B))))
+(defun manhattan-distance (a b)
+ (destructuring-bind ((ax ay) (bx by)) (list a b)
+ (+ (abs (- ax bx))
+ (abs (- ay by)))))
+
(def-suite util)
(in-suite util)