Skip to content

Commit d4ffda8

Browse files
committed
Code simplification
1 parent 3d92f87 commit d4ffda8

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

graphs/deep_clone_graph.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,7 @@ def clone_graph(node: Node | None) -> Node | None:
5757

5858
originals_to_clones[original] = Node(original.value)
5959

60-
for neighbor in original.neighbors or []:
61-
stack.append(neighbor)
60+
stack.extend(original.neighbors or [])
6261

6362
for original, clone in originals_to_clones.items():
6463
for neighbor in original.neighbors or []:

0 commit comments

Comments
 (0)