You are viewing a single comment's thread. Return to all comments →
If v1 is the ancestor of v2, then should the LCA = parent of v1 instead of v1?
No, if v1 is an ancestor of v2, v1 will be the lca. (this confused me for quite some time and I hope they change the challenge description to account for this.)
Agreed, it confused me too until I read your comment! Thanks :)
How can v1 be the ancestor of itself? I am still confused.
Or, are you referring to the correct answer that the question will accept?