This for dupes values:
(defun ALE_MostOccurrences (In_Lst / OutLst TmpItm TmpLen MaxLen)
(while In_Lst
(setq
TmpItm (car In_Lst)
OutLst
(cons
(cons
(setq TmpLen
(-
(length In_Lst)
(length (setq In_Lst (vl-remove TmpItm (cdr In_Lst))))
)
)
TmpItm
)
OutLst
)
)
(if (> TmpLen MaxLen) (setq MaxLen TmpLen))
)
(list Maxlen OutLst)
)
; Orginal "Massoc" by M. Puckett
(defun ALE_MAssoc (DxfKey ImpLst / TmpLst OutLst)
(while (setq TmpLst (assoc DxfKey ImpLst))
(setq OutLst (cons (cdr TmpLst) OutLst)
ImpLst (cdr (member TmpLst ImpLst))
)
)
(reverse OutLst)
)
Comando: (setq Info (ALE_MostOccurrences '(4 3 2 1 4 3 2 4 3 4 5 5 5 5)))
(4 ((4 . 5) (1 . 1) (2 . 2) (3 . 3) (4 . 4)))
Comando: (ALE_MAssoc (car Info) (cadr Info))
(5 4)