Ballots for a club election are listed in votes (integers, one per ballot). A candidate is dominant if it holds strictly more than half of all ballots. Write dominant(votes) returning the dominant value, or None if there is none, using divide and conquer: split the ballots, find the dominant value of each half, and decide between the two candidates.
Examples
Input: votes = [2, 2, 1, 2, 3, 2, 2]
Output: 2
Explanation: 2 holds 5 of 7 ballots.
Input: votes = [1, 2, 3]
Output: None
Constraints
0 <= len(votes) <= 10**4- Target: O(n log n); recursion depth about log2(n).
Goals
- Solve each half recursively and reconcile two candidate answers
- Verify a candidate by counting within the current range only
- Return None when no value dominates