GilesWong / GilesWong.github.io

0 stars 0 forks source link

LeetCode每日一题-1026.节点与其祖先之间的最大差值 - Giles' Blog #28

Open GilesWong opened 1 year ago

GilesWong commented 1 year ago

https://wwg.xyz/leetcode-maximum-difference-between-node-and-ancestor/

给定二叉树的根节点 root,找出存在于 不同 节点 A 和 B 之间的最大值 V,其中 V = |A.val - B.val|,且 A 是 B 的祖先