Lowest common ancestor with parent pointers

0
Remix

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.

MetaCodingLast asked Feb 2026
No answer yet. Write the first one; the best answer gets endorsed.