01 Matrix (Distance to Nearest Zero)
Medium
Grid Search (BFS & DFS)
Given a binary matrix, print for every cell the distance (number of 4-directional steps) to the nearest 0.
Constraints
1 <= R, C <= 10^4 (R * C <= 10^4)
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.