Skip to content

Commit 14af000

Browse files
committed
remove res
1 parent 9800d75 commit 14af000

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

python/0332-reconstruct-itinerary.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,17 @@ def findItinerary(self, tickets: List[List[str]]) -> List[str]:
99
for key in adj:
1010
adj[key].sort()
1111

12-
def dfs(adj, result, src):
12+
def dfs(adj, src):
1313
if src in adj:
1414
destinations = adj[src][:]
1515
while destinations:
1616
dest = destinations[0]
1717
adj[src].pop(0)
18-
dfs(adj, res, dest)
18+
dfs(adj, dest)
1919
destinations = adj[src][:]
2020
res.append(src)
2121

22-
dfs(adj, res, "JFK")
22+
dfs(adj, "JFK")
2323
res.reverse()
2424

2525
if len(res) != len(tickets) + 1:

0 commit comments

Comments
 (0)