Back to Questions

Shortest Distance from All Buildings

102.9K viewsAsked at Salesforce
Hard

Question Explain

You want to build a house on an empty land that is closest to all the buildings. Find the shortest total travel distance to all buildings. Use BFS starting from each building.

Start Trying This Question Simulation

Practice answering orally or with text to get instant AI feedback.

Practice with This Question
Shortest Distance from All Buildings - Interview Question