Coding Trainer
Flood Fill
Problem
Given an image grid, a starting pixel (sr,sc), and a new color, perform flood fill: change the starting pixel and all connected same-color pixels to the new color.
Example: image=[[1,1,1],[1,1,0],[1,0,1]], sr=1, sc=1, color=2 → [[2,2,2],[2,2,0],[2,0,1]]