矩阵:
1 0 0 1 0 0
0 1 0 0 1 0
1 1 0 1 0 1
有时候要在一个二维数组中找出连续的区域,比如红色的1是连续的(上下左右及以四个角落八个方向含有不是0的数都是连续)
上图就有两个连续的区域
python代码实现:https://github.com/duanyzhi/LeetCode_with_Python/tree/master/continue_area_in_2D_matrix
矩阵:
1 0 0 1 0 0
0 1 0 0 1 0
1 1 0 1 0 1
有时候要在一个二维数组中找出连续的区域,比如红色的1是连续的(上下左右及以四个角落八个方向含有不是0的数都是连续)
上图就有两个连续的区域
python代码实现:https://github.com/duanyzhi/LeetCode_with_Python/tree/master/continue_area_in_2D_matrix