Skip to content

Commit 6b6093b

Browse files
committed
Update reconstruct-itinerary.py
1 parent f2eb1c8 commit 6b6093b

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

Python/reconstruct-itinerary.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ def findItinerary(self, tickets):
2828
:type tickets: List[List[str]]
2929
:rtype: List[str]
3030
"""
31-
def route_helper(start, graph, size, ans):
31+
def route_helper(start, size, graph, ans):
3232
if size == 0:
3333
return True
3434

3535
for i, (end, valid) in enumerate(graph[start]):
3636
if valid:
3737
graph[start][i][1] = False
3838
ans.append(end)
39-
if route_helper(end, graph, size - 1, ans):
39+
if route_helper(end, size - 1, graph, ans):
4040
return ans
4141
ans.pop()
4242
graph[start][i][1] = True
@@ -50,5 +50,5 @@ def route_helper(start, graph, size, ans):
5050

5151
start = "JFK"
5252
ans = [start]
53-
route_helper(start, graph, len(tickets), ans)
53+
route_helper(start, len(tickets), graph, ans)
5454
return ans

0 commit comments

Comments
 (0)