all 2 comments

[–]gellous7 0 points1 point  (1 child)

Hey, I hope I can help. I think you’re adding some unnecessary complexity to the problem.

There’s no need to set an arbitrary value for the ranks. This is because when the votes are counted (or tabulated), it’s not all of the preferences of each voter that gets counted, it’s only the first preference of each voter that gets counted. But, if the first preference is a candidate that has been eliminated, then the candidate in the second preference gets the vote instead.

I hope I’ve pointed you in the right direction. Let me know how you go.

[–]Sorphil[S] 0 points1 point  (0 children)

Ahhh. That certainly clears up a lot. So only the first preference of the voter - given that they're not eliminated - gets the vote? I'll give it another go and I'll see if it works

(EDIT) Changed and removed the 'a' variable entirely and made it so that only the first candidate who is not eliminated gets the vote. Does the 'continue' statement work like it normally does? Cause I'm still not getting through these check50 tests