- max_votes = max(self.votes.values())
- winners = [option for option, votes in self.votes.items() if votes == max_votes]
+ option_counts = {}
+ for voter, option in self.votes.items():
+ if option not in option_counts:
+ option_counts[option] = 0
+ option_counts[option] += 1
+
+ winners = {}
+ max_count = max(option_counts.values())
+ for option, count in option_counts.items():
+ if count == max_count:
+ winners[option] = [voter for voter, chosen_option in self.votes.items() if
+ chosen_option == option]