Gossip dissemination rounds
Your task
A value is being disseminated through a cluster via deterministic gossip. The cluster is described by an adjacency list neighbors (a dict from node id to the list of nodes it gossips to). In each round, EVERY node that already knows the value pushes it to ALL of its neighbors simultaneously; a neighbor that did not previously know the value learns it (becomes 'knowing') at the END of that round. Starting from the single seed node seed (which knows the value before round 1), return the sorted list of node ids that know the value after exactly k rounds.
Examples
gossip_known_after(neighbors: dict[str,list[str]], seed: str, k: int) -> list[str]Example 1
Input
gossip_known_after({"A": ["B", "C"], "B": ["D"], "C": ["D"], "D": []}, "A", 1)Output
["A", "B", "C"]