πDay 5. Find the Number of Islands π§
π‘ Problem Description:
π Example Walkthrough:
Example 1:
grid[][] = [['L', 'L', 'W', 'W', 'W'],
['W', 'L', 'W', 'W', 'L'],
['L', 'W', 'W', 'L', 'L'],
['W', 'W', 'W', 'W', 'W'],
['L', 'W', 'L', 'L', 'W']]4Example 2:
Constraints:
π― My Approach:
DFS (Recursive Flood Fill β 8 Directions)
Algorithm Steps:
π Time and Auxiliary Space Complexity
π Solution Code
Code (C++)
Code (Java)
Code (Python)
π― Contribution and Support:
πVisitor Count
Last updated