← Questions
Lowest common ancestor with parent pointers
0
I was asked this
No reports yet. Sign in to say where you were asked it.
Each tree node has a pointer to its parent, and you are given only the two nodes, not the root. Return their lowest common ancestor using O(1) extra space.
No official answer yet. Write yours on the right and run it.
Nothing published yet.
Write and test your solution herePython in your browser, the question's tests level by level, saved for you.Sign in to start coding
