DIY: Maximum Difference Between Node and Ancestor
Problem statement
Given the root of a binary tree, find the maximum value, X
, for which there exist two different nodes, A
and B
. X = |A.val -
...
Create a free account to view this lesson.
By signing up, you agree to Educative's Terms of Service and Privacy Policy