For tree as follows
/ / \
4 6 7
p.val = 6, q.val = 7
what output should I return?
Depends on what p and q are. Which 6 is p, and which 7 is q? It's impossible to tell just from the values. Fortunately, you are given the nodes, not just the values.
Comparison should be done by node references, not node values.
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.