This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Solution: | |
def numIslands(self, grid): | |
# They have empty input | |
if not grid: | |
return 0 | |
directions = {"up": (-1,0), "down":(1,0), "left":(0,-1), "right":(0,1)} | |
island_number = 0 | |
lenx, leny = len(grid), len(grid[0]) | |
def land_zeroizer(x, y): |