it is giving correct answer for sample test case.
What is problem in following code?
Hey @chhabrapiyush480
Code is fine
One small error
Line 25 should be
else if(tree[2index][i]==tree[2index+1][j])
you wrote
else if(tree[2index][i]==tree[2index][j])
If your doubt is resolved please mark it as closed.