Skip to content

Commit ad93d57

Browse files
authored
Update check-if-a-string-is-a-valid-sequence-from-root-to-leaves-path-in-a-binary-tree.py
1 parent cce8a9f commit ad93d57

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Python/check-if-a-string-is-a-valid-sequence-from-root-to-leaves-path-in-a-binary-tree.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def isValidSequence(self, root, arr):
2626
continue
2727
if depth+1 == len(arr) and node.left == node.right:
2828
return True
29-
new_q.extend(child for child in (node.left, node.right) if child)
29+
new_q.extend(child for child in (node.left, node.right))
3030
q = new_q
3131
return False
3232

0 commit comments

Comments
 (0)