Binary Tree Right Side View

Given the root of a binary tree, return the value visible at each depth when the tree is viewed from the right side. Return the values from the root level downward. An empty tree produces an empty array.

Examples
Input: []
Output: []
Hints

Binary Tree Right Side View

Given the root of a binary tree, return the value visible at each depth when the tree is viewed from the right side. Return the values from the root level downward. An empty tree produces an empty array.