Grid Evacuation Reachability / Minimum Escape Time (Multi-source BFS)

Problem: Building Evacuation (Multi-source BFS)

You are given a building floor plan as an m x n grid:

  • .: empty cell (walkable)
  • #: obstacle (blocked)
  • E: exit (one or more)
  • P: per...

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: