(votes: Dict[str, int], ranks: Dict[str, int])
| 22 | from typing import Dict, MutableMapping |
| 23 | |
| 24 | def populate_ranks(votes: Dict[str, int], ranks: Dict[str, int]) -> None: |
| 25 | names = list(votes.keys()) |
| 26 | names.sort(key=votes.__getitem__, reverse=True) |
| 27 | for i, name in enumerate(names, 1): |
| 28 | ranks[name] = i |
| 29 | |
| 30 | def get_winner(ranks: Dict[str, int]) -> str: |
| 31 | return next(iter(ranks)) |
no outgoing calls
no test coverage detected