Walls and Gates
Medium
BFS on Grids (Variants)
In a grid, -1 is a wall, 0 is a gate and 2147483647 is an empty room. Fill each room with the distance to its nearest gate (leave it as 2147483647 if unreachable).
Constraints
1 <= r, c <= 250
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.