fork download
  1. (define (f ns)
  2. (define (aux m1 m2 ns)
  3. (let* ((n (and (not (null? ns)) (car ns)))
  4. (ns (and n (cdr ns))))
  5. (cond
  6. ((not n) m2)
  7. ((not m1) (aux n #f ns))
  8. ((or (and (not m2) (< m1 n)) (< m1 n m2)) (aux m1 n ns))
  9. ((or (and (not m2) (< n m1)) (< n m1 m2)) (aux n m1 ns))
  10. (else (aux m1 m2 ns)))))
  11. (aux #f #f ns))
  12. (print (f '(4 5 1 7 1 2 8 9 2 7)))
  13. (print (f '(1 1 1)))
  14. (print (f '(1)))
  15. (print (f '()))
  16.  
Success #stdin #stdout 0.01s 7880KB
stdin
Standard input is empty
stdout
2
#f
#f
#f