How To Calculate Height Of Building From Far

How To Calculate Height Of Building From Far - Now, perform dfs to calculate the maximum distance of a node from all its ancestors.