226. Invert Binary Tree
Practice Invert Binary Tree for free on NudgeCode: Easy, Binary Tree pattern. Write it in Python or JavaScript, run the tests in your browser, and ask for a hint when you are stuck.
Mirror a binary tree: swap the left and right child of every node, and return the root.
Example
root = [4,2,7,1,3,6,9] -> [4,7,2,9,6,3,1]
Constraints
- 0 <= number of nodes <= 100