题目 题解 递归 def lowestCommonAncestor(root: TreeNode, p: TreeNode, q: TreeNode) -> TreeNode:if not root or root == p or root == q:return rootleft = lowestCommonAncestor(root.left, p, q)right = lowestCommonAncestor(root.right, p, q)if not left:return rightif not right:return leftreturn root