Diameter of a binary tree

0
Remix

Return the number of edges on the longest path between any two nodes of a binary tree. The path need not pass through the root. Solve it in one pass.

MetaAmazonCodingLast asked May 2026
No answer yet. Write the first one; the best answer gets endorsed.