diff --git a/problems/0235.二叉搜索树的最近公共祖先.md b/problems/0235.二叉搜索树的最近公共祖先.md index 07e55ba5..a8c94ec9 100644 --- a/problems/0235.二叉搜索树的最近公共祖先.md +++ b/problems/0235.二叉搜索树的最近公共祖先.md @@ -328,13 +328,11 @@ var lowestCommonAncestor = function(root, p, q) { } if(root.val>p.val&&root.val>q.val) { // 向左子树查询 - let left = lowestCommonAncestor(root.left,p,q); - return left !== null&&left; + return root.left = lowestCommonAncestor(root.left,p,q); } if(root.val