Surrounded Regions
Medium
Grid Search (BFS & DFS)
In a board of 'X' and 'O', capture every region of 'O' cells that is completely surrounded by 'X' by flipping them to 'X'. Regions touching the border are not captured. Print the resulting board.
Constraints
1 <= R, C <= 200
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.