The test case example doesn't take the NULL right subtree into consideration?


  • 0
    B

    The Tree such as that root is 1,left child of root is 2,right child of root is null can be accept.However,according to the topic,we can only see 1,And 2 is the left tree of root tree 1.


  • 0

    Do you mean the input [1,null,2]? This means 2 is the right child of the root node 1.

    PS: By the way there is no longer # in the binary tree representation. It is replaced by null.


  • 0
    B

    Sorry, I have change the ambiguous expression of my question.root is 1,left child of root is 2,right child of root is null,according to the topic, I think result is [1],not [1,2],but [1,2]is accept


  • 0
    F

    It's right side view, not right side. So you look through null nodes or non-nodes.


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.