https://leetcode.com/problems/minimum-index-of-a-valid-split/description/
[Javascript] Boyer-Moore Voting Algorithm
If a number is the majority element on the left and right arrays, that means it is the majority element in the overall array.
Return the first index of a split where both the left and right arrays have the majority element equal to the overall majority element.
[Note 1] We could also employ a runningFlags to record the amount of the majority in subArray(0, n) (reference)