In [1,3,4,1] this case, obviously the majority element is 1, but the expected answer is 4. Did I misunderstand what majority element is?
I have the same problem. Why does [7,2,3,7,2,7] return 7 and not 2? That does not agree with returning the element which appears > = n/2 times.
@Chao..Feng20 See my reply, I have the same problem. The solutions don't seem to correspond to the question.
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.