Surrounded RegionsGiven a 2D board containing 'X' and 'O', capture all regions surrounded by 'X'.A region is captured by flipping all 'O's into 'X's i...
分类:
其他好文 时间:
2014-11-29 22:55:29
阅读次数:
332
Given a 2D board 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...
分类:
其他好文 时间:
2014-11-29 20:07:49
阅读次数:
226
Given a 2D board 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...
分类:
其他好文 时间:
2014-11-27 08:01:17
阅读次数:
160
【题目】
Given a 2D board 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.
For example,
X X X...
分类:
其他好文 时间:
2014-11-21 14:24:22
阅读次数:
167
Problem Statement(link):Given a 2D board containing'X'and'O', capture all regions surrounded by'X'.A region is captured by flipping all'O's into'X's i...
分类:
其他好文 时间:
2014-11-07 20:38:16
阅读次数:
300
题意:将被‘X’包围的‘O’修改成'X'。
方法:从最外围的‘O’出发,找可连接的‘O’,则这些‘O’最终都是不要标记的,剩余的‘O’是需要标记的。这里可先将从外围‘O’可遍历到的‘O’标记为其他字符,最终再统一恢复。法2:也可从所有‘O’探索,只要无法探索到越界即满足,可以用一个栈保存这些中间节点。
具体实施:bfs(用dfs会爆栈RE。。。)
int dir[4][2]={-1,0,1,...
分类:
其他好文 时间:
2014-11-04 21:17:10
阅读次数:
201
Given a 2D board 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...
分类:
编程语言 时间:
2014-10-27 06:55:21
阅读次数:
213
Given a 2D board 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...
分类:
其他好文 时间:
2014-10-24 23:36:15
阅读次数:
309
Given a 2D board 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 ...
分类:
其他好文 时间:
2014-10-10 06:05:44
阅读次数:
238
Surrounded Regions
Total Accepted: 14948 Total
Submissions: 105121My Submissions
Given a 2D board containing 'X' and 'O',
capture all regions surrounded by 'X'.
A region is captured by...
分类:
其他好文 时间:
2014-10-09 01:20:38
阅读次数:
237