Lowest common ancestor with parent pointers
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 answer yet. Write the first one; the best answer gets endorsed.
