Back to QuestionsPractice with This Question
Shortest Distance from All Buildings
102.9K views•Asked 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.