We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f00598c commit 9f3e81cCopy full SHA for 9f3e81c
1 file changed
graphs/breadth_first_search_shortest_path_2.py
@@ -90,7 +90,7 @@ def bfs_shortest_path_distance(graph: dict, start, target) -> int:
90
return -1
91
if start == target:
92
return 0
93
- queue = deque(start)
+ queue = deque([start])
94
visited = set(start)
95
# Keep tab on distances from `start` node.
96
dist = {start: 0, target: -1}
0 commit comments