Can someone help me with trying to determine what the most common entry would be from a list. For example,

human
human
elf
elf
elf
halfling

The most common is elf, the second most common is human.

Also, say I wanted to add a level to each entry and depending on the level of the entry would resolve the most common.

human 7
human 3
elf 2
elf 2
elf 2
halfling 7

In this example, human would be most (as 7+3) and halfling would be second most (7).

Cheers,