Euler problem 4.1

(describe #'elt)

(defun palindromep (seq)
  (let ((end (1- (length seq))))
    (or (< end 1)
        (and (eql (elt seq 0) (elt seq end))
             (palindromep (subseq seq 1 end))))))

(defun euler-4 ()
  (loop for a from 1 to 999
      maximize
      (loop for b from 1 to 999
            when (palindromep
                    (prin1-to-string (* a b)))
              maximize (* a b) into best
            finally (return (or best 0)))))

— skeeto/euler-cl

.

— Me@2022.10.03 03:03:30 PM

.

.

2022.10.03 Monday (c) All rights reserved by ACHK