Standing to the right of a binary tree, return the values you can see from top to bottom (the rightmost node of each level).
Input: one line — the tree in level order. Output: the visible values, space-separated (nothing for an empty tree).
1 2 3 null 5 null 4
1 3 4
1 null 3
1 3
Run your code against the sample tests, or Submit to run the full suite.