2026-08-25 19:14:07 -06:00

17 lines
244 B
Python

from itertools import product
grid = [
["1","1","1","1","0"],
["1","1","0","1","0"],
["1","1","0","0","1"],
["0","0","0","1","0"]
]
def numIslands(grid):
def dfs(i, j):
if i<0 and
print( numIslands(grid) )