01 · Question
An image is represented by an m x n integer grid image where image[i][j] represents the pixel value.
Perform a flood fill starting from (sr, sc), replacing the starting pixel's color and all connected pixels of the same color with color.
Example:
- Input:
image = [[1,1,1],[1,1,0],[1,0,1]], sr = 1, sc = 1, color = 2 - Output:
[[2,2,2],[2,2,0],[2,0,1]]