Given the root of a binary tree, return its right view — the last node seen at each level when looking from the right side, ordered top to bottom. The tree is given as a level-order array with null for missing children.
Input: A level-order array of the tree.
Output: Array — the rightmost node value per level.
Input: [1,2,3,4,5,null,6]
Output: [1,3,6]
Explanation: Rightmost node at each depth.Input: [1]
Output: [1]
Explanation: Single node.Input: []
Output: []
Explanation: Empty tree.0<=nodes<=10^4-1000<=value<=1000