题目:

题解:
func lowestCommonAncestor(root, p, q *TreeNode) (ancestor *TreeNode) {
ancestor = root
for {
if p.Val < ancestor.Val && q.Val < ancestor.Val {
ancestor = ancestor.Left
} else if p.Val > ancestor.Val && q.Val > ancestor.Val {
ancestor = ancestor.Right
} else {
return
}
}
}





![[AHK] WinHttpRequest.5.1报错 0x80092004 找不到对象或属性](https://i-blog.csdnimg.cn/direct/c90f6c0a22d24a3a89f9b6f0a63a2bee.png)













