Given the root of a binary tree, invert it (swap the left and right children of every node) and return the resulting tree as a level-order array with null for missing children.
Input: A level-order array of the tree.
Output: Array — the inverted tree in level order.
Input: [4,2,7,1,3,6,9]
Output: [4,7,2,9,6,3,1]
Explanation: All left/right children swapped.Input: [1]
Output: [1]
Explanation: Single node unchanged.Input: []
Output: []
Explanation: Empty tree.0<=nodes<=10^4-1000<=value<=1000