update
This commit is contained in:
parent
23be3094f9
commit
e754ded095
@ -11,6 +11,7 @@ func find(root *TreeNode, l, r int) *TreeNode {
|
|||||||
if root == nil {
|
if root == nil {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
// p 和 q 均存在于给定的二叉树中
|
||||||
if root.Val == l || root.Val == r {
|
if root.Val == l || root.Val == r {
|
||||||
return root
|
return root
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user