Find the majority element (appears more than n/2 times) in an array.
MediumProblem Statement
Find the majority element (appears more than n/2 times) in an array.
Sample Input
[3, 3, 4, 2, 3, 3, 3]
Sample Output
3
Limits
Time: 2s · Memory: 256 MB
Find the majority element (appears more than n/2 times) in an array.
[3, 3, 4, 2, 3, 3, 3]
3
Time: 2s · Memory: 256 MB