LeetCode刷题 Flood Fill 洪水填充问题

An  image is represented by a 2-D array of integers,each integers,each integer respresenting the staring pixel

value of the image (from 0 to 65535)

Given a coordinate (sr,sc)representing the starting pixel (row and column) of the flood fill ,and a pixel 

value newColor,"flood fill" the image.

To perform a "flood fill",consider the starting  piexl (row and column ) of the flood fill,and a pixel value 

newColor ,"flood fill" the image.

To perform a "flood fill" ,consider the starting pixel,plus any pixel (row and column)of the flood fill,and a pixel

value newColour ,"flood fill" the image.

To perform a "flood fill",consider the starting pixel ,plus any pixel connected 4-directionally to the starting 

pixel of the same color as the starting pixel ,plus any pixels connnected 4-directionally to the staring 

E1:

Input :image =[[1,1,1],[1,1,0],[1,0,1]]

原文地址:https://www.cnblogs.com/heruonan/p/8329493.html