What I really like about this kind of problems is that it makes one think
Without a sorting or recursive
(defun db:anum (nl / il minn maxn i ml dl bl gl fl)
;;;GOOD AND BAD LISTS
(foreach a nl
(if (wcmatch a "*[~0-9]*")
(setq bl (cons a bl))
(setq gl (cons a gl))))
(setq il (mapcar 'atoi gl)
minn (apply 'min il)
maxn (apply 'max il)
i minn)
(repeat (1+ (- maxn minn))
(setq fl (cons (list i 0) fl))
(setq i (1+ i)))
(foreach n il
(if (assoc n fl)
(setq fl (subst (list n (1+ (cadr (assoc n fl))))
(assoc n fl) fl))))
(foreach n fl
(cond ((= 1 (cadr n)))
((= 0 (cadr n)) (setq ml (cons (car n) ml)))
((< 1 (cadr n)) (setq dl (cons (car n) dl)))))
(princ "\nFull List : \t")(prin1 fl)
(princ "\nDuplicate : \t")(prin1 dl)
(princ "\n Missing : \t")(prin1 ml)
(princ "\n Bad : \t")(prin1 bl)
(prin1))
I'll have to noddle on the rest of variations. Thanks to all ! -David