In problem C instead of taking any node with dp[I]==dp[1] take the node with the largest depth Otherwise, your code will fail on the newly added test cases 42
31:35 Actually i have a doubt here , you traversed through all the nodes and found if there exists a node whose subtreexor is same as the xor sum of complete tree and as soon as you found such a node , you set variable node as that i value and break out from here and then check if there is an ancestor of this node with a subtreexor as 0 or if there is a node whose subtree is disjoint from this one and has a subtreexor as total xorsum but my point is that we may miss some node that might be lead to the answer in the loop afterwards because of breaking out because the first time we encounter a node with subtreexor as total xorsum we break but there might be some other node with a subtreexor as total xor and with an ancestor with subtreexor zero which we wont be checking because of breaking out at first occurrence Please can you clarify this
I thinks the for problem B first statement is correct but I a bit confusing still: Any element in region 1 can be moved to AT LEAST (not anywhere) one position in region 3. And by this any element in first can be moved everywhere to the first by this: from first to third, from third to first. Thanks for editorial, bro!