#K80697. Majority Element
Majority Element
Majority Element
You are given a list of integers. Your task is to find the majority element, which is the element that appears more than \( \frac{n}{2} \) times in the list, where \( n \) is the number of elements. If no such element exists, output None
.
Note: The input will be provided via standard input (stdin) and the output should be printed to standard output (stdout).
inputFormat
The first line contains a single integer \( n \) representing the number of elements in the list. The second line contains \( n \) space-separated integers.
outputFormat
Print the majority element if it exists; otherwise, print None
.
9
3 3 4 2 4 4 2 4 4
4