From 3947eeaab9d868fbe4665629a1792c1c9cd3a593 Mon Sep 17 00:00:00 2001 From: L1Y1 <108316255+L1Y1@users.noreply.github.com> Date: Thu, 13 Oct 2022 17:00:01 +0800 Subject: [PATCH] =?UTF-8?q?Update=200235.=E4=BA=8C=E5=8F=89=E6=90=9C?= =?UTF-8?q?=E7=B4=A2=E6=A0=91=E7=9A=84=E6=9C=80=E8=BF=91=E5=85=AC=E5=85=B1?= =?UTF-8?q?=E7=A5=96=E5=85=88.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 可以写的更通俗易懂一些 --- problems/0235.二叉搜索树的最近公共祖先.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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