#K57672. Count Majority Element Occurrences
Count Majority Element Occurrences
Count Majority Element Occurrences
Given an array of integers, find the number of occurrences of the majority element. The majority element is defined as the element that appears more than \(\lfloor \frac{n}{2} \rfloor\) times, where \(n\) is the length of the array.
Your task is to determine this count by first identifying the majority element using the Boyer–Moore majority vote algorithm and then counting its occurrences in the array.
inputFormat
The first line of input contains a single integer \(n\) representing the number of elements in the array. The second line contains \(n\) space-separated integers representing the array elements.
outputFormat
Output a single integer, which is the number of occurrences of the majority element in the array.
## sample3
3 2 3
2