/* * function TreeNode(x) { * this.val = x; * this.left = null; * this.right = null; * } */ function lowestCommonAncestor(root, p, q) { const node = travese(root, p, q); return node?.val || null; } function travese(root, p, q) { /// 终止条件 if (root == null || root.val == ...