Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Total vote count or win 2 of 3 regions? #42

Open
jmchamber58 opened this issue Oct 16, 2020 · 1 comment
Open

Total vote count or win 2 of 3 regions? #42

jmchamber58 opened this issue Oct 16, 2020 · 1 comment

Comments

@jmchamber58
Copy link

In reading the exercise, the winner has to win 2 of 3 regions. This code seems to count wins as total vote counts across all regions. So the exercise was to do an electoral college kind of win, but your solution is counting the popular vote. Am I misinterpreting your code? Thanks, love the book and the exercises.

@somacdivad
Copy link
Contributor

Hey @jmchamber58! What was meant by the note "Assume that a candidate wins the election if they win at least two of the three regions" is that there is no additional weight or anything on the regions themselves. That is, the votes in one region don't count for more than the votes in another region.

The code is correct. It is not tallying the total number of votes for a candidate. Instead, it is tallying the number of reagions won by each candidate. The variable naming might be a bit confusing in this case. I'll see if I can improve that to make the solution easier to understand.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants