Service-to-service links have one-way latencies: [from, to, ms]. Find the path from source to
target with the lowest total latency. Return {"ms": total, "path": [...]}, or None if target is
unreachable. If several paths tie, return the lexicographically smallest path (compare the lists).
Implement fastest_path. Input: links: list[[str, str, int]], source: str, target: str. Returns: dict | None.
def fastest_path(links, source, target):
return None
Run executes the public tests. Submit grades against public and hidden tests.
Service-to-service links have one-way latencies: [from, to, ms]. Find the path from source to
target with the lowest total latency. Return {"ms": total, "path": [...]}, or None if target is
unreachable. If several paths tie, return the lexicographically smallest path (compare the lists).
Implement fastest_path. Input: links: list[[str, str, int]], source: str, target: str. Returns: dict | None.
def fastest_path(links, source, target):
return None
Run executes the public tests. Submit grades against public and hidden tests.