Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit33dfc12

Browse files
authored
Merge pull requestneetcode-gh#306 from rileymblaylock/patch-1
Missing for-loop to add initial gates to queue - Update 286-Walls-and-Gates.py
2 parents6c17fec +37cf62a commit33dfc12

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

‎286-Walls-and-Gates.py‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,13 @@ def addRooms(r, c):
1414
return
1515
visit.add((r,c))
1616
q.append([r,c])
17-
17+
18+
forrinrange(ROWS):
19+
forcinrange(COLS):
20+
ifrooms[r][c]==0:
21+
q.append([r,c])
22+
visit.add((r,c))
23+
1824
dist=0
1925
whileq:
2026
foriinrange(len(q)):

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp