U10fix2
This commit is contained in:
parent
930630815d
commit
9903988d4d
@ -3,3 +3,13 @@ def shortest_path(number_of_nodes, connections):
|
||||
end = number_of_nodes - 1
|
||||
if start == end:
|
||||
return [0]
|
||||
|
||||
dist = []
|
||||
path = []
|
||||
for i in range(number_of_nodes):
|
||||
dist.append(None)
|
||||
path.append([])
|
||||
dist[start] = 0
|
||||
path[start] = [start]
|
||||
|
||||
return path[end]
|
||||
|
||||
Loading…
Reference in New Issue
Block a user