# @param num, a list of integers
# @return an integer
def majorityElement(self, num):
I like this. I completely didn't realize that the major element will be in the n/2's slot. Instead of getting the length of each repeated element, simply go for the n/2 spot.
Very nice code!
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.