(root)
| 12 | }; |
| 13 | |
| 14 | const dfs = (root) => { |
| 15 | const left = invertTree(root.left); |
| 16 | const right = invertTree(root.right); |
| 17 | |
| 18 | root.left = right; |
| 19 | root.right = left; |
| 20 | |
| 21 | return root; |
| 22 | }; |
| 23 | |
| 24 | /** |
| 25 | * https://leetcode.com/problems/invert-binary-tree/ |
no test coverage detected