← Questions

Minimum broadcast latency between cities

0
NetflixCodingLast asked Aug 2026

Cities are linked by network connections, each with a latency. A broadcast starts from a source city and travels along the links. Compute the shortest latency from the source to every city (and the time until every city has the message), or report cities that can't be reached. Use Dijkstra's algorithm and state its complexity.

Write and test your solution herePython in your browser, the question's tests level by level, saved for you.Sign in to start coding