A new solution:O(n) — Moore voting algorithm

The old solution was a hash table, Space was O(n), the new solution's Space was O(1)