Link: https://leetcode.com/problems/missing-number/
Solution:
Topics: math, Boyer-Moore voting, Majority element
Intuition
Cute little problem… perhaps not worth spending time on it but I think it offers some intuition on the Boyer-Moore voting algorithm. In this problem the missing number “sticks” to the total through subtraction, but in Boyer-Moore voting the majority element “sticks” as the candidate through counting.
Implementation
Review 1
Not much to say here…not sure If I agree with myself about the connection to the voting algorithm, but ill leave it.