LeetCode: 1026. Maximum Difference Between Node and Ancestor 解題紀錄
Last Updated on 2022-12-09 by Clay
題目
Given the root
of a binary tree, find the maximum value v
for which there exist different nodes a
and b
where v = |a.val - b.val|
and a
is an ancestor of b
.