Step-by-step explanation:
Assuming that a simple majority is sufficient for a win, we can keep track of the difference in the number of votes for the two candidates.
__
1. set the integer to zero
2. while there are votes to count ...
3. increment the integer if the vote is 1, or decrement the integer if the vote is 0
4. end while
5. if the final value of the integer is positive, Candidate B won. If it is zero, there was a tie. If it is negative, Candidate A won.