2 parents 7dbce8e + b7ab04f commit ebf95d8Copy full SHA for ebf95d8
1 file changed
leetcode3/최민지/226.py
@@ -0,0 +1,11 @@
1
+class Solution:
2
+ def invertTree(self, root: TreeNode | None) -> TreeNode | None:
3
+ if root is None:
4
+ return None
5
+
6
+ root.left, root.right = root.right, root.left
7
8
+ self.invertTree(root.left)
9
+ self.invertTree(root.right)
10
11
+ return root
0 commit comments