130. 被围绕的区域
来源:力扣(LeetCode)
链接: https://leetcode.cn/problems/surrounded-regions/
给你一个 m x n
的矩阵 board ,由若干字符 'X'
和 'O'
,找到所有被 'X'
围绕的区域,并将这些区域里所有的 'O'
用 'X'
填充。
示例 1:
输入:board = [["X","X","X","X"],["X","O","O","X"],["X","X","O","X"],["X","O","X","X"]]
输出:[["X","X","X","X"],["X","X","X","X"],["X","X","X","X"],[&