Distance to the Nearest Zero
Medium
BFS on Grids (Variants)
For every cell of a binary matrix print the distance (number of 4-directional steps) to the nearest 0.
Constraints
1 <= r, c <= 1000
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.