Given the root of a binary tree, transform it into its mirror image by swapping 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 mirrored tree in level order.
Input: [1,2,3,4,5]
Output: [1,3,2,null,null,5,4]
Explanation: All children swapped.Input: [1]
Output: [1]
Explanation: Single node unchanged.Input: []
Output: []
Explanation: Empty tree.0<=nodes<=10^4-1000<=value<=1000