update the answer , because diameter of a tree is nothing but maximum value of ( left_height + right_height + 1 ) for each node
ans [ 0 ] = max ( ans [ 0 ] , 1 + left_height + right_height ) NEW_LINE return 1 + max ( left_height , right_height ) NEW_LINE