Available question text
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.
Related questions
Continue with questions that share topics or the same question type.
- All Nodes Distance K in Binary Tree
Coding · Binary Tree · Breadth-First Search · Depth-First Search
- Find a Corresponding Node of a Binary Tree in a Clone of That Tree
Coding
- Find Elements in a Contaminated Binary Tree
Coding
- Find Leaves of Binary Tree
Coding
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
Amazon
Leetcode 1740. Find Distance in a Binary Tree
Reported Jul 23, 2026 · 1 source report
SENIOR
Source snapshot: Nov 12, 2026
View source