Given a graph of cities and bidirectional roads, print the cities in order of their shortest distance from a source city. For cities at the same distance, visit them in ascending numerical order.
You've read your 3 free write-ups
Sign up free to keep reading. Your account opens the first 10 questions of every company.