[('John',5), ('Mary',4), ('Sherry',10), ('John',3),('Mary',3),......... ..]
There are duplicate names in this list, and each name corresponds to the number of characters in their text messages. Given such a list and a specific number N, you are asked to return the top N most active users.
I used a dict to count how many words each person said. Then it's sorted.