Test cases for nodes that don't exist in a tree


  • 0
    I

    It appears that test cases for the problem do not cover situations when p or q do not exist in a tree. For example, for tree shown in the question such node would be 10. Many solutions provided in comments will fail such test as they return first node which is equal to p or q if another node is not found.


  • 0
    This post is deleted!

Log in to reply
 

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