if (root.val == p.val) or (root.val == q.val):
The code above does not work, why?...
if (root == p) or (root == q):
Tree could have duplicate value. Image a scenario that p, q on different sub tree, but p.val == q. val == root.val
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.