Shortest Distance from All Buildings
Given an m x n grid grid where:
0is an empty land cell;1is a building;2is an obstacle.
You can move only up, down, left, and right, and cannot pass through buildings or obstacle...
Example
Unlock to view complete problem details
and practice with sample input/output
Was this article helpful?
View Test Cases & Run Code requires membership
Standard Input
Execution Result:
