Invert a binary tree (mirror it left-to-right) and return its root.
Input: one line — the tree in level order, null for missing children.
Output: the inverted tree in level order (trailing nulls trimmed; null for an empty tree).
4 2 7 1 3 6 9
4 7 2 9 6 3 1
2 1 3
2 3 1
null
null
Run your code against the sample tests, or Submit to run the full suite.