Fetching data...
This may take a moment
Back
1790. Lowest Common Ancestor of a Binary Tree III
Medium
Hash Table
Two Pointers
Tree
Binary Tree
Binary Lifting
Lowest Common Ancestor
Solve on LeetCode
View Solutions
Description
Hints
Hint 1
Store the path from p to the root.
Hint 2
Traverse the path from q to the root, the first common point of the two paths is the LCA.
Similar Questions
Lowest Common Ancestor of a Binary Search Tree
Medium
Lowest Common Ancestor of a Binary Tree
Medium
Lowest Common Ancestor of a Binary Tree II
Medium
Lowest Common Ancestor of a Binary Tree IV
Medium
Statistics
Acceptance
83.0%
Submissions
494,325
Accepted
410,397