AlgoMaster Logo

Maximum Difference Between Node and Ancestor

tree=[8, 3, 10, 1, 6, null, 14, null, null, 4, 7, 13]
0 / 55
algomaster.io
Step:Start a DFS from the root with an empty ancestors list, maxDiff = 0