Search
⌘K
Get Premium
Leetcode 130. Surrounded Regions
Given an m x n board of 'X' and 'O', flip all 'O' cells that belong to regions completely surrounded by 'X' to 'X' (regions connected to the border remain unchanged). The core challenge is to identify border-connected 'O' regions (e.g., via DFS/BFS or Union-Find) and flip all other 'O's in-place.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.