Invert Tree
Given a binary tree root
, invert it so that its left subtree and right subtree are swapped and the children are recursively inverted.
Constraints
n ≤ 100,000
wheren
is the number of nodes inroot
https://binarysearch.com/problems/Invert-Tree
Examples
Example 1
Input
- root =
Output
- answer =
Leave a comment