fork(2) download
  1. (define (task lst)
  2. (define (count x c m)
  3. (cond ((null? x) (if (> c m) c m))
  4. ((list? (car x)) (if (> c m) (count (cdr x) 0 c) (count (cdr x) 0 m)))
  5. (#t (count (cdr x) (+ c 1) m))))
  6. (count lst 0 0))
  7.  
  8. (display (task '(1 2 (1) (2) (3) 4 5 6)))
  9.  
Success #stdin #stdout 0.01s 8672KB
stdin
Standard input is empty
stdout
3