Update bt_is_same_trees.py

This commit is contained in:
bt3gl 2023-08-08 13:52:20 -07:00 committed by GitHub
parent 3606be45c1
commit 153e85ca03
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -11,4 +11,4 @@ def is_same_trees(p, q):
if (not p and q) or (not q and p) or p.val != q.val:
return False
return self.is_same_trees(p.right, q.right) and self.is_same_trees(p.left, q.left)
return is_same_trees(p.right, q.right) and is_same_trees(p.left, q.left)