This question evaluates proficiency in graph traversal and shortest-path concepts applied to grid-based problems, including handling obstacles, Manhattan distance computation, and extensions to multi-layer (3D) grids and weighted movement.

You are given a 2D grid representing a building floor with three cell types: -1 for walls, 0 for exits, and a large sentinel value for empty rooms. Update each empty room with the Manhattan distance (4-directional moves) to its nearest exit; if unreachable, leave it as the sentinel value. Solve it efficiently and analyze time and space complexity. Follow-ups: extend to a 3D grid (multiple floors) and to weighted movement costs.