Skip to content

Commit c825861

Browse files
committed
Update walls-and-gates.py
1 parent 63bb12e commit c825861

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Python/walls-and-gates.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ def wallsAndGates(self, rooms):
1414
while q:
1515
(i, j) = q.popleft()
1616
for I, J in (i+1, j), (i-1, j), (i, j+1), (i, j-1):
17-
if 0 <= I < len(rooms) and 0 <= J < len(rooms[0]) \
18-
and rooms[I][J] == INF:
17+
if 0 <= I < len(rooms) and 0 <= J < len(rooms[0]) and \
18+
rooms[I][J] == INF:
1919
rooms[I][J] = rooms[i][j] + 1
2020
q.append((I, J))
2121

0 commit comments

Comments
 (0)