πDay 12. Flood fill Algorithm π§
π‘ Problem Description:
π Example Walkthrough:
Example 1:
Input:
image[][] = [
[1, 1, 1, 0],
[0, 1, 1, 1],
[1, 0, 1, 1]
]
sr = 1, sc = 2, newColor = 2Output:
Explanation:
Example 2:
Input:
Output:
Explanation:
Example 3:
Input:
Output:
Explanation:
Constraints:
π― My Approach:
Flood Fill using BFS/DFS
Algorithm Steps:
π Time and Auxiliary Space Complexity
π Solution Code
Code (C++)
Code (Java)
Code (Python)
π― Contribution and Support:
πVisitor Count
Last updated