Given the root of a binary tree, imagine standing on its right side; return the values of the nodes visible from top to bottom (the last node at each level). 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,null,5,null,4]
Output: [1,3,4]
Explanation: Rightmost visible nodes.Input: [1]
Output: [1]
Explanation: Single node.Input: []
Output: []
Explanation: Empty tree.0<=nodes<=10^4-100<=value<=100