Boundary

3 articles

dsa2 min read

Surrounded Regions — Boundary DFS

Capture all 'O' regions not connected to the border. Classic boundary DFS: mark safe cells from edges, then flip remaining O to X.

Read →