Learn
Practice
Newsletter
Resources
Animations
New
F
Toggle theme
0
F
0
Toggle menu
← Back to All Animations
Surrounded Regions
Bookmark
Input
Example 1
All Surrounded
All Border
Mixed
Custom
board
=
[["X","X","X","X"],["X","O","O","X"],["X","X","O","X"],["X","O","X","X"]]
0
1
2
3
0
1
2
3
X
X
X
X
X
O
O
X
X
X
O
X
X
O
X
X
algo
master
.
io
Step:
Capture every 'O' region that cannot reach the border
0 / 14
Input
Example 1
All Surrounded
All Border
Mixed
Custom
board
=
[["X","X","X","X"],["X","O","O","X"],["X","X","O","X"],["X","O","X","X"]]
0 / 14
0
1
2
3
0
1
2
3
X
X
X
X
X
O
O
X
X
X
O
X
X
O
X
X
algo
master
.
io
Step:
Capture every 'O' region that cannot reach the border