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
Nis the number of cells in the grid.
- O(N), where