Possible Duplicate:
How to count occurrence of an element in a List
I have a list like List<String> A={12, 12, 14, 16, 16}. How can I find the number of elements distinctly as
12->2
14->1
16->2
by using a function like countElements(A,"12") or A.count("12")? Is there a library or a function?