Loading...
Given a 2D image grid, a starting pixel (sr, sc), and a new color, perform a flood fill — change the starting pixel and all connected same-colored pixels to the new color.
Output the resulting grid, each row on a new line, values space-separated.
1,1,1 1,1,0 1,0,1 1 1 2
2 2 2 2 2 0 2 0 1