SOLUTION: It makes sense to use the counter to keep track of how well the name currently in memory is doing. Then, whenever that name is heard again, you can increment the counter; when some other name is heard, you must decrement it. The counter begins at 0; if it ever threatens to dip below zero, the current name in memory is replaced by the name being heard, and the counter is incremented from 0 to 1.
This may seem a bit dubious at first, because the new name you are putting into the counter may be the first occurrence of that name, while in the meantime your previous name (and other names) may have occurred many times. For example, if the list were "Alice, Bob, Alice, Bob, Alice, Bob, Charlie," Alice's name would remain in your memory until the end when Charlie becomes your nominee. But that's OK, since no name has a majority.
If a name does occur more than half the time, it's guaranteed to be the one in your memory at the end. Why? Suppose the majority name is Mary, and assume (for convenience) that a name is heard every minute. Divide time into intervals during which the same name remains in memory. Then each interval except possibly the last is an even number of minutes in length, and its memory-name was heard exactly half the time during the interval.
It follows that Mary's name is heard at most half the time within every interval except the last, therefore more than half the time in the last interval — which must therefore end with Mary's name in memory.
Here's an example: Suppose the name list is A, M, A, M, M, A, B, B, M, M, A, M, M, B, M. Then the intervals are of length 4 (with "A" in memory), 2 (with "M"), 4 (with "B"), 2 (with "A" again), and finally 3 (with "M"), the counter ending at value 1.