Skip to content

Commit bf80ec2

Browse files
committed
re-solve "226. Invert Binary Tree"
1 parent 0014084 commit bf80ec2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/invert_binary_tree.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33

44
class Solution:
55
def invertTree(self, root: TreeNode | None) -> TreeNode | None:
6-
if not root:
6+
if root is None:
77
return None
88

99
root.left, root.right = root.right, root.left
10+
1011
self.invertTree(root.left)
1112
self.invertTree(root.right)
1213

0 commit comments

Comments
 (0)