Expected Answer is not considering left descendants


  • 0
    I

    For the following input, expected output is [3] instead of [3,2,null,1]. Why?

    [3,0,4,2,null,null,null,1]
    1
    3

    Where as for the following input, it is considering left node. Weird!!. Expected output is [1,null,2].

    [3,1,4,null,2]
    1
    2


Log in to reply
 

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