You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hint 1
For the node i, calculate the height of each of its children and keep the first and second maximum heights (max1_i , max2_i).
Hint 2
Check all nodes and return max( 2 + max1_i + max2_i ).