...

/

DIY: Maximum Difference Between Node and Ancestor

DIY: Maximum Difference Between Node and Ancestor

Solve the interview question "Maximum Difference Between Node and Ancestor" in this lesson.

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 ...