0-1 BFS: Minimum Obstacle Removal
In an R x C grid, 0 is an empty cell and 1 is an obstacle. You may remove obstacles. Print the minimum number of obstacles to remove to travel from the top-left to the bottom-right cell with 4-directional moves.
Constraints
1 <= R, C <= 1000 The start and end cells are 0
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.