-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Anshul Saxena edited this page Jun 20, 2020
·
2 revisions
Given a 2D character matrix A of size N x M, containing 'X' and 'O', capture all regions surrounded by 'X'.
A region is captured by flipping all 'O's into 'X's in that surrounded region.
Input 1:
A = [ [X, X, X, X], [X, O, O, X], [X, X, O, X], [X, O, X, X] ]
Output 1:
A = [ [X, X, X, X], [X, X, X, X], [X, X, X, X], [X, O, X, X] ]