Shortest Distance from All Buildings

317. Shortest Distance from All Buildings

You are given an m × n grid grid:

  • 0 represents empty land that can be walked through.
  • 1 represents a building.
  • 2 represents an obstacle th...

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: