Given an array of integers, determine the digit that appears more than n/2 times where n is the length of the array.
Explanation: The digit 3 appears 7 times which is more than n/2 (9/2 = 4.5) times.
Explanation: The digit 5 appears 5 times which is more than n/2 (9/2 = 4.5) times.
Explanation: The digit 4 appears 7 times which is more than n/2 (7/2 = 3.5) times.
Majority element detection
No dry run loaded.
🚀 Practice this problem
Run code, get AI hints & track streak