Problem is LCA of 2 nodes. not a single node. right?


#1

by definition of lca, a and b should be different nodes. in the following test case, they are not diff nodes. the answer should be -1. what am i missing?

3 1 -1 -1
1
1