code: def numIslands(self, grid):
      """
      :type grid: List[List[str]]
      :rtype: int
      """
      # BFS with marks
      if grid is None or len(grid) == 0:
          return 0
      islands = 0
      for i in range(len(grid)):
          for j in range(len(grid[i])):
              if grid[i][j] == "1":
                  self.explore(grid, i, j)
                  islands += 1
      return islands
  
label_desc: Use image node_id 1 for calling the Solution obj's underlying member method code with example usage: obj.numIslands(grid) and returns: islands, int