← 返回 bytedance 的题目列表Right Side View of Binary Tree
类型:online_judge
Given a binary tree, write a function that returns the right side view of this binary tree from top to bottom.
Input Example:
Binary Tree:
1
/ \
2 3
\ \
5 4
Output Example:
[1, 3, 4]
Input Data Constraints:
The number of nodes does not exceed 1000.
The node values are unique.
Example
Input
1,2,3,null,5,null,4