september challange

I dont understand whats wrong with my code its the brute force solution , i have commented the code can someone help me find what i am doing wrong .It works for the sample test case though.

link to the question

link to the solution solution

More importantly, why are sub-tasks hidden for this one?

yeah i dont understand why they decide to hide sub-taskā€¦ maybe a bug?

ITwas reported earlier by @meooow as well. PErhaps your problem passes some subtask but is getting WA due to larger tasks. Its hard to debug this way.

Sad but do u think that the solution is correct though?

Where did you update the value of rest of the nodes? Each and every node undergoes change in value daily, by forumula new value= old value ^(xor of values of all its children)?

Well, I asked cause I couldnt find it XD (Not a python user), but ofc if you passed I/O you must have done it somewhere.

i did update them every day recursively for all node line 10

value[index]=ans