(define (pandigital? . xs)
(let ((ds (make-vector 10 #f)))1
(let x-loop ((xs xs))
(if (null? xs) #t
(let d-loop ((x (car xs)))
(if (zero? x) (x-loop (cdr xs))
(let ((q (quotient x 10))
(r (remainder x 10)))
(if (vector-ref ds r) #f
(begin (vector-set! ds r #t)
(d-loop q))))))))))
(time (begin (display
(let a-loop ((a 100))
(let b-loop ((b (+ a 1)))
(if (= b 1000) (a-loop (+ a 1))
(let ((c (+ a b)))
(if (and (< 999 c) (pandigital? a b c)) a
(b-loop (+ b 1)))))))) (newline)))