new test case - how should this work


  • 0
    T

    Lets say my tree is
    [1,2,3] , so 1 is root and 2 is left node of 1 and 3 is left node of 3. I pass to the method the following
    the
    lca(root, new Node(2), new Node (4) ) , the answer should be null , right?

    Point is, that one of the nodes, Node (4) doesn't exists in the tree. In that case, the answer should be null


Log in to reply
 

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