Given a binary tree A of integers. Return an array of integers representing the right view of the Binary tree.
Right view of a Binary Tree: is a set of nodes visible when the tree is visited from Right side.
1 <= Number of nodes in binary tree <= 105
0 <= node values <= 109
First and only argument is an pointer to the root of binary tree A.
Return an integer array denoting the right view of the binary tree A.
1 / \ 2 3 / \ / \ 4 5 6 7 / 8
1 / \ 2 3 \ 4 \ 5
[1, 3, 7, 8]
[1, 3, 4, 5]
NOTE: You only need to implement the given function. Do not read input, instead use the arguments to the function. Do not print the output, instead return values as specified. Still have a doubt? Checkout Sample Codes for more details.