fork download
  1. (defun two-max (list)
  2. (if (= 2 (length list))
  3. (values (apply #'max list) (apply #'min list))
  4. (multiple-value-bind (a b) (two-max (cdr list))
  5. (let ((c (car list)))
  6. (values (max a c) (max b (min c a)))))))
  7.  
  8. (print (multiple-value-list (two-max '(34 3 2 5 7 3 2 4 7 9 7 5 8 10 33 25 29))))
Success #stdin #stdout 0.02s 10584KB
stdin
Standard input is empty
stdout
(34 33)