Concept Flow - Majority Element Moore's Voting Algorithm
Initialize candidate and count
Iterate over array elements
If count == 0
→Set candidate = current element
If current element == candidate
→Increment count
Else
→Decrement count
Repeat until end of array
Candidate is majority element
Start with no candidate and zero count. For each element, if count is zero, pick new candidate. Increase count if element matches candidate, else decrease. At end, candidate is majority.
