Boyer-Moore Majority Voting Algorithm Explained
Intro
Today I coded the Leetcode 169. Majority Element again. I vaguely remember what the optimal solution is called Boyer-Moore Majority Voting Algorithm. However, I have no idea what is except for its name. So I plan to systematically learn the principle of this algorithm and summarize it to write this blog. I once heard that:
If you want to master something, teach it :)
So, I’m here today to share this algorithm with you, and try to teach you this method in plain language, so let’s get started :)