Solution: Flood Fill

Let's solve the Flood Fill problem using the Backtracking pattern.

Statement

We are given the following values as input to begin with:

  • The coordinates of a source cell, i.e., sr and sc.

  • A target value, target.

  • An (m×n)(m \times n) grid.

Our task is to perform flood fill by updating the values of the ...

Access this course and 1400+ top-rated courses and projects.