Given the root of a binary tree, return both its height (number of edges on the longest path from root to leaf) and its diameter (number of edges on the longest path between any two nodes).
You've read your 3 free write-ups
Sign up free to keep reading. Your account opens the first 10 questions of every company.