56. Right/Left View of BT
Assuming standing on the right side of a binary tree and given its root, return the values of the nodes visible, arranged from top to bottom.
Example 1:
Input : root = [1, 2, 3, null, 5, null, 4]
Output : [1, 3, 4]
Explanation :

Example 2:
Input : root = [1, 2, 3, 6, 5, 8, 4]
Output : [1, 3, 4]
Explanation :

Now Your Turn!
Pick the correct output for the given inputInput : root = [5, 1, 2, 8, null, 4, 5, null, 6]
Still unsure what the problem is asking ?
Let’s go through a few more examples, step by step, to make it clearer.
Constraints:
- 1 <= Number of Nodes <= 104
- -103 <= Node.val <= 103