5class SequentialNameGenerator:
6 def __init__(self) -> None:
7 self._counters: dict[str, int] = defaultdict[str, int](int)
8
9 def __call__(self, candidate: str) -> str:
10 current: int = self._counters[candidate]
11 self._counters[candidate] += 1
12 return f"{candidate}{current}"