Explanation

- **Flood Fill** is an algorithm used to determine the area connected to a given node in a multi-dimensional array.
-
  • Steps:

    • Start from a given point and mark it as visited.
    • Check neighboring cells and recursively visit all cells that are the same as the starting point.
    • Continue until the entire connected region is filled.
  • Time Complexity:

    • O(N), where N is the number of cells in the grid.