码迷,mamicode.com
首页 > 其他好文 > 详细

[LeetCode] Surrounded Regions 包围区域

时间:2015-06-06 00:14:31      阅读:106      评论:0      收藏:0      [点我收藏+]

标签:

 

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 X
X O O X
X X O X
X O X X

After running your function, the board should be:

X X X X
X X X X
X X X X
X O X X

 

 

 

 

参考资料:

 

[LeetCode] Surrounded Regions 包围区域

标签:

原文地址:http://www.cnblogs.com/grandyang/p/4555831.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!