Search
⌘K
Get Premium
Leetcode 1740. Find Distance in a Binary Tree
Given a binary tree and two node values, compute the distance (number of edges) between the corresponding nodes. Key approaches include finding their lowest common ancestor and using node depths (or treating the tree as an undirected graph and BFS) to compute the edge count.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.