Number Of Islands | Depth First Search | LeetCode 200 | PYTHON

Опубликовано: 03 Июнь 2026
на канале: The Code Architect
165
7

Given an m x n 2d grid map of '1's (land) and '0's (water), return the number of islands.
An island is surrounded by water and is formed by connecting adjacent lands horizontally or vertically. You may assume all four edges of the grid are all surrounded by water. For Example
Input: grid = [
["1","1","0","0","0"],
["1","1","0","0","0"],
["0","0","1","0","0"],
["0","0","0","1","1"]
]
Output: 3

#competitiveprogramming #interview #interviewquestion
#coding #leetcode #programmer #tech #software #leetcode #programmingisfun #python #python3 #pythonprogramming