Paint Fill in a Drawing Program

Implement the "fill" feature of a paint program: given an R x C integer grid of colors, a starting cell (sr, sc) and a new color, change the starting cell and all cells 4-directionally connected to it...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: