Skip to content

Commit 9deb47a

Browse files
authored
Update second-minimum-time-to-reach-destination.py
1 parent baaadf4 commit 9deb47a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Python/second-minimum-time-to-reach-destination.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ def bi_bfs(adj, start, target):
2222
new_left = set()
2323
for pos in left:
2424
if pos in right:
25-
if result and result < steps: # modified
26-
return result+1
27-
elif not result: # modifeid
25+
if not result: # modified
2826
result = steps
27+
elif result < steps: # modifeid
28+
return result+1
2929
for nei in adj[pos]:
3030
if nei in lookup:
3131
continue

0 commit comments

Comments
 (0)