Skip to content

Commit 767318a

Browse files
authored
Fixed BFS comments, and readability
1 parent ac8a900 commit 767318a

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

python/200-Number-of-Islands.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,16 @@ def dfs(r, c):
2828
dfs(r, c)
2929
return islands
3030

31-
def numIslands(self, grid: List[List[str]]) -> int:
32-
if not grid:
33-
return 0
34-
35-
rows, cols = len(grid), len(grid[0])
36-
visited=set()
37-
islands=0
38-
31+
3932
# BFS Version From Video
33+
34+
# def numIslands(self, grid: List[List[str]]) -> int:
35+
# if not grid:
36+
# return 0
37+
38+
# rows, cols = len(grid), len(grid[0])
39+
# visited=set()
40+
# islands=0
4041

4142
# def bfs(r,c):
4243
# q = deque()
@@ -53,8 +54,7 @@ def numIslands(self, grid: List[List[str]]) -> int:
5354

5455
# q.append((r , c ))
5556
# visited.add((r, c ))
56-
57-
57+
5858
# for r in range(rows):
5959
# for c in range(cols):
6060

0 commit comments

Comments
 (0)